diff --git a/src/tools/TurtlebotViewer-web/kobukiviewerjs.in b/src/tools/TurtlebotViewer-web/kobukiviewerjs.in new file mode 100644 index 000000000..76018bae5 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/kobukiviewerjs.in @@ -0,0 +1,5 @@ +#!/bin/bash + +cd @CMAKE_INSTALL_PREFIX@/share/jderobot/webtools/kobukiviewerjs/ + +nodejs run.js \ No newline at end of file diff --git a/src/tools/TurtlebotViewer-web/main.js b/src/tools/TurtlebotViewer-web/main.js new file mode 100644 index 000000000..2feb838dc --- /dev/null +++ b/src/tools/TurtlebotViewer-web/main.js @@ -0,0 +1,56 @@ +const electron = require('electron') +const {app, BrowserWindow} = electron +const path = require('path') +const url = require('url') + +// Keep a global reference of the window object, if you don't, the window will +// be closed automatically when the JavaScript object is garbage collected. +let win + +function createWindow () { + // Create the browser window. + var screenElectron = electron.screen; + var mainScreen = screenElectron.getPrimaryDisplay(); + var dimensions = mainScreen.size; + win = new BrowserWindow({width: dimensions.width, height: dimensions.height}); + + // and load the index.html of the app. + win.loadURL(url.format({ + pathname: path.join(__dirname, '/public/index.html'), + protocol: 'file:', + slashes: true + })) + + // Open the DevTools. +// win.webContents.openDevTools() + + // Emitted when the window is closed. + win.on('closed', () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + win = null + }) +} + +// This method will be called when Electron has finished +// initialization and is ready to create browser windows. +// Some APIs can only be used after this event occurs. +app.on('ready', createWindow) + +// Quit when all windows are closed. +app.on('window-all-closed', () => { + // On macOS it is common for applications and their menu bar + // to stay active until the user quits explicitly with Cmd + Q + if (process.platform !== 'darwin') { + app.quit() + } +}) + +app.on('activate', () => { + // On macOS it's common to re-create a window in the app when the + // dock icon is clicked and there are no other windows open. + if (win === null) { + createWindow() + } +}) diff --git a/src/tools/TurtlebotViewer-web/package-lock.json b/src/tools/TurtlebotViewer-web/package-lock.json new file mode 100644 index 000000000..acc524198 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/package-lock.json @@ -0,0 +1,1347 @@ +{ + "name": "TurtlebotViewer-web", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.9.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.9.4.tgz", + "integrity": "sha512-dSvD36qnQs78G1BPsrZFdPpvLgMW/dnvr5+nTW2csMs5TiP9MOXrjUbnMZOEwnIuBklXtn7b6TPA2Cuq07bDHA==", + "dev": true + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "1.0.3" + } + }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", + "dev": true + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=", + "dev": true + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "camelcase": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-2.1.1.tgz", + "integrity": "sha1-fB0W1nmhu+WcoCys7PsBHiAfWh8=", + "dev": true + }, + "camelcase-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-2.1.0.tgz", + "integrity": "sha1-MIvur/3ygRkFHvodkyITyRuPkuc=", + "dev": true, + "requires": { + "camelcase": "2.1.1", + "map-obj": "1.0.1" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "dev": true + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "integrity": "sha1-CqxmL9Ur54lk1VMvaUeE5wEQrPc=", + "dev": true, + "requires": { + "inherits": "2.0.3", + "readable-stream": "2.3.4", + "typedarray": "0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "readable-stream": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.4.tgz", + "integrity": "sha512-vuYxeWYM+fde14+rajzqgeohAI7YoJcHE7kXDAc4Nk0EbuKnJfqtY9YtRkLo/tqkuF7MsBQRhPnPeyjYITp3ZQ==", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "2.0.0", + "safe-buffer": "5.1.1", + "string_decoder": "1.0.3", + "util-deprecate": "1.0.2" + } + }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha1-D8Z9fBQYJd6UKC3VNr7GubzoYKs=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "dev": true, + "requires": { + "boom": "5.2.0" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha1-XdnabuOl8wIHdDYpDLcX0/SlTgI=", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + } + } + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "1.0.2" + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "electron": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/electron/-/electron-1.8.2.tgz", + "integrity": "sha512-0TV5Hy92g8ACnPn+PVol6a/2uk+khzmRtWxhah/FcKs6StCytm5hD14QqOdZxEdJN8HljXIVCayN/wJX+0wDiQ==", + "dev": true, + "requires": { + "@types/node": "8.9.4", + "electron-download": "3.3.0", + "extract-zip": "1.6.6" + } + }, + "electron-download": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/electron-download/-/electron-download-3.3.0.tgz", + "integrity": "sha1-LP1U1pZsAZxNSa1l++Zcyc3vaMg=", + "dev": true, + "requires": { + "debug": "2.6.9", + "fs-extra": "0.30.0", + "home-path": "1.0.5", + "minimist": "1.2.0", + "nugget": "2.0.1", + "path-exists": "2.1.0", + "rc": "1.2.5", + "semver": "5.5.0", + "sumchecker": "1.3.1" + } + }, + "electron-ipc-server": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/electron-ipc-server/-/electron-ipc-server-0.1.2.tgz", + "integrity": "sha1-okGdqm7hUwH1oCqCDDhAVW1dJeA=", + "requires": { + "parseurl": "1.3.2", + "path-to-regexp": "1.7.0", + "qs": "6.5.1", + "uuid": "2.0.3" + }, + "dependencies": { + "uuid": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.3.tgz", + "integrity": "sha1-Z+LoY3lyFVMN/zGOW/nc6/1Hsho=" + } + } + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==" + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "dev": true + }, + "extract-zip": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.6.tgz", + "integrity": "sha1-EpDt6NINCHK0Kf0/NRyhKOxe+Fw=", + "dev": true, + "requires": { + "concat-stream": "1.6.0", + "debug": "2.6.9", + "mkdirp": "0.5.0", + "yauzl": "2.4.1" + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fd-slicer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", + "dev": true, + "requires": { + "pend": "1.2.0" + } + }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "dev": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.6", + "mime-types": "2.1.18" + } + }, + "fs-extra": { + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.30.0.tgz", + "integrity": "sha1-8jP/zAjU2n1DLapEl3aYnbHfk/A=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "jsonfile": "2.4.0", + "klaw": "1.3.1", + "path-is-absolute": "1.0.1", + "rimraf": "2.6.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "1.0.0" + } + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "dev": true + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "dev": true, + "requires": { + "ajv": "5.5.2", + "har-schema": "2.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha1-r02RTrBl+bXOTZ0RwcshJu7MMDg=", + "dev": true, + "requires": { + "boom": "4.3.1", + "cryptiles": "3.1.2", + "hoek": "4.2.1", + "sntp": "2.1.0" + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==", + "dev": true + }, + "home-path": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/home-path/-/home-path-1.0.5.tgz", + "integrity": "sha1-eIspgVsS1Tus9XVkhHbm+QQdEz8=", + "dev": true + }, + "hosted-git-info": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.5.0.tgz", + "integrity": "sha1-bWDjSzq7yDEwYsO3mO+NkBoHrzw=", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "jsprim": "1.4.1", + "sshpk": "1.13.1" + } + }, + "ice": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/ice/-/ice-3.7.0.tgz", + "integrity": "sha512-kXKP3xxP4f0aAnFlJTeJwmhJmWz7vkww7xvrr0S0wdVvUD4nr/kxuGor5iCNGU5jc00oAHw2FZ+1lBsoahchwg==" + }, + "indent-string": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-2.1.0.tgz", + "integrity": "sha1-ji1INIdCEhtKghi3oTfppSBJ3IA=", + "dev": true, + "requires": { + "repeating": "2.0.1" + } + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=", + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-finite": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", + "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "jquery": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.2.1.tgz", + "integrity": "sha1-XE2d5lKvbNCncBVKYxu6ErAVx4c=" + }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "jsonfile": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz", + "integrity": "sha1-NzaitCi4e72gzIO1P6PWM6NcKug=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "klaw": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz", + "integrity": "sha1-QIhDO0azsbolnXh4XY6W9zugJDk=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11" + } + }, + "load-json-file": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz", + "integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "strip-bom": "2.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "0.4.1", + "signal-exit": "3.0.2" + } + }, + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + }, + "meow": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", + "integrity": "sha1-cstmi0JSKCkKu/qFaJJYcwioAfs=", + "dev": true, + "requires": { + "camelcase-keys": "2.1.0", + "decamelize": "1.2.0", + "loud-rejection": "1.6.0", + "map-obj": "1.0.1", + "minimist": "1.2.0", + "normalize-package-data": "2.4.0", + "object-assign": "4.1.1", + "read-pkg-up": "1.0.1", + "redent": "1.0.0", + "trim-newlines": "1.0.0" + } + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "dev": true + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "dev": true, + "requires": { + "mime-db": "1.33.0" + } + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + }, + "mkdirp": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.0.tgz", + "integrity": "sha1-HXMHam35hs2TROFecfzAWkyavxI=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha1-EvlaMH1YNSB1oEkHuErIvpisAS8=", + "dev": true, + "requires": { + "hosted-git-info": "2.5.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.1" + } + }, + "nugget": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/nugget/-/nugget-2.0.1.tgz", + "integrity": "sha1-IBCVpIfhrTYIGzQy+jytpPjQcbA=", + "dev": true, + "requires": { + "debug": "2.6.9", + "minimist": "1.2.0", + "pretty-bytes": "1.0.4", + "progress-stream": "1.2.0", + "request": "2.83.0", + "single-line-log": "1.1.2", + "throttleit": "0.0.2" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "parseurl": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", + "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-to-regexp": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz", + "integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=", + "requires": { + "isarray": "0.0.1" + } + }, + "path-type": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz", + "integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, + "pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pretty-bytes": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-1.0.4.tgz", + "integrity": "sha1-CiLoIQYJrTVUL4yNXSFZr/B1HIQ=", + "dev": true, + "requires": { + "get-stdin": "4.0.1", + "meow": "3.7.0" + } + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "dev": true + }, + "progress-stream": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/progress-stream/-/progress-stream-1.2.0.tgz", + "integrity": "sha1-LNPP6jO6OonJwSHsM0er6asSX3c=", + "dev": true, + "requires": { + "speedometer": "0.1.4", + "through2": "0.2.3" + } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha1-NJzfbu+J7EXBLX1es/wMhwNDptg=" + }, + "rc": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.5.tgz", + "integrity": "sha1-J1zWh/bjs2zHVrqibf7oCnkDAf0=", + "dev": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + } + }, + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", + "dev": true, + "requires": { + "load-json-file": "1.1.0", + "normalize-package-data": "2.4.0", + "path-type": "1.1.0" + } + }, + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "dev": true, + "requires": { + "find-up": "1.1.2", + "read-pkg": "1.1.0" + } + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "dev": true, + "requires": { + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "0.0.1", + "string_decoder": "0.10.31" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "2.1.0", + "strip-indent": "1.0.1" + } + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "1.0.2" + } + }, + "request": { + "version": "2.83.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.83.0.tgz", + "integrity": "sha1-ygtl2gLtYpNYh4COb1EDgQNOM1Y=", + "dev": true, + "requires": { + "aws-sign2": "0.7.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.6", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.3.2", + "har-validator": "5.0.3", + "hawk": "6.0.2", + "http-signature": "1.2.0", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.18", + "oauth-sign": "0.8.2", + "performance-now": "2.1.0", + "qs": "6.5.1", + "safe-buffer": "5.1.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.3", + "tunnel-agent": "0.6.0", + "uuid": "3.2.1" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha1-LtgVDSShbqhlHm1u8PR8QVjOejY=", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha1-iTMSr2myEj3vcfV4iQAWce6yyFM=", + "dev": true + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, + "single-line-log": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/single-line-log/-/single-line-log-1.1.2.tgz", + "integrity": "sha1-wvg/Jzo+GhbtsJlWYdoO1e8DM2Q=", + "dev": true, + "requires": { + "string-width": "1.0.2" + } + }, + "slice2js": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/slice2js/-/slice2js-3.7.0.tgz", + "integrity": "sha512-iY1mnI1OMxM9uq9YaewLnRPYTrQr1UdlBAJ94u4TimhTqDCG1j9UHfIqkptjmpDqWQiQgLVug/xz3TD2qJobkw==", + "dev": true + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha1-LGzsFP7cIiJznK+bXD2F0cxaLMg=", + "dev": true, + "requires": { + "hoek": "4.2.1" + } + }, + "spdx-correct": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-1.0.2.tgz", + "integrity": "sha1-SzBz2TP/UfORLwOsVRlJikFQ20A=", + "dev": true, + "requires": { + "spdx-license-ids": "1.2.2" + } + }, + "spdx-expression-parse": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz", + "integrity": "sha1-m98vIOH0DtRH++JzJmGR/O1RYmw=", + "dev": true + }, + "spdx-license-ids": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz", + "integrity": "sha1-yd96NCRZSt5r0RkA1ZZpbcBrrFc=", + "dev": true + }, + "speedometer": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/speedometer/-/speedometer-0.1.4.tgz", + "integrity": "sha1-mHbb0qFp0xFUAtSObqYynIgWpQ0=", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "sshpk": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.13.1.tgz", + "integrity": "sha1-US322mKHFEMW3EwY/hzx2UBzm+M=", + "dev": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", + "dev": true + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", + "dev": true + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-bom": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz", + "integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=", + "dev": true, + "requires": { + "is-utf8": "0.2.1" + } + }, + "strip-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-1.0.1.tgz", + "integrity": "sha1-DHlipq3vp7vUrDZkYKY4VSrhoKI=", + "dev": true, + "requires": { + "get-stdin": "4.0.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, + "sumchecker": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/sumchecker/-/sumchecker-1.3.1.tgz", + "integrity": "sha1-ebs7RFbdBPGOvbwNcDodHa7FEF0=", + "dev": true, + "requires": { + "debug": "2.6.9", + "es6-promise": "4.2.4" + } + }, + "throttleit": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-0.0.2.tgz", + "integrity": "sha1-z+34jmDADdlpe2H90qg0OptoDq8=", + "dev": true + }, + "through2": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", + "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", + "dev": true, + "requires": { + "readable-stream": "1.1.14", + "xtend": "2.1.2" + } + }, + "tough-cookie": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.3.tgz", + "integrity": "sha1-C2GKVWW23qkL80JdBNVe3EdadWE=", + "dev": true, + "requires": { + "punycode": "1.4.1" + } + }, + "trim-newlines": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", + "integrity": "sha1-WIeWa7WCpFA6QetST301ARgVphM=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true, + "optional": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz", + "integrity": "sha1-KAS6vnEq0zeUWaz74kdGqywwP7w=", + "dev": true, + "requires": { + "spdx-correct": "1.0.2", + "spdx-expression-parse": "1.0.4" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "1.3.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "dev": true, + "requires": { + "object-keys": "0.4.0" + } + }, + "yauzl": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", + "dev": true, + "requires": { + "fd-slicer": "1.0.1" + } + } + } +} diff --git a/src/tools/TurtlebotViewer-web/package.json b/src/tools/TurtlebotViewer-web/package.json new file mode 100644 index 000000000..3909c932e --- /dev/null +++ b/src/tools/TurtlebotViewer-web/package.json @@ -0,0 +1,18 @@ +{ + "name": "TurtlebotViewer-web", + "version": "0.1.0", + "main": "main.js", + "scripts": { + "start": "electron ." + }, + "dependencies": { + "electron-ipc-server": "^0.1.2", + "ice": "^3.7.0", + "jquery": "^3.2.1", + "js-yaml": "^3.11.0" + }, + "devDependencies": { + "electron": "^1.8.2", + "slice2js": "^3.7.0" + } +} diff --git a/src/tools/TurtlebotViewer-web/public/config.yml b/src/tools/TurtlebotViewer-web/public/config.yml new file mode 100644 index 000000000..b8759c8c5 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/config.yml @@ -0,0 +1,22 @@ +camrightserv: + dir: localhost + port: 11010 +camrightepname: CameraR +camleftserv: + dir: localhost + port: 11010 +camleftepname: CameraL +motorserv: + dir: locahost + port: 11010 +motorsepname: Motors +pose3dserv: + dir: localhost + port: 11010 +pose3depname: Pose3D +laserserv: + dir: localhost + port: 11010 +laserepname: Laser +maxv: 3 +maxw: 0.7 diff --git a/src/tools/TurtlebotViewer-web/public/css/bootstrap-toggle.min.css b/src/tools/TurtlebotViewer-web/public/css/bootstrap-toggle.min.css new file mode 100644 index 000000000..0d42ed09c --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/css/bootstrap-toggle.min.css @@ -0,0 +1,28 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.css v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ +.checkbox label .toggle,.checkbox-inline .toggle{margin-left:-20px;margin-right:5px} +.toggle{position:relative;overflow:hidden} +.toggle input[type=checkbox]{display:none} +.toggle-group{position:absolute;width:200%;top:0;bottom:0;left:0;transition:left .35s;-webkit-transition:left .35s;-moz-user-select:none;-webkit-user-select:none} +.toggle.off .toggle-group{left:-100%} +.toggle-on{position:absolute;top:0;bottom:0;left:0;right:50%;margin:0;border:0;border-radius:0} +.toggle-off{position:absolute;top:0;bottom:0;left:50%;right:0;margin:0;border:0;border-radius:0} +.toggle-handle{position:relative;margin:0 auto;padding-top:0;padding-bottom:0;height:100%;width:0;border-width:0 1px} +.toggle.btn{min-width:59px;min-height:34px} +.toggle-on.btn{padding-right:24px} +.toggle-off.btn{padding-left:24px} +.toggle.btn-lg{min-width:79px;min-height:45px} +.toggle-on.btn-lg{padding-right:31px} +.toggle-off.btn-lg{padding-left:31px} +.toggle-handle.btn-lg{width:40px} +.toggle.btn-sm{min-width:50px;min-height:30px} +.toggle-on.btn-sm{padding-right:20px} +.toggle-off.btn-sm{padding-left:20px} +.toggle.btn-xs{min-width:35px;min-height:22px} +.toggle-on.btn-xs{padding-right:12px} +.toggle-off.btn-xs{padding-left:12px} \ No newline at end of file diff --git a/src/tools/TurtlebotViewer-web/public/css/bootstrap.min.css b/src/tools/TurtlebotViewer-web/public/css/bootstrap.min.css new file mode 100644 index 000000000..a5f95e37f --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/css/bootstrap.min.css @@ -0,0 +1,14 @@ +/*! + * Bootstrap v3.3.5 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ + +/*! + * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=5c9895f0d94dc160deb5) + * Config saved to config.json and https://gist.github.com/5c9895f0d94dc160deb5 + *//*! + * Bootstrap v3.3.6 (http://getbootstrap.com) + * Copyright 2011-2015 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + *//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */@media print{*,*:before,*:after{background:transparent !important;color:#000 !important;-webkit-box-shadow:none !important;box-shadow:none !important;text-shadow:none !important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="#"]:after,a[href^="javascript:"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100% !important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}.navbar{display:none}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000 !important}.label{border:1px solid #000}.table{border-collapse:collapse !important}.table td,.table th{background-color:#fff !important}.table-bordered th,.table-bordered td{border:1px solid #ddd !important}}@font-face{font-family:'Glyphicons Halflings';src:url('../fonts/glyphicons-halflings-regular.eot');src:url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),url('../fonts/glyphicons-halflings-regular.woff') format('woff'),url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'),url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\002a"}.glyphicon-plus:before{content:"\002b"}.glyphicon-euro:before,.glyphicon-eur:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}.glyphicon-cd:before{content:"\e201"}.glyphicon-save-file:before{content:"\e202"}.glyphicon-open-file:before{content:"\e203"}.glyphicon-level-up:before{content:"\e204"}.glyphicon-copy:before{content:"\e205"}.glyphicon-paste:before{content:"\e206"}.glyphicon-alert:before{content:"\e209"}.glyphicon-equalizer:before{content:"\e210"}.glyphicon-king:before{content:"\e211"}.glyphicon-queen:before{content:"\e212"}.glyphicon-pawn:before{content:"\e213"}.glyphicon-bishop:before{content:"\e214"}.glyphicon-knight:before{content:"\e215"}.glyphicon-baby-formula:before{content:"\e216"}.glyphicon-tent:before{content:"\26fa"}.glyphicon-blackboard:before{content:"\e218"}.glyphicon-bed:before{content:"\e219"}.glyphicon-apple:before{content:"\f8ff"}.glyphicon-erase:before{content:"\e221"}.glyphicon-hourglass:before{content:"\231b"}.glyphicon-lamp:before{content:"\e223"}.glyphicon-duplicate:before{content:"\e224"}.glyphicon-piggy-bank:before{content:"\e225"}.glyphicon-scissors:before{content:"\e226"}.glyphicon-bitcoin:before{content:"\e227"}.glyphicon-btc:before{content:"\e227"}.glyphicon-xbt:before{content:"\e227"}.glyphicon-yen:before{content:"\00a5"}.glyphicon-jpy:before{content:"\00a5"}.glyphicon-ruble:before{content:"\20bd"}.glyphicon-rub:before{content:"\20bd"}.glyphicon-scale:before{content:"\e230"}.glyphicon-ice-lolly:before{content:"\e231"}.glyphicon-ice-lolly-tasted:before{content:"\e232"}.glyphicon-education:before{content:"\e233"}.glyphicon-option-horizontal:before{content:"\e234"}.glyphicon-option-vertical:before{content:"\e235"}.glyphicon-menu-hamburger:before{content:"\e236"}.glyphicon-modal-window:before{content:"\e237"}.glyphicon-oil:before{content:"\e238"}.glyphicon-grain:before{content:"\e239"}.glyphicon-sunglasses:before{content:"\e240"}.glyphicon-text-size:before{content:"\e241"}.glyphicon-text-color:before{content:"\e242"}.glyphicon-text-background:before{content:"\e243"}.glyphicon-object-align-top:before{content:"\e244"}.glyphicon-object-align-bottom:before{content:"\e245"}.glyphicon-object-align-horizontal:before{content:"\e246"}.glyphicon-object-align-left:before{content:"\e247"}.glyphicon-object-align-vertical:before{content:"\e248"}.glyphicon-object-align-right:before{content:"\e249"}.glyphicon-triangle-right:before{content:"\e250"}.glyphicon-triangle-left:before{content:"\e251"}.glyphicon-triangle-bottom:before{content:"\e252"}.glyphicon-triangle-top:before{content:"\e253"}.glyphicon-console:before{content:"\e254"}.glyphicon-superscript:before{content:"\e255"}.glyphicon-subscript:before{content:"\e256"}.glyphicon-menu-left:before{content:"\e257"}.glyphicon-menu-right:before{content:"\e258"}.glyphicon-menu-down:before{content:"\e259"}.glyphicon-menu-up:before{content:"\e260"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#58d9ff;background-color:#333}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#fbfbfb;text-decoration:none}a:hover,a:focus{color:#d5d5d5;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#333;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:normal;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}mark,.mark{background-color:#fcf8e3;padding:.2em}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#337ab7}a.text-primary:hover,a.text-primary:focus{color:#285f8f}.text-success{color:#3c763d}a.text-success:hover,a.text-success:focus{color:#2b542c}.text-info{color:#31708f}a.text-info:hover,a.text-info:focus{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover,a.text-warning:focus{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover,a.text-danger:focus{color:#843534}.bg-primary{color:#fff;background-color:#337ab7}a.bg-primary:hover,a.bg-primary:focus{background-color:#285f8f}.bg-success{background-color:#dff0d8}a.bg-success:hover,a.bg-success:focus{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover,a.bg-info:focus{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover,a.bg-warning:focus{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover,a.bg-danger:focus{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none;margin-left:-5px}.list-inline>li{display:inline-block;padding-left:5px;padding-right:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:bold}dd{margin-left:0}@media (min-width:992px){.dl-horizontal dt{float:left;width:160px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0;text-align:right}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.25)}kbd kbd{padding:0;font-size:100%;font-weight:bold;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;word-break:break-all;word-wrap:break-word;color:#333;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1, .col-sm-1, .col-md-1, .col-lg-1, .col-xs-2, .col-sm-2, .col-md-2, .col-lg-2, .col-xs-3, .col-sm-3, .col-md-3, .col-lg-3, .col-xs-4, .col-sm-4, .col-md-4, .col-lg-4, .col-xs-5, .col-sm-5, .col-md-5, .col-lg-5, .col-xs-6, .col-sm-6, .col-md-6, .col-lg-6, .col-xs-7, .col-sm-7, .col-md-7, .col-lg-7, .col-xs-8, .col-sm-8, .col-md-8, .col-lg-8, .col-xs-9, .col-sm-9, .col-md-9, .col-lg-9, .col-xs-10, .col-sm-10, .col-md-10, .col-lg-10, .col-xs-11, .col-sm-11, .col-md-11, .col-lg-11, .col-xs-12, .col-sm-12, .col-md-12, .col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1, .col-xs-2, .col-xs-3, .col-xs-4, .col-xs-5, .col-xs-6, .col-xs-7, .col-xs-8, .col-xs-9, .col-xs-10, .col-xs-11, .col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}caption{padding-top:8px;padding-bottom:8px;color:#777;text-align:left}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#333}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-of-type(odd){background-color:#f9f9f9}.table-hover>tbody>tr:hover{background-color:#f5f5f5}table col[class*="col-"]{position:static;float:none;display:table-column}table td[class*="col-"],table th[class*="col-"]{position:static;float:none;display:table-cell}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}.table-responsive{overflow-x:auto;min-height:0.01%}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-y:hidden;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{padding:0;margin:0;border:0;min-width:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#58d9ff;border:0;border-bottom:1px solid #58d9ff}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:bold}input[type="search"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type="file"]{display:block}input[type="range"]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #58d9ff;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border-color ease-in-out .15s, -webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s, box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px rgba(102, 175, 233, 0.6)}.form-control::-moz-placeholder{color:#999;opacity:1}.form-control:-ms-input-placeholder{color:#999}.form-control::-webkit-input-placeholder{color:#999}.form-control::-ms-expand{border:0;background-color:transparent}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{background-color:#eee;opacity:1}.form-control[disabled],fieldset[disabled] .form-control{cursor:not-allowed}textarea.form-control{height:auto}input[type="search"]{-webkit-appearance:none}@media screen and (-webkit-min-device-pixel-ratio:0){input[type="date"].form-control,input[type="time"].form-control,input[type="datetime-local"].form-control,input[type="month"].form-control{line-height:34px}input[type="date"].input-sm,input[type="time"].input-sm,input[type="datetime-local"].input-sm,input[type="month"].input-sm,.input-group-sm input[type="date"],.input-group-sm input[type="time"],.input-group-sm input[type="datetime-local"],.input-group-sm input[type="month"]{line-height:30px}input[type="date"].input-lg,input[type="time"].input-lg,input[type="datetime-local"].input-lg,input[type="month"].input-lg,.input-group-lg input[type="date"],.input-group-lg input[type="time"],.input-group-lg input[type="datetime-local"],.input-group-lg input[type="month"]{line-height:46px}}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{min-height:20px;padding-left:20px;margin-bottom:0;font-weight:normal;cursor:pointer}.radio input[type="radio"],.radio-inline input[type="radio"],.checkbox input[type="checkbox"],.checkbox-inline input[type="checkbox"]{position:absolute;margin-left:-20px;margin-top:4px \9}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{position:relative;display:inline-block;padding-left:20px;margin-bottom:0;vertical-align:middle;font-weight:normal;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"].disabled,input[type="checkbox"].disabled,fieldset[disabled] input[type="radio"],fieldset[disabled] input[type="checkbox"]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0;min-height:34px}.form-control-static.input-lg,.form-control-static.input-sm{padding-left:0;padding-right:0}.input-sm{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.form-group-sm select.form-control{height:30px;line-height:30px}.form-group-sm textarea.form-control,.form-group-sm select[multiple].form-control{height:auto}.form-group-sm .form-control-static{height:30px;min-height:32px;padding:6px 10px;font-size:12px;line-height:1.5}.input-lg{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.form-group-lg select.form-control{height:46px;line-height:46px}.form-group-lg textarea.form-control,.form-group-lg select[multiple].form-control{height:auto}.form-group-lg .form-control-static{height:46px;min-height:38px;padding:11px 16px;font-size:18px;line-height:1.3333333}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:0;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center;pointer-events:none}.input-lg+.form-control-feedback,.input-group-lg+.form-control-feedback,.form-group-lg .form-control+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback,.input-group-sm+.form-control-feedback,.form-group-sm .form-control+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline,.has-success.radio label,.has-success.checkbox label,.has-success.radio-inline label,.has-success.checkbox-inline label{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;border-color:#3c763d;background-color:#dff0d8}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline,.has-warning.radio label,.has-warning.checkbox label,.has-warning.radio-inline label,.has-warning.checkbox-inline label{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;border-color:#8a6d3b;background-color:#fcf8e3}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline,.has-error.radio label,.has-error.checkbox label,.has-error.radio-inline label,.has-error.checkbox-inline label{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;border-color:#a94442;background-color:#f2dede}.has-error .form-control-feedback{color:#a94442}.has-feedback label~.form-control-feedback{top:25px}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#d8f6ff}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .form-control-static{display:inline-block}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{margin-top:0;margin-bottom:0;padding-top:7px}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-left:-15px;margin-right:-15px}@media (min-width:768px){.form-horizontal .control-label{text-align:right;margin-bottom:0;padding-top:7px}}.form-horizontal .has-feedback .form-control-feedback{right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:11px;font-size:18px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px;font-size:12px}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#ccc;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#ccc;background-color:#333;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#ccc;background-color:#1a1a1a;border-color:#8c8c8c}.btn-default:hover{color:#ccc;background-color:#1a1a1a;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#ccc;background-color:#1a1a1a;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#ccc;background-color:#080808;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus{background-color:#333;border-color:#ccc}.btn-default .badge{color:#333;background-color:#ccc}.btn-primary{color:#337ab7;background-color:#333;border-color:#337ab7}.btn-primary:focus,.btn-primary.focus{color:#337ab7;background-color:#1a1a1a;border-color:#173853}.btn-primary:hover{color:#337ab7;background-color:#1a1a1a;border-color:#265a87}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#337ab7;background-color:#1a1a1a;border-color:#265a87}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#337ab7;background-color:#080808;border-color:#173853}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus{background-color:#333;border-color:#337ab7}.btn-primary .badge{color:#333;background-color:#337ab7}.btn-success{color:#5cb85c;background-color:#333;border-color:#5cb85c}.btn-success:focus,.btn-success.focus{color:#5cb85c;background-color:#1a1a1a;border-color:#2d672d}.btn-success:hover{color:#5cb85c;background-color:#1a1a1a;border-color:#419641}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#5cb85c;background-color:#1a1a1a;border-color:#419641}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#5cb85c;background-color:#080808;border-color:#2d672d}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus{background-color:#333;border-color:#5cb85c}.btn-success .badge{color:#333;background-color:#5cb85c}.btn-info{color:#58d9ff;background-color:#333;border-color:#58d9ff}.btn-info:focus,.btn-info.focus{color:#58d9ff;background-color:#1a1a1a;border-color:#00a6d8}.btn-info:hover{color:#58d9ff;background-color:#1a1a1a;border-color:#1bcbff}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#58d9ff;background-color:#1a1a1a;border-color:#1bcbff}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#58d9ff;background-color:#080808;border-color:#00a6d8}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus{background-color:#333;border-color:#58d9ff}.btn-info .badge{color:#333;background-color:#58d9ff}.btn-warning{color:#f0ad4e;background-color:#333;border-color:#f0ad4e}.btn-warning:focus,.btn-warning.focus{color:#f0ad4e;background-color:#1a1a1a;border-color:#b06d0f}.btn-warning:hover{color:#f0ad4e;background-color:#1a1a1a;border-color:#eb9316}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#f0ad4e;background-color:#1a1a1a;border-color:#eb9316}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#f0ad4e;background-color:#080808;border-color:#b06d0f}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus{background-color:#333;border-color:#f0ad4e}.btn-warning .badge{color:#333;background-color:#f0ad4e}.btn-danger{color:#d9534f;background-color:#333;border-color:#d9534f}.btn-danger:focus,.btn-danger.focus{color:#d9534f;background-color:#1a1a1a;border-color:#8b211e}.btn-danger:hover{color:#d9534f;background-color:#1a1a1a;border-color:#c12e2a}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#d9534f;background-color:#1a1a1a;border-color:#c12e2a}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#d9534f;background-color:#080808;border-color:#8b211e}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus{background-color:#333;border-color:#d9534f}.btn-danger .badge{color:#333;background-color:#d9534f}.btn-link{color:#fbfbfb;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#d5d5d5;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition-property:height, visibility;-o-transition-property:height, visibility;transition-property:height, visibility;-webkit-transition-duration:.35s;-o-transition-duration:.35s;transition-duration:.35s;-webkit-transition-timing-function:ease;-o-transition-timing-function:ease;transition-timing-function:ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px dashed;border-top:4px solid \9;border-right:4px solid transparent;border-left:4px solid transparent}.dropup,.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;font-size:14px;text-align:left;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,0.175);box-shadow:0 6px 12px rgba(0,0,0,0.175);-webkit-background-clip:padding-box;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{text-decoration:none;color:#262626;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;outline:0;background-color:#337ab7}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);cursor:not-allowed}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{left:auto;right:0}.dropdown-menu-left{left:0;right:auto}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;left:0;right:0;bottom:0;top:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px dashed;border-bottom:4px solid \9;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:2px}@media (min-width:992px){.navbar-right .dropdown-menu{left:auto;right:0}.navbar-right .dropdown-menu-left{left:0;right:auto}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn,.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-bottom-left-radius:0;border-top-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-top-right-radius:0}.btn-group>.btn-group:last-child:not(:first-child)>.btn:first-child{border-bottom-left-radius:0;border-top-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-left:8px;padding-right:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-left:12px;padding-right:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-top-left-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-right-radius:0;border-top-left-radius:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-right-radius:0;border-top-left-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{float:none;display:table-cell;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle="buttons"]>.btn input[type="radio"],[data-toggle="buttons"]>.btn-group>.btn input[type="radio"],[data-toggle="buttons"]>.btn input[type="checkbox"],[data-toggle="buttons"]>.btn-group>.btn input[type="checkbox"]{position:absolute;clip:rect(0, 0, 0, 0);pointer-events:none}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*="col-"]{float:none;padding-left:0;padding-right:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group .form-control:focus{z-index:3}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:normal;line-height:1;color:#555;text-align:center;background-color:#333;border:1px solid #58d9ff;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type="radio"],.input-group-addon input[type="checkbox"]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-bottom-right-radius:0;border-top-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-bottom-left-radius:0;border-top-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{z-index:2;margin-left:-1px}.nav{margin-bottom:0;padding-left:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#58d9ff}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;background-color:transparent;cursor:not-allowed}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#58d9ff;border-color:#fbfbfb}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #58d9ff}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#58d9ff #58d9ff #58d9ff}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#58d9ff;background-color:#333;border:1px solid #58d9ff;border-bottom-color:transparent;cursor:default}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #58d9ff}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #58d9ff;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#333}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#337ab7}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{text-align:center;margin-bottom:5px}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #58d9ff}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #58d9ff;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#333}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-right-radius:0;border-top-left-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:992px){.navbar{border-radius:6px}}@media (min-width:992px){.navbar-header{float:left}}.navbar-collapse{overflow-x:visible;padding-right:15px;padding-left:15px;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1);-webkit-overflow-scrolling:touch}.navbar-collapse.in{overflow-y:auto}@media (min-width:992px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block !important;height:auto !important;padding-bottom:0;overflow:visible !important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-left:0;padding-right:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-device-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:992px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:992px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030}@media (min-width:992px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;padding:15px 15px;font-size:18px;line-height:20px;height:50px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}.navbar-brand>img{display:block}@media (min-width:992px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;margin-right:15px;padding:9px 10px;margin-top:8px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:992px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:991px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:992px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}}.navbar-form{margin-left:-15px;margin-right:-15px;padding:10px 15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);margin-top:8px;margin-bottom:8px}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .form-control-static{display:inline-block}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type="radio"],.navbar-form .checkbox input[type="checkbox"]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:991px){.navbar-form .form-group{margin-bottom:5px}.navbar-form .form-group:last-child{margin-bottom:0}}@media (min-width:992px){.navbar-form{width:auto;border:0;margin-left:0;margin-right:0;padding-top:0;padding-bottom:0;-webkit-box-shadow:none;box-shadow:none}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-right-radius:0;border-top-left-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{margin-bottom:0;border-top-right-radius:6px;border-top-left-radius:6px;border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:992px){.navbar-text{float:left;margin-left:15px;margin-right:15px}}@media (min-width:992px){.navbar-left{float:left !important}.navbar-right{float:right !important;margin-right:-15px}.navbar-right~.navbar-right{margin-right:0}}.navbar-default{background-color:#fbfbfb;border-color:#58d9ff}.navbar-default .navbar-brand{color:#58d9ff}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#25cdff;background-color:transparent}.navbar-default .navbar-text{color:#58d9ff}.navbar-default .navbar-nav>li>a{color:#58d9ff}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#25cdff;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#fbfbfb;background-color:#58d9ff}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#58d9ff}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#e2e2e2}.navbar-default .navbar-toggle .icon-bar{background-color:#58d9ff}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#58d9ff}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{background-color:#58d9ff;color:#fbfbfb}@media (max-width:991px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#58d9ff}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#25cdff;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fbfbfb;background-color:#58d9ff}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#58d9ff}.navbar-default .navbar-link:hover{color:#25cdff}.navbar-default .btn-link{color:#58d9ff}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#25cdff}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#333;border-color:#58d9ff}.navbar-inverse .navbar-brand{color:#58d9ff}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#0cc8ff;background-color:transparent}.navbar-inverse .navbar-text{color:#58d9ff}.navbar-inverse .navbar-nav>li>a{color:#58d9ff}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#0cc8ff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fbfbfb;background-color:#333}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#58d9ff}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:arken(#fbfbfb, 10%)}.navbar-inverse .navbar-toggle .icon-bar{background-color:#58d9ff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#212121}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{background-color:#333;color:#fbfbfb}@media (max-width:991px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#58d9ff}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#58d9ff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#58d9ff}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#0cc8ff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fbfbfb;background-color:#333}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#58d9ff}.navbar-inverse .navbar-link:hover{color:#0cc8ff}.navbar-inverse .btn-link{color:#58d9ff}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#0cc8ff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{content:"/\00a0";padding:0 5px;color:#ccc}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;line-height:1.42857143;text-decoration:none;color:#fbfbfb;background-color:#fff;border:1px solid #ddd;margin-left:-1px}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-bottom-left-radius:4px;border-top-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-bottom-right-radius:4px;border-top-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{z-index:2;color:#d5d5d5;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:3;color:#fff;background-color:#337ab7;border-color:#337ab7;cursor:default}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;background-color:#fff;border-color:#ddd;cursor:not-allowed}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px;line-height:1.3333333}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-bottom-left-radius:6px;border-top-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-bottom-right-radius:6px;border-top-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px;line-height:1.5}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-bottom-left-radius:3px;border-top-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-bottom-right-radius:3px;border-top-right-radius:3px}.pager{padding-left:0;margin:20px 0;list-style:none;text-align:center}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;background-color:#fff;cursor:not-allowed}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:bold;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#337ab7}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#285f8f}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#58d9ff}.label-info[href]:hover,.label-info[href]:focus{background-color:#25cdff}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:bold;color:#fff;line-height:1;vertical-align:middle;white-space:nowrap;text-align:center;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge,.btn-group-xs>.btn .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#fbfbfb;background-color:#fff}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding-top:30px;padding-bottom:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron,.container-fluid .jumbotron{border-radius:6px;padding-left:15px;padding-right:15px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron,.container-fluid .jumbotron{padding-left:60px;padding-right:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#333;border:1px solid #ddd;border-radius:4px;-webkit-transition:border .2s ease-in-out;-o-transition:border .2s ease-in-out;transition:border .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-left:auto;margin-right:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#fbfbfb}.thumbnail .caption{padding:9px;color:#58d9ff}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:bold}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{background-color:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{background-color:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{background-color:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{background-color:#f2dede;border-color:#ebccd1;color:#a94442}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{overflow:hidden;height:20px;margin-bottom:20px;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress-bar{float:left;width:0%;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#337ab7;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-info{background-color:#58d9ff}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:-o-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent);background-image:linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent)}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.list-group{margin-bottom:20px;padding-left:0}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-right-radius:4px;border-top-left-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}a.list-group-item,button.list-group-item{color:#555}a.list-group-item .list-group-item-heading,button.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,button.list-group-item:hover,a.list-group-item:focus,button.list-group-item:focus{text-decoration:none;color:#555;background-color:#f5f5f5}button.list-group-item{width:100%;text-align:left}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{background-color:#eee;color:#777;cursor:not-allowed}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#337ab7;border-color:#337ab7}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#c7ddef}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success,button.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading,button.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,button.list-group-item-success:hover,a.list-group-item-success:focus,button.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,button.list-group-item-success.active,a.list-group-item-success.active:hover,button.list-group-item-success.active:hover,a.list-group-item-success.active:focus,button.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info,button.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading,button.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,button.list-group-item-info:hover,a.list-group-item-info:focus,button.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,button.list-group-item-info.active,a.list-group-item-info.active:hover,button.list-group-item-info.active:hover,a.list-group-item-info.active:focus,button.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning,button.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading,button.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,button.list-group-item-warning:hover,a.list-group-item-warning:focus,button.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,button.list-group-item-warning.active,a.list-group-item-warning.active:hover,button.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus,button.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger,button.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading,button.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,button.list-group-item-danger:hover,a.list-group-item-danger:focus,button.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,button.list-group-item-danger.active,a.list-group-item-danger.active:hover,button.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus,button.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#333;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,0.05);box-shadow:0 1px 1px rgba(0,0,0,0.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-right-radius:3px;border-top-left-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a,.panel-title>small,.panel-title>.small,.panel-title>small>a,.panel-title>.small>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#333;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group,.panel>.panel-collapse>.list-group{margin-bottom:0}.panel>.list-group .list-group-item,.panel>.panel-collapse>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child,.panel>.panel-collapse>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-right-radius:3px;border-top-left-radius:3px}.panel>.list-group:last-child .list-group-item:last-child,.panel>.panel-collapse>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.panel-heading+.panel-collapse>.list-group .list-group-item:first-child{border-top-right-radius:0;border-top-left-radius:0}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table caption,.panel>.table-responsive>.table caption,.panel>.panel-collapse>.table caption{padding-left:15px;padding-right:15px}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-right-radius:3px;border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive,.panel>.table+.panel-body,.panel>.table-responsive+.panel-body{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{border:0;margin-bottom:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body,.panel-group .panel-heading+.panel-collapse>.list-group{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#337ab7}.panel-primary>.panel-heading{color:#fff;background-color:#337ab7;border-color:#337ab7}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#337ab7}.panel-primary>.panel-heading .badge{color:#337ab7;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#337ab7}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#58d9ff}.panel-info>.panel-heading{color:#58d9ff;background-color:#333;border-color:#58d9ff}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#58d9ff}.panel-info>.panel-heading .badge{color:#333;background-color:#58d9ff}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#58d9ff}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object,.embed-responsive video{position:absolute;top:0;left:0;bottom:0;height:100%;width:100%;border:0}.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:bold;line-height:1;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;opacity:.5;filter:alpha(opacity=50)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.modal-open{overflow:hidden}.modal{display:none;overflow:hidden;position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transform:translate(0, -25%);-ms-transform:translate(0, -25%);-o-transform:translate(0, -25%);transform:translate(0, -25%);-webkit-transition:-webkit-transform 0.3s ease-out;-o-transition:-o-transform 0.3s ease-out;transition:transform 0.3s ease-out}.modal.in .modal-dialog{-webkit-transform:translate(0, 0);-ms-transform:translate(0, 0);-o-transform:translate(0, 0);transform:translate(0, 0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#333;border:1px solid #999;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 3px 9px rgba(0,0,0,0.5);box-shadow:0 3px 9px rgba(0,0,0,0.5);-webkit-background-clip:padding-box;background-clip:padding-box;outline:0}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0;filter:alpha(opacity=0)}.modal-backdrop.in{opacity:.5;filter:alpha(opacity=50)}.modal-header{padding:15px;border-bottom:1px solid #58d9ff}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #58d9ff}.modal-footer .btn+.btn{margin-left:5px;margin-bottom:0}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,0.5);box-shadow:0 5px 15px rgba(0,0,0,0.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:12px;opacity:0;filter:alpha(opacity=0)}.tooltip.in{opacity:.9;filter:alpha(opacity=90)}.tooltip.top{margin-top:-3px;padding:5px 0}.tooltip.right{margin-left:3px;padding:0 5px}.tooltip.bottom{margin-top:3px;padding:5px 0}.tooltip.left{margin-left:-3px;padding:0 5px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;right:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{bottom:0;left:5px;margin-bottom:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;right:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;left:5px;margin-top:-5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-style:normal;font-weight:normal;letter-spacing:normal;line-break:auto;line-height:1.42857143;text-align:left;text-align:start;text-decoration:none;text-shadow:none;text-transform:none;white-space:normal;word-break:normal;word-spacing:normal;word-wrap:normal;font-size:14px;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{margin:0;padding:8px 14px;font-size:14px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{border-width:10px;content:""}.popover.top>.arrow{left:50%;margin-left:-11px;border-bottom-width:0;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);bottom:-11px}.popover.top>.arrow:after{content:" ";bottom:1px;margin-left:-10px;border-bottom-width:0;border-top-color:#fff}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-left-width:0;border-right-color:#999;border-right-color:rgba(0,0,0,0.25)}.popover.right>.arrow:after{content:" ";left:1px;bottom:-10px;border-left-width:0;border-right-color:#fff}.popover.bottom>.arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.popover.bottom>.arrow:after{content:" ";top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,0.25)}.popover.left>.arrow:after{content:" ";right:1px;border-right-width:0;border-left-color:#fff;bottom:-10px}.carousel{position:relative}.carousel-inner{position:relative;overflow:hidden;width:100%}.carousel-inner>.item{display:none;position:relative;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}@media all and (transform-3d),(-webkit-transform-3d){.carousel-inner>.item{-webkit-transition:-webkit-transform 0.6s ease-in-out;-o-transition:-o-transform 0.6s ease-in-out;transition:transform 0.6s ease-in-out;-webkit-backface-visibility:hidden;backface-visibility:hidden;-webkit-perspective:1000px;perspective:1000px}.carousel-inner>.item.next,.carousel-inner>.item.active.right{-webkit-transform:translate3d(100%, 0, 0);transform:translate3d(100%, 0, 0);left:0}.carousel-inner>.item.prev,.carousel-inner>.item.active.left{-webkit-transform:translate3d(-100%, 0, 0);transform:translate3d(-100%, 0, 0);left:0}.carousel-inner>.item.next.left,.carousel-inner>.item.prev.right,.carousel-inner>.item.active{-webkit-transform:translate3d(0, 0, 0);transform:translate3d(0, 0, 0);left:0}}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;left:0;bottom:0;width:15%;opacity:.5;filter:alpha(opacity=50);font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6);background-color:rgba(0,0,0,0)}.carousel-control.left{background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.5)), to(rgba(0,0,0,0.0001)));background-image:linear-gradient(to right, rgba(0,0,0,0.5) 0, rgba(0,0,0,0.0001) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1)}.carousel-control.right{left:auto;right:0;background-image:-webkit-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-o-linear-gradient(left, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-image:-webkit-gradient(linear, left top, right top, color-stop(0, rgba(0,0,0,0.0001)), to(rgba(0,0,0,0.5)));background-image:linear-gradient(to right, rgba(0,0,0,0.0001) 0, rgba(0,0,0,0.5) 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1)}.carousel-control:hover,.carousel-control:focus{outline:0;color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;margin-top:-10px;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;line-height:1;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;margin-left:-30%;padding-left:0;list-style:none;text-align:center}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;border:1px solid #fff;border-radius:10px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0)}.carousel-indicators .active{margin:0;width:12px;height:12px;background-color:#fff}.carousel-caption{position:absolute;left:15%;right:15%;bottom:20px;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,0.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-10px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-10px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-10px}.carousel-caption{left:20%;right:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-header:before,.modal-header:after,.modal-footer:before,.modal-footer:after{content:" ";display:table}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-header:after,.modal-footer:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none !important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none !important}@media (max-width:767px){.visible-xs{display:block !important}table.visible-xs{display:table !important}tr.visible-xs{display:table-row !important}th.visible-xs,td.visible-xs{display:table-cell !important}}@media (max-width:767px){.visible-xs-block{display:block !important}}@media (max-width:767px){.visible-xs-inline{display:inline !important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block !important}table.visible-sm{display:table !important}tr.visible-sm{display:table-row !important}th.visible-sm,td.visible-sm{display:table-cell !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline !important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block !important}table.visible-md{display:table !important}tr.visible-md{display:table-row !important}th.visible-md,td.visible-md{display:table-cell !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline !important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block !important}}@media (min-width:1200px){.visible-lg{display:block !important}table.visible-lg{display:table !important}tr.visible-lg{display:table-row !important}th.visible-lg,td.visible-lg{display:table-cell !important}}@media (min-width:1200px){.visible-lg-block{display:block !important}}@media (min-width:1200px){.visible-lg-inline{display:inline !important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block !important}}@media (max-width:767px){.hidden-xs{display:none !important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none !important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none !important}}@media (min-width:1200px){.hidden-lg{display:none !important}}.visible-print{display:none !important}@media print{.visible-print{display:block !important}table.visible-print{display:table !important}tr.visible-print{display:table-row !important}th.visible-print,td.visible-print{display:table-cell !important}}.visible-print-block{display:none !important}@media print{.visible-print-block{display:block !important}}.visible-print-inline{display:none !important}@media print{.visible-print-inline{display:inline !important}}.visible-print-inline-block{display:none !important}@media print{.visible-print-inline-block{display:inline-block !important}}@media print{.hidden-print{display:none !important}} \ No newline at end of file diff --git a/src/tools/TurtlebotViewer-web/public/css/turtlebotviewer.css b/src/tools/TurtlebotViewer-web/public/css/turtlebotviewer.css new file mode 100644 index 000000000..334a78049 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/css/turtlebotviewer.css @@ -0,0 +1,137 @@ +/*azul: #58D9FF + naranja: #e67e22 + blanco: #FBFBFB + carbon: #333333 +*/ + +/* +@btn-success-color #fff +@btn-success-bg @brand-success +@btn-success-border darken(@btn-success-bg, 5%) +@btn-info-color #fff +@btn-info-bg @brand-info +@btn-info-border darken(@btn-info-bg, 5%) +*/ + + +#body{ width: inherit; +} + +.color-light, .input-group-addon{ +/* color:#eee;*/ + color:#58D9FF; +} +.border-light{ + border-style: solid; + border-color: #eee; + border-width: 2px; +} + +.padding0 { + padding: 0px 0px 0px 0px; +} + +.letrero{ + padding: 2px 15px; +} + +.border-carbon{ + border-color: #333; +} +.border-blue{ + border: 1px solid #58D9FF; +} + +.row{ + margin-bottom: 3px; +} + +.width100{ + width:100%; +} +.right{ + text-align: right; +} + +.row { + margin-bottom: 10px; + +} + + +/* toggle button navbar*/ +.navbar-default .navbar-toggle:hover, .navbar-default .navbar-toggle:focus, +.navbar-inverse .navbar-toggle:hover, .navbar-inverse .navbar-toggle:focus { + background-color: #58D9FF; +} + +.navbar-default .navbar-toggle:hover .icon-bar, .navbar-default .navbar-toggle:focus .icon-bar, +.navbar-inverse .navbar-toggle:hover .icon-bar, .navbar-inverse .navbar-toggle:focus .icon-bar{ + background-color: #FBFBFB; +} + +.navbar-inverse .navbar-collapse, .navbar-inverse .navbar-form { + border-color: #58D9FF; +} + +.nav-tabs li a{ + color: #58D9FF; +} +.nav-tabs li a:hover{ + color: #333; +} + +.nav-tabs li.active a{ + color: #FBFBFB; +} + +/* Buttons */ + +.btn-success:hover{ + background-color: #5cb85c; + color: #FBFBFB; + +} +.btn-info:hover{ + background-color: #58D9FF; + color: #FBFBFB; + +} +.btn-warning:hover{ + background-color: #f0ad4e; + color: #FBFBFB; + +} +.btn-danger:hover{ + background-color: #d9534f; + color: #FBFBFB; + +} +.btn-primary:hover{ + background-color: #337ab7; + color: #FBFBFB; + +} + +.padding-left0{ + padding-left: 0; +} + +.padding-right0{ + padding-right: 0; +} + +@media (max-width: 767px) { + +} +@media (min-width: 768px) and (max-width: 991px) { + +} + +@media (min-width: 992px) and (max-width: 1199px) { + +} + +@media (min-width: 1200px) { + +} diff --git a/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.eot b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.eot new file mode 100644 index 000000000..b93a4953f Binary files /dev/null and b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.eot differ diff --git a/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.svg b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.svg new file mode 100644 index 000000000..94fb5490a --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.ttf b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.ttf new file mode 100644 index 000000000..1413fc609 Binary files /dev/null and b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.ttf differ diff --git a/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff new file mode 100644 index 000000000..9e612858f Binary files /dev/null and b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff differ diff --git a/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff2 b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff2 new file mode 100644 index 000000000..64539b54c Binary files /dev/null and b/src/tools/TurtlebotViewer-web/public/fonts/glyphicons-halflings-regular.woff2 differ diff --git a/src/tools/TurtlebotViewer-web/public/index.html b/src/tools/TurtlebotViewer-web/public/index.html new file mode 100644 index 000000000..2eae45ba7 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/index.html @@ -0,0 +1,213 @@ + + + + + + TurtlebotViewer + + + + + + + + + + + + +
+
+
+

+ + + +

+
+
+
+
+
+ +
+ Your browser does not support the HTML5 canvas tag. +
+
+
+
+
+ +
+ Your browser does not support the HTML5 canvas tag. +
+
+
+
+
+ +
+ Your browser does not support the HTML5 canvas tag. +
+
+
+
+
+
+
+
+ 3D Model +
+
+ Your browser does not support the HTML5 canvas tag. +
+
+
+
+
+ +
+ Your browser does not support the HTML5 canvas tag. +
+
+
+
+ +
+
+
+ + + + + + + + + + + + + + + + diff --git a/src/tools/TurtlebotViewer-web/public/js/ColladaLoader.js b/src/tools/TurtlebotViewer-web/public/js/ColladaLoader.js new file mode 100644 index 000000000..353ad00f6 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/ColladaLoader.js @@ -0,0 +1,5511 @@ +/** +* @author Tim Knip / http://www.floorplanner.com/ / tim at floorplanner.com +* @author Tony Parisi / http://www.tonyparisi.com/ +*/ + +THREE.ColladaLoader = function () { + + var COLLADA = null; + var scene = null; + var visualScene; + var kinematicsModel; + + var readyCallbackFunc = null; + + var sources = {}; + var images = {}; + var animations = {}; + var controllers = {}; + var geometries = {}; + var materials = {}; + var effects = {}; + var cameras = {}; + var lights = {}; + + var animData; + var kinematics; + var visualScenes; + var kinematicsModels; + var baseUrl; + var morphs; + var skins; + + var flip_uv = true; + var preferredShading = THREE.SmoothShading; + + var options = { + // Force Geometry to always be centered at the local origin of the + // containing Mesh. + centerGeometry: false, + + // Axis conversion is done for geometries, animations, and controllers. + // If we ever pull cameras or lights out of the COLLADA file, they'll + // need extra work. + convertUpAxis: false, + + subdivideFaces: true, + + upAxis: 'Y', + + // For reflective or refractive materials we'll use this cubemap + defaultEnvMap: null + + }; + + var colladaUnit = 1.0; + var colladaUp = 'Y'; + var upConversion = null; + + function load ( url, readyCallback, progressCallback, failCallback ) { + + var length = 0; + + if ( document.implementation && document.implementation.createDocument ) { + + var request = new XMLHttpRequest(); + + request.onreadystatechange = function() { + + if ( request.readyState === 4 ) { + + if ( request.status === 0 || request.status === 200 ) { + + + if ( request.responseXML ) { + + readyCallbackFunc = readyCallback; + parse( request.responseXML, undefined, url ); + + } else if ( request.responseText ) { + + readyCallbackFunc = readyCallback; + var xmlParser = new DOMParser(); + var responseXML = xmlParser.parseFromString( request.responseText, "application/xml" ); + parse( responseXML, undefined, url ); + + } else { + + if ( faillCallback ) { + + failCallback(); + + } else { + + console.error( "ColladaLoader: Empty or non-existing file (" + url + ")" ); + + } + + } + + } + + } else if ( request.readyState === 3 ) { + + if ( progressCallback ) { + + if ( length === 0 ) { + + length = request.getResponseHeader( "Content-Length" ); + + } + + progressCallback( { total: length, loaded: request.responseText.length } ); + + } + + } + + } + + request.open( "GET", url, true ); + request.send( null ); + + } else { + + alert( "Don't know how to parse XML!" ); + + } + + } + + function parse( doc, callBack, url ) { + + COLLADA = doc; + callBack = callBack || readyCallbackFunc; + + if ( url !== undefined ) { + + var parts = url.split( '/' ); + parts.pop(); + baseUrl = ( parts.length < 1 ? '.' : parts.join( '/' ) ) + '/'; + + } + + parseAsset(); + setUpConversion(); + images = parseLib( "library_images image", _Image, "image" ); + materials = parseLib( "library_materials material", Material, "material" ); + effects = parseLib( "library_effects effect", Effect, "effect" ); + geometries = parseLib( "library_geometries geometry", Geometry, "geometry" ); + cameras = parseLib( "library_cameras camera", Camera, "camera" ); + lights = parseLib( "library_lights light", Light, "light" ); + controllers = parseLib( "library_controllers controller", Controller, "controller" ); + animations = parseLib( "library_animations animation", Animation, "animation" ); + visualScenes = parseLib( "library_visual_scenes visual_scene", VisualScene, "visual_scene" ); + kinematicsModels = parseLib( "library_kinematics_models kinematics_model", KinematicsModel, "kinematics_model" ); + + morphs = []; + skins = []; + + visualScene = parseScene(); + scene = new THREE.Group(); + + for ( var i = 0; i < visualScene.nodes.length; i ++ ) { + + scene.add( createSceneGraph( visualScene.nodes[ i ] ) ); + + } + + // unit conversion + scene.scale.multiplyScalar( colladaUnit ); + + createAnimations(); + + kinematicsModel = parseKinematicsModel(); + createKinematics(); + + var result = { + + scene: scene, + morphs: morphs, + skins: skins, + animations: animData, + kinematics: kinematics, + dae: { + images: images, + materials: materials, + cameras: cameras, + lights: lights, + effects: effects, + geometries: geometries, + controllers: controllers, + animations: animations, + visualScenes: visualScenes, + visualScene: visualScene, + scene: visualScene, + kinematicsModels: kinematicsModels, + kinematicsModel: kinematicsModel + } + + }; + + if ( callBack ) { + + callBack( result ); + + } + + return result; + + } + + function setPreferredShading ( shading ) { + + preferredShading = shading; + + } + + function parseAsset () { + + var elements = COLLADA.querySelectorAll('asset'); + + var element = elements[0]; + + if ( element && element.childNodes ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'unit': + + var meter = child.getAttribute( 'meter' ); + + if ( meter ) { + + colladaUnit = parseFloat( meter ); + + } + + break; + + case 'up_axis': + + colladaUp = child.textContent.charAt(0); + break; + + } + + } + + } + + } + + function parseLib ( q, classSpec, prefix ) { + + var elements = COLLADA.querySelectorAll(q); + + var lib = {}; + + var i = 0; + + var elementsLength = elements.length; + + for ( var j = 0; j < elementsLength; j ++ ) { + + var element = elements[j]; + var daeElement = ( new classSpec() ).parse( element ); + + if ( !daeElement.id || daeElement.id.length === 0 ) daeElement.id = prefix + ( i ++ ); + lib[ daeElement.id ] = daeElement; + + } + + return lib; + + } + + function parseScene() { + + var sceneElement = COLLADA.querySelectorAll('scene instance_visual_scene')[0]; + + if ( sceneElement ) { + + var url = sceneElement.getAttribute( 'url' ).replace( /^#/, '' ); + return visualScenes[ url.length > 0 ? url : 'visual_scene0' ]; + + } else { + + return null; + + } + + } + + function parseKinematicsModel() { + + var kinematicsModelElement = COLLADA.querySelectorAll('instance_kinematics_model')[0]; + + if ( kinematicsModelElement ) { + + var url = kinematicsModelElement.getAttribute( 'url' ).replace(/^#/, ''); + return kinematicsModels[ url.length > 0 ? url : 'kinematics_model0' ]; + + } else { + + return null; + + } + + } + + function createAnimations() { + + animData = []; + + // fill in the keys + recurseHierarchy( scene ); + + } + + function recurseHierarchy( node ) { + + var n = visualScene.getChildById( node.colladaId, true ), + newData = null; + + if ( n && n.keys ) { + + newData = { + fps: 60, + hierarchy: [ { + node: n, + keys: n.keys, + sids: n.sids + } ], + node: node, + name: 'animation_' + node.name, + length: 0 + }; + + animData.push(newData); + + for ( var i = 0, il = n.keys.length; i < il; i ++ ) { + + newData.length = Math.max( newData.length, n.keys[i].time ); + + } + + } else { + + newData = { + hierarchy: [ { + keys: [], + sids: [] + } ] + } + + } + + for ( var i = 0, il = node.children.length; i < il; i ++ ) { + + var d = recurseHierarchy( node.children[i] ); + + for ( var j = 0, jl = d.hierarchy.length; j < jl; j ++ ) { + + newData.hierarchy.push( { + keys: [], + sids: [] + } ); + + } + + } + + return newData; + + } + + function calcAnimationBounds () { + + var start = 1000000; + var end = -start; + var frames = 0; + var ID; + for ( var id in animations ) { + + var animation = animations[ id ]; + ID = ID || animation.id; + for ( var i = 0; i < animation.sampler.length; i ++ ) { + + var sampler = animation.sampler[ i ]; + + sampler.create(); + + start = Math.min( start, sampler.startTime ); + end = Math.max( end, sampler.endTime ); + frames = Math.max( frames, sampler.input.length ); + + } + + } + + return { start:start, end:end, frames:frames,ID:ID }; + + } + + function createMorph ( geometry, ctrl ) { + + var morphCtrl = ctrl instanceof InstanceController ? controllers[ ctrl.url ] : ctrl; + + if ( !morphCtrl || !morphCtrl.morph ) { + + console.log("could not find morph controller!"); + return; + + } + + var morph = morphCtrl.morph; + + for ( var i = 0; i < morph.targets.length; i ++ ) { + + var target_id = morph.targets[ i ]; + var daeGeometry = geometries[ target_id ]; + + if ( !daeGeometry.mesh || + !daeGeometry.mesh.primitives || + !daeGeometry.mesh.primitives.length ) { + continue; + } + + var target = daeGeometry.mesh.primitives[ 0 ].geometry; + + if ( target.vertices.length === geometry.vertices.length ) { + + geometry.morphTargets.push( { name: "target_1", vertices: target.vertices } ); + + } + + } + + geometry.morphTargets.push( { name: "target_Z", vertices: geometry.vertices } ); + + }; + + function createSkin ( geometry, ctrl, applyBindShape ) { + + var skinCtrl = controllers[ ctrl.url ]; + + if ( !skinCtrl || !skinCtrl.skin ) { + + console.log( "could not find skin controller!" ); + return; + + } + + if ( !ctrl.skeleton || !ctrl.skeleton.length ) { + + console.log( "could not find the skeleton for the skin!" ); + return; + + } + + var skin = skinCtrl.skin; + var skeleton = visualScene.getChildById( ctrl.skeleton[ 0 ] ); + var hierarchy = []; + + applyBindShape = applyBindShape !== undefined ? applyBindShape : true; + + var bones = []; + geometry.skinWeights = []; + geometry.skinIndices = []; + + //createBones( geometry.bones, skin, hierarchy, skeleton, null, -1 ); + //createWeights( skin, geometry.bones, geometry.skinIndices, geometry.skinWeights ); + + /* + geometry.animation = { + name: 'take_001', + fps: 30, + length: 2, + JIT: true, + hierarchy: hierarchy + }; + */ + + if ( applyBindShape ) { + + for ( var i = 0; i < geometry.vertices.length; i ++ ) { + + geometry.vertices[ i ].applyMatrix4( skin.bindShapeMatrix ); + + } + + } + + } + + function setupSkeleton ( node, bones, frame, parent ) { + + node.world = node.world || new THREE.Matrix4(); + node.localworld = node.localworld || new THREE.Matrix4(); + node.world.copy( node.matrix ); + node.localworld.copy( node.matrix ); + + if ( node.channels && node.channels.length ) { + + var channel = node.channels[ 0 ]; + var m = channel.sampler.output[ frame ]; + + if ( m instanceof THREE.Matrix4 ) { + + node.world.copy( m ); + node.localworld.copy(m); + if (frame === 0) + node.matrix.copy(m); + } + + } + + if ( parent ) { + + node.world.multiplyMatrices( parent, node.world ); + + } + + bones.push( node ); + + for ( var i = 0; i < node.nodes.length; i ++ ) { + + setupSkeleton( node.nodes[ i ], bones, frame, node.world ); + + } + + } + + function setupSkinningMatrices ( bones, skin ) { + + // FIXME: this is dumb... + + for ( var i = 0; i < bones.length; i ++ ) { + + var bone = bones[ i ]; + var found = -1; + + if ( bone.type != 'JOINT' ) continue; + + for ( var j = 0; j < skin.joints.length; j ++ ) { + + if ( bone.sid === skin.joints[ j ] ) { + + found = j; + break; + + } + + } + + if ( found >= 0 ) { + + var inv = skin.invBindMatrices[ found ]; + + bone.invBindMatrix = inv; + bone.skinningMatrix = new THREE.Matrix4(); + bone.skinningMatrix.multiplyMatrices(bone.world, inv); // (IBMi * JMi) + bone.animatrix = new THREE.Matrix4(); + + bone.animatrix.copy(bone.localworld); + bone.weights = []; + + for ( var j = 0; j < skin.weights.length; j ++ ) { + + for (var k = 0; k < skin.weights[ j ].length; k ++ ) { + + var w = skin.weights[ j ][ k ]; + + if ( w.joint === found ) { + + bone.weights.push( w ); + + } + + } + + } + + } else { + + console.warn( "ColladaLoader: Could not find joint '" + bone.sid + "'." ); + + bone.skinningMatrix = new THREE.Matrix4(); + bone.weights = []; + + } + } + + } + + //Walk the Collada tree and flatten the bones into a list, extract the position, quat and scale from the matrix + function flattenSkeleton(skeleton) { + + var list = []; + var walk = function(parentid, node, list) { + + var bone = {}; + bone.name = node.sid; + bone.parent = parentid; + bone.matrix = node.matrix; + var data = [ new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3() ]; + bone.matrix.decompose(data[0], data[1], data[2]); + + bone.pos = [ data[0].x,data[0].y,data[0].z ]; + + bone.scl = [ data[2].x,data[2].y,data[2].z ]; + bone.rotq = [ data[1].x,data[1].y,data[1].z,data[1].w ]; + list.push(bone); + + for (var i in node.nodes) { + + walk(node.sid, node.nodes[i], list); + + } + + }; + + walk(-1, skeleton, list); + return list; + + } + + //Move the vertices into the pose that is proper for the start of the animation + function skinToBindPose(geometry,skeleton,skinController) { + + var bones = []; + setupSkeleton( skeleton, bones, -1 ); + setupSkinningMatrices( bones, skinController.skin ); + v = new THREE.Vector3(); + var skinned = []; + + for (var i = 0; i < geometry.vertices.length; i ++) { + + skinned.push(new THREE.Vector3()); + + } + + for ( i = 0; i < bones.length; i ++ ) { + + if ( bones[ i ].type != 'JOINT' ) continue; + + for ( j = 0; j < bones[ i ].weights.length; j ++ ) { + + w = bones[ i ].weights[ j ]; + vidx = w.index; + weight = w.weight; + + o = geometry.vertices[vidx]; + s = skinned[vidx]; + + v.x = o.x; + v.y = o.y; + v.z = o.z; + + v.applyMatrix4( bones[i].skinningMatrix ); + + s.x += (v.x * weight); + s.y += (v.y * weight); + s.z += (v.z * weight); + } + + } + + for (var i = 0; i < geometry.vertices.length; i ++) { + + geometry.vertices[i] = skinned[i]; + + } + + } + + function applySkin ( geometry, instanceCtrl, frame ) { + + var skinController = controllers[ instanceCtrl.url ]; + + frame = frame !== undefined ? frame : 40; + + if ( !skinController || !skinController.skin ) { + + console.log( 'ColladaLoader: Could not find skin controller.' ); + return; + + } + + if ( !instanceCtrl.skeleton || !instanceCtrl.skeleton.length ) { + + console.log( 'ColladaLoader: Could not find the skeleton for the skin. ' ); + return; + + } + + var animationBounds = calcAnimationBounds(); + var skeleton = visualScene.getChildById( instanceCtrl.skeleton[0], true ) || visualScene.getChildBySid( instanceCtrl.skeleton[0], true ); + + //flatten the skeleton into a list of bones + var bonelist = flattenSkeleton(skeleton); + var joints = skinController.skin.joints; + + //sort that list so that the order reflects the order in the joint list + var sortedbones = []; + for (var i = 0; i < joints.length; i ++) { + + for (var j = 0; j < bonelist.length; j ++) { + + if (bonelist[j].name === joints[i]) { + + sortedbones[i] = bonelist[j]; + + } + + } + + } + + //hook up the parents by index instead of name + for (var i = 0; i < sortedbones.length; i ++) { + + for (var j = 0; j < sortedbones.length; j ++) { + + if (sortedbones[i].parent === sortedbones[j].name) { + + sortedbones[i].parent = j; + + } + + } + + } + + + var i, j, w, vidx, weight; + var v = new THREE.Vector3(), o, s; + + // move vertices to bind shape + for ( i = 0; i < geometry.vertices.length; i ++ ) { + geometry.vertices[i].applyMatrix4( skinController.skin.bindShapeMatrix ); + } + + var skinIndices = []; + var skinWeights = []; + var weights = skinController.skin.weights; + + // hook up the skin weights + // TODO - this might be a good place to choose greatest 4 weights + for ( var i =0; i < weights.length; i ++ ) { + + var indicies = new THREE.Vector4(weights[i][0] ? weights[i][0].joint : 0,weights[i][1] ? weights[i][1].joint : 0,weights[i][2] ? weights[i][2].joint : 0,weights[i][3] ? weights[i][3].joint : 0); + var weight = new THREE.Vector4(weights[i][0] ? weights[i][0].weight : 0,weights[i][1] ? weights[i][1].weight : 0,weights[i][2] ? weights[i][2].weight : 0,weights[i][3] ? weights[i][3].weight : 0); + + skinIndices.push(indicies); + skinWeights.push(weight); + + } + + geometry.skinIndices = skinIndices; + geometry.skinWeights = skinWeights; + geometry.bones = sortedbones; + // process animation, or simply pose the rig if no animation + + //create an animation for the animated bones + //NOTE: this has no effect when using morphtargets + var animationdata = { "name":animationBounds.ID,"fps":30,"length":animationBounds.frames / 30,"hierarchy":[] }; + + for (var j = 0; j < sortedbones.length; j ++) { + + animationdata.hierarchy.push({ parent:sortedbones[j].parent, name:sortedbones[j].name, keys:[] }); + + } + + console.log( 'ColladaLoader:', animationBounds.ID + ' has ' + sortedbones.length + ' bones.' ); + + + + skinToBindPose(geometry, skeleton, skinController); + + + for ( frame = 0; frame < animationBounds.frames; frame ++ ) { + + var bones = []; + var skinned = []; + // process the frame and setup the rig with a fresh + // transform, possibly from the bone's animation channel(s) + + setupSkeleton( skeleton, bones, frame ); + setupSkinningMatrices( bones, skinController.skin ); + + for (var i = 0; i < bones.length; i ++) { + + for (var j = 0; j < animationdata.hierarchy.length; j ++) { + + if (animationdata.hierarchy[j].name === bones[i].sid) { + + var key = {}; + key.time = (frame / 30); + key.matrix = bones[i].animatrix; + + if (frame === 0) + bones[i].matrix = key.matrix; + + var data = [ new THREE.Vector3(),new THREE.Quaternion(),new THREE.Vector3() ]; + key.matrix.decompose(data[0], data[1], data[2]); + + key.pos = [ data[0].x,data[0].y,data[0].z ]; + + key.scl = [ data[2].x,data[2].y,data[2].z ]; + key.rot = data[1]; + + animationdata.hierarchy[j].keys.push(key); + + } + + } + + } + + geometry.animation = animationdata; + + } + + }; + + function createKinematics() { + + if ( kinematicsModel && kinematicsModel.joints.length === 0 ) { + kinematics = undefined; + return; + } + + var jointMap = {}; + + var _addToMap = function( jointIndex, parentVisualElement ) { + + var parentVisualElementId = parentVisualElement.getAttribute( 'id' ); + var colladaNode = visualScene.getChildById( parentVisualElementId, true ); + var joint = kinematicsModel.joints[ jointIndex ]; + + scene.traverse(function( node ) { + + if ( node.colladaId == parentVisualElementId ) { + + jointMap[ jointIndex ] = { + node: node, + transforms: colladaNode.transforms, + joint: joint, + position: joint.zeroPosition + }; + + } + + }); + + }; + + kinematics = { + + joints: kinematicsModel && kinematicsModel.joints, + + getJointValue: function( jointIndex ) { + + var jointData = jointMap[ jointIndex ]; + + if ( jointData ) { + + return jointData.position; + + } else { + + console.log( 'getJointValue: joint ' + jointIndex + ' doesn\'t exist' ); + + } + + }, + + setJointValue: function( jointIndex, value ) { + + var jointData = jointMap[ jointIndex ]; + + if ( jointData ) { + + var joint = jointData.joint; + + if ( value > joint.limits.max || value < joint.limits.min ) { + + console.log( 'setJointValue: joint ' + jointIndex + ' value ' + value + ' outside of limits (min: ' + joint.limits.min + ', max: ' + joint.limits.max + ')' ); + + } else if ( joint.static ) { + + console.log( 'setJointValue: joint ' + jointIndex + ' is static' ); + + } else { + + var threejsNode = jointData.node; + var axis = joint.axis; + var transforms = jointData.transforms; + + var matrix = new THREE.Matrix4(); + + for (i = 0; i < transforms.length; i ++ ) { + + var transform = transforms[ i ]; + + // kinda ghetto joint detection + if ( transform.sid && transform.sid.indexOf( 'joint' + jointIndex ) !== -1 ) { + + // apply actual joint value here + switch ( joint.type ) { + + case 'revolute': + + matrix.multiply( m1.makeRotationAxis( axis, THREE.Math.degToRad(value) ) ); + break; + + case 'prismatic': + + matrix.multiply( m1.makeTranslation(axis.x * value, axis.y * value, axis.z * value ) ); + break; + + default: + + console.warn( 'setJointValue: unknown joint type: ' + joint.type ); + break; + + } + + } else { + + var m1 = new THREE.Matrix4(); + + switch ( transform.type ) { + + case 'matrix': + + matrix.multiply( transform.obj ); + + break; + + case 'translate': + + matrix.multiply( m1.makeTranslation( transform.obj.x, transform.obj.y, transform.obj.z ) ); + + break; + + case 'rotate': + + matrix.multiply( m1.makeRotationAxis( transform.obj, transform.angle ) ); + + break; + + } + } + } + + // apply the matrix to the threejs node + var elementsFloat32Arr = matrix.elements; + var elements = Array.prototype.slice.call( elementsFloat32Arr ); + + var elementsRowMajor = [ + elements[ 0 ], + elements[ 4 ], + elements[ 8 ], + elements[ 12 ], + elements[ 1 ], + elements[ 5 ], + elements[ 9 ], + elements[ 13 ], + elements[ 2 ], + elements[ 6 ], + elements[ 10 ], + elements[ 14 ], + elements[ 3 ], + elements[ 7 ], + elements[ 11 ], + elements[ 15 ] + ]; + + threejsNode.matrix.set.apply( threejsNode.matrix, elementsRowMajor ); + threejsNode.matrix.decompose( threejsNode.position, threejsNode.quaternion, threejsNode.scale ); + } + + } else { + + console.log( 'setJointValue: joint ' + jointIndex + ' doesn\'t exist' ); + + } + + } + + }; + + var element = COLLADA.querySelector('scene instance_kinematics_scene'); + + if ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'bind_joint_axis': + + var visualTarget = child.getAttribute( 'target' ).split( '/' ).pop(); + var axis = child.querySelector('axis param').textContent; + var jointIndex = parseInt( axis.split( 'joint' ).pop().split( '.' )[0] ); + var visualTargetElement = COLLADA.querySelector( '[sid="' + visualTarget + '"]' ); + + if ( visualTargetElement ) { + var parentVisualElement = visualTargetElement.parentElement; + _addToMap(jointIndex, parentVisualElement); + } + + break; + + default: + + break; + + } + + } + } + + }; + + function createSceneGraph ( node, parent ) { + + var obj = new THREE.Object3D(); + var skinned = false; + var skinController; + var morphController; + var i, j; + + // FIXME: controllers + + for ( i = 0; i < node.controllers.length; i ++ ) { + + var controller = controllers[ node.controllers[ i ].url ]; + + switch ( controller.type ) { + + case 'skin': + + if ( geometries[ controller.skin.source ] ) { + + var inst_geom = new InstanceGeometry(); + + inst_geom.url = controller.skin.source; + inst_geom.instance_material = node.controllers[ i ].instance_material; + + node.geometries.push( inst_geom ); + skinned = true; + skinController = node.controllers[ i ]; + + } else if ( controllers[ controller.skin.source ] ) { + + // urgh: controller can be chained + // handle the most basic case... + + var second = controllers[ controller.skin.source ]; + morphController = second; + // skinController = node.controllers[i]; + + if ( second.morph && geometries[ second.morph.source ] ) { + + var inst_geom = new InstanceGeometry(); + + inst_geom.url = second.morph.source; + inst_geom.instance_material = node.controllers[ i ].instance_material; + + node.geometries.push( inst_geom ); + + } + + } + + break; + + case 'morph': + + if ( geometries[ controller.morph.source ] ) { + + var inst_geom = new InstanceGeometry(); + + inst_geom.url = controller.morph.source; + inst_geom.instance_material = node.controllers[ i ].instance_material; + + node.geometries.push( inst_geom ); + morphController = node.controllers[ i ]; + + } + + console.log( 'ColladaLoader: Morph-controller partially supported.' ); + + default: + break; + + } + + } + + // geometries + + var double_sided_materials = {}; + + for ( i = 0; i < node.geometries.length; i ++ ) { + + var instance_geometry = node.geometries[i]; + var instance_materials = instance_geometry.instance_material; + var geometry = geometries[ instance_geometry.url ]; + var used_materials = {}; + var used_materials_array = []; + var num_materials = 0; + var first_material; + + if ( geometry ) { + + if ( !geometry.mesh || !geometry.mesh.primitives ) + continue; + + if ( obj.name.length === 0 ) { + + obj.name = geometry.id; + + } + + // collect used fx for this geometry-instance + + if ( instance_materials ) { + + for ( j = 0; j < instance_materials.length; j ++ ) { + + var instance_material = instance_materials[ j ]; + var mat = materials[ instance_material.target ]; + var effect_id = mat.instance_effect.url; + var shader = effects[ effect_id ].shader; + var material3js = shader.material; + + if ( geometry.doubleSided ) { + + if ( !( instance_material.symbol in double_sided_materials ) ) { + + var _copied_material = material3js.clone(); + _copied_material.side = THREE.DoubleSide; + double_sided_materials[ instance_material.symbol ] = _copied_material; + + } + + material3js = double_sided_materials[ instance_material.symbol ]; + + } + + material3js.opacity = !material3js.opacity ? 1 : material3js.opacity; + used_materials[ instance_material.symbol ] = num_materials; + used_materials_array.push( material3js ); + first_material = material3js; + first_material.name = mat.name === null || mat.name === '' ? mat.id : mat.name; + num_materials ++; + + } + + } + + var mesh; + var material = first_material || new THREE.MeshLambertMaterial( { color: 0xdddddd, side: geometry.doubleSided ? THREE.DoubleSide : THREE.FrontSide } ); + var geom = geometry.mesh.geometry3js; + + if ( num_materials > 1 ) { + + material = new THREE.MeshFaceMaterial( used_materials_array ); + + for ( j = 0; j < geom.faces.length; j ++ ) { + + var face = geom.faces[ j ]; + face.materialIndex = used_materials[ face.daeMaterial ] + + } + + } + + if ( skinController !== undefined ) { + + + applySkin( geom, skinController ); + + if ( geom.morphTargets.length > 0 ) { + + material.morphTargets = true; + material.skinning = false; + + } else { + + material.morphTargets = false; + material.skinning = true; + + } + + + mesh = new THREE.SkinnedMesh( geom, material, false ); + + + //mesh.skeleton = skinController.skeleton; + //mesh.skinController = controllers[ skinController.url ]; + //mesh.skinInstanceController = skinController; + mesh.name = 'skin_' + skins.length; + + + + //mesh.animationHandle.setKey(0); + skins.push( mesh ); + + } else if ( morphController !== undefined ) { + + createMorph( geom, morphController ); + + material.morphTargets = true; + + mesh = new THREE.Mesh( geom, material ); + mesh.name = 'morph_' + morphs.length; + + morphs.push( mesh ); + + } else { + + if ( geom.isLineStrip === true ) { + + mesh = new THREE.Line( geom ); + + } else { + + mesh = new THREE.Mesh( geom, material ); + + } + + } + + obj.add(mesh); + + } + + } + + for ( i = 0; i < node.cameras.length; i ++ ) { + + var instance_camera = node.cameras[i]; + var cparams = cameras[instance_camera.url]; + + var cam = new THREE.PerspectiveCamera(cparams.yfov, parseFloat(cparams.aspect_ratio), + parseFloat(cparams.znear), parseFloat(cparams.zfar)); + + obj.add(cam); + } + + for ( i = 0; i < node.lights.length; i ++ ) { + + var light = null; + var instance_light = node.lights[i]; + var lparams = lights[instance_light.url]; + + if ( lparams && lparams.technique ) { + + var color = lparams.color.getHex(); + var intensity = lparams.intensity; + var distance = lparams.distance; + var angle = lparams.falloff_angle; + var exponent; // Intentionally undefined, don't know what this is yet + + switch ( lparams.technique ) { + + case 'directional': + + light = new THREE.DirectionalLight( color, intensity, distance ); + light.position.set(0, 0, 1); + break; + + case 'point': + + light = new THREE.PointLight( color, intensity, distance ); + break; + + case 'spot': + + light = new THREE.SpotLight( color, intensity, distance, angle, exponent ); + light.position.set(0, 0, 1); + break; + + case 'ambient': + + light = new THREE.AmbientLight( color ); + break; + + } + + } + + if (light) { + obj.add(light); + } + } + + obj.name = node.name || node.id || ""; + obj.colladaId = node.id || ""; + obj.layer = node.layer || ""; + obj.matrix = node.matrix; + obj.matrix.decompose( obj.position, obj.quaternion, obj.scale ); + + if ( options.centerGeometry && obj.geometry ) { + + var delta = obj.geometry.center(); + delta.multiply( obj.scale ); + delta.applyQuaternion( obj.quaternion ); + + obj.position.sub( delta ); + + } + + for ( i = 0; i < node.nodes.length; i ++ ) { + + obj.add( createSceneGraph( node.nodes[i], node ) ); + + } + + return obj; + + }; + + function getJointId( skin, id ) { + + for ( var i = 0; i < skin.joints.length; i ++ ) { + + if ( skin.joints[ i ] === id ) { + + return i; + + } + + } + + }; + + function getLibraryNode( id ) { + + var nodes = COLLADA.querySelectorAll('library_nodes node'); + + for ( var i = 0; i < nodes.length; i++ ) { + + var attObj = nodes[i].attributes.getNamedItem('id'); + + if ( attObj && attObj.value === id ) { + + return nodes[i]; + + } + + } + + return undefined; + + }; + + function getChannelsForNode ( node ) { + + var channels = []; + var startTime = 1000000; + var endTime = -1000000; + + for ( var id in animations ) { + + var animation = animations[id]; + + for ( var i = 0; i < animation.channel.length; i ++ ) { + + var channel = animation.channel[i]; + var sampler = animation.sampler[i]; + var id = channel.target.split('/')[0]; + + if ( id == node.id ) { + + sampler.create(); + channel.sampler = sampler; + startTime = Math.min(startTime, sampler.startTime); + endTime = Math.max(endTime, sampler.endTime); + channels.push(channel); + + } + + } + + } + + if ( channels.length ) { + + node.startTime = startTime; + node.endTime = endTime; + + } + + return channels; + + }; + + function calcFrameDuration( node ) { + + var minT = 10000000; + + for ( var i = 0; i < node.channels.length; i ++ ) { + + var sampler = node.channels[i].sampler; + + for ( var j = 0; j < sampler.input.length - 1; j ++ ) { + + var t0 = sampler.input[ j ]; + var t1 = sampler.input[ j + 1 ]; + minT = Math.min( minT, t1 - t0 ); + + } + } + + return minT; + + }; + + function calcMatrixAt( node, t ) { + + var animated = {}; + + var i, j; + + for ( i = 0; i < node.channels.length; i ++ ) { + + var channel = node.channels[ i ]; + animated[ channel.sid ] = channel; + + } + + var matrix = new THREE.Matrix4(); + + for ( i = 0; i < node.transforms.length; i ++ ) { + + var transform = node.transforms[ i ]; + var channel = animated[ transform.sid ]; + + if ( channel !== undefined ) { + + var sampler = channel.sampler; + var value; + + for ( j = 0; j < sampler.input.length - 1; j ++ ) { + + if ( sampler.input[ j + 1 ] > t ) { + + value = sampler.output[ j ]; + //console.log(value.flatten) + break; + + } + + } + + if ( value !== undefined ) { + + if ( value instanceof THREE.Matrix4 ) { + + matrix.multiplyMatrices( matrix, value ); + + } else { + + // FIXME: handle other types + + matrix.multiplyMatrices( matrix, transform.matrix ); + + } + + } else { + + matrix.multiplyMatrices( matrix, transform.matrix ); + + } + + } else { + + matrix.multiplyMatrices( matrix, transform.matrix ); + + } + + } + + return matrix; + + }; + + function bakeAnimations ( node ) { + + if ( node.channels && node.channels.length ) { + + var keys = [], + sids = []; + + for ( var i = 0, il = node.channels.length; i < il; i ++ ) { + + var channel = node.channels[i], + fullSid = channel.fullSid, + sampler = channel.sampler, + input = sampler.input, + transform = node.getTransformBySid( channel.sid ), + member; + + if ( channel.arrIndices ) { + + member = []; + + for ( var j = 0, jl = channel.arrIndices.length; j < jl; j ++ ) { + + member[ j ] = getConvertedIndex( channel.arrIndices[ j ] ); + + } + + } else { + + member = getConvertedMember( channel.member ); + + } + + if ( transform ) { + + if ( sids.indexOf( fullSid ) === -1 ) { + + sids.push( fullSid ); + + } + + for ( var j = 0, jl = input.length; j < jl; j ++ ) { + + var time = input[j], + data = sampler.getData( transform.type, j, member ), + key = findKey( keys, time ); + + if ( !key ) { + + key = new Key( time ); + var timeNdx = findTimeNdx( keys, time ); + keys.splice( timeNdx === -1 ? keys.length : timeNdx, 0, key ); + + } + + key.addTarget( fullSid, transform, member, data ); + + } + + } else { + + console.log( 'Could not find transform "' + channel.sid + '" in node ' + node.id ); + + } + + } + + // post process + for ( var i = 0; i < sids.length; i ++ ) { + + var sid = sids[ i ]; + + for ( var j = 0; j < keys.length; j ++ ) { + + var key = keys[ j ]; + + if ( !key.hasTarget( sid ) ) { + + interpolateKeys( keys, key, j, sid ); + + } + + } + + } + + node.keys = keys; + node.sids = sids; + + } + + }; + + function findKey ( keys, time) { + + var retVal = null; + + for ( var i = 0, il = keys.length; i < il && retVal === null; i ++ ) { + + var key = keys[i]; + + if ( key.time === time ) { + + retVal = key; + + } else if ( key.time > time ) { + + break; + + } + + } + + return retVal; + + }; + + function findTimeNdx ( keys, time) { + + var ndx = -1; + + for ( var i = 0, il = keys.length; i < il && ndx === -1; i ++ ) { + + var key = keys[i]; + + if ( key.time >= time ) { + + ndx = i; + + } + + } + + return ndx; + + }; + + function interpolateKeys ( keys, key, ndx, fullSid ) { + + var prevKey = getPrevKeyWith( keys, fullSid, ndx ? ndx - 1 : 0 ), + nextKey = getNextKeyWith( keys, fullSid, ndx + 1 ); + + if ( prevKey && nextKey ) { + + var scale = (key.time - prevKey.time) / (nextKey.time - prevKey.time), + prevTarget = prevKey.getTarget( fullSid ), + nextData = nextKey.getTarget( fullSid ).data, + prevData = prevTarget.data, + data; + + if ( prevTarget.type === 'matrix' ) { + + data = prevData; + + } else if ( prevData.length ) { + + data = []; + + for ( var i = 0; i < prevData.length; ++ i ) { + + data[ i ] = prevData[ i ] + ( nextData[ i ] - prevData[ i ] ) * scale; + + } + + } else { + + data = prevData + ( nextData - prevData ) * scale; + + } + + key.addTarget( fullSid, prevTarget.transform, prevTarget.member, data ); + + } + + }; + + // Get next key with given sid + + function getNextKeyWith( keys, fullSid, ndx ) { + + for ( ; ndx < keys.length; ndx ++ ) { + + var key = keys[ ndx ]; + + if ( key.hasTarget( fullSid ) ) { + + return key; + + } + + } + + return null; + + }; + + // Get previous key with given sid + + function getPrevKeyWith( keys, fullSid, ndx ) { + + ndx = ndx >= 0 ? ndx : ndx + keys.length; + + for ( ; ndx >= 0; ndx -- ) { + + var key = keys[ ndx ]; + + if ( key.hasTarget( fullSid ) ) { + + return key; + + } + + } + + return null; + + }; + + function _Image() { + + this.id = ""; + this.init_from = ""; + + }; + + _Image.prototype.parse = function(element) { + + this.id = element.getAttribute('id'); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + if ( child.nodeName === 'init_from' ) { + + this.init_from = child.textContent; + + } + + } + + return this; + + }; + + function Controller() { + + this.id = ""; + this.name = ""; + this.type = ""; + this.skin = null; + this.morph = null; + + }; + + Controller.prototype.parse = function( element ) { + + this.id = element.getAttribute('id'); + this.name = element.getAttribute('name'); + this.type = "none"; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'skin': + + this.skin = (new Skin()).parse(child); + this.type = child.nodeName; + break; + + case 'morph': + + this.morph = (new Morph()).parse(child); + this.type = child.nodeName; + break; + + default: + break; + + } + } + + return this; + + }; + + function Morph() { + + this.method = null; + this.source = null; + this.targets = null; + this.weights = null; + + }; + + Morph.prototype.parse = function( element ) { + + var sources = {}; + var inputs = []; + var i; + + this.method = element.getAttribute( 'method' ); + this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); + + for ( i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'source': + + var source = ( new Source() ).parse( child ); + sources[ source.id ] = source; + break; + + case 'targets': + + inputs = this.parseInputs( child ); + break; + + default: + + console.log( child.nodeName ); + break; + + } + + } + + for ( i = 0; i < inputs.length; i ++ ) { + + var input = inputs[ i ]; + var source = sources[ input.source ]; + + switch ( input.semantic ) { + + case 'MORPH_TARGET': + + this.targets = source.read(); + break; + + case 'MORPH_WEIGHT': + + this.weights = source.read(); + break; + + default: + break; + + } + } + + return this; + + }; + + Morph.prototype.parseInputs = function(element) { + + var inputs = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1) continue; + + switch ( child.nodeName ) { + + case 'input': + + inputs.push( (new Input()).parse(child) ); + break; + + default: + break; + } + } + + return inputs; + + }; + + function Skin() { + + this.source = ""; + this.bindShapeMatrix = null; + this.invBindMatrices = []; + this.joints = []; + this.weights = []; + + }; + + Skin.prototype.parse = function( element ) { + + var sources = {}; + var joints, weights; + + this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); + this.invBindMatrices = []; + this.joints = []; + this.weights = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'bind_shape_matrix': + + var f = _floats(child.textContent); + this.bindShapeMatrix = getConvertedMat4( f ); + break; + + case 'source': + + var src = new Source().parse(child); + sources[ src.id ] = src; + break; + + case 'joints': + + joints = child; + break; + + case 'vertex_weights': + + weights = child; + break; + + default: + + console.log( child.nodeName ); + break; + + } + } + + this.parseJoints( joints, sources ); + this.parseWeights( weights, sources ); + + return this; + + }; + + Skin.prototype.parseJoints = function ( element, sources ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'input': + + var input = ( new Input() ).parse( child ); + var source = sources[ input.source ]; + + if ( input.semantic === 'JOINT' ) { + + this.joints = source.read(); + + } else if ( input.semantic === 'INV_BIND_MATRIX' ) { + + this.invBindMatrices = source.read(); + + } + + break; + + default: + break; + } + + } + + }; + + Skin.prototype.parseWeights = function ( element, sources ) { + + var v, vcount, inputs = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'input': + + inputs.push( ( new Input() ).parse( child ) ); + break; + + case 'v': + + v = _ints( child.textContent ); + break; + + case 'vcount': + + vcount = _ints( child.textContent ); + break; + + default: + break; + + } + + } + + var index = 0; + + for ( var i = 0; i < vcount.length; i ++ ) { + + var numBones = vcount[i]; + var vertex_weights = []; + + for ( var j = 0; j < numBones; j ++ ) { + + var influence = {}; + + for ( var k = 0; k < inputs.length; k ++ ) { + + var input = inputs[ k ]; + var value = v[ index + input.offset ]; + + switch ( input.semantic ) { + + case 'JOINT': + + influence.joint = value;//this.joints[value]; + break; + + case 'WEIGHT': + + influence.weight = sources[ input.source ].data[ value ]; + break; + + default: + break; + + } + + } + + vertex_weights.push( influence ); + index += inputs.length; + } + + for ( var j = 0; j < vertex_weights.length; j ++ ) { + + vertex_weights[ j ].index = i; + + } + + this.weights.push( vertex_weights ); + + } + + }; + + function VisualScene () { + + this.id = ""; + this.name = ""; + this.nodes = []; + this.scene = new THREE.Group(); + + }; + + VisualScene.prototype.getChildById = function( id, recursive ) { + + for ( var i = 0; i < this.nodes.length; i ++ ) { + + var node = this.nodes[ i ].getChildById( id, recursive ); + + if ( node ) { + + return node; + + } + + } + + return null; + + }; + + VisualScene.prototype.getChildBySid = function( sid, recursive ) { + + for ( var i = 0; i < this.nodes.length; i ++ ) { + + var node = this.nodes[ i ].getChildBySid( sid, recursive ); + + if ( node ) { + + return node; + + } + + } + + return null; + + }; + + VisualScene.prototype.parse = function( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + this.nodes = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'node': + + this.nodes.push( ( new Node() ).parse( child ) ); + break; + + default: + break; + + } + + } + + return this; + + }; + + function Node() { + + this.id = ""; + this.name = ""; + this.sid = ""; + this.nodes = []; + this.controllers = []; + this.transforms = []; + this.geometries = []; + this.channels = []; + this.matrix = new THREE.Matrix4(); + + }; + + Node.prototype.getChannelForTransform = function( transformSid ) { + + for ( var i = 0; i < this.channels.length; i ++ ) { + + var channel = this.channels[i]; + var parts = channel.target.split('/'); + var id = parts.shift(); + var sid = parts.shift(); + var dotSyntax = (sid.indexOf(".") >= 0); + var arrSyntax = (sid.indexOf("(") >= 0); + var arrIndices; + var member; + + if ( dotSyntax ) { + + parts = sid.split("."); + sid = parts.shift(); + member = parts.shift(); + + } else if ( arrSyntax ) { + + arrIndices = sid.split("("); + sid = arrIndices.shift(); + + for ( var j = 0; j < arrIndices.length; j ++ ) { + + arrIndices[ j ] = parseInt( arrIndices[ j ].replace( /\)/, '' ) ); + + } + + } + + if ( sid === transformSid ) { + + channel.info = { sid: sid, dotSyntax: dotSyntax, arrSyntax: arrSyntax, arrIndices: arrIndices }; + return channel; + + } + + } + + return null; + + }; + + Node.prototype.getChildById = function ( id, recursive ) { + + if ( this.id === id ) { + + return this; + + } + + if ( recursive ) { + + for ( var i = 0; i < this.nodes.length; i ++ ) { + + var n = this.nodes[ i ].getChildById( id, recursive ); + + if ( n ) { + + return n; + + } + + } + + } + + return null; + + }; + + Node.prototype.getChildBySid = function ( sid, recursive ) { + + if ( this.sid === sid ) { + + return this; + + } + + if ( recursive ) { + + for ( var i = 0; i < this.nodes.length; i ++ ) { + + var n = this.nodes[ i ].getChildBySid( sid, recursive ); + + if ( n ) { + + return n; + + } + + } + } + + return null; + + }; + + Node.prototype.getTransformBySid = function ( sid ) { + + for ( var i = 0; i < this.transforms.length; i ++ ) { + + if ( this.transforms[ i ].sid === sid ) return this.transforms[ i ]; + + } + + return null; + + }; + + Node.prototype.parse = function( element ) { + + var url; + + this.id = element.getAttribute('id'); + this.sid = element.getAttribute('sid'); + this.name = element.getAttribute('name'); + this.type = element.getAttribute('type'); + this.layer = element.getAttribute('layer'); + + this.type = this.type === 'JOINT' ? this.type : 'NODE'; + + this.nodes = []; + this.transforms = []; + this.geometries = []; + this.cameras = []; + this.lights = []; + this.controllers = []; + this.matrix = new THREE.Matrix4(); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'node': + + this.nodes.push( ( new Node() ).parse( child ) ); + break; + + case 'instance_camera': + + this.cameras.push( ( new InstanceCamera() ).parse( child ) ); + break; + + case 'instance_controller': + + this.controllers.push( ( new InstanceController() ).parse( child ) ); + break; + + case 'instance_geometry': + + this.geometries.push( ( new InstanceGeometry() ).parse( child ) ); + break; + + case 'instance_light': + + this.lights.push( ( new InstanceLight() ).parse( child ) ); + break; + + case 'instance_node': + + url = child.getAttribute( 'url' ).replace( /^#/, '' ); + var iNode = getLibraryNode( url ); + + if ( iNode ) { + + this.nodes.push( ( new Node() ).parse( iNode )) ; + + } + + break; + + case 'rotate': + case 'translate': + case 'scale': + case 'matrix': + case 'lookat': + case 'skew': + + this.transforms.push( ( new Transform() ).parse( child ) ); + break; + + case 'extra': + break; + + default: + + console.log( child.nodeName ); + break; + + } + + } + + this.channels = getChannelsForNode( this ); + bakeAnimations( this ); + + this.updateMatrix(); + + return this; + + }; + + Node.prototype.updateMatrix = function () { + + this.matrix.identity(); + + for ( var i = 0; i < this.transforms.length; i ++ ) { + + this.transforms[ i ].apply( this.matrix ); + + } + + }; + + function Transform () { + + this.sid = ""; + this.type = ""; + this.data = []; + this.obj = null; + + }; + + Transform.prototype.parse = function ( element ) { + + this.sid = element.getAttribute( 'sid' ); + this.type = element.nodeName; + this.data = _floats( element.textContent ); + this.convert(); + + return this; + + }; + + Transform.prototype.convert = function () { + + switch ( this.type ) { + + case 'matrix': + + this.obj = getConvertedMat4( this.data ); + break; + + case 'rotate': + + this.angle = THREE.Math.degToRad( this.data[3] ); + + case 'translate': + + fixCoords( this.data, -1 ); + this.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] ); + break; + + case 'scale': + + fixCoords( this.data, 1 ); + this.obj = new THREE.Vector3( this.data[ 0 ], this.data[ 1 ], this.data[ 2 ] ); + break; + + default: + console.log( 'Can not convert Transform of type ' + this.type ); + break; + + } + + }; + + Transform.prototype.apply = function () { + + var m1 = new THREE.Matrix4(); + + return function ( matrix ) { + + switch ( this.type ) { + + case 'matrix': + + matrix.multiply( this.obj ); + + break; + + case 'translate': + + matrix.multiply( m1.makeTranslation( this.obj.x, this.obj.y, this.obj.z ) ); + + break; + + case 'rotate': + + matrix.multiply( m1.makeRotationAxis( this.obj, this.angle ) ); + + break; + + case 'scale': + + matrix.scale( this.obj ); + + break; + + } + + }; + + }(); + + Transform.prototype.update = function ( data, member ) { + + var members = [ 'X', 'Y', 'Z', 'ANGLE' ]; + + switch ( this.type ) { + + case 'matrix': + + if ( ! member ) { + + this.obj.copy( data ); + + } else if ( member.length === 1 ) { + + switch ( member[ 0 ] ) { + + case 0: + + this.obj.n11 = data[ 0 ]; + this.obj.n21 = data[ 1 ]; + this.obj.n31 = data[ 2 ]; + this.obj.n41 = data[ 3 ]; + + break; + + case 1: + + this.obj.n12 = data[ 0 ]; + this.obj.n22 = data[ 1 ]; + this.obj.n32 = data[ 2 ]; + this.obj.n42 = data[ 3 ]; + + break; + + case 2: + + this.obj.n13 = data[ 0 ]; + this.obj.n23 = data[ 1 ]; + this.obj.n33 = data[ 2 ]; + this.obj.n43 = data[ 3 ]; + + break; + + case 3: + + this.obj.n14 = data[ 0 ]; + this.obj.n24 = data[ 1 ]; + this.obj.n34 = data[ 2 ]; + this.obj.n44 = data[ 3 ]; + + break; + + } + + } else if ( member.length === 2 ) { + + var propName = 'n' + ( member[ 0 ] + 1 ) + ( member[ 1 ] + 1 ); + this.obj[ propName ] = data; + + } else { + + console.log('Incorrect addressing of matrix in transform.'); + + } + + break; + + case 'translate': + case 'scale': + + if ( Object.prototype.toString.call( member ) === '[object Array]' ) { + + member = members[ member[ 0 ] ]; + + } + + switch ( member ) { + + case 'X': + + this.obj.x = data; + break; + + case 'Y': + + this.obj.y = data; + break; + + case 'Z': + + this.obj.z = data; + break; + + default: + + this.obj.x = data[ 0 ]; + this.obj.y = data[ 1 ]; + this.obj.z = data[ 2 ]; + break; + + } + + break; + + case 'rotate': + + if ( Object.prototype.toString.call( member ) === '[object Array]' ) { + + member = members[ member[ 0 ] ]; + + } + + switch ( member ) { + + case 'X': + + this.obj.x = data; + break; + + case 'Y': + + this.obj.y = data; + break; + + case 'Z': + + this.obj.z = data; + break; + + case 'ANGLE': + + this.angle = THREE.Math.degToRad( data ); + break; + + default: + + this.obj.x = data[ 0 ]; + this.obj.y = data[ 1 ]; + this.obj.z = data[ 2 ]; + this.angle = THREE.Math.degToRad( data[ 3 ] ); + break; + + } + break; + + } + + }; + + function InstanceController() { + + this.url = ""; + this.skeleton = []; + this.instance_material = []; + + }; + + InstanceController.prototype.parse = function ( element ) { + + this.url = element.getAttribute('url').replace(/^#/, ''); + this.skeleton = []; + this.instance_material = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType !== 1 ) continue; + + switch ( child.nodeName ) { + + case 'skeleton': + + this.skeleton.push( child.textContent.replace(/^#/, '') ); + break; + + case 'bind_material': + + var instances = child.querySelectorAll('instance_material'); + + for ( var j = 0; j < instances.length; j ++ ) { + + var instance = instances[j]; + this.instance_material.push( (new InstanceMaterial()).parse(instance) ); + + } + + + break; + + case 'extra': + break; + + default: + break; + + } + } + + return this; + + }; + + function InstanceMaterial () { + + this.symbol = ""; + this.target = ""; + + }; + + InstanceMaterial.prototype.parse = function ( element ) { + + this.symbol = element.getAttribute('symbol'); + this.target = element.getAttribute('target').replace(/^#/, ''); + return this; + + }; + + function InstanceGeometry() { + + this.url = ""; + this.instance_material = []; + + }; + + InstanceGeometry.prototype.parse = function ( element ) { + + this.url = element.getAttribute('url').replace(/^#/, ''); + this.instance_material = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1 ) continue; + + if ( child.nodeName === 'bind_material' ) { + + var instances = child.querySelectorAll('instance_material'); + + for ( var j = 0; j < instances.length; j ++ ) { + + var instance = instances[j]; + this.instance_material.push( (new InstanceMaterial()).parse(instance) ); + + } + + break; + + } + + } + + return this; + + }; + + function Geometry() { + + this.id = ""; + this.mesh = null; + + }; + + Geometry.prototype.parse = function ( element ) { + + this.id = element.getAttribute('id'); + + extractDoubleSided( this, element ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + + switch ( child.nodeName ) { + + case 'mesh': + + this.mesh = (new Mesh(this)).parse(child); + break; + + case 'extra': + + // console.log( child ); + break; + + default: + break; + } + } + + return this; + + }; + + function Mesh( geometry ) { + + this.geometry = geometry.id; + this.primitives = []; + this.vertices = null; + this.geometry3js = null; + + }; + + Mesh.prototype.parse = function ( element ) { + + this.primitives = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'source': + + _source( child ); + break; + + case 'vertices': + + this.vertices = ( new Vertices() ).parse( child ); + break; + + case 'linestrips': + + this.primitives.push( ( new LineStrips().parse( child ) ) ); + break; + + case 'triangles': + + this.primitives.push( ( new Triangles().parse( child ) ) ); + break; + + case 'polygons': + + this.primitives.push( ( new Polygons().parse( child ) ) ); + break; + + case 'polylist': + + this.primitives.push( ( new Polylist().parse( child ) ) ); + break; + + default: + break; + + } + + } + + this.geometry3js = new THREE.Geometry(); + + if ( this.vertices === null ) { + + // TODO (mrdoob): Study case when this is null (carrier.dae) + + return this; + + } + + var vertexData = sources[ this.vertices.input['POSITION'].source ].data; + + for ( var i = 0; i < vertexData.length; i += 3 ) { + + this.geometry3js.vertices.push( getConvertedVec3( vertexData, i ).clone() ); + + } + + for ( var i = 0; i < this.primitives.length; i ++ ) { + + var primitive = this.primitives[ i ]; + primitive.setVertices( this.vertices ); + this.handlePrimitive( primitive, this.geometry3js ); + + } + + if ( this.geometry3js.calcNormals ) { + + this.geometry3js.computeVertexNormals(); + delete this.geometry3js.calcNormals; + + } + + return this; + + }; + + Mesh.prototype.handlePrimitive = function ( primitive, geom ) { + + if ( primitive instanceof LineStrips ) { + + // TODO: Handle indices. Maybe easier with BufferGeometry? + + geom.isLineStrip = true; + return; + + } + + var j, k, pList = primitive.p, inputs = primitive.inputs; + var input, index, idx32; + var source, numParams; + var vcIndex = 0, vcount = 3, maxOffset = 0; + var texture_sets = []; + + for ( j = 0; j < inputs.length; j ++ ) { + + input = inputs[ j ]; + + var offset = input.offset + 1; + maxOffset = (maxOffset < offset) ? offset : maxOffset; + + switch ( input.semantic ) { + + case 'TEXCOORD': + texture_sets.push( input.set ); + break; + + } + + } + + for ( var pCount = 0; pCount < pList.length; ++ pCount ) { + + var p = pList[ pCount ], i = 0; + + while ( i < p.length ) { + + var vs = []; + var ns = []; + var ts = null; + var cs = []; + + if ( primitive.vcount ) { + + vcount = primitive.vcount.length ? primitive.vcount[ vcIndex ++ ] : primitive.vcount; + + } else { + + vcount = p.length / maxOffset; + + } + + + for ( j = 0; j < vcount; j ++ ) { + + for ( k = 0; k < inputs.length; k ++ ) { + + input = inputs[ k ]; + source = sources[ input.source ]; + + index = p[ i + ( j * maxOffset ) + input.offset ]; + numParams = source.accessor.params.length; + idx32 = index * numParams; + + switch ( input.semantic ) { + + case 'VERTEX': + + vs.push( index ); + + break; + + case 'NORMAL': + + ns.push( getConvertedVec3( source.data, idx32 ) ); + + break; + + case 'TEXCOORD': + + ts = ts || { }; + if ( ts[ input.set ] === undefined ) ts[ input.set ] = []; + // invert the V + ts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], source.data[ idx32 + 1 ] ) ); + + break; + + case 'COLOR': + + cs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) ); + + break; + + default: + + break; + + } + + } + + } + + if ( ns.length === 0 ) { + + // check the vertices inputs + input = this.vertices.input.NORMAL; + + if ( input ) { + + source = sources[ input.source ]; + numParams = source.accessor.params.length; + + for ( var ndx = 0, len = vs.length; ndx < len; ndx ++ ) { + + ns.push( getConvertedVec3( source.data, vs[ ndx ] * numParams ) ); + + } + + } else { + + geom.calcNormals = true; + + } + + } + + if ( !ts ) { + + ts = { }; + // check the vertices inputs + input = this.vertices.input.TEXCOORD; + + if ( input ) { + + texture_sets.push( input.set ); + source = sources[ input.source ]; + numParams = source.accessor.params.length; + + for ( var ndx = 0, len = vs.length; ndx < len; ndx ++ ) { + + idx32 = vs[ ndx ] * numParams; + if ( ts[ input.set ] === undefined ) ts[ input.set ] = [ ]; + // invert the V + ts[ input.set ].push( new THREE.Vector2( source.data[ idx32 ], 1.0 - source.data[ idx32 + 1 ] ) ); + + } + + } + + } + + if ( cs.length === 0 ) { + + // check the vertices inputs + input = this.vertices.input.COLOR; + + if ( input ) { + + source = sources[ input.source ]; + numParams = source.accessor.params.length; + + for ( var ndx = 0, len = vs.length; ndx < len; ndx ++ ) { + + idx32 = vs[ ndx ] * numParams; + cs.push( new THREE.Color().setRGB( source.data[ idx32 ], source.data[ idx32 + 1 ], source.data[ idx32 + 2 ] ) ); + + } + + } + + } + + var face = null, faces = [], uv, uvArr; + + if ( vcount === 3 ) { + + faces.push( new THREE.Face3( vs[0], vs[1], vs[2], ns, cs.length ? cs : new THREE.Color() ) ); + + } else if ( vcount === 4 ) { + + faces.push( new THREE.Face3( vs[0], vs[1], vs[3], [ ns[0].clone(), ns[1].clone(), ns[3].clone() ], cs.length ? [ cs[0], cs[1], cs[3] ] : new THREE.Color() ) ); + + faces.push( new THREE.Face3( vs[1], vs[2], vs[3], [ ns[1].clone(), ns[2].clone(), ns[3].clone() ], cs.length ? [ cs[1], cs[2], cs[3] ] : new THREE.Color() ) ); + + } else if ( vcount > 4 && options.subdivideFaces ) { + + var clr = cs.length ? cs : new THREE.Color(), + vec1, vec2, vec3, v1, v2, norm; + + // subdivide into multiple Face3s + + for ( k = 1; k < vcount - 1; ) { + + faces.push( new THREE.Face3( vs[0], vs[k], vs[k + 1], [ ns[0].clone(), ns[k ++].clone(), ns[k].clone() ], clr ) ); + + } + + } + + if ( faces.length ) { + + for ( var ndx = 0, len = faces.length; ndx < len; ndx ++ ) { + + face = faces[ndx]; + face.daeMaterial = primitive.material; + geom.faces.push( face ); + + for ( k = 0; k < texture_sets.length; k ++ ) { + + uv = ts[ texture_sets[k] ]; + + if ( vcount > 4 ) { + + // Grab the right UVs for the vertices in this face + uvArr = [ uv[0], uv[ndx + 1], uv[ndx + 2] ]; + + } else if ( vcount === 4 ) { + + if ( ndx === 0 ) { + + uvArr = [ uv[0], uv[1], uv[3] ]; + + } else { + + uvArr = [ uv[1].clone(), uv[2], uv[3].clone() ]; + + } + + } else { + + uvArr = [ uv[0], uv[1], uv[2] ]; + + } + + if ( geom.faceVertexUvs[k] === undefined ) { + + geom.faceVertexUvs[k] = []; + + } + + geom.faceVertexUvs[k].push( uvArr ); + + } + + } + + } else { + + console.log( 'dropped face with vcount ' + vcount + ' for geometry with id: ' + geom.id ); + + } + + i += maxOffset * vcount; + + } + + } + + }; + + function Polygons () { + + this.material = ""; + this.count = 0; + this.inputs = []; + this.vcount = null; + this.p = []; + this.geometry = new THREE.Geometry(); + + }; + + Polygons.prototype.setVertices = function ( vertices ) { + + for ( var i = 0; i < this.inputs.length; i ++ ) { + + if ( this.inputs[ i ].source === vertices.id ) { + + this.inputs[ i ].source = vertices.input[ 'POSITION' ].source; + + } + + } + + }; + + Polygons.prototype.parse = function ( element ) { + + this.material = element.getAttribute( 'material' ); + this.count = _attr_as_int( element, 'count', 0 ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'input': + + this.inputs.push( ( new Input() ).parse( element.childNodes[ i ] ) ); + break; + + case 'vcount': + + this.vcount = _ints( child.textContent ); + break; + + case 'p': + + this.p.push( _ints( child.textContent ) ); + break; + + case 'ph': + + console.warn( 'polygon holes not yet supported!' ); + break; + + default: + break; + + } + + } + + return this; + + }; + + function Polylist () { + + Polygons.call( this ); + + this.vcount = []; + + }; + + Polylist.prototype = Object.create( Polygons.prototype ); + Polylist.prototype.constructor = Polylist; + + function LineStrips() { + + Polygons.call( this ); + + this.vcount = 1; + + }; + + LineStrips.prototype = Object.create( Polygons.prototype ); + LineStrips.prototype.constructor = LineStrips; + + function Triangles () { + + Polygons.call( this ); + + this.vcount = 3; + + }; + + Triangles.prototype = Object.create( Polygons.prototype ); + Triangles.prototype.constructor = Triangles; + + function Accessor() { + + this.source = ""; + this.count = 0; + this.stride = 0; + this.params = []; + + }; + + Accessor.prototype.parse = function ( element ) { + + this.params = []; + this.source = element.getAttribute( 'source' ); + this.count = _attr_as_int( element, 'count', 0 ); + this.stride = _attr_as_int( element, 'stride', 0 ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + if ( child.nodeName === 'param' ) { + + var param = {}; + param[ 'name' ] = child.getAttribute( 'name' ); + param[ 'type' ] = child.getAttribute( 'type' ); + this.params.push( param ); + + } + + } + + return this; + + }; + + function Vertices() { + + this.input = {}; + + }; + + Vertices.prototype.parse = function ( element ) { + + this.id = element.getAttribute('id'); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + if ( element.childNodes[i].nodeName === 'input' ) { + + var input = ( new Input() ).parse( element.childNodes[ i ] ); + this.input[ input.semantic ] = input; + + } + + } + + return this; + + }; + + function Input () { + + this.semantic = ""; + this.offset = 0; + this.source = ""; + this.set = 0; + + }; + + Input.prototype.parse = function ( element ) { + + this.semantic = element.getAttribute('semantic'); + this.source = element.getAttribute('source').replace(/^#/, ''); + this.set = _attr_as_int(element, 'set', -1); + this.offset = _attr_as_int(element, 'offset', 0); + + if ( this.semantic === 'TEXCOORD' && this.set < 0 ) { + + this.set = 0; + + } + + return this; + + }; + + function Source ( id ) { + + this.id = id; + this.type = null; + + }; + + Source.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + + switch ( child.nodeName ) { + + case 'bool_array': + + this.data = _bools( child.textContent ); + this.type = child.nodeName; + break; + + case 'float_array': + + this.data = _floats( child.textContent ); + this.type = child.nodeName; + break; + + case 'int_array': + + this.data = _ints( child.textContent ); + this.type = child.nodeName; + break; + + case 'IDREF_array': + case 'Name_array': + + this.data = _strings( child.textContent ); + this.type = child.nodeName; + break; + + case 'technique_common': + + for ( var j = 0; j < child.childNodes.length; j ++ ) { + + if ( child.childNodes[ j ].nodeName === 'accessor' ) { + + this.accessor = ( new Accessor() ).parse( child.childNodes[ j ] ); + break; + + } + } + break; + + default: + // console.log(child.nodeName); + break; + + } + + } + + return this; + + }; + + Source.prototype.read = function () { + + var result = []; + + //for (var i = 0; i < this.accessor.params.length; i++) { + + var param = this.accessor.params[ 0 ]; + + //console.log(param.name + " " + param.type); + + switch ( param.type ) { + + case 'IDREF': + case 'Name': case 'name': + case 'float': + + return this.data; + + case 'float4x4': + + for ( var j = 0; j < this.data.length; j += 16 ) { + + var s = this.data.slice( j, j + 16 ); + var m = getConvertedMat4( s ); + result.push( m ); + } + + break; + + default: + + console.log( 'ColladaLoader: Source: Read dont know how to read ' + param.type + '.' ); + break; + + } + + //} + + return result; + + }; + + function Material () { + + this.id = ""; + this.name = ""; + this.instance_effect = null; + + }; + + Material.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + if ( element.childNodes[ i ].nodeName === 'instance_effect' ) { + + this.instance_effect = ( new InstanceEffect() ).parse( element.childNodes[ i ] ); + break; + + } + + } + + return this; + + }; + + function ColorOrTexture () { + + this.color = new THREE.Color(); + this.color.setRGB( Math.random(), Math.random(), Math.random() ); + this.color.a = 1.0; + + this.texture = null; + this.texcoord = null; + this.texOpts = null; + + }; + + ColorOrTexture.prototype.isColor = function () { + + return ( this.texture === null ); + + }; + + ColorOrTexture.prototype.isTexture = function () { + + return ( this.texture != null ); + + }; + + ColorOrTexture.prototype.parse = function ( element ) { + + if (element.nodeName === 'transparent') { + + this.opaque = element.getAttribute('opaque'); + + } + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'color': + + var rgba = _floats( child.textContent ); + this.color = new THREE.Color(); + this.color.setRGB( rgba[0], rgba[1], rgba[2] ); + this.color.a = rgba[3]; + break; + + case 'texture': + + this.texture = child.getAttribute('texture'); + this.texcoord = child.getAttribute('texcoord'); + // Defaults from: + // https://collada.org/mediawiki/index.php/Maya_texture_placement_MAYA_extension + this.texOpts = { + offsetU: 0, + offsetV: 0, + repeatU: 1, + repeatV: 1, + wrapU: 1, + wrapV: 1 + }; + this.parseTexture( child ); + break; + + default: + break; + + } + + } + + return this; + + }; + + ColorOrTexture.prototype.parseTexture = function ( element ) { + + if ( ! element.childNodes ) return this; + + // This should be supported by Maya, 3dsMax, and MotionBuilder + + if ( element.childNodes[1] && element.childNodes[1].nodeName === 'extra' ) { + + element = element.childNodes[1]; + + if ( element.childNodes[1] && element.childNodes[1].nodeName === 'technique' ) { + + element = element.childNodes[1]; + + } + + } + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'offsetU': + case 'offsetV': + case 'repeatU': + case 'repeatV': + + this.texOpts[ child.nodeName ] = parseFloat( child.textContent ); + + break; + + case 'wrapU': + case 'wrapV': + + // some dae have a value of true which becomes NaN via parseInt + + if ( child.textContent.toUpperCase() === 'TRUE' ) { + + this.texOpts[ child.nodeName ] = 1; + + } else { + + this.texOpts[ child.nodeName ] = parseInt( child.textContent ); + + } + break; + + default: + + this.texOpts[ child.nodeName ] = child.textContent; + + break; + + } + + } + + return this; + + }; + + function Shader ( type, effect ) { + + this.type = type; + this.effect = effect; + this.material = null; + + }; + + Shader.prototype.parse = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'emission': + case 'diffuse': + case 'specular': + case 'transparent': + + this[ child.nodeName ] = ( new ColorOrTexture() ).parse( child ); + break; + + case 'bump': + + // If 'bumptype' is 'heightfield', create a 'bump' property + // Else if 'bumptype' is 'normalmap', create a 'normal' property + // (Default to 'bump') + var bumpType = child.getAttribute( 'bumptype' ); + if ( bumpType ) { + if ( bumpType.toLowerCase() === "heightfield" ) { + this[ 'bump' ] = ( new ColorOrTexture() ).parse( child ); + } else if ( bumpType.toLowerCase() === "normalmap" ) { + this[ 'normal' ] = ( new ColorOrTexture() ).parse( child ); + } else { + console.error( "Shader.prototype.parse: Invalid value for attribute 'bumptype' (" + bumpType + ") - valid bumptypes are 'HEIGHTFIELD' and 'NORMALMAP' - defaulting to 'HEIGHTFIELD'" ); + this[ 'bump' ] = ( new ColorOrTexture() ).parse( child ); + } + } else { + console.warn( "Shader.prototype.parse: Attribute 'bumptype' missing from bump node - defaulting to 'HEIGHTFIELD'" ); + this[ 'bump' ] = ( new ColorOrTexture() ).parse( child ); + } + + break; + + case 'shininess': + case 'reflectivity': + case 'index_of_refraction': + case 'transparency': + + var f = child.querySelectorAll('float'); + + if ( f.length > 0 ) + this[ child.nodeName ] = parseFloat( f[ 0 ].textContent ); + + break; + + default: + break; + + } + + } + + this.create(); + return this; + + }; + + Shader.prototype.create = function() { + + var props = {}; + + var transparent = false; + + if (this['transparency'] !== undefined && this['transparent'] !== undefined) { + // convert transparent color RBG to average value + var transparentColor = this['transparent']; + var transparencyLevel = (this.transparent.color.r + this.transparent.color.g + this.transparent.color.b) / 3 * this.transparency; + + if (transparencyLevel > 0) { + transparent = true; + props[ 'transparent' ] = true; + props[ 'opacity' ] = 1 - transparencyLevel; + + } + + } + + var keys = { + 'diffuse':'map', + 'ambient':'lightMap', + 'specular':'specularMap', + 'emission':'emissionMap', + 'bump':'bumpMap', + 'normal':'normalMap' + }; + + for ( var prop in this ) { + + switch ( prop ) { + + case 'ambient': + case 'emission': + case 'diffuse': + case 'specular': + case 'bump': + case 'normal': + + var cot = this[ prop ]; + + if ( cot instanceof ColorOrTexture ) { + + if ( cot.isTexture() ) { + + var samplerId = cot.texture; + var surfaceId = this.effect.sampler[samplerId]; + + if ( surfaceId !== undefined && surfaceId.source !== undefined ) { + + var surface = this.effect.surface[surfaceId.source]; + + if ( surface !== undefined ) { + + var image = images[ surface.init_from ]; + + if ( image ) { + + var url = baseUrl + image.init_from; + + var texture; + var loader = THREE.Loader.Handlers.get( url ); + + if ( loader !== null ) { + + texture = loader.load( url ); + + } else { + + texture = new THREE.Texture(); + + loadTextureImage( texture, url ); + + } + + texture.wrapS = cot.texOpts.wrapU ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping; + texture.wrapT = cot.texOpts.wrapV ? THREE.RepeatWrapping : THREE.ClampToEdgeWrapping; + texture.offset.x = cot.texOpts.offsetU; + texture.offset.y = cot.texOpts.offsetV; + texture.repeat.x = cot.texOpts.repeatU; + texture.repeat.y = cot.texOpts.repeatV; + props[keys[prop]] = texture; + + // Texture with baked lighting? + if (prop === 'emission') props['emissive'] = 0xffffff; + + } + + } + + } + + } else if ( prop === 'diffuse' || !transparent ) { + + if ( prop === 'emission' ) { + + props[ 'emissive' ] = cot.color.getHex(); + + } else { + + props[ prop ] = cot.color.getHex(); + + } + + } + + } + + break; + + case 'shininess': + + props[ prop ] = this[ prop ]; + break; + + case 'reflectivity': + + props[ prop ] = this[ prop ]; + if ( props[ prop ] > 0.0 ) props['envMap'] = options.defaultEnvMap; + props['combine'] = THREE.MixOperation; //mix regular shading with reflective component + break; + + case 'index_of_refraction': + + props[ 'refractionRatio' ] = this[ prop ]; //TODO: "index_of_refraction" becomes "refractionRatio" in shader, but I'm not sure if the two are actually comparable + if ( this[ prop ] !== 1.0 ) props['envMap'] = options.defaultEnvMap; + break; + + case 'transparency': + // gets figured out up top + break; + + default: + break; + + } + + } + + props[ 'shading' ] = preferredShading; + props[ 'side' ] = this.effect.doubleSided ? THREE.DoubleSide : THREE.FrontSide; + + switch ( this.type ) { + + case 'constant': + + if (props.emissive != undefined) props.color = props.emissive; + this.material = new THREE.MeshBasicMaterial( props ); + break; + + case 'phong': + case 'blinn': + + if (props.diffuse != undefined) props.color = props.diffuse; + this.material = new THREE.MeshPhongMaterial( props ); + break; + + case 'lambert': + default: + + if (props.diffuse != undefined) props.color = props.diffuse; + this.material = new THREE.MeshLambertMaterial( props ); + break; + + } + + return this.material; + + }; + + function Surface ( effect ) { + + this.effect = effect; + this.init_from = null; + this.format = null; + + }; + + Surface.prototype.parse = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'init_from': + + this.init_from = child.textContent; + break; + + case 'format': + + this.format = child.textContent; + break; + + default: + + console.log( "unhandled Surface prop: " + child.nodeName ); + break; + + } + + } + + return this; + + }; + + function Sampler2D ( effect ) { + + this.effect = effect; + this.source = null; + this.wrap_s = null; + this.wrap_t = null; + this.minfilter = null; + this.magfilter = null; + this.mipfilter = null; + + }; + + Sampler2D.prototype.parse = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'source': + + this.source = child.textContent; + break; + + case 'minfilter': + + this.minfilter = child.textContent; + break; + + case 'magfilter': + + this.magfilter = child.textContent; + break; + + case 'mipfilter': + + this.mipfilter = child.textContent; + break; + + case 'wrap_s': + + this.wrap_s = child.textContent; + break; + + case 'wrap_t': + + this.wrap_t = child.textContent; + break; + + default: + + console.log( "unhandled Sampler2D prop: " + child.nodeName ); + break; + + } + + } + + return this; + + }; + + function Effect () { + + this.id = ""; + this.name = ""; + this.shader = null; + this.surface = {}; + this.sampler = {}; + + }; + + Effect.prototype.create = function () { + + if ( this.shader === null ) { + + return null; + + } + + }; + + Effect.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + + extractDoubleSided( this, element ); + + this.shader = null; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'profile_COMMON': + + this.parseTechnique( this.parseProfileCOMMON( child ) ); + break; + + default: + break; + + } + + } + + return this; + + }; + + Effect.prototype.parseNewparam = function ( element ) { + + var sid = element.getAttribute( 'sid' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'surface': + + this.surface[sid] = ( new Surface( this ) ).parse( child ); + break; + + case 'sampler2D': + + this.sampler[sid] = ( new Sampler2D( this ) ).parse( child ); + break; + + case 'extra': + + break; + + default: + + console.log( child.nodeName ); + break; + + } + + } + + }; + + Effect.prototype.parseProfileCOMMON = function ( element ) { + + var technique; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'profile_COMMON': + + this.parseProfileCOMMON( child ); + break; + + case 'technique': + + technique = child; + break; + + case 'newparam': + + this.parseNewparam( child ); + break; + + case 'image': + + var _image = ( new _Image() ).parse( child ); + images[ _image.id ] = _image; + break; + + case 'extra': + break; + + default: + + console.log( child.nodeName ); + break; + + } + + } + + return technique; + + }; + + Effect.prototype.parseTechnique = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'constant': + case 'lambert': + case 'blinn': + case 'phong': + + this.shader = ( new Shader( child.nodeName, this ) ).parse( child ); + break; + case 'extra': + this.parseExtra(child); + break; + default: + break; + + } + + } + + }; + + Effect.prototype.parseExtra = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'technique': + this.parseExtraTechnique( child ); + break; + default: + break; + + } + + } + + }; + + Effect.prototype.parseExtraTechnique = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[i]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'bump': + this.shader.parse( element ); + break; + default: + break; + + } + + } + + }; + + function InstanceEffect () { + + this.url = ""; + + }; + + InstanceEffect.prototype.parse = function ( element ) { + + this.url = element.getAttribute( 'url' ).replace( /^#/, '' ); + return this; + + }; + + function Animation() { + + this.id = ""; + this.name = ""; + this.source = {}; + this.sampler = []; + this.channel = []; + + }; + + Animation.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + this.source = {}; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'animation': + + var anim = ( new Animation() ).parse( child ); + + for ( var src in anim.source ) { + + this.source[ src ] = anim.source[ src ]; + + } + + for ( var j = 0; j < anim.channel.length; j ++ ) { + + this.channel.push( anim.channel[ j ] ); + this.sampler.push( anim.sampler[ j ] ); + + } + + break; + + case 'source': + + var src = ( new Source() ).parse( child ); + this.source[ src.id ] = src; + break; + + case 'sampler': + + this.sampler.push( ( new Sampler( this ) ).parse( child ) ); + break; + + case 'channel': + + this.channel.push( ( new Channel( this ) ).parse( child ) ); + break; + + default: + break; + + } + + } + + return this; + + }; + + function Channel( animation ) { + + this.animation = animation; + this.source = ""; + this.target = ""; + this.fullSid = null; + this.sid = null; + this.dotSyntax = null; + this.arrSyntax = null; + this.arrIndices = null; + this.member = null; + + }; + + Channel.prototype.parse = function ( element ) { + + this.source = element.getAttribute( 'source' ).replace( /^#/, '' ); + this.target = element.getAttribute( 'target' ); + + var parts = this.target.split( '/' ); + + var id = parts.shift(); + var sid = parts.shift(); + + var dotSyntax = ( sid.indexOf(".") >= 0 ); + var arrSyntax = ( sid.indexOf("(") >= 0 ); + + if ( dotSyntax ) { + + parts = sid.split("."); + this.sid = parts.shift(); + this.member = parts.shift(); + + } else if ( arrSyntax ) { + + var arrIndices = sid.split("("); + this.sid = arrIndices.shift(); + + for (var j = 0; j < arrIndices.length; j ++ ) { + + arrIndices[j] = parseInt( arrIndices[j].replace(/\)/, '') ); + + } + + this.arrIndices = arrIndices; + + } else { + + this.sid = sid; + + } + + this.fullSid = sid; + this.dotSyntax = dotSyntax; + this.arrSyntax = arrSyntax; + + return this; + + }; + + function Sampler ( animation ) { + + this.id = ""; + this.animation = animation; + this.inputs = []; + this.input = null; + this.output = null; + this.strideOut = null; + this.interpolation = null; + this.startTime = null; + this.endTime = null; + this.duration = 0; + + }; + + Sampler.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.inputs = []; + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'input': + + this.inputs.push( (new Input()).parse( child ) ); + break; + + default: + break; + + } + + } + + return this; + + }; + + Sampler.prototype.create = function () { + + for ( var i = 0; i < this.inputs.length; i ++ ) { + + var input = this.inputs[ i ]; + var source = this.animation.source[ input.source ]; + + switch ( input.semantic ) { + + case 'INPUT': + + this.input = source.read(); + break; + + case 'OUTPUT': + + this.output = source.read(); + this.strideOut = source.accessor.stride; + break; + + case 'INTERPOLATION': + + this.interpolation = source.read(); + break; + + case 'IN_TANGENT': + + break; + + case 'OUT_TANGENT': + + break; + + default: + + console.log(input.semantic); + break; + + } + + } + + this.startTime = 0; + this.endTime = 0; + this.duration = 0; + + if ( this.input.length ) { + + this.startTime = 100000000; + this.endTime = -100000000; + + for ( var i = 0; i < this.input.length; i ++ ) { + + this.startTime = Math.min( this.startTime, this.input[ i ] ); + this.endTime = Math.max( this.endTime, this.input[ i ] ); + + } + + this.duration = this.endTime - this.startTime; + + } + + }; + + Sampler.prototype.getData = function ( type, ndx, member ) { + + var data; + + if ( type === 'matrix' && this.strideOut === 16 ) { + + data = this.output[ ndx ]; + + } else if ( this.strideOut > 1 ) { + + data = []; + ndx *= this.strideOut; + + for ( var i = 0; i < this.strideOut; ++ i ) { + + data[ i ] = this.output[ ndx + i ]; + + } + + if ( this.strideOut === 3 ) { + + switch ( type ) { + + case 'rotate': + case 'translate': + + fixCoords( data, -1 ); + break; + + case 'scale': + + fixCoords( data, 1 ); + break; + + } + + } else if ( this.strideOut === 4 && type === 'matrix' ) { + + fixCoords( data, -1 ); + + } + + } else { + + data = this.output[ ndx ]; + + if ( member && type === 'translate' ) { + data = getConvertedTranslation( member, data ); + } + + } + + return data; + + }; + + function Key ( time ) { + + this.targets = []; + this.time = time; + + }; + + Key.prototype.addTarget = function ( fullSid, transform, member, data ) { + + this.targets.push( { + sid: fullSid, + member: member, + transform: transform, + data: data + } ); + + }; + + Key.prototype.apply = function ( opt_sid ) { + + for ( var i = 0; i < this.targets.length; ++ i ) { + + var target = this.targets[ i ]; + + if ( !opt_sid || target.sid === opt_sid ) { + + target.transform.update( target.data, target.member ); + + } + + } + + }; + + Key.prototype.getTarget = function ( fullSid ) { + + for ( var i = 0; i < this.targets.length; ++ i ) { + + if ( this.targets[ i ].sid === fullSid ) { + + return this.targets[ i ]; + + } + + } + + return null; + + }; + + Key.prototype.hasTarget = function ( fullSid ) { + + for ( var i = 0; i < this.targets.length; ++ i ) { + + if ( this.targets[ i ].sid === fullSid ) { + + return true; + + } + + } + + return false; + + }; + + // TODO: Currently only doing linear interpolation. Should support full COLLADA spec. + Key.prototype.interpolate = function ( nextKey, time ) { + + for ( var i = 0, l = this.targets.length; i < l; i ++ ) { + + var target = this.targets[ i ], + nextTarget = nextKey.getTarget( target.sid ), + data; + + if ( target.transform.type !== 'matrix' && nextTarget ) { + + var scale = ( time - this.time ) / ( nextKey.time - this.time ), + nextData = nextTarget.data, + prevData = target.data; + + if ( scale < 0 ) scale = 0; + if ( scale > 1 ) scale = 1; + + if ( prevData.length ) { + + data = []; + + for ( var j = 0; j < prevData.length; ++ j ) { + + data[ j ] = prevData[ j ] + ( nextData[ j ] - prevData[ j ] ) * scale; + + } + + } else { + + data = prevData + ( nextData - prevData ) * scale; + + } + + } else { + + data = target.data; + + } + + target.transform.update( data, target.member ); + + } + + }; + + // Camera + function Camera() { + + this.id = ""; + this.name = ""; + this.technique = ""; + + }; + + Camera.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'optics': + + this.parseOptics( child ); + break; + + default: + break; + + } + + } + + return this; + + }; + + Camera.prototype.parseOptics = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + if ( element.childNodes[ i ].nodeName === 'technique_common' ) { + + var technique = element.childNodes[ i ]; + + for ( var j = 0; j < technique.childNodes.length; j ++ ) { + + this.technique = technique.childNodes[ j ].nodeName; + + if ( this.technique === 'perspective' ) { + + var perspective = technique.childNodes[ j ]; + + for ( var k = 0; k < perspective.childNodes.length; k ++ ) { + + var param = perspective.childNodes[ k ]; + + switch ( param.nodeName ) { + + case 'yfov': + this.yfov = param.textContent; + break; + case 'xfov': + this.xfov = param.textContent; + break; + case 'znear': + this.znear = param.textContent; + break; + case 'zfar': + this.zfar = param.textContent; + break; + case 'aspect_ratio': + this.aspect_ratio = param.textContent; + break; + + } + + } + + } else if ( this.technique === 'orthographic' ) { + + var orthographic = technique.childNodes[ j ]; + + for ( var k = 0; k < orthographic.childNodes.length; k ++ ) { + + var param = orthographic.childNodes[ k ]; + + switch ( param.nodeName ) { + + case 'xmag': + this.xmag = param.textContent; + break; + case 'ymag': + this.ymag = param.textContent; + break; + case 'znear': + this.znear = param.textContent; + break; + case 'zfar': + this.zfar = param.textContent; + break; + case 'aspect_ratio': + this.aspect_ratio = param.textContent; + break; + + } + + } + + } + + } + + } + + } + + return this; + + }; + + function InstanceCamera() { + + this.url = ""; + + }; + + InstanceCamera.prototype.parse = function ( element ) { + + this.url = element.getAttribute('url').replace(/^#/, ''); + + return this; + + }; + + // Light + + function Light() { + + this.id = ""; + this.name = ""; + this.technique = ""; + + }; + + Light.prototype.parse = function ( element ) { + + this.id = element.getAttribute( 'id' ); + this.name = element.getAttribute( 'name' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'technique_common': + + this.parseCommon( child ); + break; + + case 'technique': + + this.parseTechnique( child ); + break; + + default: + break; + + } + + } + + return this; + + }; + + Light.prototype.parseCommon = function ( element ) { + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + switch ( element.childNodes[ i ].nodeName ) { + + case 'directional': + case 'point': + case 'spot': + case 'ambient': + + this.technique = element.childNodes[ i ].nodeName; + + var light = element.childNodes[ i ]; + + for ( var j = 0; j < light.childNodes.length; j ++ ) { + + var child = light.childNodes[j]; + + switch ( child.nodeName ) { + + case 'color': + + var rgba = _floats( child.textContent ); + this.color = new THREE.Color(0); + this.color.setRGB( rgba[0], rgba[1], rgba[2] ); + this.color.a = rgba[3]; + break; + + case 'falloff_angle': + + this.falloff_angle = parseFloat( child.textContent ); + break; + + case 'quadratic_attenuation': + var f = parseFloat( child.textContent ); + this.distance = f ? Math.sqrt( 1 / f ) : 0; + } + + } + + } + + } + + return this; + + }; + + Light.prototype.parseTechnique = function ( element ) { + + this.profile = element.getAttribute( 'profile' ); + + for ( var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + + switch ( child.nodeName ) { + + case 'intensity': + + this.intensity = parseFloat(child.textContent); + break; + + } + + } + + return this; + + }; + + function InstanceLight() { + + this.url = ""; + + }; + + InstanceLight.prototype.parse = function ( element ) { + + this.url = element.getAttribute('url').replace(/^#/, ''); + + return this; + + }; + + function KinematicsModel( ) { + + this.id = ''; + this.name = ''; + this.joints = []; + this.links = []; + + } + + KinematicsModel.prototype.parse = function( element ) { + + this.id = element.getAttribute('id'); + this.name = element.getAttribute('name'); + this.joints = []; + this.links = []; + + for (var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'technique_common': + + this.parseCommon(child); + break; + + default: + break; + + } + + } + + return this; + + }; + + KinematicsModel.prototype.parseCommon = function( element ) { + + for (var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( element.childNodes[ i ].nodeName ) { + + case 'joint': + this.joints.push( (new Joint()).parse(child) ); + break; + + case 'link': + this.links.push( (new Link()).parse(child) ); + break; + + default: + break; + + } + + } + + return this; + + }; + + function Joint( ) { + + this.sid = ''; + this.name = ''; + this.axis = new THREE.Vector3(); + this.limits = { + min: 0, + max: 0 + }; + this.type = ''; + this.static = false; + this.zeroPosition = 0.0; + this.middlePosition = 0.0; + + } + + Joint.prototype.parse = function( element ) { + + this.sid = element.getAttribute('sid'); + this.name = element.getAttribute('name'); + this.axis = new THREE.Vector3(); + this.limits = { + min: 0, + max: 0 + }; + this.type = ''; + this.static = false; + this.zeroPosition = 0.0; + this.middlePosition = 0.0; + + var axisElement = element.querySelector('axis'); + var _axis = _floats(axisElement.textContent); + this.axis = getConvertedVec3(_axis, 0); + + var min = element.querySelector('limits min') ? parseFloat(element.querySelector('limits min').textContent) : -360; + var max = element.querySelector('limits max') ? parseFloat(element.querySelector('limits max').textContent) : 360; + + this.limits = { + min: min, + max: max + }; + + var jointTypes = [ 'prismatic', 'revolute' ]; + for (var i = 0; i < jointTypes.length; i ++ ) { + + var type = jointTypes[ i ]; + + var jointElement = element.querySelector(type); + + if ( jointElement ) { + + this.type = type; + + } + + } + + // if the min is equal to or somehow greater than the max, consider the joint static + if ( this.limits.min >= this.limits.max ) { + + this.static = true; + + } + + this.middlePosition = (this.limits.min + this.limits.max) / 2.0; + return this; + + }; + + function Link( ) { + + this.sid = ''; + this.name = ''; + this.transforms = []; + this.attachments = []; + + } + + Link.prototype.parse = function( element ) { + + this.sid = element.getAttribute('sid'); + this.name = element.getAttribute('name'); + this.transforms = []; + this.attachments = []; + + for (var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'attachment_full': + this.attachments.push( (new Attachment()).parse(child) ); + break; + + case 'rotate': + case 'translate': + case 'matrix': + + this.transforms.push( (new Transform()).parse(child) ); + break; + + default: + + break; + + } + + } + + return this; + + }; + + function Attachment( ) { + + this.joint = ''; + this.transforms = []; + this.links = []; + + } + + Attachment.prototype.parse = function( element ) { + + this.joint = element.getAttribute('joint').split('/').pop(); + this.links = []; + + for (var i = 0; i < element.childNodes.length; i ++ ) { + + var child = element.childNodes[ i ]; + if ( child.nodeType != 1 ) continue; + + switch ( child.nodeName ) { + + case 'link': + this.links.push( (new Link()).parse(child) ); + break; + + case 'rotate': + case 'translate': + case 'matrix': + + this.transforms.push( (new Transform()).parse(child) ); + break; + + default: + + break; + + } + + } + + return this; + + }; + + function _source( element ) { + + var id = element.getAttribute( 'id' ); + + if ( sources[ id ] != undefined ) { + + return sources[ id ]; + + } + + sources[ id ] = ( new Source(id )).parse( element ); + return sources[ id ]; + + }; + + function _nsResolver( nsPrefix ) { + + if ( nsPrefix === "dae" ) { + + return "http://www.collada.org/2005/11/COLLADASchema"; + + } + + return null; + + }; + + function _bools( str ) { + + var raw = _strings( str ); + var data = []; + + for ( var i = 0, l = raw.length; i < l; i ++ ) { + + data.push( (raw[i] === 'true' || raw[i] === '1') ? true : false ); + + } + + return data; + + }; + + function _floats( str ) { + + var raw = _strings(str); + var data = []; + + for ( var i = 0, l = raw.length; i < l; i ++ ) { + + data.push( parseFloat( raw[ i ] ) ); + + } + + return data; + + }; + + function _ints( str ) { + + var raw = _strings( str ); + var data = []; + + for ( var i = 0, l = raw.length; i < l; i ++ ) { + + data.push( parseInt( raw[ i ], 10 ) ); + + } + + return data; + + }; + + function _strings( str ) { + + return ( str.length > 0 ) ? _trimString( str ).split( /\s+/ ) : []; + + }; + + function _trimString( str ) { + + return str.replace( /^\s+/, "" ).replace( /\s+$/, "" ); + + }; + + function _attr_as_float( element, name, defaultValue ) { + + if ( element.hasAttribute( name ) ) { + + return parseFloat( element.getAttribute( name ) ); + + } else { + + return defaultValue; + + } + + }; + + function _attr_as_int( element, name, defaultValue ) { + + if ( element.hasAttribute( name ) ) { + + return parseInt( element.getAttribute( name ), 10) ; + + } else { + + return defaultValue; + + } + + }; + + function _attr_as_string( element, name, defaultValue ) { + + if ( element.hasAttribute( name ) ) { + + return element.getAttribute( name ); + + } else { + + return defaultValue; + + } + + }; + + function _format_float( f, num ) { + + if ( f === undefined ) { + + var s = '0.'; + + while ( s.length < num + 2 ) { + + s += '0'; + + } + + return s; + + } + + num = num || 2; + + var parts = f.toString().split( '.' ); + parts[ 1 ] = parts.length > 1 ? parts[ 1 ].substr( 0, num ) : "0"; + + while ( parts[ 1 ].length < num ) { + + parts[ 1 ] += '0'; + + } + + return parts.join( '.' ); + + }; + + function loadTextureImage ( texture, url ) { + + loader = new THREE.ImageLoader(); + + loader.load( url, function ( image ) { + + texture.image = image; + texture.needsUpdate = true; + + } ); + + }; + + function extractDoubleSided( obj, element ) { + + obj.doubleSided = false; + + var node = element.querySelectorAll('extra double_sided')[0]; + + if ( node ) { + + if ( node && parseInt( node.textContent, 10 ) === 1 ) { + + obj.doubleSided = true; + + } + + } + + }; + + // Up axis conversion + + function setUpConversion() { + + if ( options.convertUpAxis !== true || colladaUp === options.upAxis ) { + + upConversion = null; + + } else { + + switch ( colladaUp ) { + + case 'X': + + upConversion = options.upAxis === 'Y' ? 'XtoY' : 'XtoZ'; + break; + + case 'Y': + + upConversion = options.upAxis === 'X' ? 'YtoX' : 'YtoZ'; + break; + + case 'Z': + + upConversion = options.upAxis === 'X' ? 'ZtoX' : 'ZtoY'; + break; + + } + + } + + }; + + function fixCoords( data, sign ) { + + if ( options.convertUpAxis !== true || colladaUp === options.upAxis ) { + + return; + + } + + switch ( upConversion ) { + + case 'XtoY': + + var tmp = data[ 0 ]; + data[ 0 ] = sign * data[ 1 ]; + data[ 1 ] = tmp; + break; + + case 'XtoZ': + + var tmp = data[ 2 ]; + data[ 2 ] = data[ 1 ]; + data[ 1 ] = data[ 0 ]; + data[ 0 ] = tmp; + break; + + case 'YtoX': + + var tmp = data[ 0 ]; + data[ 0 ] = data[ 1 ]; + data[ 1 ] = sign * tmp; + break; + + case 'YtoZ': + + var tmp = data[ 1 ]; + data[ 1 ] = sign * data[ 2 ]; + data[ 2 ] = tmp; + break; + + case 'ZtoX': + + var tmp = data[ 0 ]; + data[ 0 ] = data[ 1 ]; + data[ 1 ] = data[ 2 ]; + data[ 2 ] = tmp; + break; + + case 'ZtoY': + + var tmp = data[ 1 ]; + data[ 1 ] = data[ 2 ]; + data[ 2 ] = sign * tmp; + break; + + } + + }; + + function getConvertedTranslation( axis, data ) { + + if ( options.convertUpAxis !== true || colladaUp === options.upAxis ) { + + return data; + + } + + switch ( axis ) { + case 'X': + data = upConversion === 'XtoY' ? data * -1 : data; + break; + case 'Y': + data = upConversion === 'YtoZ' || upConversion === 'YtoX' ? data * -1 : data; + break; + case 'Z': + data = upConversion === 'ZtoY' ? data * -1 : data ; + break; + default: + break; + } + + return data; + }; + + function getConvertedVec3( data, offset ) { + + var arr = [ data[ offset ], data[ offset + 1 ], data[ offset + 2 ] ]; + fixCoords( arr, -1 ); + return new THREE.Vector3( arr[ 0 ], arr[ 1 ], arr[ 2 ] ); + + }; + + function getConvertedMat4( data ) { + + if ( options.convertUpAxis ) { + + // First fix rotation and scale + + // Columns first + var arr = [ data[ 0 ], data[ 4 ], data[ 8 ] ]; + fixCoords( arr, -1 ); + data[ 0 ] = arr[ 0 ]; + data[ 4 ] = arr[ 1 ]; + data[ 8 ] = arr[ 2 ]; + arr = [ data[ 1 ], data[ 5 ], data[ 9 ] ]; + fixCoords( arr, -1 ); + data[ 1 ] = arr[ 0 ]; + data[ 5 ] = arr[ 1 ]; + data[ 9 ] = arr[ 2 ]; + arr = [ data[ 2 ], data[ 6 ], data[ 10 ] ]; + fixCoords( arr, -1 ); + data[ 2 ] = arr[ 0 ]; + data[ 6 ] = arr[ 1 ]; + data[ 10 ] = arr[ 2 ]; + // Rows second + arr = [ data[ 0 ], data[ 1 ], data[ 2 ] ]; + fixCoords( arr, -1 ); + data[ 0 ] = arr[ 0 ]; + data[ 1 ] = arr[ 1 ]; + data[ 2 ] = arr[ 2 ]; + arr = [ data[ 4 ], data[ 5 ], data[ 6 ] ]; + fixCoords( arr, -1 ); + data[ 4 ] = arr[ 0 ]; + data[ 5 ] = arr[ 1 ]; + data[ 6 ] = arr[ 2 ]; + arr = [ data[ 8 ], data[ 9 ], data[ 10 ] ]; + fixCoords( arr, -1 ); + data[ 8 ] = arr[ 0 ]; + data[ 9 ] = arr[ 1 ]; + data[ 10 ] = arr[ 2 ]; + + // Now fix translation + arr = [ data[ 3 ], data[ 7 ], data[ 11 ] ]; + fixCoords( arr, -1 ); + data[ 3 ] = arr[ 0 ]; + data[ 7 ] = arr[ 1 ]; + data[ 11 ] = arr[ 2 ]; + + } + + return new THREE.Matrix4().set( + data[0], data[1], data[2], data[3], + data[4], data[5], data[6], data[7], + data[8], data[9], data[10], data[11], + data[12], data[13], data[14], data[15] + ); + + }; + + function getConvertedIndex( index ) { + + if ( index > -1 && index < 3 ) { + + var members = [ 'X', 'Y', 'Z' ], + indices = { X: 0, Y: 1, Z: 2 }; + + index = getConvertedMember( members[ index ] ); + index = indices[ index ]; + + } + + return index; + + }; + + function getConvertedMember( member ) { + + if ( options.convertUpAxis ) { + + switch ( member ) { + + case 'X': + + switch ( upConversion ) { + + case 'XtoY': + case 'XtoZ': + case 'YtoX': + + member = 'Y'; + break; + + case 'ZtoX': + + member = 'Z'; + break; + + } + + break; + + case 'Y': + + switch ( upConversion ) { + + case 'XtoY': + case 'YtoX': + case 'ZtoX': + + member = 'X'; + break; + + case 'XtoZ': + case 'YtoZ': + case 'ZtoY': + + member = 'Z'; + break; + + } + + break; + + case 'Z': + + switch ( upConversion ) { + + case 'XtoZ': + + member = 'X'; + break; + + case 'YtoZ': + case 'ZtoX': + case 'ZtoY': + + member = 'Y'; + break; + + } + + break; + + } + + } + + return member; + + }; + + return { + + load: load, + parse: parse, + setPreferredShading: setPreferredShading, + applySkin: applySkin, + geometries : geometries, + options: options + + }; + +}; diff --git a/src/tools/TurtlebotViewer-web/public/js/Ice.min.js b/src/tools/TurtlebotViewer-web/public/js/Ice.min.js new file mode 100644 index 000000000..ee100584f --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/Ice.min.js @@ -0,0 +1,10 @@ +(function(){var e=typeof window!=="undefined"?window:self;e.Ice=e.Ice||{};Ice.Slice=Ice.Slice||{};e.IceMX=e.IceMX||{};e.IceSSL=e.IceSSL||{};var t=Ice.Slice;(function(){var e=typeof window!=="undefined"?window:self;var t={module:function(t){var n=e[t];if(n===undefined){n={};e[t]=n}return n},require:function(t){return e},type:function(t){if(t===undefined){return undefined}var n=t.split(".");var i=e;for(var r=0,s=n.length;r1;--t){var n=e[t-1];var i=Math.floor(Math.random()*t);e[t-1]=e[i];e[i]=n}},indexOf:function(e,t,n){if(n!==undefined&&n!==null){for(var i=0;ie.MAX_UINT32){throw new RangeError("Low word must be between 0 and 0xFFFFFFFF")}if(t<0||t>e.MAX_UINT32){throw new RangeError("High word must be between 0 and 0xFFFFFFFF")}this.high=t;this.low=n},hashCode:function(){return this.low},equals:function(t){if(this===t){return true}if(!(t instanceof e)){return false}return this.high===t.high&&this.low===t.low},toString:function(){return this.high+":"+this.low},toNumber:function(){if((this.high&e.SIGN_MASK)!==0){const t=~this.low>>>0;const n=~this.high>>>0;if(n>e.HIGH_MAX||n==e.HIGH_MAX&&t==e.MAX_UINT32){return Number.NEGATIVE_INFINITY}return-(n*e.HIGH_MASK+t+1)}else{if(this.high>e.HIGH_MAX){return Number.POSITIVE_INFINITY}return this.high*e.HIGH_MASK+this.low}}});e.MAX_UINT32=4294967295;e.SIGN_MASK=2147483648;e.HIGH_MASK=4294967296;e.HIGH_MAX=2097151;Ice.Long=e})();(function(){Ice.AssertionFailedException=Ice.Class(Error,{__init__:function(e){Error.call(this);Ice.Exception.captureStackTrace(this);this.message=e}});Ice.Debug={assert:function(e,t){if(!e){console.log(t===undefined?"assertion failed":t);console.log(Error().stack);throw new Ice.AssertionFailedException(t===undefined?"assertion failed":t)}}}})();(function(){Ice.DispatchStatus={DispatchOK:0,DispatchUserException:1,DispatchAsync:2}})();(function(){var e=Ice.Class({__init__:function(e,t){this._name=e;this._value=t},equals:function(e){if(this===e){return true}var t=Object.getPrototypeOf(this);if(!(e instanceof t.constructor)){return false}return this._value==e._value},hashCode:function(){return this._value},toString:function(){return this._name}});Ice.EnumBase=e;var t=e.prototype;Object.defineProperty(t,"name",{enumerable:true,get:function(){return this._name}});Object.defineProperty(t,"value",{enumerable:true,get:function(){return this._value}});var n=Ice.Class({__init__:function(e){this._enumType=e},write:function(e,t){this._enumType.__write(e,t)},writeOpt:function(e,t,n){this._enumType.__writeOpt(e,t,n)},read:function(e){return this._enumType.__read(e)},readOpt:function(e,t){return this._enumType.__readOpt(e,t)}});Ice.EnumHelper=n;var i=Ice.Slice;i.defineEnum=function(t){var i=function(t,n){e.call(this,t,n)};i.prototype=new e;i.prototype.constructor=i;var r=[];var s=0;var o=null;for(var c in t){var a=t[c][0],u=t[c][1];var l=new i(a,u);r[u]=l;if(!o){o=l}Object.defineProperty(i,a,{enumerable:true,value:l});if(u>s){s=u}}Object.defineProperty(i,"minWireSize",{get:function(){return 1}});i.__write=function(e,t){if(t){e.writeEnum(t)}else{e.writeEnum(o)}};i.__read=function(e){return e.readEnum(i)};i.__writeOpt=function(e,t,n){if(n!==undefined){if(e.writeOpt(t,Ice.OptionalFormat.Size)){i.__write(e,n)}}};i.__readOpt=function(e,t){return e.readOptEnum(t,i)};i.__helper=new n(i);Object.defineProperty(i,"valueOf",{value:function(e){if(e===undefined){return i}return r[e]}});Object.defineProperty(i,"maxValue",{value:s});Object.defineProperty(i.prototype,"maxValue",{value:s});return i}})();(function(){function e(){var e=(new Date).getTime();var t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){var n=(e+Math.random()*16)%16|0;e=Math.floor(e/16);return(t=="x"?n:n&7|8).toString(16)});return t}Ice.generateUUID=e})();(function(){Ice.FormatType=Ice.Slice.defineEnum([["DefaultFormat",0],["CompactFormat",1],["SlicedFormat",2]])})();(function(){var e=Ice.Debug;Ice.StringUtil={findFirstOf:function(e,t,n){n=n===undefined?0:n;var i=e.length;for(var r=n;r126){throw new Error("special characters must be in ASCII range 32-126")}}}var s=[],o;for(i=0,r=e.length;i127&&o<2048){t(o>>6|192,s,n);t(o&63|128,s,n)}else{t(o>>12|224,s,n);t(o>>6&63|128,s,n);t(o&63|128,s,n)}}return s.join("")},unescapeString:function(t,n,i){n=n===undefined?0:n;i=i===undefined?t.length:i;e.assert(n>=0&&n<=i&&i<=t.length);var s=[];r(t,n,i,s);return s.join("")},splitString:function(e,t){var n=[];var i="";var r=0;var s=null;while(r0){n.push(i);i=""}continue}}if(r0){n.push(i)}if(s!==null){return null}return n},checkQuote:function(e,t){t=t===undefined?0:t;var n=e.charAt(t);if(n=='"'||n=="'"){t++;var i=e.length;var r;while(t=32&&e<=126)){t.push("\\");var i=e.toString(8);for(var r=i.length;r<3;r++){t.push("0")}t.push(i)}else{var s=String.fromCharCode(e);if(n!==null&&n.indexOf(s)!==-1){t.push("\\");t.push(s)}else{t.push(s)}}}}}function n(e,t){var n=e.charCodeAt(t);if(!(n>=32&&n<=126)){var i;if(t>0){i="character after `"+e.substring(0,t)+"'"}else{i="first character"}i+=" is not a printable ASCII character (ordinal "+n+")";throw new Error(i)}return n}function i(t,i,r,s){e.assert(i>=0);e.assert(r<=t.length);if(i>=r){throw new Error("EOF while decoding string")}var o;if(t.charAt(i)!="\\"){o=n(t,i++)}else{if(i+1==r){throw new Error("trailing backslash")}switch(t.charAt(++i)){case"\\":case"'":case'"':{o=t.charCodeAt(i++);break}case"b":{++i;o="\b".charCodeAt(0);break}case"f":{++i;o="\f".charCodeAt(0);break}case"n":{++i;o="\n".charCodeAt(0);break}case"r":{++i;o="\r".charCodeAt(0);break}case"t":{++i;o="\t".charCodeAt(0);break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{var c="01234567";var a=0;for(var u=0;u<3&&i255){var h="octal value \\"+a.toString(8)+" ("+a+") is out of range";throw new Error(h)}o=a;break}default:{o=n(t,i++);break}}}s.value=i;return o}function r(e,t,n,r){var s={value:0},o,c,a;while(t191&&o<224){c=i(e,t,n,s);t=s.value;r.push(String.fromCharCode((o&31)<<6|c&63))}else{c=i(e,t,n,s);t=s.value;a=i(e,t,n,s);t=s.value;r.push(String.fromCharCode((o&15)<<12|(c&63)<<6|a&63))}}}})();(function(){var e=Ice.__M;var t=Ice.StringUtil;function n(e,t,n,i,r){for(var s=e._table[r];s!==null;s=s._nextInBucket){if(s._hash===i&&e.keysEqual(t,s._key)){s._value=n;return undefined}}e.add(t,n,i,r);return undefined}function i(e,t){if(e===t){return true}if(e===undefined||e===null||t===undefined||t===null){return false}return e.equals(t)}function r(e,t){return e===t}var s=Ice.Class({__init__:function(e,t){var n=arguments;var i,o,c;if(typeof e=="function"){o=e;c=t}else if(e instanceof s){i=e;o=i.keyComparator;c=i.valueComparator}this._size=0;this._head=null;this._initialCapacity=32;this._loadFactor=.75;this._table=[];this._keyComparator=typeof o=="function"?o:r;this._valueComparator=typeof c=="function"?c:r;var a,u;if(i instanceof s&&i._size>0){this._threshold=i._threshold;u=i._table.length;this._table.length=u;for(a=0;a=this._threshold){this.resize(this._table.length*2)}},resize:function(e){var t=this._table;var n=[];for(var i=0;i254?s*e+5:s*e+1);this.write(t,r)}};this.readOpt=function(e,t){var n;if(e.readOpt(t,i.VSize)){e.skipSize();n=this.read(e)}return n}};r.VSizeContainer1OptHelper=function(){this.writeOpt=function(e,t,n){if(n!==undefined&&e.writeOpt(t,i.VSize)){this.write(e,n)}};this.readOpt=function(e,t){var n;if(e.readOpt(t,i.VSize)){n=this.read(e)}return n}};var s=e({write:function(e,t){if(t===null||t.length===0){e.writeSize(0)}else{var n=this.elementHelper;e.writeSize(t.length);for(var i=0;i=0},ice_ping:function(e){},ice_ids:function(e){return this.__mostDerivedType().__ids},ice_id:function(e){return this.__mostDerivedType().__id},toString:function(){return"[object "+this.ice_id()+"]"},ice_preMarshal:function(){},ice_postUnmarshal:function(){},__write:function(e){e.startWriteObject(null);i(this,e,this.__mostDerivedType());e.endWriteObject()},__read:function(e){e.startReadObject();r(this,e,this.__mostDerivedType());e.endReadObject(false)},ice_instanceof:function(e){if(e){if(this instanceof e){return true}return this.__mostDerivedType().__instanceof(e)}return false},__mostDerivedType:function(){return n},equals:function(e){return this===e}});n.write=function(e,t){e.writeObject(t)};n.writeOpt=function(e,t,n){e.writeOptObject(t,n)};n.read=function(e){var t={value:null};e.readObject(function(e){t.value=e},n);return t};n.readOpt=function(e,t){var i={value:undefined};e.readOptObject(t,function(e){i.value=e},n);return i};n.ice_staticId=function(){return n.__id};n.__instanceof=function(e){if(e===this){return true}for(var t in this.__implements){if(this.__implements[t].__instanceof(e)){return true}}if(this.__parent){return this.__parent.__instanceof(e)}return false};n.__ids=["::Ice::Object"];n.__id=n.__ids[0];n.__compactId=-1;n.__preserved=false;var i=function(e,t,r){if(r===undefined||r===n){return}t.startWriteSlice(r.__id,r.__compactId,r.__parent===n);if(r.prototype.__writeMemberImpl){r.prototype.__writeMemberImpl.call(e,t)}t.endWriteSlice();i(e,t,r.__parent)};var r=function(e,t,i){if(i===undefined||i===n){return}t.startReadSlice();if(i.prototype.__readMemberImpl){i.prototype.__readMemberImpl.call(e,t)}t.endReadSlice();r(e,t,i.__parent)};var s=function(e){e.startWriteObject(this.__slicedData);i(this,e,this.__mostDerivedType());e.endWriteObject()};var o=function(e){e.startReadObject();r(this,e,this.__mostDerivedType());this.__slicedData=e.endReadObject(true)};Ice.Object=n;var c=Ice.Slice;c.defineLocalObject=function(e,t){var n=e||function(){};if(t!==undefined){n.prototype=new t;n.__parent=t;n.prototype.constructor=e}return n};c.defineObject=function(e,t,i,r,c,a,u,l,h){var f=e||function(){};f.prototype=new t;f.__parent=t;f.__ids=c;f.__id=c[r];f.__compactId=a;f.__instanceof=n.__instanceof;f.__implements=i;f.write=function(e,t){e.writeObject(t)};f.writeOpt=function(e,t,n){e.writeOptObject(t,n)};f.read=function(e){var t={value:null};e.readObject(function(e){t.value=e},f);return t};f.readOpt=function(e,t){var n={value:undefined};e.readOptObject(t,function(e){n.value=e},f);return n};f.ice_staticId=function(){return c[r]};f.prototype.constructor=f;f.prototype.__mostDerivedType=function(){return f};if(h){f.prototype.__write=s;f.prototype.__read=o}f.prototype.__writeMemberImpl=u;f.prototype.__readMemberImpl=l;return f}})();(function(){var e=Ice.StringUtil;Ice.HashUtil={addBoolean:function(e,t){return(e<<5)+e^(t?0:1)},addString:function(t,n){if(n!==undefined&&n!==null){t=(t<<5)+t^e.hashCode(n)}return t},addNumber:function(e,t){return(e<<5)+e^t},addHashable:function(e,t){if(t!==undefined&&t!==null){e=(e<<5)+e^t.hashCode()}return e},addArray:function(e,t,n){if(t!==undefined&&t!==null){for(var i=0;ithis.capacity){this.reserve(e)}this._limit=e},clear:function(){this.b=null;this.v=null;this._position=0;this._limit=0},expand:function(e){var t=this.capacity===0?e:this._position+e;if(t>this._limit){this.resize(t)}},reset:function(){if(this._limit>0&&this._limit*22){this.reserve(this._limit);this._shrinkCounter=0}}else{this._shrinkCounter=0}this._limit=0;this._position=0},reserve:function(e){if(e>this.capacity){var t=Math.max(e,2*this.capacity);t=Math.max(1024,t);if(!this.b){this.b=new ArrayBuffer(t)}else{var n=new Uint8Array(t);n.set(new Uint8Array(this.b));this.b=n.buffer}this.v=new DataView(this.b)}else if(e=this._limit){throw new Error(i)}this.v.setUint8(e,t)},putArray:function(e){if(!(e instanceof Uint8Array)){throw new TypeError("argument is not a Uint8Array")}if(e.byteLength>0){if(this._position+e.length>this._limit){throw new Error(t)}new Uint8Array(this.b,0,this.b.byteLength).set(e,this._position);this._position+=e.byteLength}},putShort:function(e){if(this._position+2>this._limit){throw new Error(t)}this.v.setInt16(this._position,e,true);this._position+=2},putInt:function(e){if(this._position+4>this._limit){throw new Error(t)}this.v.setInt32(this._position,e,true);this._position+=4},putIntAt:function(e,t){if(e+4>this._limit||e<0){throw new Error(i)}this.v.setInt32(e,t,true)},putFloat:function(e){if(this._position+4>this._limit){throw new Error(t)}this.v.setFloat32(this._position,e,true);this._position+=4},putDouble:function(e){if(this._position+8>this._limit){throw new Error(t)}this.v.setFloat64(this._position,e,true);this._position+=8},putLong:function(e){if(this._position+8>this._limit){throw new Error(t)}this.v.setInt32(this._position,e.low,true);this._position+=4;this.v.setInt32(this._position,e.high,true);this._position+=4},writeString:function(e,t){var n=unescape(encodeURIComponent(t));e.writeSize(n.length);e.expand(n.length);this.putString(n,n.length)},putString:function(e,n){if(this._position+n>this._limit){throw new Error(t)}for(var i=0;i=this._limit){throw new Error(n)}var e=this.v.getUint8(this._position);this._position++;return e},getAt:function(e){if(e<0||e>=this._limit){throw new Error(i)}return this.v.getUint8(e)},getArray:function(e){if(this._position+e>this._limit){throw new Error(n)}var t=this.b.slice(this._position,this._position+e);this._position+=e;return new Uint8Array(t)},getArrayAt:function(e,t){if(e+t>this._limit){throw new Error(n)}t=t===undefined?this.b.byteLength-e:t;return new Uint8Array(this.b.slice(e,e+t)); +},getShort:function(){if(this._limit-this._position<2){throw new Error(n)}var e=this.v.getInt16(this._position,true);this._position+=2;return e},getInt:function(){if(this._limit-this._position<4){throw new Error(n)}var e=this.v.getInt32(this._position,true);this._position+=4;return e},getFloat:function(){if(this._limit-this._position<4){throw new Error(n)}var e=this.v.getFloat32(this._position,true);this._position+=4;return e},getDouble:function(){if(this._limit-this._position<8){throw new Error(n)}var e=this.v.getFloat64(this._position,true);this._position+=8;return e},getLong:function(){if(this._limit-this._position<8){throw new Error(n)}var t=new e;t.low=this.v.getUint32(this._position,true);this._position+=4;t.high=this.v.getUint32(this._position,true);this._position+=4;return t},getString:function(e){if(this._position+e>this._limit){throw new Error(n)}var t=new DataView(this.b,this._position,e);var i="";for(var r=0;r=0&&e<=this._limit){this._position=e}}});Object.defineProperty(s,"limit",{get:function(){return this._limit},set:function(e){if(e<=this.capacity){this._limit=e;if(this._position>e){this._position=e}}}});Object.defineProperty(s,"capacity",{get:function(){return this.b===null?0:this.b.byteLength}});Object.defineProperty(s,"remaining",{get:function(){return this._limit-this._position}});r.createNative=function(e){if(e===undefined){return new Uint8Array(0)}else{return new Uint8Array(e)}};Ice.Buffer=r})();(function(){var e=Ice.Buffer;var t={};var n="A".charCodeAt(0);var i="a".charCodeAt(0);var r="0".charCodeAt(0);t.encode=function(e){if(e===null||e.length===0){return""}var t=e.length*4/3+1;var n=t*2/76+1;var i=t+n;var r=[];var o;var c;var a;var u;var l;var h;var f;for(var d=0;d>2&255;l=((o&3)<<4|c>>4)&255;h=((c&15)<<2|a>>6)&255;f=a&63;r.push(s(u));r.push(s(l));if(d+176){_.push(p.substring(I,I+76));_.push("\r\n");I+=76}_.push(p.substring(I));return _.join("")};t.decode=function(n){var i=[];for(var r=0;r>4);if(_!="="){a.put((l&15)<<4|h>>2)}if(I!="="){a.put((h&3)<<6|f)}}return a.remaining>0?a.getArrayAt(0,a.position):a.getArrayAt(0)};t.isBase64=function(e){if(e>="A"&&e<="Z"){return true}if(e>="a"&&e<="z"){return true}if(e>="0"&&e<="9"){return true}if(e=="+"){return true}if(e=="/"){return true}if(e=="="){return true}return false};function s(e){if(e<26){return String.fromCharCode(n+e)}if(e<52){return String.fromCharCode(i+(e-26))}if(e<62){return String.fromCharCode(r+(e-52))}if(e==62){return"+"}return"/"}function o(e){if(e>="A"&&e<="Z"){return e.charCodeAt(0)-n}if(e>="a"&&e<="z"){return e.charCodeAt(0)-i+26}if(e>="0"&&e<="9"){return e.charCodeAt(0)-r+52}if(e=="+"){return 62}return 63}Ice.Base64=t})();(function(){Ice.Identity=t.defineStruct(function(e,t){this.name=e!==undefined?e:"";this.category=t!==undefined?t:""},true,function(e){e.writeString(this.name);e.writeString(this.category)},function(e){this.name=e.readString();this.category=e.readString()},2,false);t.defineDictionary(Ice,"ObjectDict","ObjectDictHelper","Ice.Identity","Ice.ObjectHelper",false,Ice.HashMap.compareEquals,"Ice.Object");t.defineSequence(Ice,"IdentitySeqHelper","Ice.Identity",false)})();(function(){})();(function(){Ice.ProtocolVersion=t.defineStruct(function(e,t){this.major=e!==undefined?e:0;this.minor=t!==undefined?t:0},true,function(e){e.writeByte(this.major);e.writeByte(this.minor)},function(e){this.major=e.readByte();this.minor=e.readByte()},2,true);Ice.EncodingVersion=t.defineStruct(function(e,t){this.major=e!==undefined?e:0;this.minor=t!==undefined?t:0},true,function(e){e.writeByte(this.major);e.writeByte(this.minor)},function(e){this.major=e.readByte();this.minor=e.readByte()},2,true)})();(function(){var e=function(){this.typeId="";this.compactId=-1;this.bytes=[];this.objects=[];this.hasOptionalMembers=false;this.isLastSlice=false};Ice.SliceInfo=e;var t=function(e){this.slices=e};Ice.SlicedData=t;var n=Ice.Class(Ice.Object,{__init__:function(e){this._unknownTypeId=e},getUnknownTypeId:function(){return this._unknownTypeId},__write:function(e){e.startWriteObject(this._slicedData);e.endWriteObject()},__read:function(e){e.startReadObject();this._slicedData=e.endReadObject(true)}});Ice.UnknownSlicedObject=n})();(function(){})();(function(){var e=Ice.HashMap;var t=Ice.Debug;var n=Ice.Class({__init__:function(){this._adapterEndpointsTable=new e;this._objectTable=new e(e.compareEquals)},clear:function(){this._adapterEndpointsTable.clear();this._objectTable.clear()},getAdapterEndpoints:function(e,t,n){if(t===0){n.value=false;return null}var i=this._adapterEndpointsTable.get(e);if(i!==undefined){n.value=this.checkTTL(i.time,t);return i.endpoints}n.value=false;return null},addAdapterEndpoints:function(e,t){this._adapterEndpointsTable.set(e,new i(Date.now(),t))},removeAdapterEndpoints:function(e){var t=this._adapterEndpointsTable.get(e);this._adapterEndpointsTable.delete(e);return t!==undefined?t.endpoints:null},getObjectReference:function(e,t,n){if(t===0){n.value=false;return null}var i=this._objectTable.get(e);if(i!==undefined){n.value=this.checkTTL(i.time,t);return i.reference}n.value=false;return null},addObjectReference:function(e,t){this._objectTable.set(e,new r(Date.now(),t))},removeObjectReference:function(e){var t=this._objectTable.get(e);this._objectTable.delete(e);return t!==undefined?t.reference:null},checkTTL:function(e,n){t.assert(n!==0);if(n<0){return true}else{return Date.now()-e<=n*1e3}}});Ice.LocatorTable=n;var i=function(e,t){this.time=e;this.endpoints=t};var r=function(e,t){this.time=e;this.reference=t}})();(function(){var e=Ice.Timer;var t={Pending:0,Success:1,Failed:2};var n=function(e,n){var i=e.__state===t.Success?n.onResponse:n.onException;try{if(typeof i!=="function"){n.promise.setState(e.__state,e._args)}else{var r=i.apply(null,e._args);if(r&&typeof r.then=="function"){r.then(function(){var e=arguments;n.promise.succeed.apply(n.promise,e)},function(){var e=arguments;n.promise.fail.apply(n.promise,e)})}else{n.promise.succeed(r)}}}catch(s){n.promise.fail.call(n.promise,s)}};var i=Ice.Class({__init__:function(){this.__state=t.Pending;this.__listeners=[]},then:function(t,n){var r=new i;var s=this;e.setImmediate(function(){s.__listeners.push({promise:r,onResponse:t,onException:n});s.resolve()});return r},exception:function(e){return this.then(null,e)},"finally":function(t){var n=new i;var r=this;var s=function(e){return function(){var i=arguments;try{var r=t.apply(null,i);if(r&&typeof r.then=="function"){var s=function(){e.apply(n,i)};r.then(s).exception(s)}else{e.apply(n,i)}}catch(o){e.apply(n,i)}}};e.setImmediate(function(){r.then(s(n.succeed),s(n.fail))});return n},delay:function(t){var n=new i;var r=this;var s=function(n,i){return function(){var r=arguments;e.setTimeout(function(){i.apply(n,r)},t)}};e.setImmediate(function(){r.then(s(n,n.succeed),s(n,n.fail))});return n},resolve:function(){if(this.__state===t.Pending){return}var e;while(e=this.__listeners.pop()){n(this,e)}},setState:function(n,i){if(this.__state===t.Pending&&n!==t.Pending){this.__state=n;this._args=i;var r=this;e.setImmediate(function(){r.resolve()})}},succeed:function(){var e=arguments;this.setState(t.Success,e);return this},fail:function(){var e=arguments;this.setState(t.Failed,e);return this},succeeded:function(){return this.__state===t.Success},failed:function(){return this.__state===t.Failed},completed:function(){return this.__state!==t.Pending}});i.all=function(){if(arguments.length===1&&arguments[0]instanceof Array){return i.all.apply(this,arguments[0])}var e=new i;var t=Array.prototype.slice.call(arguments);var n=new Array(arguments.length);var r=t.length;if(r===0){e.succeed.apply(e,n)}for(var s=0;s1){var t=new i;var n=Array.prototype.slice.call(arguments);e=n.pop();return t.succeed.apply(t,n).delay(e)}else{return(new i).succeed().delay(e)}};Ice.Promise=i})();(function(){var e=Ice.Class({__init__:function(e){if(e!==undefined&&e.length>0){this._prefix=e+": "}else{this._prefix=""}this._dateformat={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric",hour12:false}},print:function(e){this.write(e,false)},trace:function(e,t){var n=[];var i=new Date;n.push("-- ");n.push(this.timestamp());n.push(" ");n.push(this._prefix);n.push(e);n.push(": ");n.push(t);this.write(n.join(""),true)},warning:function(e){var t=[];var n=new Date;t.push("-! ");t.push(this.timestamp());t.push(" ");t.push(this._prefix);t.push("warning: ");t.push(e);this.write(t.join(""),true)},error:function(e){var t=[];var n=new Date;t.push("!! ");t.push(this.timestamp());t.push(" ");t.push(this._prefix);t.push("error: ");t.push(e);this.write(t.join(""),true)},cloneWithPrefix:function(t){return new e(t)},write:function(e,t){if(t){e=e.replace(/\n/g,"\n ")}console.log(e)},timestamp:function(){var e=new Date;return e.toLocaleString("en-US",this._dateformat)+"."+e.getMilliseconds()}});Ice.Logger=e})();(function(){Ice.InitializationException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::InitializationException");Ice.PluginInitializationException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::PluginInitializationException");Ice.CollocationOptimizationException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CollocationOptimizationException");Ice.AlreadyRegisteredException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.kindOfObject=e!==undefined?e:"";this.id=t!==undefined?t:""},Ice.LocalException,"Ice::AlreadyRegisteredException");Ice.NotRegisteredException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.kindOfObject=e!==undefined?e:"";this.id=t!==undefined?t:""},Ice.LocalException,"Ice::NotRegisteredException");Ice.TwowayOnlyException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.operation=e!==undefined?e:""},Ice.LocalException,"Ice::TwowayOnlyException");Ice.CloneNotImplementedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CloneNotImplementedException");Ice.UnknownException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.unknown=e!==undefined?e:""},Ice.LocalException,"Ice::UnknownException");Ice.UnknownLocalException=t.defineLocalException(function(e,t){Ice.UnknownException.call(this,e,t)},Ice.UnknownException,"Ice::UnknownLocalException");Ice.UnknownUserException=t.defineLocalException(function(e,t){Ice.UnknownException.call(this,e,t)},Ice.UnknownException,"Ice::UnknownUserException");Ice.VersionMismatchException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::VersionMismatchException");Ice.CommunicatorDestroyedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::CommunicatorDestroyedException");Ice.ObjectAdapterDeactivatedException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.name=e!==undefined?e:""},Ice.LocalException,"Ice::ObjectAdapterDeactivatedException");Ice.ObjectAdapterIdInUseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.id=e!==undefined?e:""},Ice.LocalException,"Ice::ObjectAdapterIdInUseException");Ice.NoEndpointException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.proxy=e!==undefined?e:""},Ice.LocalException,"Ice::NoEndpointException");Ice.EndpointParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::EndpointParseException");Ice.EndpointSelectionTypeParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::EndpointSelectionTypeParseException");Ice.VersionParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::VersionParseException");Ice.IdentityParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::IdentityParseException");Ice.ProxyParseException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.str=e!==undefined?e:""},Ice.LocalException,"Ice::ProxyParseException");Ice.IllegalIdentityException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.id=e!==undefined?e:new Ice.Identity},Ice.LocalException,"Ice::IllegalIdentityException");Ice.IllegalServantException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::IllegalServantException");Ice.RequestFailedException=t.defineLocalException(function(e,t,n,i){Ice.LocalException.call(this,i);this.id=e!==undefined?e:new Ice.Identity;this.facet=t!==undefined?t:"";this.operation=n!==undefined?n:""},Ice.LocalException,"Ice::RequestFailedException");Ice.ObjectNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::ObjectNotExistException");Ice.FacetNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::FacetNotExistException");Ice.OperationNotExistException=t.defineLocalException(function(e,t,n,i){Ice.RequestFailedException.call(this,e,t,n,i)},Ice.RequestFailedException,"Ice::OperationNotExistException");Ice.SyscallException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.error=e!==undefined?e:0},Ice.LocalException,"Ice::SyscallException");Ice.SocketException=t.defineLocalException(function(e,t){Ice.SyscallException.call(this,e,t)},Ice.SyscallException,"Ice::SocketException");Ice.FileException=t.defineLocalException(function(e,t,n){Ice.SyscallException.call(this,e,n);this.path=t!==undefined?t:""},Ice.SyscallException,"Ice::FileException");Ice.ConnectFailedException=t.defineLocalException(function(e,t){Ice.SocketException.call(this,e,t)},Ice.SocketException,"Ice::ConnectFailedException");Ice.ConnectionRefusedException=t.defineLocalException(function(e,t){Ice.ConnectFailedException.call(this,e,t)},Ice.ConnectFailedException,"Ice::ConnectionRefusedException");Ice.ConnectionLostException=t.defineLocalException(function(e,t){Ice.SocketException.call(this,e,t)},Ice.SocketException,"Ice::ConnectionLostException");Ice.DNSException=t.defineLocalException(function(e,t,n){Ice.LocalException.call(this,n);this.error=e!==undefined?e:0;this.host=t!==undefined?t:""},Ice.LocalException,"Ice::DNSException");Ice.OperationInterruptedException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::OperationInterruptedException");Ice.TimeoutException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::TimeoutException");Ice.ConnectTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::ConnectTimeoutException");Ice.CloseTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::CloseTimeoutException");Ice.ConnectionTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::ConnectionTimeoutException");Ice.InvocationTimeoutException=t.defineLocalException(function(e){Ice.TimeoutException.call(this,e)},Ice.TimeoutException,"Ice::InvocationTimeoutException");Ice.InvocationCanceledException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::InvocationCanceledException");Ice.ProtocolException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::ProtocolException");Ice.BadMagicException=t.defineLocalException(function(e,t,n){Ice.ProtocolException.call(this,e,n);this.badMagic=t!==undefined?t:null},Ice.ProtocolException,"Ice::BadMagicException");Ice.UnsupportedProtocolException=t.defineLocalException(function(e,t,n,i){Ice.ProtocolException.call(this,e,i);this.bad=t!==undefined?t:new Ice.ProtocolVersion;this.supported=n!==undefined?n:new Ice.ProtocolVersion},Ice.ProtocolException,"Ice::UnsupportedProtocolException");Ice.UnsupportedEncodingException=t.defineLocalException(function(e,t,n,i){Ice.ProtocolException.call(this,e,i);this.bad=t!==undefined?t:new Ice.EncodingVersion;this.supported=n!==undefined?n:new Ice.EncodingVersion},Ice.ProtocolException,"Ice::UnsupportedEncodingException");Ice.UnknownMessageException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownMessageException");Ice.ConnectionNotValidatedException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::ConnectionNotValidatedException");Ice.UnknownRequestIdException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownRequestIdException");Ice.UnknownReplyStatusException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::UnknownReplyStatusException");Ice.CloseConnectionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::CloseConnectionException");Ice.ForcedCloseConnectionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::ForcedCloseConnectionException");Ice.IllegalMessageSizeException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::IllegalMessageSizeException");Ice.CompressionException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::CompressionException");Ice.DatagramLimitException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::DatagramLimitException");Ice.MarshalException=t.defineLocalException(function(e,t){Ice.ProtocolException.call(this,e,t)},Ice.ProtocolException,"Ice::MarshalException");Ice.ProxyUnmarshalException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::ProxyUnmarshalException");Ice.UnmarshalOutOfBoundsException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::UnmarshalOutOfBoundsException");Ice.NoObjectFactoryException=t.defineLocalException(function(e,t,n){Ice.MarshalException.call(this,e,n);this.type=t!==undefined?t:""},Ice.MarshalException,"Ice::NoObjectFactoryException");Ice.UnexpectedObjectException=t.defineLocalException(function(e,t,n,i){Ice.MarshalException.call(this,e,i);this.type=t!==undefined?t:"";this.expectedType=n!==undefined?n:""},Ice.MarshalException,"Ice::UnexpectedObjectException");Ice.MemoryLimitException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::MemoryLimitException");Ice.StringConversionException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::StringConversionException");Ice.EncapsulationException=t.defineLocalException(function(e,t){Ice.MarshalException.call(this,e,t)},Ice.MarshalException,"Ice::EncapsulationException");Ice.FeatureNotSupportedException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.unsupportedFeature=e!==undefined?e:""},Ice.LocalException,"Ice::FeatureNotSupportedException");Ice.SecurityException=t.defineLocalException(function(e,t){Ice.LocalException.call(this,t);this.reason=e!==undefined?e:""},Ice.LocalException,"Ice::SecurityException");Ice.FixedProxyException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::FixedProxyException");Ice.ResponseSentException=t.defineLocalException(function(e){Ice.LocalException.call(this,e)},Ice.LocalException,"Ice::ResponseSentException")})();(function(){var e=Ice.StringUtil;var t={};Ice.Encoding_1_0=new Ice.EncodingVersion(1,0);Ice.Encoding_1_1=new Ice.EncodingVersion(1,1);Ice.Protocol_1_0=new Ice.ProtocolVersion(1,0);t.headerSize=14;t.magic=Ice.Buffer.createNative([73,99,101,80]);t.protocolMajor=1;t.protocolMinor=0;t.protocolEncodingMajor=1;t.protocolEncodingMinor=0;t.encodingMajor=1;t.encodingMinor=1;t.requestMsg=0;t.requestBatchMsg=1;t.replyMsg=2;t.validateConnectionMsg=3;t.closeConnectionMsg=4;t.replyOK=0;t.replyUserException=1;t.replyObjectNotExist=2;t.replyFacetNotExist=3;t.replyOperationNotExist=4;t.replyUnknownLocalException=5;t.replyUnknownUserException=6;t.replyUnknownException=7;t.requestHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.requestMsg,0,0,0,0,0,0,0,0,0]);t.requestBatchHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.requestBatchMsg,0,0,0,0,0,0,0,0,0]);t.replyHdr=Ice.Buffer.createNative([t.magic[0],t.magic[1],t.magic[2],t.magic[3],t.protocolMajor,t.protocolMinor,t.protocolEncodingMajor,t.protocolEncodingMinor,t.replyMsg,0,0,0,0,0]);t.currentProtocol=new Ice.ProtocolVersion(t.protocolMajor,t.protocolMinor);t.currentProtocolEncoding=new Ice.EncodingVersion(t.protocolEncodingMajor,t.protocolEncodingMinor);t.currentEncoding=new Ice.EncodingVersion(t.encodingMajor,t.encodingMinor);t.checkSupportedProtocol=function(e){if(e.major!==t.currentProtocol.major||e.minor>t.currentProtocol.minor){throw new Ice.UnsupportedProtocolException("",e,t.currentProtocol)}};t.checkSupportedProtocolEncoding=function(e){if(e.major!==t.currentProtocolEncoding.major||e.minor>t.currentProtocolEncoding.minor){throw new Ice.UnsupportedEncodingException("",e,t.currentProtocolEncoding)}};t.checkSupportedEncoding=function(e){if(e.major!==t.currentEncoding.major||e.minor>t.currentEncoding.minor){throw new Ice.UnsupportedEncodingException("",e,t.currentEncoding)}};t.getCompatibleProtocol=function(e){if(e.major!==t.currentProtocol.major){return e}else if(e.minor255){throw new Ice.VersionParseException("range error in version `"+t+"'")}return r}function i(t){var n=t.indexOf(".");if(n===-1){throw new Ice.VersionParseException("malformed version value `"+t+"'")}var i=t.substring(n+1);var r;try{r=e.toInt(i)}catch(s){throw new Ice.VersionParseException("invalid version value `"+t+"'")}if(r<0||r>255){throw new Ice.VersionParseException("range error in version `"+t+"'")}return r}function r(e,t){return e+"."+t}})();(function(){var e=function t(e,n,i){this._pattern=e;this._deprecated=n;this._deprecatedBy=i};Object.defineProperty(e.prototype,"pattern",{get:function(){return this._pattern}});Object.defineProperty(e.prototype,"deprecated",{get:function(){return this._deprecated}});Object.defineProperty(e.prototype,"deprecatedBy",{get:function(){return this._deprecatedBy}});Ice.Property=e})();(function(){var e={};var t=Ice.Property;e.IceProps=[new t("/^Ice.ACM.Client/",true,null),new t("/^Ice.ACM.Server/",true,null),new t("/^Ice.ACM.Timeout/",false,null),new t("/^Ice.ACM.Heartbeat/",false,null),new t("/^Ice.ACM.Close/",false,null),new t("/^Ice.ACM/",false,null),new t("/^Ice.ACM.Client.Timeout/",false,null),new t("/^Ice.ACM.Client.Heartbeat/",false,null),new t("/^Ice.ACM.Client.Close/",false,null),new t("/^Ice.ACM.Client/",false,null),new t("/^Ice.ACM.Server.Timeout/",false,null),new t("/^Ice.ACM.Server.Heartbeat/",false,null),new t("/^Ice.ACM.Server.Close/",false,null),new t("/^Ice.ACM.Server/",false,null),new t("/^Ice.Admin.ACM.Timeout/",false,null),new t("/^Ice.Admin.ACM.Heartbeat/",false,null),new t("/^Ice.Admin.ACM.Close/",false,null),new t("/^Ice.Admin.ACM/",false,null),new t("/^Ice.Admin.AdapterId/",false,null),new t("/^Ice.Admin.Endpoints/",false,null),new t("/^Ice.Admin.Locator.EndpointSelection/",false,null),new t("/^Ice.Admin.Locator.ConnectionCached/",false,null),new t("/^Ice.Admin.Locator.PreferSecure/",false,null),new t("/^Ice.Admin.Locator.LocatorCacheTimeout/",false,null),new t("/^Ice.Admin.Locator.InvocationTimeout/",false,null),new t("/^Ice.Admin.Locator.Locator/",false,null),new t("/^Ice.Admin.Locator.Router/",false,null),new t("/^Ice.Admin.Locator.CollocationOptimized/",false,null),new t("/^Ice.Admin.Locator.Context../",false,null),new t("/^Ice.Admin.Locator/",false,null),new t("/^Ice.Admin.PublishedEndpoints/",false,null),new t("/^Ice.Admin.ReplicaGroupId/",false,null),new t("/^Ice.Admin.Router.EndpointSelection/",false,null),new t("/^Ice.Admin.Router.ConnectionCached/",false,null),new t("/^Ice.Admin.Router.PreferSecure/",false,null),new t("/^Ice.Admin.Router.LocatorCacheTimeout/",false,null),new t("/^Ice.Admin.Router.InvocationTimeout/",false,null),new t("/^Ice.Admin.Router.Locator/",false,null),new t("/^Ice.Admin.Router.Router/",false,null),new t("/^Ice.Admin.Router.CollocationOptimized/",false,null),new t("/^Ice.Admin.Router.Context../",false,null),new t("/^Ice.Admin.Router/",false,null),new t("/^Ice.Admin.ProxyOptions/",false,null),new t("/^Ice.Admin.ThreadPool.Size/",false,null),new t("/^Ice.Admin.ThreadPool.SizeMax/",false,null),new t("/^Ice.Admin.ThreadPool.SizeWarn/",false,null),new t("/^Ice.Admin.ThreadPool.StackSize/",false,null),new t("/^Ice.Admin.ThreadPool.Serialize/",false,null),new t("/^Ice.Admin.ThreadPool.ThreadIdleTime/",false,null),new t("/^Ice.Admin.ThreadPool.ThreadPriority/",false,null),new t("/^Ice.Admin.MessageSizeMax/",false,null),new t("/^Ice.Admin.DelayCreation/",false,null),new t("/^Ice.Admin.Enabled/",false,null),new t("/^Ice.Admin.Facets/",false,null),new t("/^Ice.Admin.InstanceName/",false,null),new t("/^Ice.Admin.Logger.KeepLogs/",false,null),new t("/^Ice.Admin.Logger.KeepTraces/",false,null),new t("/^Ice.Admin.Logger.Properties/",false,null),new t("/^Ice.Admin.ServerId/",false,null),new t("/^Ice.BackgroundLocatorCacheUpdates/",false,null),new t("/^Ice.BatchAutoFlush/",true,null),new t("/^Ice.BatchAutoFlushSize/",false,null),new t("/^Ice.ChangeUser/",false,null),new t("/^Ice.ClassGraphDepthMax/",false,null),new t("/^Ice.ClientAccessPolicyProtocol/",false,null),new t("/^Ice.Compression.Level/",false,null),new t("/^Ice.CollectObjects/",false,null),new t("/^Ice.Config/",false,null),new t("/^Ice.ConsoleListener/",false,null),new t("/^Ice.Default.CollocationOptimized/",false,null),new t("/^Ice.Default.EncodingVersion/",false,null),new t("/^Ice.Default.EndpointSelection/",false,null),new t("/^Ice.Default.Host/",false,null),new t("/^Ice.Default.Locator.EndpointSelection/",false,null),new t("/^Ice.Default.Locator.ConnectionCached/",false,null),new t("/^Ice.Default.Locator.PreferSecure/",false,null),new t("/^Ice.Default.Locator.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.Locator.InvocationTimeout/",false,null),new t("/^Ice.Default.Locator.Locator/",false,null),new t("/^Ice.Default.Locator.Router/",false,null),new t("/^Ice.Default.Locator.CollocationOptimized/",false,null),new t("/^Ice.Default.Locator.Context../",false,null),new t("/^Ice.Default.Locator/",false,null),new t("/^Ice.Default.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.InvocationTimeout/",false,null),new t("/^Ice.Default.Package/",false,null),new t("/^Ice.Default.PreferSecure/",false,null),new t("/^Ice.Default.Protocol/",false,null),new t("/^Ice.Default.Router.EndpointSelection/",false,null),new t("/^Ice.Default.Router.ConnectionCached/",false,null),new t("/^Ice.Default.Router.PreferSecure/",false,null),new t("/^Ice.Default.Router.LocatorCacheTimeout/",false,null),new t("/^Ice.Default.Router.InvocationTimeout/",false,null),new t("/^Ice.Default.Router.Locator/",false,null),new t("/^Ice.Default.Router.Router/",false,null),new t("/^Ice.Default.Router.CollocationOptimized/",false,null),new t("/^Ice.Default.Router.Context../",false,null),new t("/^Ice.Default.Router/",false,null),new t("/^Ice.Default.SlicedFormat/",false,null),new t("/^Ice.Default.SourceAddress/",false,null),new t("/^Ice.Default.Timeout/",false,null),new t("/^Ice.EventLog.Source/",false,null),new t("/^Ice.FactoryAssemblies/",false,null),new t("/^Ice.HTTPProxyHost/",false,null),new t("/^Ice.HTTPProxyPort/",false,null),new t("/^Ice.ImplicitContext/",false,null),new t("/^Ice.InitPlugins/",false,null),new t("/^Ice.IPv4/",false,null),new t("/^Ice.IPv6/",false,null),new t("/^Ice.LogFile/",false,null),new t("/^Ice.LogFile.SizeMax/",false,null),new t("/^Ice.LogStdErr.Convert/",false,null),new t("/^Ice.MessageSizeMax/",false,null),new t("/^Ice.Nohup/",false,null),new t("/^Ice.NullHandleAbort/",false,null),new t("/^Ice.Override.CloseTimeout/",false,null),new t("/^Ice.Override.Compress/",false,null),new t("/^Ice.Override.ConnectTimeout/",false,null),new t("/^Ice.Override.Timeout/",false,null),new t("/^Ice.Override.Secure/",false,null),new t("/^Ice.Package../",false,null),new t("/^Ice.Plugin../",false,null),new t("/^Ice.PluginLoadOrder/",false,null),new t("/^Ice.PreferIPv6Address/",false,null),new t("/^Ice.PrintAdapterReady/",false,null),new t("/^Ice.PrintProcessId/",false,null),new t("/^Ice.PrintStackTraces/",false,null),new t("/^Ice.ProgramName/",false,null),new t("/^Ice.RetryIntervals/",false,null),new t("/^Ice.ServerIdleTime/",false,null),new t("/^Ice.SOCKSProxyHost/",false,null),new t("/^Ice.SOCKSProxyPort/",false,null),new t("/^Ice.StdErr/",false,null),new t("/^Ice.StdOut/",false,null),new t("/^Ice.SyslogFacility/",false,null),new t("/^Ice.ThreadPool.Client.Size/",false,null),new t("/^Ice.ThreadPool.Client.SizeMax/",false,null),new t("/^Ice.ThreadPool.Client.SizeWarn/",false,null),new t("/^Ice.ThreadPool.Client.StackSize/",false,null),new t("/^Ice.ThreadPool.Client.Serialize/",false,null),new t("/^Ice.ThreadPool.Client.ThreadIdleTime/",false,null),new t("/^Ice.ThreadPool.Client.ThreadPriority/",false,null),new t("/^Ice.ThreadPool.Server.Size/",false,null),new t("/^Ice.ThreadPool.Server.SizeMax/",false,null),new t("/^Ice.ThreadPool.Server.SizeWarn/",false,null),new t("/^Ice.ThreadPool.Server.StackSize/",false,null),new t("/^Ice.ThreadPool.Server.Serialize/",false,null),new t("/^Ice.ThreadPool.Server.ThreadIdleTime/",false,null),new t("/^Ice.ThreadPool.Server.ThreadPriority/",false,null),new t("/^Ice.ThreadPriority/",false,null),new t("/^Ice.Trace.Admin.Properties/",false,null),new t("/^Ice.Trace.Admin.Logger/",false,null),new t("/^Ice.Trace.Locator/",false,null),new t("/^Ice.Trace.Network/",false,null),new t("/^Ice.Trace.Protocol/",false,null),new t("/^Ice.Trace.Retry/",false,null),new t("/^Ice.Trace.Slicing/",false,null),new t("/^Ice.Trace.ThreadPool/",false,null),new t("/^Ice.UDP.RcvSize/",false,null),new t("/^Ice.UDP.SndSize/",false,null),new t("/^Ice.TCP.Backlog/",false,null),new t("/^Ice.TCP.RcvSize/",false,null),new t("/^Ice.TCP.SndSize/",false,null),new t("/^Ice.UseApplicationClassLoader/",false,null),new t("/^Ice.UseSyslog/",false,null),new t("/^Ice.Warn.AMICallback/",false,null),new t("/^Ice.Warn.Connections/",false,null),new t("/^Ice.Warn.Datagrams/",false,null),new t("/^Ice.Warn.Dispatch/",false,null),new t("/^Ice.Warn.Endpoints/",false,null),new t("/^Ice.Warn.UnknownProperties/",false,null),new t("/^Ice.Warn.UnusedProperties/",false,null),new t("/^Ice.CacheMessageBuffers/",false,null),new t("/^Ice.ThreadInterruptSafe/",false,null),new t("/^Ice.Voip/",false,null)]; +e.validProps=[e.IceProps];e.clPropNames=["Ice"];Ice.PropertyNames=e})();(function(){var e=Ice.HashMap;var t=Ice.AlreadyRegisteredException;var n=Ice.NotRegisteredException;var i=Ice.Class({__init__:function(){this._factoryMap=new e},add:function(e,n){var i,r;i=this._factoryMap.get(n);if(i!==undefined){r=new t;r.id=n;r.kindOfObject="object factory";throw r}this._factoryMap.set(n,e)},remove:function(e){var t,i;t=this._factoryMap.get(e);if(t===undefined){i=new n;i.id=e;i.kindOfObject="object factory";throw i}this._factoryMap.delete(e);t.destroy()},find:function(e){return this._factoryMap.get(e)},destroy:function(){var t=this._factoryMap,n=t.entries;this._factoryMap=new e;while(n!==null){n.value.destroy();n=n.next}}});Ice.ObjectFactoryManager=i})();(function(){var e=Ice.Promise;var t=Ice.Class(e,{__init__:function(t,n,i,r,s){e.call(this);if(t!==undefined){this._communicator=t;this._instance=t!==null?t.instance:null;this._operation=n;this._connection=i;this._proxy=r;this._adapter=s}}});var n=t.prototype;var i=Object.defineProperty;i(n,"communicator",{get:function(){return this._communicator}});i(n,"connection",{get:function(){return this._connection}});i(n,"proxy",{get:function(){return this._proxy}});i(n,"adapter",{get:function(){return this._adapter}});i(n,"operation",{get:function(){return this._operation}});Ice.AsyncResultBase=t})();(function(){t.defineDictionary(Ice,"Context","ContextHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.OperationMode=t.defineEnum([["Normal",0],["Nonmutating",1],["Idempotent",2]]);Ice.Current=t.defineStruct(function(e,t,n,i,r,s,o,c,a){this.adapter=e!==undefined?e:null;this.con=t!==undefined?t:null;this.id=n!==undefined?n:new Ice.Identity;this.facet=i!==undefined?i:"";this.operation=r!==undefined?r:"";this.mode=s!==undefined?s:Ice.OperationMode.Normal;this.ctx=o!==undefined?o:null;this.requestId=c!==undefined?c:0;this.encoding=a!==undefined?a:new Ice.EncodingVersion},false)})();(function(){Ice.ObjectFactory=Ice.Class({create:function(e){throw new Error("not implemented")},destroy:function(){throw new Error("not implemented")}})})();(function(){var e=Ice.Class(Error,{__init__:function(t){if(t instanceof Ice.LocalException){this._ex=t}else{Ice.Debug.assert(t instanceof e);this._ex=t._ex}}});var t=e.prototype;Object.defineProperty(t,"inner",{get:function(){return this._ex}});Ice.RetryException=e})();(function(){Ice.EndpointSelectionType=t.defineEnum([["Random",0],["Ordered",1]])})();(function(){var e=Ice.Promise;var t=Ice.ReferenceMode;var n=Ice.Class({__init__:function(e,n,i){this._reference=e;this._response=e.getMode()==t.ModeTwoway;this._connection=n;this._compress=i},update:function(e,t){try{if(e===this){return t}else if(e.getConnection()===this._connection){return t}}catch(n){}return this},sendAsyncRequest:function(e){return e.__invokeRemote(this._connection,this._compress,this._response)},asyncRequestCanceled:function(e){return this._connection.asyncRequestCanceled(e)},getReference:function(){return this._reference},getConnection:function(){return this._connection}});Ice.ConnectionRequestHandler=n})();(function(){var e=Ice.Debug;var t=Ice.HashMap;var n=Ice.Protocol;var i=Ice.StringUtil;var r=Ice.OperationMode;var s=Ice.Identity;var o={};o.traceSend=function(e,t,n){if(n.protocol>=1){var i=e.pos;e.pos=0;var r=[];var s=_(r,e);t.trace(n.protocolCat,"sending "+I(s)+" "+r.join(""));e.pos=i}};o.traceRecv=function(e,t,n){if(n.protocol>=1){var i=e.pos;e.pos=0;var r=[];var s=_(r,e);t.trace(n.protocolCat,"received "+I(s)+" "+r.join(""));e.pos=i}};o.trace=function(e,t,n,i){if(i.protocol>=1){var r=t.pos;t.pos=0;var s=[];s.push(e);_(s,t);n.trace(i.protocolCat,s.join(""));t.pos=r}};var c=new t;function a(e,t,n,i){if(!c.has(t)){var r="unknown "+e+" type `"+t+"'";i.trace(n,r);c.set(t,1)}}o.dumpStream=function(e){var t=e.pos;e.pos=0;var n=e.readBlob(e.size());o.dumpOctets(n);e.pos=t};o.dumpOctets=function(e){var t=8;var n=[];for(var i=0;i=32&&e[r]<127){n.push(String.fromCharCode(e[r]))}else{n.push(".")}}n.push('"\n')}console.log(n.join(""))};Ice.TraceUtil=o;function u(e,t){var n=new s;n.__read(t);e.push("\nidentity = "+t.instance.identityToString(n));var r=Ice.StringSeqHelper.read(t);e.push("\nfacet = ");if(r.length>0){e.push(i.escapeString(r[0],""))}var o=t.readString();e.push("\noperation = "+o)}function l(e,t){var n=t.readInt();e.push("\nrequest id = "+n);if(n===0){e.push(" (oneway)")}d(e,t)}function h(e,t){var n=t.readInt();e.push("\nnumber of requests = "+n);for(var i=0;i0){var s=t.readString();var o=t.readString();e.push(s+"/"+o);if(i>0){e.push(", ")}}var c=t.skipEncaps();if(!c.equals(Ice.Encoding_1_0)){e.push("\nencoding = ");e.push(Ice.encodingVersionToString(c))}}function p(e,t){t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();t.readByte();var n=t.readByte();e.push("\nmessage type = "+n+" ("+I(n)+")");var i=t.readByte();e.push("\ncompression status = "+i+" ");switch(i){case 0:{e.push("(not compressed; do not compress response, if any)");break}case 1:{e.push("(not compressed; compress response, if any)");break}case 2:{e.push("(compressed; compress response, if any)");break}default:{e.push("(unknown)");break}}var r=t.readInt();e.push("\nmessage size = "+r);return n}function _(e,t){var i=p(e,t);switch(i){case n.closeConnectionMsg:case n.validateConnectionMsg:{break}case n.requestMsg:{l(e,t);break}case n.requestBatchMsg:{h(e,t);break}case n.replyMsg:{f(e,t);break}default:{break}}return i}function I(e){switch(e){case n.requestMsg:return"request";case n.requestBatchMsg:return"batch request";case n.replyMsg:return"reply";case n.closeConnectionMsg:return"close connection";case n.validateConnectionMsg:return"validate connection";default:return"unknown"}}})();(function(){var e=Ice.Logger;var t=null;Ice.getProcessLogger=function(){if(t===null){t=new e("","")}return t};Ice.setProcessLogger=function(e){t=e}})();(function(){var e=Ice.UnexpectedObjectException;var t=Ice.MemoryLimitException;Ice.ExUtil={throwUOE:function(t,n){var i=n.ice_id();throw new e("expected element of type `"+t+"' but received '"+i,i,t)},throwMemoryLimitException:function(e,n){throw new t("requested "+e+" bytes, maximum allowed is "+n+" bytes (see Ice.MessageSizeMax)")}}})();(function(){var e=Ice.StringUtil;var t=Ice.HashMap;var n=Ice.Promise;var i=Ice.PropertyNames;var r=Ice.Debug;var s=Ice.ProcessLogger;var o=Ice.getProcessLogger;var c=Ice.InitializationException;var a=0;var u=1;var l=Ice.Class({__init__:function(e,n){this._properties=new t;if(n!==undefined&&n!==null){for(var i=n._properties.entries;i!==null;i=i.next){this._properties.set(i.key,{value:i.value.value,used:false})}}if(e!==undefined&&e!==null){var r=this.parseIceCommandLineOptions(e);e.length=0;for(var s=0;s0){var g=this._properties.get(e);if(g!==undefined){g.value=t}else{this._properties.set(e,{value:t,used:false})}}else{this._properties.delete(e)}},getCommandLineOptions:function(){var e=[];for(var t=this._properties.entries;t!==null;t=t.next){e.push("--"+t.key+"="+t.pv.value)}return e},parseCommandLineOptions:function(e,t){if(e.length>0&&e.charAt(e.length-1)!="."){e+="."}e="--"+e;var n=[];var i=this;t.forEach(function(t){if(t.indexOf(e)===0){if(t.indexOf("=")===-1){t+="=1"}i.parseLine(t.substring(2))}else{n.push(t)}});return n},parseIceCommandLineOptions:function(e){var t=e.slice();for(var n=0;n0){c.id+=" -f "+n.escapeString(s,"")}throw c}}o.set(s,i)},addDefaultServant:function(t,n){e.assert(this._instance!==null);var i=this._defaultServantMap.get(n);if(i!==undefined){var r=new Ice.AlreadyRegisteredException;r.kindOfObject="default servant";r.id=n;throw r}this._defaultServantMap.set(n,t)},removeServant:function(t,i){e.assert(this._instance!==null);if(i===null){i=""}var r=this._servantMapMap.get(t);if(r===undefined||!r.has(i)){var s=new Ice.NotRegisteredException;s.id=this._instance.identityToString(t);s.kindOfObject="servant";if(i.length>0){s.id+=" -f "+n.escapeString(i,"")}throw s}var o=r.get(i);r.delete(i);if(r.size===0){this._servantMapMap.delete(t)}return o},removeDefaultServant:function(t){e.assert(this._instance!==null);var n=this._defaultServantMap.get(t);if(n===undefined){var i=new Ice.NotRegisteredException;i.kindOfObject="default servant";i.id=t;throw i}this._defaultServantMap.delete(t);return n},removeAllFacets:function(t){e.assert(this._instance!==null);var n=this._servantMapMap.get(t);if(n===undefined){var i=new Ice.NotRegisteredException;i.id=this._instance.identityToString(t);i.kindOfObject="servant";throw i}this._servantMapMap.delete(t);return n},findServant:function(e,t){if(t===null){t=""}var n=this._servantMapMap.get(e);var i=null;if(n===undefined){i=this._defaultServantMap.get(e.category);if(i===undefined){i=this._defaultServantMap.get("")}}else{i=n.get(t)}return i===undefined?null:i},findDefaultServant:function(t){e.assert(this._instance!==null);var n=this._defaultServantMap.get(t);return n===undefined?null:n},findAllFacets:function(n){e.assert(this._instance!==null);var i=this._servantMapMap.get(n);if(i!==undefined){return i.clone()}return new t},hasServant:function(t){var n=this._servantMapMap.get(t);if(n===undefined){return false}else{e.assert(n.size>0);return true}},addServantLocator:function(t,i){e.assert(this._instance!==null);var r=this._locatorMap.get(i);if(r!==undefined){var s=new Ice.AlreadyRegisteredException;s.id=n.escapeString(i,"");s.kindOfObject="servant locator";throw s}this._locatorMap.set(i,t)},removeServantLocator:function(t){e.assert(this._instance!==null);var i=this._locatorMap.get(t);if(i===undefined){var r=new Ice.NotRegisteredException;r.id=n.escapeString(t,"");r.kindOfObject="servant locator";throw r}this._locatorMap.delete(t);return i},findServantLocator:function(e){var t=this._locatorMap.get(e);return t===undefined?null:t},destroy:function(){e.assert(this._instance!==null);var t=this._instance.initializationData().logger;this._servantMapMap.clear();this._defaultServantMap.clear();var n=this._locatorMap.clone();this._locatorMap.clear();this._instance=null;for(var i=n.entries;i!==null;i=i.next){var r=i.value;try{r.deactivate(i.key)}catch(s){var o="exception during locator deactivation:\n"+"object adapter: `"+this._adapterName+"'\n"+"locator category: `"+i.key+"'\n"+s.toString();t.error(o)}}}});Ice.ServantManager=i})();(function(){var e=Ice.__M;var t=Ice.Debug;var n=Ice.ExUtil;var i=Ice.FormatType;var r=Ice.HashMap;var s=Ice.Object;var o=Ice.OptionalFormat;var c=Ice.Protocol;var a=Ice.TraceUtil;var u=Ice.ArrayUtil;var l=Ice.SlicedData;var h={};h.NoSlice=0;h.ObjectSlice=1;h.ExceptionSlice=2;var f=255;var d=1<<0;var p=1<<1;var _=1<<1|1<<0;var I=1<<2;var g=1<<3;var v=1<<4;var m=1<<5;Number.isNaN=Number.isNaN||function(e){return typeof e==="number"&&isNaN(e)};var y=function(e,t){this.index=e;this.patcher=t};var w=Ice.Class;var E=w({__init__:function(e,t,n,i){this._stream=e;this._encaps=t;this._sliceObjects=n;this._servantFactoryManager=i;this._patchMap=null;this._unmarshaledMap=new r;this._typeIdMap=null;this._typeIdIndex=0;this._objectList=null},readOpt:function(){return false},readPendingObjects:function(){},readTypeId:function(e){var t,n;if(this._typeIdMap===null){this._typeIdMap=new r}if(e){n=this._stream.readSize();t=this._typeIdMap.get(n);if(t===undefined){throw new Ice.UnmarshalOutOfBoundsException}}else{t=this._stream.readString();this._typeIdMap.set(++this._typeIdIndex,t)}return t},newInstance:function(e){var t=this._servantFactoryManager.find(e);var n=null;if(t!==undefined){n=t.create(e)}if(n===null||n===undefined){t=this._servantFactoryManager.find("");if(t!==undefined){n=t.create(e)}}if(n===null||n===undefined){n=this._stream.createObject(e)}return n},addPatchEntry:function(e,n){t.assert(e>0);var i=this._unmarshaledMap.get(e);if(i!==undefined&&i!==null){n.call(null,i);return}if(this._patchMap===null){this._patchMap=new r}var s=this._patchMap.get(e);if(s===undefined){s=[];this._patchMap.set(e,s)}s.push(n)},unmarshal:function(e,n){var i,r,s;this._unmarshaledMap.set(e,n);n.__read(this._stream);if(this._patchMap!==null){s=this._patchMap.get(e);if(s!==undefined){t.assert(s.length>0);for(i=0,r=s.length;i0){throw new Ice.MarshalException("invalid object id")}n=-n;if(n===0){e.call(null,null)}else{this.addPatchEntry(n,e)}},throwException:function(){t.assert(this._sliceType===h.NoSlice);var e=this._stream.readBool();this._sliceType=h.ExceptionSlice;this._skipFirstSlice=false;this.startSlice();var n=this._typeId;while(true){var i=this._stream.createUserException(this._typeId);if(i!==null){i.__read(this._stream);if(e){this.readPendingObjects()}throw i}this.skipSlice();try{this.startSlice()}catch(r){if(r instanceof Ice.UnmarshalOutOfBoundsException){r.reason="unknown exception type `"+n+"'"}throw r}}},startInstance:function(e){t.assert(this._sliceType===e);this._skipFirstSlice=true},endInstance:function(){var e;if(this._sliceType===h.ObjectSlice){this.startSlice();e=this._stream.readSize();if(e!==0){throw new Ice.MarshalException("invalid Object slice")}this.endSlice()}this._sliceType=h.NoSlice;return null},startSlice:function(){var e;if(this._skipFirstSlice){this._skipFirstSlice=false;return this._typeId}if(this._sliceType===h.ObjectSlice){e=this._stream.readBool();this._typeId=this.readTypeId(e)}else{this._typeId=this._stream.readString()}this._sliceSize=this._stream.readInt();if(this._sliceSize<4){throw new Ice.UnmarshalOutOfBoundsException}return this._typeId},endSlice:function(){},skipSlice:function(){if(this._stream.instance.traceLevels().slicing>0){var e=this._stream.instance.initializationData().logger;if(this._sliceType===h.ObjectSlice){a.traceSlicing("object",this._typeId,this._stream.instance.traceLevels().slicingCat,e)}else{a.traceSlicing("exception",this._typeId,this._stream.instance.traceLevels().slicingCat,e)}}t.assert(this._sliceSize>=4);this._stream.skip(this._sliceSize-4)},readPendingObjects:function(){var e,t;do{t=this._stream.readSize();for(e=t;e>0;--e){this.readInstance()}}while(t>0);if(this._patchMap!==null&&this._patchMap.size!==0){throw new Ice.MarshalException("index for class received, but no instance")}},readInstance:function(){var e=this._stream.readInt(),t,n=null;if(e<=0){throw new Ice.MarshalException("invalid object id")}this._sliceType=h.ObjectSlice;this._skipFirstSlice=false;this.startSlice();t=this._typeId;while(true){if(this._typeId==s.ice_staticId()){throw new Ice.NoObjectFactoryException("",t)}n=this.newInstance(this._typeId);if(n){break}if(!this._sliceObjects){throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled",this._typeId)}this.skipSlice();this.startSlice()}this.unmarshal(e,n)}});var S=w(E,{__init__:function(e,t,n,i){E.call(this,e,t,n,i);this._current=null;this._objectIdIndex=1},readObject:function(e){t.assert(e!==undefined);var n=this._stream.readSize();if(n<0){throw new Ice.MarshalException("invalid object id")}if(n===0){if(e!==null){e.call(null,null)}}else if(this._current!==null&&(this._current.sliceFlags&g)!==0){if(e!==null){if(this._current.indirectPatchList===null){this._current.indirectPatchList=[]}var i=new y;i.index=n-1;i.patcher=e;this._current.indirectPatchList.push(i)}}else{this.readInstance(n,e)}},throwException:function(){t.assert(this._current===null);this.push(h.ExceptionSlice);this.startSlice();var e=this._current.typeId;while(true){var n=this._stream.createUserException(this._current.typeId);if(n!==null){n.__read(this._stream);throw n}this.skipSlice();if((this._current.sliceFlags&m)!==0){if(e.indexOf("::")===0){throw new Ice.UnknownUserException(e.substr(2))}throw new Ice.UnknownUserException(e)}this.startSlice()}},startInstance:function(e){t.assert(e!==undefined);t.assert(this._current.sliceType!==null&&this._current.sliceType===e);this._current.skipFirstSlice=true},endInstance:function(e){var t=null;if(e){t=this.readSlicedData()}if(this._current.slices!==null){this._current.slices.length=0;this._current.indirectionTables.length=0}this._current=this._current.previous;return t},startSlice:function(){if(this._current.skipFirstSlice){this._current.skipFirstSlice=false;return this._current.typeId}this._current.sliceFlags=this._stream.readByte();if(this._current.sliceType===h.ObjectSlice){if((this._current.sliceFlags&_)===_){this._current.typeId="";this._current.compactId=this._stream.readSize()}else if((this._current.sliceFlags&(p|d))!==0){this._current.typeId=this.readTypeId((this._current.sliceFlags&p)!==0);this._current.compactId=-1}else{this._current.typeId="";this._current.compactId=-1}}else{this._current.typeId=this._stream.readString();this._current.compactId=-1}if((this._current.sliceFlags&v)!==0){this._current.sliceSize=this._stream.readInt();if(this._current.sliceSize<4){throw new Ice.UnmarshalOutOfBoundsException}}else{this._current.sliceSize=0}return this._current.typeId},endSlice:function(){var e,n,i=[],r;if((this._current.sliceFlags&I)!==0){this._stream.skipOpts()}if((this._current.sliceFlags&g)!==0){r=this._stream.readAndCheckSeqSize(1);for(n=0;n=0);if(e.index>=i.length){throw new Ice.MarshalException("indirection out of range")}this.addPatchEntry(i[e.index],e.patcher)}this._current.indirectPatchList.length=0}}},skipSlice:function(){if(this._stream.instance.traceLevels().slicing>0){var e=this._stream.instance.initializationData().logger;var n=this._stream.instance.traceLevels().slicingCat;if(this._current.sliceType===h.ExceptionSlice){a.traceSlicing("exception",this._current.typeId,n,e)}else{a.traceSlicing("object",this._current.typeId,n,e)}}var i=this._stream.pos;if((this._current.sliceFlags&v)!==0){t.assert(this._current.sliceSize>=4);this._stream.skip(this._current.sliceSize-4)}else{if(this._current.sliceType===h.ObjectSlice){throw new Ice.NoObjectFactoryException("no object factory found and compact format prevents slicing "+"(the sender should use the sliced format instead)",this._current.typeId)}if(this._current.typeId.indexOf("::")===0){throw new Ice.UnknownUserException(this._current.typeId.substring(2))}throw new Ice.UnknownUserException(this._current.typeId)}var r=new Ice.SliceInfo;r.typeId=this._current.typeId;r.compactId=this._current.compactId;r.hasOptionalMembers=(this._current.sliceFlags&I)!==0;r.isLastSlice=(this._current.sliceFlags&m)!==0;var s=this._stream._buf;var o=s.position;var c=o;if(r.hasOptionalMembers){--c}s.position=i;r.bytes=s.getArray(c-i);s.position=o;if(this._current.slices===null){this._current.slices=[];this._current.indirectionTables=[]}if((this._current.sliceFlags&g)!==0){var u=this._stream.readAndCheckSeqSize(1);var l=[];for(var f=0;f0);var i,r=null;if(e>1){if(n!==null){this.addPatchEntry(e,n)}return e}this.push(h.ObjectSlice);e=++this._objectIdIndex;this.startSlice();i=this._current.typeId;while(true){if(this._current.compactId>=0){this._current.typeId="";if(this._current.typeId.length===0){this._current.typeId=this._stream.getTypeId(this._current.compactId)}}if(this._current.typeId.length>0){r=this.newInstance(this._current.typeId);if(r!==null&&r!==undefined){break}}if(!this._sliceObjects){throw new Ice.NoObjectFactoryException("no object factory found and object slicing is disabled",this._current.typeId)}this.skipSlice();if((this._current.sliceFlags&m)!==0){r=new Ice.UnknownSlicedObject(i);break}this.startSlice()}this.unmarshal(e,r);if(this._current===null&&this._patchMap!==null&&this._patchMap.size!==0){throw new Ice.MarshalException("index for class received, but no instance")}if(n!==null){n.call(null,r)}return e},readSlicedData:function(){var e,n,i,r,o,c;if(this._current.slices===null){return null}t.assert(this._current.slices.length===this._current.indirectionTables.length);for(e=0,n=this._current.slices.length;e0){this._marshaledMap.merge(this._toBeMarshaledMap);n=this._toBeMarshaledMap;this._toBeMarshaledMap=new r;this._stream.writeSize(n.size);n.forEach(t)}this._stream.writeSize(0)},registerObject:function(e){t.assert(e!==null);var n=this._toBeMarshaledMap.get(e);if(n!==undefined){return n}n=this._marshaledMap.get(e);if(n!==undefined){return n}this._toBeMarshaledMap.set(e,++this._objectIdIndex);return this._objectIdIndex}});var M=w(C,{__init__:function(e,t){C.call(this,e,t);this._current=null;this._objectIdIndex=1},writeObject:function(e){t.assert(e!==undefined);var n,s;if(e===null){this._stream.writeSize(0)}else if(this._current!==null&&this._encaps.format===i.SlicedFormat){if(this._current.indirectionTable===null){this._current.indirectionTable=[];this._current.indirectionMap=new r}n=this._current.indirectionMap.get(e);if(n===undefined){this._current.indirectionTable.push(e);s=this._current.indirectionTable.length;this._current.indirectionMap.set(e,s);this._stream.writeSize(s)}else{this._stream.writeSize(n)}}else{this.writeInstance(e)}},writePendingObjects:function(){return undefined},writeUserException:function(e){t.assert(e!==null&&e!==undefined);e.__write(this._stream)},startInstance:function(e,t){if(this._current===null){this._current=new M.InstanceData(null)}else{this._current=this._current.next===null?new M.InstanceData(this._current):this._current.next}this._current.sliceType=e;this._current.firstSlice=true;if(t!==null&&t!==undefined){this.writeSlicedData(t)}},endInstance:function(){this._current=this._current.previous},startSlice:function(e,n,r){t.assert((this._current.indirectionTable===null||this._current.indirectionTable.length===0)&&(this._current.indirectionMap===null||this._current.indirectionMap.size===0));this._current.sliceFlagsPos=this._stream.pos;this._current.sliceFlags=0;if(this._encaps.format===i.SlicedFormat){this._current.sliceFlags|=v}if(r){this._current.sliceFlags|=m}this._stream.writeByte(0);if(this._current.sliceType===h.ObjectSlice){if(this._encaps.format===i.SlicedFormat||this._current.firstSlice){if(n>=0){this._current.sliceFlags|=_;this._stream.writeSize(n)}else{var s=this.registerTypeId(e);if(s<0){this._current.sliceFlags|=d;this._stream.writeString(e)}else{this._current.sliceFlags|=p;this._stream.writeSize(s)}}}}else{this._stream.writeString(e)}if((this._current.sliceFlags&v)!==0){ +this._stream.writeInt(0)}this._current.writeSlice=this._stream.pos;this._current.firstSlice=false},endSlice:function(){var e,n,r;if((this._current.sliceFlags&I)!==0){this._stream.writeByte(f)}if((this._current.sliceFlags&v)!==0){e=this._stream.pos-this._current.writeSlice+4;this._stream.rewriteInt(e,this._current.writeSlice-4)}if(this._current.indirectionTable!==null&&this._current.indirectionTable.length!==0){t.assert(this._encaps.format===i.SlicedFormat);this._current.sliceFlags|=g;this._stream.writeSize(this._current.indirectionTable.length);for(n=0,r=this._current.indirectionTable.length;n0){if(this._current.indirectionTable===null){this._current.indirectionTable=[];this._current.indirectionMap=new r}for(c=0,a=o.objects.length;cthis._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}this._readEncapsStack.sz=t;var n=new Ice.EncodingVersion;n.__read(this);c.checkSupportedEncoding(n);this._readEncapsStack.setEncoding(n);return n},endReadEncaps:function(){t.assert(this._readEncapsStack!==null);if(!this._readEncapsStack.encoding_1_0){this.skipOpts();if(this._buf.position!==this._readEncapsStack.start+this._readEncapsStack.sz){throw new Ice.EncapsulationException}}else if(this._buf.position!==this._readEncapsStack.start+this._readEncapsStack.sz){if(this._buf.position+1!==this._readEncapsStack.start+this._readEncapsStack.sz){throw new Ice.EncapsulationException}try{this._buf.get()}catch(e){throw new Ice.UnmarshalOutOfBoundsException}}var n=this._readEncapsStack;this._readEncapsStack=n.next;n.next=this._readEncapsCache;this._readEncapsCache=n;this._readEncapsCache.reset()},skipEmptyEncaps:function(){var e=this.readInt();if(e<6){throw new Ice.EncapsulationException}if(e-4>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}var t=new Ice.EncodingVersion;t.__read(this);if(t.equals(Ice.Encoding_1_0)){if(e!=6){throw new Ice.EncapsulationException}}else{this._buf.position=this._buf.position+e-6}return t},endReadEncapsChecked:function(){if(this._readEncapsStack===null){throw new Ice.EncapsulationException("not in an encapsulation")}this.endReadEncaps()},readEncaps:function(e){t.assert(e!==undefined);var n=this.readInt();if(n<6){throw new Ice.UnmarshalOutOfBoundsException}if(n-4>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}if(e!==null){e.__read(this);this._buf.position=this._buf.position-6}else{this._buf.position=this._buf.position-4}try{return this._buf.getArray(n)}catch(i){throw new Ice.UnmarshalOutOfBoundsException}},getReadEncoding:function(){return this._readEncapsStack!==null?this._readEncapsStack.encoding:this._encoding},getReadEncapsSize:function(){t.assert(this._readEncapsStack!==null);return this._readEncapsStack.sz-6},skipEncaps:function(){var e=this.readInt();if(e<6){throw new Ice.UnmarshalOutOfBoundsException}var t=new Ice.EncodingVersion;t.__read(this);try{this._buf.position=this._buf.position+e-6}catch(n){throw new Ice.UnmarshalOutOfBoundsException}return t},startWriteSlice:function(e,n,i){t.assert(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null);this._writeEncapsStack.encoder.startSlice(e,n,i)},endWriteSlice:function(){t.assert(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null);this._writeEncapsStack.encoder.endSlice()},startReadSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);return this._readEncapsStack.decoder.startSlice()},endReadSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);this._readEncapsStack.decoder.endSlice()},skipSlice:function(){t.assert(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null);this._readEncapsStack.decoder.skipSlice()},readPendingObjects:function(){if(this._readEncapsStack!==null&&this._readEncapsStack.decoder!==null){this._readEncapsStack.decoder.readPendingObjects()}else if(this._readEncapsStack!==null&&this._readEncapsStack.encoding_1_0||this._readEncapsStack===null&&this._encoding.equals(Ice.Encoding_1_0)){this.skipSize()}},writePendingObjects:function(){if(this._writeEncapsStack!==null&&this._writeEncapsStack.encoder!==null){this._writeEncapsStack.encoder.writePendingObjects()}else if(this._writeEncapsStack!==null&&this._writeEncapsStack.encoding_1_0||this._writeEncapsStack===null&&this._encoding.equals(Ice.Encoding_1_0)){this.writeSize(0)}},writeSize:function(e){if(e>254){this.expand(5);this._buf.put(255);this._buf.putInt(e)}else{this.expand(1);this._buf.put(e)}},readSize:function(){try{var e=this._buf.get();if(e===255){var t=this._buf.getInt();if(t<0){throw new Ice.UnmarshalOutOfBoundsException}return t}return e}catch(n){throw new Ice.UnmarshalOutOfBoundsException}},readAndCheckSeqSize:function(e){var t=this.readSize();if(t===0){return t}if(this._startSeq===-1||this._buf.position>this._startSeq+this._minSeqSize){this._startSeq=this._buf.position;this._minSeqSize=t*e}else{this._minSeqSize+=t*e}if(this._startSeq+this._minSeqSize>this._buf.limit){throw new Ice.UnmarshalOutOfBoundsException}return t},startSize:function(){var e=this._buf.position;this.writeInt(0);return e},endSize:function(e){t.assert(e>=0);this.rewriteInt(this._buf.position-e-4,e)},writeBlob:function(e){if(e===null){return}this.expand(e.length);this._buf.putArray(e)},readBlob:function(e){if(this._buf.remaining=this._readEncapsStack.start+this._readEncapsStack.sz){return false}i=this.readByte();if(i===f){this._buf.position-=1;return false}r=o.valueOf(i&7);s=i>>3;if(s===30){s=this.readSize()}if(s>e){c=s<30?1:s<255?2:6;this._buf.position-=c;return false}if(s=this._readEncapsStack.start+this._readEncapsStack.sz){return}e=this.readByte();t=e<0?e+256:e;if(t===f){return}n=o.valueOf(t&7);if(t>>3===30){this.skipSize()}this.skipOpt(n)}},skip:function(e){if(e>this._buf.remaining){throw new Ice.UnmarshalOutOfBoundsException}this._buf.position+=e},skipSize:function(){var e=this.readByte();if(e===255){this.skip(4)}},isEmpty:function(){return this._buf.empty()},expand:function(e){this._buf.expand(e)},createObject:function(t){var n=null,i;try{var r=t.length>2?t.substr(2).replace(/::/g,"."):"";i=e.type(r);if(i!==undefined){n=new i}}catch(s){throw new Ice.NoObjectFactoryException("no object factory",t,s)}return n},getTypeId:function(e){var t=Ice.CompactIdRegistry.get(e);return t===undefined?"":t},isReadEncoding_1_0:function(){return this._readEncapsStack!==null?this._readEncapsStack.encoding_1_0:this._encoding.equals(Ice.Encoding_1_0)},isWriteEncoding_1_0:function(){return this._writeEncapsStack?this._writeEncapsStack.encoding_1_0:this._encoding.equals(Ice.Encoding_1_0)},initReadEncaps:function(){if(this._readEncapsStack===null){this._readEncapsStack=this._readEncapsCache;if(this._readEncapsStack!==null){this._readEncapsCache=this._readEncapsCache.next}else{this._readEncapsStack=new O}this._readEncapsStack.setEncoding(this._encoding);this._readEncapsStack.sz=this._buf.limit}if(this._readEncapsStack.decoder===null){var e=this._instance.servantFactoryManager();if(this._readEncapsStack.encoding_1_0){this._readEncapsStack.decoder=new x(this,this._readEncapsStack,this._sliceObjects,e)}else{this._readEncapsStack.decoder=new S(this,this._readEncapsStack,this._sliceObjects,e)}}},initWriteEncaps:function(){if(!this._writeEncapsStack){this._writeEncapsStack=this._writeEncapsCache;if(this._writeEncapsStack){this._writeEncapsCache=this._writeEncapsCache.next}else{this._writeEncapsStack=new k}this._writeEncapsStack.setEncoding(this._encoding)}if(this._writeEncapsStack.format===i.DefaultFormat){this._writeEncapsStack.format=this._instance.defaultsAndOverrides().defaultFormat}if(!this._writeEncapsStack.encoder){if(this._writeEncapsStack.encoding_1_0){this._writeEncapsStack.encoder=new P(this,this._writeEncapsStack)}else{this._writeEncapsStack.encoder=new M(this,this._writeEncapsStack)}}},createUserException:function(t){var n=null,i;try{var r=t.length>2?t.substr(2).replace(/::/g,"."):"";i=e.type(r);if(i!==undefined){n=new i}}catch(s){throw new Ice.MarshalException(s)}return n}});var T=Object.defineProperty;T(A.prototype,"pos",{get:function(){return this._buf.position},set:function(e){this._buf.position=e}});T(A.prototype,"size",{get:function(){return this._buf.limit}});T(A.prototype,"instance",{get:function(){return this._instance}});T(A.prototype,"closure",{get:function(){return this._type},set:function(e){this._type=e}});T(A.prototype,"buffer",{get:function(){return this._buf}});var L=function(e,t,n,i,r,s){var o={write:function(t,n){return e.call(t,n)},read:function(e){return t.call(e)},writeOpt:function(t,n,r){t.writeOptValue(n,i,e,r)},readOpt:function(e,n){return e.readOptValue(n,i,t)}};if(r!==undefined&&s!==undefined){o.validate=function(e){return e>=r&&e<=s}}T(o,"minWireSize",{get:function(){return n}});return o};var F=A.prototype;var R=0;var D=255;var j=-32768;var z=32767;var q=0;var B=4294967295;var U=-2147483648;var H=2147483647;var N=-3.4028234664e38;var W=3.4028234664e38;Ice.ByteHelper=L(F.writeByte,F.readByte,1,Ice.OptionalFormat.F1,R,D);Ice.ShortHelper=L(F.writeShort,F.readShort,2,Ice.OptionalFormat.F2,j,z);Ice.IntHelper=L(F.writeInt,F.readInt,4,Ice.OptionalFormat.F4,U,H);Ice.FloatHelper=L(F.writeFloat,F.readFloat,4,Ice.OptionalFormat.F4,N,W);Ice.FloatHelper.validate=function(e){return Number.isNaN(e)||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY||e>=N&&e<=W};Ice.DoubleHelper=L(F.writeDouble,F.readDouble,8,Ice.OptionalFormat.F8,-Number.MAX_VALUE,Number.MAX_VALUE);Ice.DoubleHelper.validate=function(e){return Number.isNaN(e)||e==Number.POSITIVE_INFINITY||e==Number.NEGATIVE_INFINITY||e>=-Number.MAX_VALUE&&e<=Number.MAX_VALUE};Ice.BoolHelper=L(F.writeBool,F.readBool,1,Ice.OptionalFormat.F1);Ice.LongHelper=L(F.writeLong,F.readLong,8,Ice.OptionalFormat.F8);Ice.LongHelper.validate=function(e){return e.low>=q&&e.low<=B&&e.high>=q&&e.high<=B};Ice.StringHelper=L(F.writeString,F.readString,1,Ice.OptionalFormat.VSize);Ice.ObjectHelper={write:function(e,t){e.writeObject(t)},read:function(e){var t;e.readObject(function(e){t=e},Ice.Object);return t},writeOpt:function(e,t,n){e.writeOptValue(t,Ice.OptionalFormat.Class,F.writeObject,n)},readOpt:function(e,t){var n;e.readOptObject(t,function(e){n=e},Ice.Object);return n}};T(Ice.ObjectHelper,"minWireSize",{get:function(){return 1}});Ice.BasicStream=A})();(function(){Ice.SocketOperation={None:0,Read:1,Write:2,Connect:2}})();(function(){var e=Ice.Class({__init__:function(e,t,n,i){this._instance=e;this._traceLevel=e.traceLevels().network;this._traceCategory=e.traceLevels().networkCat;this._logger=e.initializationData().logger;this._properties=e.initializationData().properties;this._type=t;this._protocol=n;this._secure=i},traceLevel:function(){return this._traceLevel},traceCategory:function(){return this._traceCategory},logger:function(){return this._logger},protocol:function(){return this._protocol},type:function(){return this._type},secure:function(){return this._secure},properties:function(){return this._properties},defaultHost:function(){return this._instance.defaultsAndOverrides().defaultHost},defaultSourceAddress:function(){return this._instance.defaultsAndOverrides().defaultSourceAddress},defaultEncoding:function(){return this._instance.defaultsAndOverrides().defaultEncoding},defaultTimeout:function(){return this._instance.defaultsAndOverrides().defaultTimeout},messageSizeMax:function(){return this._instance.messageSizeMax()}});Ice.ProtocolInstance=e})();(function(){t.defineSequence(Ice,"EndpointSeqHelper","Ice.ObjectHelper",false,"Ice.Endpoint")})();(function(){var e=Ice.AsyncResultBase;var t=Ice.Debug;var n=Ice.Promise;var i=Ice.Protocol;var r=Ice.UserException;var s=Ice.BasicStream;var o=Ice.Class(e,{__init__:function(t,n,r,o,c,a){e.call(this,t,n,r,o,c);if(t===undefined){return}this._completed=a;this._is=null;this._os=t!==null?new s(this._instance,i.currentProtocolEncoding):null;this._state=0;this._exception=null;this._sentSynchronously=false},cancel:function(){this.__cancel(new Ice.InvocationCanceledException)},isCompleted:function(){return(this._state&o.Done)>0},isSent:function(){return(this._state&o.Sent)>0},throwLocalException:function(){if(this._exception!==null){throw this._exception}},sentSynchronously:function(){return this._sentSynchronously},__markSent:function(e){t.assert((this._state&o.Done)===0);this._state|=o.Sent;if(e){this._state|=o.Done|o.OK;this._cancellationHandler=null;this.succeed(this)}},__markFinished:function(e,n){t.assert((this._state&o.Done)===0);this._state|=o.Done;if(e){this._state|=o.OK}this._cancellationHandler=null;if(n){n(this)}else{this.succeed(this)}},__markFinishedEx:function(e){t.assert((this._state&o.Done)===0);this._exception=e;this._state|=o.Done;this._cancellationHandler=null;this.fail(e,this)},__cancel:function(e){this._cancellationException=e;if(this._cancellationHandler){this._cancellationHandler.asyncRequestCanceled(this,e)}},__cancelable:function(e){if(this._cancellationException){try{throw this._cancellationException}finally{this._cancellationException=null}}this._cancellationHandler=e},__os:function(){return this._os},__is:function(){return this._is},__startReadParams:function(){this._is.startReadEncaps();return this._is},__endReadParams:function(){this._is.endReadEncaps()},__readEmptyParams:function(){this._is.skipEmptyEncaps()},__readParamEncaps:function(){return this._is.readEncaps(null)},__throwUserException:function(){t.assert((this._state&o.Done)!==0);if((this._state&o.OK)===0){try{this._is.startReadEncaps();this._is.throwException()}catch(e){if(e instanceof r){this._is.endReadEncaps()}throw e}}}});o.OK=1;o.Done=2;o.Sent=4;Ice.AsyncResult=o})();(function(){Ice.Address=function(e,t){this.host=e;this.port=t}})();(function(){var e=Ice.BasicStream;var t=Ice.Debug;var n=Ice.ExUtil;var i=Ice.Class;var r=Ice.Protocol;var s=20+8;var o=i({__init__:function(t,n){this._batchStreamInUse=false;this._batchRequestNum=0;this._batchStream=new e(t,r.currentProtocolEncoding);this._batchStream.writeBlob(r.requestBatchHdr);this._batchMarker=this._batchStream.size;this._exception=null;this._maxSize=t.batchAutoFlushSize();if(this._maxSize>0&&n){var i=t.initializationData().properties;var o=i.getPropertyAsIntWithDefault("Ice.UDP.SndSize",65535-s);if(o0&&this._batchStream.size>=this._maxSize){n.ice_flushBatchRequests()}t.assert(this._batchMarker=0){this._requests.splice(t,1)}},cancel:function(e){var t=this._requests.indexOf(e);if(t>=0){this._requests.splice(t,1);return this._instance.timer().cancel(e.token)}return false}});Ice.RetryQueue=t;var n=e({__init__:function(e,t,n,i){this._instance=e;this._queue=t;this._outAsync=n},run:function(){this._outAsync.__retry();this._queue.remove(this)},destroy:function(){try{this._outAsync.__abort(new Ice.CommunicatorDestroyedException)}catch(e){}},asyncRequestCanceled:function(e,t){if(this._queue.cancel(this)){if(this._instance.traceLevels().retry>=1){this._instance.initializationData().logger.trace(this._instance.traceLevels().retryCat,"operation retry canceled\n"+t.toString())}this._outAsync.__completedEx(t)}}})})();(function(){var e=Ice.ArrayUtil;var t=Ice.Debug;var n=Ice.HashMap;var i=Ice.Promise;var r=Ice.Class({__init__:function(e){this._router=e;t.assert(this._router!==null);this._clientEndpoints=null;this._serverEndpoints=null;this._adapter=null;this._identities=new n(n.compareEquals);this._evictedIdentities=[]},destroy:function(){this._clientEndpoints=[];this._serverEndpoints=[];this._adapter=null;this._identities.clear()},equals:function(e){if(this===e){return true}if(e instanceof r){return this._router.equals(e._router)}return false},hashCode:function(){return this._router.hashCode()},getRouter:function(){return this._router},getClientEndpoints:function(){var e=new i;if(this._clientEndpoints!==null){e.succeed(this._clientEndpoints)}else{var t=this;this._router.getClientProxy().then(function(n){t.setClientEndpoints(n,e)}).exception(function(t){e.fail(t)})}return e},getServerEndpoints:function(){if(this._serverEndpoints!==null){return(new i).succeed(this._serverEndpoints)}else{var e=this;return this._router.getServerProxy().then(function(t){return e.setServerEndpoints(t)})}},addProxy:function(e){t.assert(e!==null);if(this._identities.has(e.ice_getIdentity())){return(new i).succeed()}else{var n=this;return this._router.addProxies([e]).then(function(t){n.addAndEvictProxies(e,t)})}},setAdapter:function(e){this._adapter=e},getAdapter:function(){return this._adapter},clearCache:function(e){this._identities.delete(e.getIdentity())},setClientEndpoints:function(e,t){if(this._clientEndpoints===null){if(e===null){this._clientEndpoints=this._router.__reference().getEndpoints();t.succeed(this._clientEndpoints)}else{e=e.ice_router(null);var n=this;this._router.ice_getConnection().then(function(i){var r=e.ice_timeout(i.timeout());n._clientEndpoints=r.__reference().getEndpoints();t.succeed(n._clientEndpoints)}).exception(function(e){t.fail(e)})}}else{t.succeed(this._clientEndpoints)}},setServerEndpoints:function(e){if(e===null){throw new Ice.NoEndpointException}e=e.ice_router(null);this._serverEndpoints=e.__reference().getEndpoints();return this._serverEndpoints},addAndEvictProxies:function(t,n){var i=e.indexOf(this._evictedIdentities,t.ice_getIdentity(),function(e,t){return e.equals(t); +});if(i>=0){this._evictedIdentities.splice(i,1)}else{this._identities.set(t.ice_getIdentity(),1)}for(var r=0;r0){var i=this;this._timeoutToken=this._instance.timer().schedule(function(){i.__cancel(new Ice.InvocationTimeoutException)},n)}}while(true){try{this._sent=false;this._handler=this._proxy.__getRequestHandler();var r=this._handler.sendAsyncRequest(this);if((r&e.Sent)>0){if(t){this._sentSynchronously=true}}return}catch(o){if(o instanceof s){this._proxy.__updateRequestHandler(this._handler,null)}else{var c=this.__handleException(o);if(c>0){this._instance.retryQueue().add(this,c);return}}}}}catch(o){this.__markFinishedEx(o)}},__markSent:function(e){this._sent=true;if(e){if(this._timeoutToken){this._instance.timer().cancel(this._timeoutToken)}}u.prototype.__markSent.call(this,e)},__markFinishedEx:function(e){if(this._timeoutToken){this._instance.timer().cancel(this._timeoutToken)}u.prototype.__markFinishedEx.call(this,e)},__handleException:function(e){var t={value:0};this._cnt=this._proxy.__handleException(e,this._handler,this._mode,this._sent,t,this._cnt);return t.value}});var h=Ice.Class(l,{__init__:function(e,t,n){if(e!==undefined){l.call(this,e,t);this._encoding=c.getCompatibleEncoding(this._proxy.__reference().getEncoding());this._completed=n}else{l.call(this)}},__prepare:function(e,t,n){c.checkSupportedProtocol(c.getCompatibleProtocol(this._proxy.__reference().getProtocol()));this._mode=t;if(n===null){n=h._emptyContext}if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._proxy.__getBatchRequestQueue().prepareBatchRequest(this._os)}else{this._os.writeBlob(c.requestHdr)}var i=this._proxy.__reference();i.getIdentity().__write(this._os);var s=i.getFacet();if(s===null||s.length===0){Ice.StringSeqHelper.write(this._os,null)}else{Ice.StringSeqHelper.write(this._os,[s])}this._os.writeString(this._operation);this._os.writeByte(t.value);if(n!==undefined){if(n!==null&&!(n instanceof r)){throw new Error("illegal context value, expecting null or HashMap")}Ice.ContextHelper.write(this._os,n)}else{var o=i.getInstance().getImplicitContext();var a=i.getContext();if(o===null){Ice.ContextHelper.write(this._os,a)}else{o.write(a,this._os)}}},__sent:function(){this.__markSent(!this._proxy.ice_isTwoway())},__invokeRemote:function(e,t,n){return e.sendAsyncRequest(this,t,n,0)},__abort:function(e){if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._proxy.__getBatchRequestQueue().abortBatchRequest(this._os)}l.prototype.__abort.call(this,e)},__invoke:function(){if(this._proxy.ice_isBatchOneway()||this._proxy.ice_isBatchDatagram()){this._sentSynchronously=true;this._proxy.__getBatchRequestQueue().finishBatchRequest(this._os,this._proxy,this._operation);this.__markFinished(true);return}this.__invokeImpl(true)},__completed:function(e){i.assert(this._proxy.ice_isTwoway());var t;try{if(this._is===null){this._is=new n(this._instance,c.currentProtocolEncoding)}this._is.swap(e);t=this._is.readByte();switch(t){case c.replyOK:case c.replyUserException:{break}case c.replyObjectNotExist:case c.replyFacetNotExist:case c.replyOperationNotExist:{var r=new a;r.__read(this._is);var s=Ice.StringSeqHelper.read(this._is);var o;if(s.length>0){if(s.length>1){throw new Ice.MarshalException}o=s[0]}else{o=""}var u=this._is.readString();var l=null;switch(t){case c.replyObjectNotExist:{l=new Ice.ObjectNotExistException;break}case c.replyFacetNotExist:{l=new Ice.FacetNotExistException;break}case c.replyOperationNotExist:{l=new Ice.OperationNotExistException;break}default:{i.assert(false);break}}l.id=r;l.facet=o;l.operation=u;throw l}case c.replyUnknownException:case c.replyUnknownLocalException:case c.replyUnknownUserException:{var h=this._is.readString();var f=null;switch(t){case c.replyUnknownException:{f=new Ice.UnknownException;break}case c.replyUnknownLocalException:{f=new Ice.UnknownLocalException;break}case c.replyUnknownUserException:{f=new Ice.UnknownUserException;break}default:{i.assert(false);break}}f.unknown=h;throw f}default:{throw new Ice.UnknownReplyStatusException}}this.__markFinished(t==c.replyOK,this._completed)}catch(d){this.__completedEx(d)}},__startWriteParams:function(e){this._os.startWriteEncaps(this._encoding,e);return this._os},__endWriteParams:function(){this._os.endWriteEncaps()},__writeEmptyParams:function(){this._os.writeEmptyEncaps(this._encoding)},__writeParamEncaps:function(e){if(e===null||e.length===0){this._os.writeEmptyEncaps(this._encoding)}else{this._os.writeEncaps(e)}},__is:function(){return this._is},__startReadParams:function(){this._is.startReadEncaps();return this._is},__endReadParams:function(){this._is.endReadEncaps()},__readEmptyParams:function(){this._is.skipEmptyEncaps()},__readParamEncaps:function(){return this._is.readEncaps(null)},__throwUserException:function(){i.assert((this._state&t.Done)!==0);if((this._state&t.OK)===0){try{this._is.startReadEncaps();this._is.throwException()}catch(e){if(e instanceof Ice.UserException){this._is.endReadEncaps()}throw e}}}});h._emptyContext=new r;var f=Ice.Class(l,{__init__:function(e,t){l.call(this,e,t);this._batchRequestNum=e.__getBatchRequestQueue().swap(this._os)},__invokeRemote:function(t,n,i){if(this._batchRequestNum===0){this.__sent();return e.Sent}return t.sendAsyncRequest(this,n,i,this._batchRequestNum)},__invoke:function(){c.checkSupportedProtocol(c.getCompatibleProtocol(this._proxy.__reference().getProtocol()));this.__invokeImpl(true)}});var d=Ice.Class(l,{__init__:function(e,t){l.call(this,e,t)},__invokeRemote:function(t,n,i){this.__markFinished(true,function(e){e.succeed(t)});return e.Sent},__invoke:function(){this.__invokeImpl(true)}});var p=Ice.Class(u,{__init__:function(e,t,n){u.call(this,t,n,e,null,null)},__invoke:function(){try{var t=this._connection.getBatchRequestQueue().swap(this._os);var n;if(t===0){this.__sent();n=e.Sent}else{n=this._connection.sendAsyncRequest(this,false,false,t)}if((n&e.Sent)>0){this._sentSynchronously=true}}catch(i){this.__completedEx(i)}}});Ice.OutgoingAsync=h;Ice.ProxyFlushBatch=f;Ice.ProxyGetConnection=d;Ice.ConnectionFlushBatch=p})();(function(){var e=Ice.ArrayUtil;var t=Ice.AsyncResultBase;var n=Ice.AsyncResult;var i=Ice.Debug;var r=Ice.FormatType;var s=Ice.HashMap;var o=Ice.OutgoingAsync;var c=Ice.ProxyFlushBatch;var a=Ice.ProxyGetConnection;var u=Ice.ReferenceMode;var l=Ice.OperationMode;var h=Ice.Class({__init__:function(){this._reference=null;this._requestHandler=null},hashCode:function(e){return this._reference.hashCode()},ice_getCommunicator:function(){return this._reference.getCommunicator()},toString:function(){return this._reference.toString()},ice_getIdentity:function(){return this._reference.getIdentity().clone()},ice_identity:function(e){if(e===undefined||e===null||e.name.length===0){throw new Ice.IllegalIdentityException}if(e.equals(this._reference.getIdentity())){return this}else{var t=new h;t.__setup(this._reference.changeIdentity(e));return t}},ice_getContext:function(){return new s(this._reference.getContext())},ice_context:function(e){return this.__newInstance(this._reference.changeContext(e))},ice_getFacet:function(){return this._reference.getFacet()},ice_facet:function(e){if(e===undefined||e===null){e=""}if(e===this._reference.getFacet()){return this}else{var t=new h;t.__setup(this._reference.changeFacet(e));return t}},ice_getAdapterId:function(){return this._reference.getAdapterId()},ice_adapterId:function(e){if(e===undefined||e===null){e=""}if(e===this._reference.getAdapterId()){return this}else{return this.__newInstance(this._reference.changeAdapterId(e))}},ice_getEndpoints:function(){return e.clone(this._reference.getEndpoints())},ice_endpoints:function(t){if(t===undefined||t===null){t=[]}if(e.equals(t,this._reference.getEndpoints())){return this}else{return this.__newInstance(this._reference.changeEndpoints(t))}},ice_getLocatorCacheTimeout:function(){return this._reference.getLocatorCacheTimeout()},ice_locatorCacheTimeout:function(e){if(e<-1){throw new Error("invalid value passed to ice_locatorCacheTimeout: "+e)}if(e===this._reference.getLocatorCacheTimeout()){return this}else{return this.__newInstance(this._reference.changeLocatorCacheTimeout(e))}},ice_getInvocationTimeout:function(){return this._reference.getInvocationTimeout()},ice_invocationTimeout:function(e){if(e<1&&e!==-1){throw new Error("invalid value passed to ice_invocationTimeout: "+e)}if(e===this._reference.getInvocationTimeout()){return this}else{return this.__newInstance(this._reference.changeInvocationTimeout(e))}},ice_isConnectionCached:function(){return this._reference.getCacheConnection()},ice_connectionCached:function(e){if(e===this._reference.getCacheConnection()){return this}else{return this.__newInstance(this._reference.changeCacheConnection(e))}},ice_getEndpointSelection:function(){return this._reference.getEndpointSelection()},ice_endpointSelection:function(e){if(e===this._reference.getEndpointSelection()){return this}else{return this.__newInstance(this._reference.changeEndpointSelection(e))}},ice_isSecure:function(){return this._reference.getSecure()},ice_secure:function(e){if(e===this._reference.getSecure()){return this}else{return this.__newInstance(this._reference.changeSecure(e))}},ice_getEncodingVersion:function(){return this._reference.getEncoding().clone()},ice_encodingVersion:function(e){if(e.equals(this._reference.getEncoding())){return this}else{return this.__newInstance(this._reference.changeEncoding(e))}},ice_isPreferSecure:function(){return this._reference.getPreferSecure()},ice_preferSecure:function(e){if(e===this._reference.getPreferSecure()){return this}else{return this.__newInstance(this._reference.changePreferSecure(e))}},ice_getRouter:function(){var e=this._reference.getRouterInfo();return e!==null?e.getRouter():null},ice_router:function(e){var t=this._reference.changeRouter(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getLocator:function(){var e=this._reference.getLocatorInfo();return e!==null?e.getLocator():null},ice_locator:function(e){var t=this._reference.changeLocator(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_isTwoway:function(){return this._reference.getMode()===u.ModeTwoway},ice_twoway:function(){if(this._reference.getMode()===u.ModeTwoway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeTwoway))}},ice_isOneway:function(){return this._reference.getMode()===u.ModeOneway},ice_oneway:function(){if(this._reference.getMode()===u.ModeOneway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeOneway))}},ice_isBatchOneway:function(){return this._reference.getMode()===u.ModeBatchOneway},ice_batchOneway:function(){if(this._reference.getMode()===u.ModeBatchOneway){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeBatchOneway))}},ice_isDatagram:function(){return this._reference.getMode()===u.ModeDatagram},ice_datagram:function(){if(this._reference.getMode()===u.ModeDatagram){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeDatagram))}},ice_isBatchDatagram:function(){return this._reference.getMode()===u.ModeBatchDatagram},ice_batchDatagram:function(){if(this._reference.getMode()===u.ModeBatchDatagram){return this}else{return this.__newInstance(this._reference.changeMode(u.ModeBatchDatagram))}},ice_compress:function(e){var t=this._reference.changeCompress(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_timeout:function(e){if(e<1&&e!==-1){throw new Error("invalid value passed to ice_timeout: "+e)}var t=this._reference.changeTimeout(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getConnectionId:function(){return this._reference.getConnectionId()},ice_connectionId:function(e){var t=this._reference.changeConnectionId(e);if(t.equals(this._reference)){return this}else{return this.__newInstance(t)}},ice_getConnection:function(){var e=new a(this,"ice_getConnection");try{e.__invoke()}catch(t){e.__abort(t)}return e},ice_getCachedConnection:function(){return this._requestHandler?this._requestHandler.getConnection():null},ice_flushBatchRequests:function(){var e=new c(this,"ice_flushBatchRequests");try{e.__invoke()}catch(t){e.__abort(t)}return e},equals:function(e){if(this===e){return true}if(e instanceof h){return this._reference.equals(e._reference)}return false},__reference:function(){return this._reference},__copyFrom:function(e){i.assert(this._reference===null);i.assert(this._requestHandler===null);this._reference=e._reference;this._requestHandler=e._requestHandler},__handleException:function(e,t,n,i,r,s){this.__updateRequestHandler(t,null);if(e instanceof Ice.LocalException&&(!i||n==l.Nonmutating||n==l.Idempotent||e instanceof Ice.CloseConnectionException||e instanceof Ice.ObjectNotExistException)){try{return this._reference.getInstance().proxyFactory().checkRetryAfterException(e,this._reference,r,s)}catch(o){if(o instanceof Ice.CommunicatorDestroyedException){throw e}else{throw o}}}else{throw e}},__checkAsyncTwowayOnly:function(e){if(!this.ice_isTwoway()){throw new Error("`"+e+"' can only be called with a twoway proxy")}},__getRequestHandler:function(){if(this._reference.getCacheConnection()){if(this._requestHandler){return this._requestHandler}}return this._reference.getRequestHandler(this)},__getBatchRequestQueue:function(){if(!this._batchRequestQueue){this._batchRequestQueue=this._reference.getBatchRequestQueue()}return this._batchRequestQueue},__setRequestHandler:function(e){if(this._reference.getCacheConnection()){if(!this._requestHandler){this._requestHandler=e}return this._requestHandler}return e},__updateRequestHandler:function(e,t){if(this._reference.getCacheConnection()&&e!==null){if(this._requestHandler&&this._requestHandler!==t){this._requestHandler=this._requestHandler.update(e,t)}}},__setup:function(e){i.assert(this._reference===null);this._reference=e},__newInstance:function(e){var t=new this.constructor;t.__setup(e);return t},ice_instanceof:function(e){if(e){if(this instanceof e){return true}return this.constructor.__instanceof(e)}return false}});h.__invoke=function(e,t,n,i,r,s,c,a,u){if(c!==null||a.length>0){e.__checkAsyncTwowayOnly(t)}var l=new o(e,t,function(e){h.__completed(e,c,a)});try{l.__prepare(t,n,r);if(s===null){l.__writeEmptyParams()}else{var f=l.__startWriteParams(i);s.call(null,f,u);l.__endWriteParams()}l.__invoke()}catch(d){l.__abort(d)}return l};h.__completed=function(e,t,n){if(!h.__check(e,n)){return}try{if(t===null){e.__readEmptyParams();e.succeed(e)}else{var i=t(e);e.succeed.apply(e,i)}}catch(r){h.__dispatchLocalException(e,r);return}};h.__returns_bool=function(e,t){t.push(e.readBool())};h.__returns_byte=function(e,t){t.push(e.readByte())};h.__returns_short=function(e,t){t.push(e.readShort())};h.__returns_int=function(e,t){t.push(e.readInt())};h.__returns_long=function(e,t){t.push(e.readLong())};h.__returns_float=function(e,t){t.push(e.readFloat())};h.__returns_double=function(e,t){t.push(e.readDouble())};h.__returns_string=function(e,t){t.push(e.readString())};h.__returns_ObjectPrx=function(e,t){t.push(e.readProxy())};h.__returns_Object=function(e,t){e.readObject(function(e){t.push(e)},Ice.Object);e.readPendingObjects()};h.__check=function(e,t){try{e.__throwUserException()}catch(n){if(n instanceof Ice.UserException){if(t!==null){for(var i=0;i0){throw new Error("ice_response called with invalid arguments")}else{this.incomingAsync.__writeEmptyParams()}}else{var t=this.incomingAsync.__startWriteParams(this.op.format);var n;if(this.op.returns&&!this.op.returns.tag){n=this.op.returns}c(t,e,n,this.op.outParams,this.op.outParamsOpt,this.op.returnsClasses);this.incomingAsync.__endWriteParams(true)}},__checkException:function(e){for(var t=0;t0&&(t.sendsClasses||t.inParamsOpt.length>0)){for(var d=0;d1&&!(g instanceof Array)){throw new Ice.MarshalException("operation `"+t.servantMethod+"' should return an array of length "+I)}else if(I===1){g=[g]}u.__sendResponse(g);return Ice.DispatchStatus.DispatchOK}}catch(_){if(u.__checkException(_)){u.__sendException(_);return Ice.DispatchStatus.DispatchUserException}else{throw _}}};function l(e,t,n){var i;for(var r=0;i===undefined&&r0){a=function(e,t){var n,i,r;for(n=0;n0){u=function(e){var t=[];var n=e.__startReadParams();var i;if(s.returns&&!s.returns.tag){i=s.returns}o(n,i,s.outParams,s.outParamsOpt,s.returnsClasses,t,0);e.__endReadParams();if(s.returnsClasses||s.outParamsOpt.length>0){var r=0;if(s.returns&&s.returns.isObject&&t[s.returns.pos+r]!==undefined){t[s.returns.pos+r]=t[s.returns.pos+r].value}for(var c=0;c0){e+=" -h ";var t=this._host.indexOf(":")!=-1;if(t){e+='"'}e+=this._host;if(t){e+='"'}}e+=" -p "+this._port;if(this._sourceAddr!==null&&this._sourceAddr.length>0){e+=" --sourceAddr "+this._sourceAddr}return e},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()65535){throw new r("port value `"+t+"' out of range in endpoint "+i)}}else if(e==="--sourceAddress"){if(t===null){throw new r("no argument provided for --sourceAddress option in endpoint "+i)}this._sourceAddr=t}else{return false}return true}});Ice.IPEndpointI=s})();(function(){Object.defineProperty(IceSSL,"EndpointType",{value:Ice.SSLEndpointType});IceSSL.EndpointInfo=t.defineLocalObject(function(e,t,n,i,r){Ice.IPEndpointInfo.call(this,e,t,n,i,r)},Ice.IPEndpointInfo);IceSSL.WSSEndpointInfo=t.defineLocalObject(function(e,t,n,i,r,s){IceSSL.EndpointInfo.call(this,e,t,n,i,r);this.resource=s!==undefined?s:""},IceSSL.EndpointInfo)})();(function(){Ice.ConnectionInfo=t.defineLocalObject(function(e,t,n,i,r){this.incoming=e!==undefined?e:false;this.adapterName=t!==undefined?t:"";this.connectionId=n!==undefined?n:"";this.rcvSize=i!==undefined?i:0;this.sndSize=r!==undefined?r:0});Ice.ConnectionCallback=t.defineLocalObject();Ice.ACMClose=t.defineEnum([["CloseOff",0],["CloseOnIdle",1],["CloseOnInvocation",2],["CloseOnInvocationAndIdle",3],["CloseOnIdleForceful",4]]);Ice.ACMHeartbeat=t.defineEnum([["HeartbeatOff",0],["HeartbeatOnInvocation",1],["HeartbeatOnIdle",2],["HeartbeatAlways",3]]);Ice.ACM=t.defineStruct(function(e,t,n){this.timeout=e!==undefined?e:0;this.close=t!==undefined?t:Ice.ACMClose.CloseOff;this.heartbeat=n!==undefined?n:Ice.ACMHeartbeat.HeartbeatOff},true);Ice.Connection=t.defineLocalObject();Ice.IPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a){Ice.ConnectionInfo.call(this,e,t,n,i,r);this.localAddress=s!==undefined?s:""; +this.localPort=o!==undefined?o:-1;this.remoteAddress=c!==undefined?c:"";this.remotePort=a!==undefined?a:-1},Ice.ConnectionInfo);Ice.TCPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a){Ice.IPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a)},Ice.IPConnectionInfo);Ice.UDPConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a,u,l){Ice.IPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a);this.mcastAddress=u!==undefined?u:"";this.mcastPort=l!==undefined?l:-1},Ice.IPConnectionInfo);t.defineDictionary(Ice,"HeaderDict","HeaderDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.WSConnectionInfo=t.defineLocalObject(function(e,t,n,i,r,s,o,c,a,u){Ice.TCPConnectionInfo.call(this,e,t,n,i,r,s,o,c,a);this.headers=u!==undefined?u:null},Ice.TCPConnectionInfo)})();(function(){Ice.TraceLevels=function(e){var t="Network";var n="Protocol";var i="Retry";var r="Locator";var s="Slicing";var o="Ice.Trace.";var c=e.getPropertyAsInt(o+t);var a=e.getPropertyAsInt(o+n);var u=e.getPropertyAsInt(o+i);var l=e.getPropertyAsInt(o+r);var h=e.getPropertyAsInt(o+s);e.getPropertyAsInt(o+"ThreadPool");return Object.create(null,{network:{get:function(){return c}},networkCat:{get:function(){return t}},protocol:{get:function(){return a}},protocolCat:{get:function(){return n}},retry:{get:function(){return u}},retryCat:{get:function(){return i}},location:{get:function(){return l}},locationCat:{get:function(){return r}},slicing:{get:function(){return h}},slicingCat:{get:function(){return s}}})}})();(function(){var e=Ice.Base64;var t=Ice.Debug;var n=Ice.HashUtil;var i=Ice.Protocol;var r=Ice.StringUtil;var s=Ice.EndpointParseException;var o=Ice.Class;var c=o(Ice.EndpointI,{__init__:function(e){this._rawEncoding=Ice.Encoding_1_0;this._type=e===undefined?-1:e;this._rawBytes=null},streamWrite:function(e){e.startWriteEncaps(this._rawEncoding,Ice.FormatType.DefaultFormat);e.writeBlob(this._rawBytes);e.endWriteEncaps()},getInfo:function(){return new a((-1),false,this._rawEncoding,this._rawBytes,this._type)},type:function(){return this._type},protocol:function(){return"opaque"},timeout:function(){return-1},changeTimeout:function(e){return this},changeConnectionId:function(e){return this},compress:function(){return false},changeCompress:function(e){return this},datagram:function(){return false},secure:function(){return false},rawBytes:function(){return this._rawBytes},transceiver:function(e){e.value=null;return null},acceptor:function(e,t){e.value=this;return null},connect:function(){return null},hashCode:function(){if(this._hashCode===undefined){var e=5381;e=n.addNumber(e,this._type);e=n.addHashable(e,this._rawEncoding);e=n.addArray(e,this._rawBytes,n.addNumber);this._hashCode=e}return this._hashCode},options:function(){var t="";t+=" -t "+this._type;t+=" -e "+Ice.encodingVersionToString(this._rawEncoding);t+=" -v "+e.encode(this._rawBytes);return t},equals:function(e){if(!(e instanceof c)){return false}if(this===e){return true}if(this._type!==e._type){return false}if(!this._rawEncoding.equals(e._rawEncoding)){return false}if(this._rawBytes.length!==e._rawBytes.length){return false}for(var t=0;t-1){throw new s("multiple -t options in endpoint "+i)}if(n===null){throw new s("no argument provided for -t option in endpoint "+i)}var o;try{o=r.toInt(n)}catch(c){throw new s("invalid type value `"+n+"' in endpoint "+i)}if(o<0||o>65535){throw new s("type value `"+n+"' out of range in endpoint "+i)}this._type=o;return true}case"v":{if(this._rawBytes){throw new s("multiple -v options in endpoint "+i)}if(n===null||n.length===0){throw new s("no argument provided for -v option in endpoint "+i)}for(var a=0;a1){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);if(e instanceof Ice.ObjectNotExistException){this._os.writeByte(o.replyObjectNotExist)}else if(e instanceof Ice.FacetNotExistException){this._os.writeByte(o.replyFacetNotExist)}else if(e instanceof Ice.OperationNotExistException){this._os.writeByte(o.replyOperationNotExist)}else{n.assert(false)}e.id.__write(this._os);if(e.facet===null||e.facet.length===0){Ice.StringSeqHelper.write(this._os,null)}else{Ice.StringSeqHelper.write(this._os,[e.facet])}this._os.writeString(e.operation);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownLocalException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownLocalException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownUserException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownUserException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UnknownException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownException);this._os.writeString(e.unknown);this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.LocalException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownLocalException);r=[e.ice_name()];if(e.stack){r.push("\n");r.push(e.stack)}this._os.writeString(r.join(""));this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else if(e instanceof Ice.UserException){if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownUserException);r=[e.ice_name()];if(e.stack){r.push("\n");r.push(e.stack)}this._os.writeString(r.join(""));this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}}else{if(i.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}if(this._response){this._os.resize(o.headerSize+4);this._os.writeByte(o.replyUnknownException);this._os.writeString(e.stack?e.stack:"");this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}if(!t){throw new Ice.ServantError(e)}}this._connection=null},invoke:function(e,t){this._is=t;var s=this._is.pos;this._current.id.__read(this._is);var c=Ice.StringSeqHelper.read(this._is);if(c.length>0){if(c.length>1){throw new Ice.MarshalException}this._current.facet=c[0]}else{this._current.facet=""}this._current.operation=this._is.readString();this._current.mode=Ice.OperationMode.valueOf(this._is.readByte());this._current.ctx=new r;var a=this._is.readSize();while(a-- >0){var u=this._is.readString();var l=this._is.readString();this._current.ctx.set(u,l)}if(e!==null){this._servant=e.findServant(this._current.id,this._current.facet);if(this._servant===null){this._locator=e.findServantLocator(this._current.id.category);if(this._locator===null&&this._current.id.category.length>0){this._locator=e.findServantLocator("")}if(this._locator!==null){try{this._servant=this._locator.locate(this._current,this._cookie)}catch(h){if(h instanceof Ice.UserException){var f=this._is.skipEncaps();if(this._response){this._os.writeByte(o.replyUserException);this._os.startWriteEncaps(f,i.DefaultFormat);this._os.writeUserException(h);this._os.endWriteEncaps();this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null;return}else{this._is.skipEncaps();this.__handleException(h,false);return}}}}}try{if(this._servant!==null){if(this._servant.__dispatch(this,this._current)===Ice.DispatchStatus.DispatchAsync){return}if(this._locator!==null&&!this.__servantLocatorFinished(false)){return}}else{this._is.skipEncaps();if(e!==null&&e.hasServant(this._current.id)){throw new Ice.FacetNotExistException(this._current.id,this._current.facet,this._current.operation)}else{throw new Ice.ObjectNotExistException(this._current.id,this._current.facet,this._current.operation)}}}catch(h){if(this._servant!==null&&this._locator!==null&&!this.__servantLocatorFinished(false)){return}this.__handleException(h,false);return}n.assert(this._connection!==null);if(this._response){this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null},startReadParams:function(){this._current.encoding=this._is.startReadEncaps();return this._is},endReadParams:function(){this._is.endReadEncaps()},readEmptyParams:function(){this._current.encoding=this._is.skipEmptyEncaps()},readParamEncaps:function(){this._current.encoding=new Ice.EncodingVersion;return this._is.readEncaps(this._current.encoding)},__response:function(){try{if(this._locator!==null&&!this.__servantLocatorFinished(true)){return}n.assert(this._connection!==null);if(this._response){this._connection.sendResponse(this._os,this._compress)}else{this._connection.sendNoResponse()}this._connection=null}catch(e){this._connection.invokeException(e,1)}},__exception:function(e){try{if(this._locator!==null&&!this.__servantLocatorFinished(true)){return}this.__handleException(e,true)}catch(t){this._connection.invokeException(t,1)}},__validateResponse:function(e){if(!this._active){return false}this._active=false;return true},ice_exception:function(e){if(!this._active){return}this._active=false;if(this._connection!==null){this.__exception(e)}else{if(this._instance.initializationData().properties.getPropertyAsIntWithDefault("Ice.Warn.Dispatch",1)>0){this.__warning(e)}}}});Ice.IncomingAsync=a})();(function(){var e=Ice.AsyncResult;var t=Ice.AsyncStatus;var n=Ice.BasicStream;var i=Ice.ConnectionRequestHandler;var r=Ice.Debug;var s=Ice.ExUtil;var o=Ice.RetryException;var c=Ice.OutgoingAsync;var a=Ice.Protocol;var u=Ice.ReferenceMode;var l=Ice.LocalException;var h=Ice.Promise;var f=Ice.Class({__init__:function(e,t){this._reference=e;this._response=e.getMode()===u.ModeTwoway;this._proxy=t;this._proxies=[];this._initialized=false;this._connection=null;this._compress=false;this._exception=null;this._requests=[]},connect:function(e){if(!this.initialized()){this._proxies.push(e)}return this._requestHandler?this._requestHandler:this},update:function(e,t){return e===this?t:this},sendAsyncRequest:function(e){if(!this._initialized){e.__cancelable(this)}if(!this.initialized()){this._requests.push(e);return t.Queued}return e.__invokeRemote(this._connection,this._compress,this._response)},asyncRequestCanceled:function(e,t){if(this._exception!==null){return}if(!this.initialized()){for(var n=0;n=5?5:.2;return Math.min(e,25)},setCallbacks:function(e,t,n){this._connectedCallback=e;this._bytesAvailableCallback=t;this._bytesWrittenCallback=n},initialize:function(e,t){try{if(this._exception){throw this._exception}if(this._state===l){this._state=h;this._fd=new WebSocket(this._url,"ice.zeroc.com");this._fd.binaryType="arraybuffer";var i=this;this._fd.onopen=function(e){i.socketConnected(e)};this._fd.onmessage=function(e){i.socketBytesAvailable(e.data)};this._fd.onclose=function(e){i.socketClosed(e)};return s.Connect}else if(this._state===h){this._desc=I(this._addr);this._state=f}}catch(r){if(!this._exception){this._exception=g(this._state,r)}throw this._exception}n.assert(this._state===f);return s.None},register:function(){this._registered=true;if(this._hasBytesAvailable||this._exception){this._bytesAvailableCallback();this._hasBytesAvailable=false}},unregister:function(){this._registered=false},close:function(){if(this._fd===null){n.assert(this._exception);return}if(t&&this._fd.readyState===WebSocket.CONNECTING){this._state=d;return}n.assert(this._fd!==null);try{this._state=p;this._fd.close()}catch(e){throw g(this._state,e)}finally{this._fd=null}},write:function(e){if(this._exception){throw this._exception}else if(e.remaining===0){return true}n.assert(this._fd);var t=this;var i=function(){if(t._fd){if(t._fd.bufferedAmount+s<=t._maxSendPacketSize){t._bytesWrittenCallback(0,0)}else{u.setTimeout(i,t.writeReadyTimeout())}}};var r=e.position;while(true){var s=this._maxSendPacketSize>0&&e.remaining>this._maxSendPacketSize?this._maxSendPacketSize:e.remaining;if(e.remaining===0){break}n.assert(s>0);if(this._fd.bufferedAmount+s>this._maxSendPacketSize){u.setTimeout(i,this.writeReadyTimeout());return false}this._writeReadyTimeout=0;var o=e.b.slice(e.position,e.position+s);this._fd.send(o);e.position=e.position+s}return true},read:function(e,t){if(this._exception){throw this._exception}t.value=false;if(this._readBuffers.length===0){return false}var i=this._readBuffers[0].byteLength-this._readPosition;n.assert(i>0);var r=e.remaining;while(e.remaining>0){if(i>e.remaining){i=e.remaining}new Uint8Array(e.b).set(new Uint8Array(this._readBuffers[0],this._readPosition,i),e.position);e.position+=i;this._readPosition+=i;if(this._readPosition===this._readBuffers[0].byteLength){this._readPosition=0;this._readBuffers.shift();if(this._readBuffers.length===0){break}else{i=this._readBuffers[0].byteLength}}}t.value=this._readBuffers.byteLength>0;return e.remaining===0},type:function(){return this._secure?"wss":"ws"},getInfo:function(){n.assert(this._fd!==null);var t=this._secure?new e.WSSConnectionInfo:new Ice.WSConnectionInfo;t.localAddress="";t.localPort=-1;t.remoteAddress=this._addr.host;t.remotePort=this._addr.port;t.rcvSize=-1;t.sndSize=this._maxSendPacketSize;t.headers={};return t},checkSendSize:function(e){},setBufferSize:function(e,t){this._maxSendPacketSize=t},toString:function(){return this._desc},socketConnected:function(e){if(this._state==d){this.close();return}n.assert(this._connectedCallback!==null);this._connectedCallback()},socketBytesAvailable:function(e){n.assert(this._bytesAvailableCallback!==null);if(e.byteLength>0){this._readBuffers.push(e);if(this._registered){this._bytesAvailableCallback()}else if(!this._hasBytesAvailable){this._hasBytesAvailable=true}}},socketClosed:function(e){if(this._state==d){this.close();return}this._exception=g(this._state,e);if(this._state\nremote address = "+e.host+":"+e.port}function g(e,t){if(e\nremote address = "+n.host+":"+n.port;r._state=l;r._secure=t;r._exception=null;return r};Ice.WSTransceiver=_})();(function(){Ice.Router=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::Router"],-1,undefined,undefined,false);Ice.RouterPrx=t.defineProxy(Ice.ObjectPrx,Ice.Router.ice_staticId,undefined);t.defineOperations(Ice.Router,Ice.RouterPrx,{getClientProxy:[,2,1,,,[9],,,,,],getServerProxy:[,2,1,,,[9],,,,,],addProxies:[,2,2,,,["Ice.ObjectProxySeqHelper"],[["Ice.ObjectProxySeqHelper"]],,,,]});Ice.RouterFinder=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::RouterFinder"],-1,undefined,undefined,false);Ice.RouterFinderPrx=t.defineProxy(Ice.ObjectPrx,Ice.RouterFinder.ice_staticId,undefined);t.defineOperations(Ice.RouterFinder,Ice.RouterFinderPrx,{getRouter:[,,,,,["Ice.RouterPrx"],,,,,]})})();(function(){Ice.AdapterNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::AdapterNotFoundException",undefined,undefined,false,false);Ice.InvalidReplicaGroupIdException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::InvalidReplicaGroupIdException",undefined,undefined,false,false);Ice.AdapterAlreadyActiveException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::AdapterAlreadyActiveException",undefined,undefined,false,false);Ice.ObjectNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::ObjectNotFoundException",undefined,undefined,false,false);Ice.ServerNotFoundException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::ServerNotFoundException",undefined,undefined,false,false);Ice.Locator=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::Locator","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorPrx=t.defineProxy(Ice.ObjectPrx,Ice.Locator.ice_staticId,undefined);t.defineOperations(Ice.Locator,Ice.LocatorPrx,{findObjectById:[,2,1,1,,[9],[[Ice.Identity]],,[Ice.ObjectNotFoundException],,],findAdapterById:[,2,1,1,,[9],[[7]],,[Ice.AdapterNotFoundException],,],getRegistry:[,2,1,,,["Ice.LocatorRegistryPrx"],,,,,]});Ice.LocatorRegistry=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LocatorRegistry","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorRegistryPrx=t.defineProxy(Ice.ObjectPrx,Ice.LocatorRegistry.ice_staticId,undefined);t.defineOperations(Ice.LocatorRegistry,Ice.LocatorRegistryPrx,{setAdapterDirectProxy:[,2,2,1,,,[[7],[9]],,[Ice.AdapterAlreadyActiveException,Ice.AdapterNotFoundException],,],setReplicatedAdapterDirectProxy:[,2,2,1,,,[[7],[7],[9]],,[Ice.AdapterAlreadyActiveException,Ice.AdapterNotFoundException,Ice.InvalidReplicaGroupIdException],,],setServerProcessProxy:[,2,2,1,,,[[7],["Ice.ProcessPrx"]],,[Ice.ServerNotFoundException],,]});Ice.LocatorFinder=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LocatorFinder","::Ice::Object"],-1,undefined,undefined,false);Ice.LocatorFinderPrx=t.defineProxy(Ice.ObjectPrx,Ice.LocatorFinder.ice_staticId,undefined);t.defineOperations(Ice.LocatorFinder,Ice.LocatorFinderPrx,{getLocator:[,,,,,["Ice.LocatorPrx"],,,,,]})})();(function(){var e=Ice.Debug;var t=Ice.HashUtil;var n=Ice.StringUtil;var i=typeof Ice.TcpTransceiver!=="undefined"?Ice.TcpTransceiver:null;var r=Ice.Class;var s=r(Ice.IPEndpointI,{__init__:function(e,t,n,i,r,s,o){Ice.IPEndpointI.call(this,e,t,n,i,s);this._timeout=r===undefined?e?e.defaultTimeout():undefined:r;this._compress=o===undefined?false:o},getInfo:function(){var e=this.secure()?new IceSSL.EndpointInfo:new Ice.TCPEndpointInfo;this.fillEndpointInfo(e);return e},timeout:function(){return this._timeout},changeTimeout:function(e){if(e===this._timeout){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,e,this._connectionId,this._compress)}},changeConnectionId:function(e){if(e===this._connectionId){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,this._timeout,e,this._compress)}},compress:function(){return this._compress},changeCompress:function(e){if(e===this._compress){return this}else{return new s(this._instance,this._host,this._port,this._sourceAddr,this._timeout,this._connectionId,e)}},datagram:function(){return false},connectable:function(){return i!==null&&!this.secure()},connect:function(){e.assert(!this.secure());return i.createOutgoing(this._instance,this.getAddress(),this._sourceAddr)},options:function(){var e=Ice.IPEndpointI.prototype.options.call(this);if(this._timeout==-1){e+=" -t infinite"}else{e+=" -t "+this._timeout}if(this._compress){e+=" -z"}return e},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()0;this._warnUdp=t.initializationData().properties.getPropertyAsInt("Ice.Warn.Datagrams")>0;this._acmLastActivity=this._monitor!==null&&this._monitor.getACM().timeout>0?Date.now():-1;this._nextRequestId=1;this._messageSizeMax=u?u.messageSizeMax():t.messageSizeMax();this._batchRequestQueue=new i(t,o.datagram());this._sendStreams=[];this._readStream=new n(t,h.currentProtocolEncoding);this._readHeader=false;this._writeStream=new n(t,h.currentProtocolEncoding);this._readStreamPos=-1;this._writeStreamPos=-1;this._dispatchCount=0;this._state=y;this._shutdownInitiated=false;this._initialized=false;this._validated=false;this._readProtocol=new _;this._readProtocolEncoding=new I;this._asyncRequests=new c;this._exception=null;this._startPromise=null;this._closePromises=[];this._holdPromises=[];this._finishedPromises=[];if(this._adapter!==null){this._servantManager=this._adapter.getServantManager()}else{this._servantManager=null}this._callback=null},start:function(){s.assert(this._startPromise===null); +try{if(this._state>=b){s.assert(this._exception!==null);return(new l).fail(this._exception)}this._startPromise=new l;var e=this;this._transceiver.setCallbacks(function(){e.message(f.Write)},function(){e.message(f.Read)},function(t,n){e.message(f.Write);if(e._instance.traceLevels().network>=3&&t>0){var i=[];i.push("sent ");i.push(t);if(!e._endpoint.datagram()){i.push(" of ");i.push(n)}i.push(" bytes via ");i.push(e._endpoint.protocol());i.push("\n");i.push(this.toString());e._instance.initializationData().logger.trace(e._instance.traceLevels().networkCat,i.join(""))}});this.initialize()}catch(t){if(t instanceof Ice.LocalException){this.exception(t)}return(new l).fail(t)}return this._startPromise},activate:function(){if(this._state<=w){return}if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}this.setState(E)},hold:function(){if(this._state<=w){return}this.setState(x)},destroy:function(e){switch(e){case O.ObjectAdapterDeactivated:{this.setState(S,new Ice.ObjectAdapterDeactivatedException);break}case O.CommunicatorDestroyed:{this.setState(S,new Ice.CommunicatorDestroyedException);break}}},close:function(e){var n=new t(this._communicator,"close",this,null,null);if(e){this.setState(b,new Ice.ForcedCloseConnectionException);n.succeed(n)}else{this._closePromises.push(n);this.checkClose()}return n},checkClose:function(){if(this._asyncRequests.size===0&&this._closePromises.length>0){this.setState(S,new Ice.CloseConnectionException);for(var e=0;ew&&this._state=S);throw this._exception}},waitUntilHolding:function(){var e=new l;this._holdPromises.push(e);this.checkState();return e},waitUntilFinished:function(){var e=new l;this._finishedPromises.push(e);this.checkState();return e},monitor:function(e,t){if(this._state!==E){return}if(t.heartbeat==Ice.ACMHeartbeat.HeartbeatAlways||t.heartbeat!=Ice.ACMHeartbeat.HeartbeatOff&&this._writeStream.isEmpty()&&e>=this._acmLastActivity+t.timeout/4){if(t.heartbeat!=Ice.ACMHeartbeat.HeartbeatOnInvocation||this._dispatchCount>0){this.heartbeat()}}if(this._readStream.size>h.headerSize||!this._writeStream.isEmpty()){return}if(t.close!=Ice.ACMClose.CloseOff&&e>=this._acmLastActivity+t.timeout){if(t.close==Ice.ACMClose.CloseOnIdleForceful||t.close!=Ice.ACMClose.CloseOnIdle&&this._asyncRequests.size>0){this.setState(b,new Ice.ConnectionTimeoutException)}else if(t.close!=Ice.ACMClose.CloseOnInvocation&&this._dispatchCount===0&&this._batchRequestQueue.isEmpty()&&this._asyncRequests.size===0){this.setState(S,new Ice.ConnectionTimeoutException)}}},sendAsyncRequest:function(e,t,n,i){var r=0;var o=e.__os();if(this._exception!==null){throw new u(this._exception)}s.assert(this._state>w);s.assert(this._state0){o.pos=h.headerSize;o.writeInt(i)}var c;try{c=this.sendMessage(k.create(e,e.__os(),t,r))}catch(a){if(a instanceof Ice.LocalException){this.setState(b,a);s.assert(this._exception!==null);throw this._exception}else{throw a}}if(n){this._asyncRequests.set(r,e)}return c},getBatchRequestQueue:function(){return this._batchRequestQueue},flushBatchRequests:function(){var e=new r(this,this._communicator,"flushBatchRequests");e.__invoke();return e},setCallback:function(e){if(this._state>=b){if(e!==null){var t=this;d.setImmediate(function(){try{e.closed(this)}catch(n){t._logger.error("connection callback exception:\n"+n+"\n"+t._desc)}})}}else{this._callback=e}},setACM:function(e,t,n){if(this._monitor===null||this._state>=b){return}if(this._state==E){this._monitor.remove(this)}this._monitor=this._monitor.acm(e,t,n);if(this._state==E){this._monitor.add(this)}if(this._monitor.getACM().timeout<=0){this._acmLastActivity=-1}else if(this._state==E&&this._acmLastActivity==-1){this._acmLastActivity=Date.now()}},getACM:function(){return this._monitor!==null?this._monitor.getACM():new g(0,v.CloseOff,m.HeartbeatOff)},asyncRequestCanceled:function(e,t){for(var n=0;n0){this._asyncRequests.delete(i.requestId)}i.canceled();if(n!==0){this._sendStreams.splice(n,1)}e.__completedEx(t);return}}if(e instanceof Ice.OutgoingAsync){for(var r=this._asyncRequests.entries;r!==null;r=r.next){if(r.value===e){this._asyncRequests.delete(r.key);e.__completedEx(t);return}}}},sendResponse:function(e,t){s.assert(this._state>w);try{if(--this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}if(this._state>=b){s.assert(this._exception!==null);throw this._exception}this.sendMessage(k.createForStream(e,t!==0,true));if(this._state===S&&this._dispatchCount===0){this.initiateShutdown()}}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n)}else{throw n}}},sendNoResponse:function(){s.assert(this._state>w);try{if(--this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}if(this._state>=b){s.assert(this._exception!==null);throw this._exception}if(this._state===S&&this._dispatchCount===0){this.initiateShutdown()}}catch(e){if(e instanceof Ice.LocalException){this.setState(b,e)}else{throw e}}},endpoint:function(){return this._endpoint},setAdapter:function(e){if(this._state<=w||this._state>=S){return}s.assert(this._state=b){return}this.unscheduleTimeout(e);this._hasMoreData.value=(e&f.Read)!==0;var t=null;try{if((e&f.Write)!==0&&this._writeStream.buffer.remaining>0){if(!this.write(this._writeStream.buffer)){s.assert(!this._writeStream.isEmpty());this.scheduleTimeout(f.Write,this._endpoint.timeout());return}s.assert(this._writeStream.buffer.remaining===0)}if((e&f.Read)!==0&&!this._readStream.isEmpty()){if(this._readHeader){if(!this.read(this._readStream.buffer)){return}s.assert(this._readStream.buffer.remaining===0);this._readHeader=false;var n=this._readStream.pos;if(nthis._messageSizeMax){o.throwMemoryLimitException(l,this._messageSizeMax)}if(l>this._readStream.size){this._readStream.resize(l)}this._readStream.pos=n}if(this._readStream.pos!=this._readStream.size){if(this._endpoint.datagram()){throw new Ice.DatagramLimitException}else{if(!this.read(this._readStream.buffer)){s.assert(!this._readStream.isEmpty());this.scheduleTimeout(f.Read,this._endpoint.timeout());return}s.assert(this._readStream.buffer.remaining===0)}}}if(this._state<=w){if(this._state===y&&!this.initialize()){return}if(this._state<=w&&!this.validate()){return}this._transceiver.unregister();this.setState(x);if(this._startPromise!==null){++this._dispatchCount}}else{s.assert(this._state<=S);if((e&f.Read)!==0){t=this.parseMessage()}if((e&f.Write)!==0){this.sendNextMessage()}}}catch(p){if(p instanceof Ice.DatagramLimitException){if(this._warnUdp){this._logger.warning("maximum datagram size of "+this._readStream.pos+" exceeded")}this._readStream.resize(h.headerSize);this._readStream.pos=0;this._readHeader=true;return}else if(p instanceof Ice.SocketException){this.setState(b,p);return}else if(p instanceof Ice.LocalException){if(this._endpoint.datagram()){if(this._warn){this._logger.warning("datagram connection exception:\n"+p+"\n"+this._desc)}this._readStream.resize(h.headerSize);this._readStream.pos=0;this._readHeader=true}else{this.setState(b,p)}return}else{throw p}}if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}this.dispatch(t);if(this._hasMoreData.value){var _=this;d.setImmediate(function(){_.message(f.Read)})}},dispatch:function(e){var t=0;if(this._startPromise!==null){this._startPromise.succeed();this._startPromise=null;++t}if(e!==null){if(e.outAsync!==null){e.outAsync.__completed(e.stream);++t}if(e.invokeNum>0){this.invokeAll(e.stream,e.invokeNum,e.requestId,e.compress,e.servantManager,e.adapter)}if(e.heartbeatCallback){try{e.heartbeatCallback.heartbeat(this)}catch(n){this._logger.error("connection callback exception:\n"+n+"\n"+this._desc)}e.heartbeatCallback=null;++t}}if(t>0){this._dispatchCount-=t;if(this._dispatchCount===0){if(this._state===S&&!this._shutdownInitiated){try{this.initiateShutdown()}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n)}else{throw n}}}else if(this._state===C){this.reap()}this.checkState()}}},finish:function(){s.assert(this._state===b);this.unscheduleTimeout(f.Read|f.Write|f.Connect);var e;var t=this._instance.traceLevels();if(!this._initialized){if(t.network>=2){e=[];e.push("failed to establish ");e.push(this._endpoint.protocol());e.push(" connection\n");e.push(this.toString());e.push("\n");e.push(this._exception.toString());this._instance.initializationData().logger.trace(t.networkCat,e.join(""))}}else{if(t.network>=1){e=[];e.push("closed ");e.push(this._endpoint.protocol());e.push(" connection\n");e.push(this.toString());if(!(this._exception instanceof Ice.CloseConnectionException||this._exception instanceof Ice.ForcedCloseConnectionException||this._exception instanceof Ice.ConnectionTimeoutException||this._exception instanceof Ice.CommunicatorDestroyedException||this._exception instanceof Ice.ObjectAdapterDeactivatedException)){e.push("\n");e.push(this._exception.toString())}this._instance.initializationData().logger.trace(t.networkCat,e.join(""))}}if(this._startPromise!==null){this._startPromise.fail(this._exception);this._startPromise=null}if(this._sendStreams.length>0){if(!this._writeStream.isEmpty()){var n=this._sendStreams[0];this._writeStream.swap(n.stream)}for(var i=0;i0){this._asyncRequests.delete(r.requestId)}r.completed(this._exception)}this._sendStreams=[]}for(var o=this._asyncRequests.entries;o!==null;o=o.next){o.value.__completedEx(this._exception)}this._asyncRequests.clear();this._readStream.clear();this._readStream.buffer.clear();this._writeStream.clear();this._writeStream.buffer.clear();if(this._callback!==null){try{this._callback.closed(this)}catch(c){this._logger.error("connection callback exception:\n"+c+"\n"+this._desc)}this._callback=null}if(this._dispatchCount===0){this.reap()}this.setState(C)},toString:function(){return this._desc},timedOut:function(e){if(this._state<=w){this.setState(b,new Ice.ConnectTimeoutException)}else if(this._state=b){throw this._exception}var e=this._transceiver.getInfo();e.adapterName=this._adapter!==null?this._adapter.getName():"";e.incoming=this._incoming;return e},setBufferSize:function(e,t){if(this._state>=b){throw this._exception}this._transceiver.setBufferSize(e,t)},exception:function(e){this.setState(b,e)},invokeException:function(e,t){this.setState(b,e);if(t>0){s.assert(this._dispatchCount>0);this._dispatchCount-=t;s.assert(this._dispatchCount>=0);if(this._dispatchCount===0){if(this._state===C){this.reap()}this.checkState()}}},setState:function(e,t){if(t!==undefined){s.assert(t instanceof Ice.LocalException);s.assert(e>=S);if(this._state===e){return}if(this._exception===null){this._exception=t;if(this._warn&&this._validated){if(!(this._exception instanceof Ice.CloseConnectionException||this._exception instanceof Ice.ForcedCloseConnectionException||this._exception instanceof Ice.ConnectionTimeoutException||this._exception instanceof Ice.CommunicatorDestroyedException||this._exception instanceof Ice.ObjectAdapterDeactivatedException||this._exception instanceof Ice.ConnectionLostException&&this._state===S)){this.warning("connection exception",this._exception)}}}}if(this._endpoint.datagram()&&e===S){e=b}if(this._state<=w&&e===S){e=b}if(this._state===e){return}try{switch(e){case y:{s.assert(false);break}case w:{if(this._state!==y){s.assert(this._state===b);return}if(!this._endpoint.datagram()&&!this._incoming){this._transceiver.register()}break}case E:{if(this._state!==x&&this._state!==w){return}this._transceiver.register();break}case x:{if(this._state!==E&&this._state!==w){return}if(this._state===E){this._transceiver.unregister()}break}case S:{if(this._state>=b){return}if(this._state===x){this._transceiver.register()}break}case b:{if(this._state===C){return}this._batchRequestQueue.destroy(this._exception);this._transceiver.unregister();break}case C:{s.assert(this._state===b);this._transceiver.close();this._communicator=null;break}}}catch(t){if(t instanceof Ice.LocalException){var n="unexpected connection exception:\n "+this._desc+"\n"+t.toString();this._instance.initializationData().logger.error(n)}else{throw t}}if(this._monitor!==null){if(e===E){this._monitor.add(this);if(this._acmLastActivity>0){this._acmLastActivity=Date.now()}}else if(this._state===E){this._monitor.remove(this)}}this._state=e;if(this._state===S&&this._dispatchCount===0){try{this.initiateShutdown()}catch(t){if(t instanceof Ice.LocalException){this.setState(b,t)}else{throw t}}}else if(this._state===b){this.finish()}this.checkState()},initiateShutdown:function(){s.assert(this._state===S);s.assert(this._dispatchCount===0);s.assert(!this._shutdownInitiated);if(!this._endpoint.datagram()){var t=new n(this._instance,h.currentProtocolEncoding);t.writeBlob(h.magic);h.currentProtocol.__write(t);h.currentProtocolEncoding.__write(t);t.writeByte(h.closeConnectionMsg);t.writeByte(0);t.writeInt(h.headerSize);var i=this.sendMessage(k.createForStream(t,false,false));if((i&e.Sent)>0){this.scheduleTimeout(f.Write,this.closeTimeout())}}},heartbeat:function(){s.assert(this._state===E);if(!this._endpoint.datagram()){var e=new n(this._instance,h.currentProtocolEncoding);e.writeBlob(h.magic);h.currentProtocol.__write(e);h.currentProtocolEncoding.__write(e);e.writeByte(h.validateConnectionMsg);e.writeByte(0);e.writeInt(h.headerSize);try{this.sendMessage(k.createForStream(e,false,false))}catch(t){this.setState(b,t);s.assert(this._exception!==null)}}},initialize:function(){var e=this._transceiver.initialize(this._readStream.buffer,this._writeStream.buffer);if(e!=f.None){this.scheduleTimeout(e,this.connectTimeout());return false}this._desc=this._transceiver.toString();this._initialized=true;this.setState(w);return true},validate:function(){if(!this._endpoint.datagram()){if(this._adapter!==null){if(this._writeStream.size===0){this._writeStream.writeBlob(h.magic);h.currentProtocol.__write(this._writeStream);h.currentProtocolEncoding.__write(this._writeStream);this._writeStream.writeByte(h.validateConnectionMsg);this._writeStream.writeByte(0);this._writeStream.writeInt(h.headerSize);p.traceSend(this._writeStream,this._logger,this._traceLevels);this._writeStream.prepareWrite()}if(this._writeStream.pos!=this._writeStream.size&&!this.write(this._writeStream.buffer)){this.scheduleTimeout(f.Write,this.connectTimeout());return false}}else{if(this._readStream.size===0){this._readStream.resize(h.headerSize);this._readStream.pos=0}if(this._readStream.pos!==this._readStream.size&&!this.read(this._readStream.buffer)){this.scheduleTimeout(f.Read,this.connectTimeout());return false}s.assert(this._readStream.pos===h.headerSize);this._readStream.pos=0;var e=this._readStream.readBlob(4);if(e[0]!==h.magic[0]||e[1]!==h.magic[1]||e[2]!==h.magic[2]||e[3]!==h.magic[3]){var t=new Ice.BadMagicException;t.badMagic=e;throw t}this._readProtocol.__read(this._readStream);h.checkSupportedProtocol(this._readProtocol);this._readProtocolEncoding.__read(this._readStream);h.checkSupportedProtocolEncoding(this._readProtocolEncoding);var n=this._readStream.readByte();if(n!==h.validateConnectionMsg){throw new Ice.ConnectionNotValidatedException}this._readStream.readByte();var i=this._readStream.readInt();if(i!==h.headerSize){throw new Ice.IllegalMessageSizeException}p.traceRecv(this._readStream,this._logger,this._traceLevels);this._validated=true}}this._writeStream.resize(0);this._writeStream.pos=0;this._readStream.resize(h.headerSize);this._readHeader=true;this._readStream.pos=0;var r=this._instance.traceLevels();if(r.network>=1){var o=[];if(this._endpoint.datagram()){o.push("starting to send ");o.push(this._endpoint.protocol());o.push(" messages\n");o.push(this._transceiver.toDetailedString())}else{o=[];o.push("established ");o.push(this._endpoint.protocol());o.push(" connection\n");o.push(this.toString())}this._instance.initializationData().logger.trace(r.networkCat,o.join(""))}return true},sendNextMessage:function(){if(this._sendStreams.length===0){return}s.assert(!this._writeStream.isEmpty()&&this._writeStream.pos===this._writeStream.size);try{while(true){var e=this._sendStreams.shift();this._writeStream.swap(e.stream);e.sent();if(this._sendStreams.length===0){break}if(this._state>=b){return}e=this._sendStreams[0];s.assert(!e.prepared);var t=e.stream;t.pos=10;t.writeInt(t.size);t.prepareWrite();e.prepared=true;if(e.outAsync!==null){p.trace("sending asynchronous request",t,this._logger,this._traceLevels)}else{p.traceSend(t,this._logger,this._traceLevels)}this._writeStream.swap(e.stream);if(this._writeStream.pos!=this._writeStream.size&&!this.write(this._writeStream.buffer)){s.assert(!this._writeStream.isEmpty());this.scheduleTimeout(f.Write,this._endpoint.timeout());return}}}catch(n){if(n instanceof Ice.LocalException){this.setState(b,n);return}else{throw n}}s.assert(this._writeStream.isEmpty());if(this._state===S){this.scheduleTimeout(f.Write,this.closeTimeout())}},sendMessage:function(t){if(this._sendStreams.length>0){t.doAdopt();this._sendStreams.push(t);return e.Queued}s.assert(this._state0){this._acmLastActivity=Date.now()}return e.Sent}t.doAdopt();this._writeStream.swap(t.stream);this._sendStreams.push(t);this.scheduleTimeout(f.Write,this._endpoint.timeout());return e.Queued},parseMessage:function(){s.assert(this._state>w&&this._state0){var c=!this._endpoint.datagram()&&n!==0;o=new a(this._instance,this,s,c,i,n);o.invoke(r,e);--t;o=null}e.clear()}catch(u){if(u instanceof Ice.LocalException){this.invokeException(u,t)}else if(u instanceof Ice.ServantError){}else{this._logger.error("unexpected exception:\n"+u.toString());this.invokeException(new Ice.UnknownException(u),t)}}},scheduleTimeout:function(e,t){if(t<0){return}var n=this;if((e&f.Read)!==0){this._readTimeoutId=this._timer.schedule(function(){n.timedOut()},t);this._readTimeoutScheduled=true}if((e&(f.Write|f.Connect))!==0){this._writeTimeoutId=this._timer.schedule(function(){n.timedOut()},t);this._writeTimeoutScheduled=true}},unscheduleTimeout:function(e){if((e&f.Read)!==0&&this._readTimeoutScheduled){this._timer.cancel(this._readTimeoutId);this._readTimeoutScheduled=false}if((e&(f.Write|f.Connect))!==0&&this._writeTimeoutScheduled){this._timer.cancel(this._writeTimeoutId);this._writeTimeoutScheduled=false}},connectTimeout:function(){var e=this._instance.defaultsAndOverrides();if(e.overrideConnectTimeout){return e.overrideConnectTimeoutValue}else{return this._endpoint.timeout()}},closeTimeout:function(){var e=this._instance.defaultsAndOverrides();if(e.overrideCloseTimeout){return e.overrideCloseTimeoutValue}else{return this._endpoint.timeout()}},warning:function(e,t){this._logger.warning(e+":\n"+this._desc+"\n"+t.toString())},checkState:function(){if(this._state0){return}var e;if(this._holdPromises.length>0){for(e=0;e0){this._adapter=null;for(e=0;e=3&&e.position!=t){var i=[];i.push("received ");if(this._endpoint.datagram()){i.push(e.limit)}else{i.push(e.position-t);i.push(" of ");i.push(e.limit-t)}i.push(" bytes via ");i.push(this._endpoint.protocol());i.push("\n");i.push(this.toString());this._instance.initializationData().logger.trace(this._instance.traceLevels().networkCat,i.join(""))}return n},write:function(e){var t=e.position;var n=this._transceiver.write(e);if(this._instance.traceLevels().network>=3&&e.position!=t){var i=[];i.push("sent ");i.push(e.position-t);if(!this._endpoint.datagram()){i.push(" of ");i.push(e.limit-t)}i.push(" bytes via ");i.push(this._endpoint.protocol());i.push("\n");i.push(this.toString());this._instance.initializationData().logger.trace(this._instance.traceLevels().networkCat,i.join(""))}return n}});O.ObjectAdapterDeactivated=0;O.CommunicatorDestroyed=1;Ice.ConnectionI=O;var k=M({__init__:function(){this.stream=null;this.outAsync=null;this.compress=false;this.requestId=0;this.prepared=false},canceled:function(){s.assert(this.outAsync!==null);this.outAsync=null},doAdopt:function(){if(this.adopt){var e=new n(this.stream.instance,h.currentProtocolEncoding);e.swap(this.stream);this.stream=e;this.adopt=false}},sent:function(){if(this.outAsync!==null){this.outAsync.__sent()}},completed:function(e){if(this.outAsync!==null){this.outAsync.__completedEx(e)}}});k.createForStream=function(e,t,n){var i=new k;i.stream=e;i.compress=t;i.adopt=n;i.isSent=false;i.requestId=0;i.outAsync=null;return i};k.create=function(e,t,n,i){var r=new k;r.stream=t;r.compress=n;r.outAsync=e;r.requestId=i;r.isSent=false;r.adopt=false;return r}})();(function(){var e=Ice.__M.module("IceSSL");var t=Ice.HashUtil;var n=Ice.StringUtil;var i=Ice.EndpointI;var r=Ice.Class;var s=r(i,{__init__:function(e,t,n){this._instance=e;this._delegate=t;this._resource=n||"/"},getInfo:function(){var t=this._delegate.secure()?new e.WSSEndpointInfo:new Ice.WSEndpointInfo;t.resource=this._resource;this._delegate.fillEndpointInfo(t);return t},type:function(){return this._delegate.type()},protocol:function(){return this._delegate.protocol()},streamWrite:function(e){e.startWriteEncaps();this._delegate.streamWriteImpl(e);e.writeString(this._resource);e.endWriteEncaps()},timeout:function(){return this._delegate.timeout()},changeTimeout:function(e){if(e===this._delegate.timeout()){return this}else{return new s(this._instance,this._delegate.changeTimeout(e),this._resource)}},changeConnectionId:function(e){if(e===this._delegate.connectionId()){return this}else{return new s(this._instance,this._delegate.changeConnectionId(e),this._resource)}},compress:function(){return this._delegate.compress()},changeCompress:function(e){if(e===this._delegate.compress()){return this}else{return new s(this._instance,this._delegate.changeCompress(e),this._resource)}},datagram:function(){return this._delegate.datagram()},secure:function(){return this._delegate.secure()},connect:function(){return Ice.WSTransceiver.createOutgoing(this._instance,this._delegate.secure(),this._delegate.getAddress(),this._resource)},hashCode:function(){if(this._hashCode===undefined){this._hashCode=this._delegate.hashCode();this._hashCode=t.addString(this._hashCode,this._resource)}return this._hashCode},compareTo:function(e){if(this===e){return 0}if(e===null){return 1}if(!(e instanceof s)){return this.type()0){e+=" -r ";e+=this._resource.indexOf(":")!==-1?'"'+this._resource+'"':this._resource}return e},toConnectorString:function(){return this._delegate.toConnectorString()},initWithStream:function(e){this._resource=e.readString()},checkOption:function(e,t,n){if(e==="-r"){if(t===null){throw new Ice.EndpointParseException("no argument provided for -r option in endpoint "+n)}this._resource=t}else{return false}return true}});if(typeof Ice.WSTransceiver!=="undefined"){s.prototype.connectable=function(){return true}}else{s.prototype.connectable=function(){return false}}Ice.WSEndpoint=s})();(function(){var e=Ice.HashMap;var t=Ice.RouterInfo;var n=Ice.RouterPrx;var i=Ice.Class({__init__:function(){this._table=new e(e.compareEquals)},destroy:function(){for(var e=this._table.entries;e!==null;e=e.next){e.value.destroy()}this._table.clear()},find:function(e){if(e===null){return null}var i=n.uncheckedCast(e.ice_router(null));var r=this._table.get(i);if(r===undefined){r=new t(i);this._table.set(i,r)}return r},erase:function(e){var t=null;if(e!==null){var i=n.uncheckedCast(e.ice_router(null));t=this._table.get(i);this._table.delete(i)}return t}});Ice.RouterManager=i})();(function(){var e=Ice.Class;var t=Ice.Debug;var n=e({__init__:function(e,t,n,i){if(e===undefined){this.timeout=60*1e3;this.heartbeat=Ice.ACMHeartbeat.HeartbeatOnInvocation;this.close=Ice.ACMClose.CloseOnInvocationAndIdle;return}var r;if((n=="Ice.ACM.Client"||n=="Ice.ACM.Server")&&e.getProperty(n+".Timeout").length===0){r=n}else{r=n+".Timeout"}this.timeout=e.getPropertyAsIntWithDefault(r,i.timeout/1e3)*1e3;var s=e.getPropertyAsIntWithDefault(n+".Heartbeat",i.heartbeat.value);if(s>=0&&s<=Ice.ACMHeartbeat.maxValue){this.heartbeat=Ice.ACMHeartbeat.valueOf(s)}else{t.warning("invalid value for property `"+n+".Heartbeat"+"', default value will be used instead");this.heartbeat=i.heartbeat}var o=e.getPropertyAsIntWithDefault(n+".Close",i.close.value);if(o>=0&&o<=Ice.ACMClose.maxValue){this.close=Ice.ACMClose.valueOf(o)}else{t.warning("invalid value for property `"+n+".Close"+"', default value will be used instead");this.close=i.close}}});var i=e({add:function(e){t.assert(false)},remove:function(e){t.assert(false)},reap:function(e){t.assert(false)},acm:function(e){t.assert(false);return null},getACM:function(){t.assert(false);return 0}});var r=e(i,{__init__:function(e,t){this._instance=e;this._config=t;this._reapedConnections=[];this._connections=[]},destroy:function(){if(this._instance===null){return}this._instance=null},add:function(e){if(this._config.timeout===0){return}this._connections.push(e);if(this._connections.length==1){var t=this;this._timerToken=this._instance.timer().scheduleRepeated(function(){t.runTimerTask()},this._config.timeout/2)}},remove:function(e){if(this._config.timeout===0){return}var n=this._connections.indexOf(e);t.assert(n>=0);this._connections.splice(n,1);if(this._connections.length===0){this._instance.timer().cancel(this._timerToken);return}},reap:function(e){this._reapedConnections.push(e)},acm:function(e,i,r){t.assert(this._instance!==null);var o=new n;o.timeout=this._config.timeout;o.close=this._config.close;o.heartbeat=this._config.heartbeat;if(e!==undefined){o.timeout=e*1e3}if(i!==undefined){o.close=i}if(r!==undefined){o.heartbeat=r}return new s(this,this._instance.timer(),o)},getACM:function(){return new Ice.ACM(this._config.timeout/1e3,this._config.close,this._config.heartbeat)},swapReapedConnections:function(){if(this._reapedConnections.length===0){return null}var e=this._reapedConnections;this._reapedConnections=[];return e},runTimerTask:function(){if(this._instance===null){this._connections=null;return}var e=Date.now();for(var t=0;t0){var n=this;this._timerToken=this._timer.scheduleRepeated(function(){n.runTimerTask()},this._config.timeout/2)}},remove:function(e){t.assert(this._connection===e);this._connection=null;if(this._config.timeout>0){this._timer.cancel(this._timerToken)}},reap:function(e){this._parent.reap(e)},acm:function(e,t,n){return this._parent.acm(e,t,n)},getACM:function(){return new Ice.ACM(this._config.timeout/1e3,this._config.close,this._config.heartbeat); +},runTimerTask:function(){try{this._connection.monitor(Date.now(),this._config)}catch(e){this._parent.handleException(e)}}});Ice.FactoryACMMonitor=r;Ice.ACMConfig=n})();(function(){var e=Ice.Context;var t=Ice.InitializationException;var n=Ice.Class({__init__:function(){this._context=new e},getContext:function(){return new e(this._context)},setContext:function(t){if(t!==null&&t.size>0){this._context=new e(t)}else{this._context.clear()}},containsKey:function(e){if(e===null){e=""}return this._context.has(e)},get:function(e){if(e===null){e=""}var t=this._context.get(e);if(t===null){t=""}return t},put:function(e,t){if(e===null){e=""}if(t===null){t=""}var n=this._context.get(e);if(n===null){n=""}this._context.set(e,t);return n},remove:function(e){if(e===null){e=""}var t=this._context.get(e);this._context.delete(e);if(t===null){t=""}return t},write:function(t,n){if(t.size===0){Ice.ContextHelper.write(n,this._context)}else{var i=null;if(this._context.size===0){i=t}else{i=new e(this._context);i.merge(t)}Ice.ContextHelper.write(n,i)}}});n.create=function(e){if(e.length===0||e==="None"){return null}else if(e==="Shared"){return new n}else{throw new t("'"+e+"' is not a valid value for Ice.ImplicitContext")}};Ice.ImplicitContextI=n})();(function(){var e=Ice.ArrayUtil;var t=Ice.Debug;var n=Ice.BatchRequestQueue;var i=Ice.HashMap;var r=Ice.HashUtil;var s=Ice.OpaqueEndpointI;var o=Ice.Promise;var c=Ice.Protocol;var a=Ice.ReferenceMode;var u=Ice.StringUtil;var l=Ice.StringSeqHelper;var h=Ice.EndpointSelectionType;var f=Ice.Identity;var d=Ice.RouterPrx;var p=Ice.LocatorPrx;var _=Ice.PropertyNames;var I=Ice.ConnectionRequestHandler;var g=Ice.Class;var v=["EndpointSelection","ConnectionCached","PreferSecure","EncodingVersion","LocatorCacheTimeout","InvocationTimeout","Locator","Router","CollocationOptimized"];var m=g({__init__:function(e,t){this._instance=e;this._communicator=t;this._defaultRouter=null;this._defaultLocator=null},create:function(e,t,n,i){if(e.name.length===0&&e.category.length===0){return null}return this.createImpl(e,t,n.getMode(),n.getSecure(),n.getProtocol(),n.getEncoding(),i,null,null)},createWithAdapterId:function(e,t,n,i){if(e.name.length===0&&e.category.length===0){return null}return this.createImpl(e,t,n.getMode(),n.getSecure(),n.getProtocol(),n.getEncoding(),null,i,null)},createFixed:function(e,t){if(e.name.length===0&&e.category.length===0){return null}var n=new w(this._instance,this._communicator,e,"",t.endpoint().datagram()?a.ModeDatagram:a.ModeTwoway,t.endpoint().secure(),this._instance.defaultsAndOverrides().defaultEncoding,t);return n},copy:function(e){var t=e.getIdentity();if(t.name.length===0&&t.category.length===0){return null}return e.clone()},createFromString:function(e,n){if(e===undefined||e===null||e.length===0){return null}var i=" \t\n\r";var r;var s=0;r=u.findFirstNotOf(e,i,s);if(r==-1){throw new Ice.ProxyParseException("no non-whitespace characters found in `"+e+"'")}var o=null;s=u.checkQuote(e,r);if(s===-1){throw new Ice.ProxyParseException("mismatched quotes around identity in `"+e+"'")}else if(s===0){s=u.findFirstOf(e,i+":@",r);if(s===-1){s=e.length}o=e.substring(r,s)}else{r++;o=e.substring(r,s);s++}if(r===s){throw new Ice.ProxyParseException("no identity in `"+e+"'")}var c=this._instance.stringToIdentity(o);if(c.name.length===0){if(c.category.length>0){throw new Ice.IllegalIdentityException(c)}else if(u.findFirstNotOf(e,i,s)!=-1){throw new Ice.ProxyParseException("invalid characters after identity in `"+e+"'")}else{return null}}var l="";var h=a.ModeTwoway;var f=false;var d=this._instance.defaultsAndOverrides().defaultEncoding;var p=Ice.Protocol_1_0;var _="";while(true){r=u.findFirstNotOf(e,i,s);if(r===-1){break}if(e.charAt(r)==":"||e.charAt(r)=="@"){break}s=u.findFirstOf(e,i+":@",r);if(s==-1){s=e.length}if(r==s){break}var I=e.substring(r,s);if(I.length!=2||I.charAt(0)!="-"){throw new Ice.ProxyParseException("expected a proxy option but found `"+I+"' in `"+e+"'")}var g=null;var v=u.findFirstNotOf(e,i,s);if(v!=-1){var m=e.charAt(v);if(m!="@"&&m!=":"&&m!="-"){r=v;s=u.checkQuote(e,r);if(s==-1){throw new Ice.ProxyParseException("mismatched quotes around value for "+I+" option in `"+e+"'")}else if(s===0){s=u.findFirstOf(e,i+":@",r);if(s===-1){s=e.length}g=e.substring(r,s)}else{r++;g=e.substring(r,s);s++}}}switch(I.charAt(1)){case"f":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -f option in `"+e+"'")}try{l=u.unescapeString(g,0,g.length)}catch(y){throw new Ice.ProxyParseException("invalid facet in `"+e+"': "+y.message)}break}case"t":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -t option in `"+e+"'")}h=a.ModeTwoway;break}case"o":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -o option in `"+e+"'")}h=a.ModeOneway;break}case"O":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -O option in `"+e+"'")}h=a.ModeBatchOneway;break}case"d":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -d option in `"+e+"'")}h=a.ModeDatagram;break}case"D":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -D option in `"+e+"'")}h=a.ModeBatchDatagram;break}case"s":{if(g!==null){throw new Ice.ProxyParseException("unexpected argument `"+g+"' provided for -s option in `"+e+"'")}f=true;break}case"e":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -e option in `"+e+"'")}try{d=Ice.stringToEncodingVersion(g)}catch(w){throw new Ice.ProxyParseException("invalid encoding version `"+g+"' in `"+e+"':\n"+w.str)}break}case"p":{if(g===null){throw new Ice.ProxyParseException("no argument provided for -p option in `"+e+"'")}try{p=Ice.stringToProtocolVersion(g)}catch(w){throw new Ice.ProxyParseException("invalid protocol version `"+g+"' in `"+e+"':\n"+w.str)}break}default:{throw new Ice.ProxyParseException("unknown option `"+I+"' in `"+e+"'")}}}if(r===-1){return this.createImpl(c,l,h,f,p,d,null,null,n)}var E=[];if(e.charAt(r)==":"){var x=[];s=r;while(s0);throw new Ice.EndpointParseException("invalid endpoint `"+x[0]+"' in `"+e+"'")}else if(x.length!==0&&this._instance.initializationData().properties.getPropertyAsIntWithDefault("Ice.Warn.Endpoints",1)>0){var M=[];M.push("Proxy contains unknown endpoints:");for(var O=0;O0){if(n.length>1){throw new Ice.ProxyUnmarshalException}i=n[0]}else{i=""}var r=t.readByte();if(r<0||r>a.ModeLast){throw new Ice.ProxyUnmarshalException}var s=t.readBool();var o=null;var c=null;if(!t.getReadEncoding().equals(Ice.Encoding_1_0)){o=new Ice.ProtocolVersion;o.__read(t);c=new Ice.EncodingVersion;c.__read(t)}else{o=Ice.Protocol_1_0;c=Ice.Encoding_1_0}var u=null;var h=null;var f=t.readSize();if(f>0){u=[];for(var d=0;d0){var c=[];c.push("found unknown properties for proxy '");c.push(e);c.push("':");for(n=0,i=t.length;n0){var y=this._instance.initializationData().properties;if(y.getPropertyAsIntWithDefault("Ice.Warn.UnknownProperties",1)>0){this.checkForUnknownProperties(a)}var w;w=a+".Locator";var x=p.uncheckedCast(this._communicator.propertyToProxy(w));if(x!==null){if(!x.__reference().getEncoding().equals(s)){l=this._instance.locatorManager().find(x.ice_encodingVersion(s))}else{l=this._instance.locatorManager().find(x)}}w=a+".Router";var S=d.uncheckedCast(this._communicator.propertyToProxy(w));if(S!==null){var b=".Router";if(a.lastIndexOf(b)==a.length-b.length){var C="`"+w+"="+y.getProperty(w)+"': cannot set a router on a router; setting ignored";this._instance.initializationData().logger.warning(C)}else{f=this._instance.routerManager().find(S)}}w=a+".ConnectionCached";_=y.getPropertyAsIntWithDefault(w,_?1:0)>0;w=a+".PreferSecure";I=y.getPropertyAsIntWithDefault(w,I?1:0)>0;w=a+".EndpointSelection";if(y.getProperty(w).length>0){var P=y.getProperty(w);if(P=="Random"){g=h.Random}else if(P=="Ordered"){g=h.Ordered}else{throw new Ice.EndpointSelectionTypeParseException("illegal value `"+P+"'; expected `Random' or `Ordered'")}}w=a+".LocatorCacheTimeout";var M=y.getProperty(w);if(M.length!==0){v=y.getPropertyAsIntWithDefault(w,v);if(v<-1){v=-1;this._instance.initializationData().logger.warning("invalid value for"+w+"`"+y.getProperty(w)+"': defaulting to -1")}}w=a+".InvocationTimeout";M=y.getProperty(w);if(M.length!==0){m=y.getPropertyAsIntWithDefault(w,m);if(m<1&&m!==-1){m=-1;this._instance.initializationData().logger.warning("invalid value for"+w+"`"+y.getProperty(w)+"': defaulting to -1")}}}return new E(this._instance,this._communicator,e,t,n,i,r,s,o,c,l,f,_,I,g,v,m)}});Ice.ReferenceFactory=m;var y=g({__init__:function(e,n,i,r,s,o,c,a,u){t.assert(i===undefined||i.name!==null);t.assert(i===undefined||i.category!==null);t.assert(r===undefined||r!==null);this._instance=e;this._communicator=n;this._mode=s;this._secure=o;this._identity=i;this._context=y._emptyContext;this._facet=r;this._protocol=c;this._encoding=a;this._invocationTimeout=u;this._hashInitialized=false;this._overrideCompress=false;this._compress=false},getMode:function(){return this._mode},getSecure:function(){return this._secure},getProtocol:function(){return this._protocol},getEncoding:function(){return this._encoding},getIdentity:function(){return this._identity},getFacet:function(){return this._facet},getInstance:function(){return this._instance},getContext:function(){return this._context},getInvocationTimeout:function(){return this._invocationTimeout},getCommunicator:function(){return this._communicator},getEndpoints:function(){t.assert(false);return null},getAdapterId:function(){t.assert(false);return""},getRouterInfo:function(){t.assert(false);return null},getLocatorInfo:function(){t.assert(false);return null},getCacheConnection:function(){t.assert(false);return false},getPreferSecure:function(){t.assert(false);return false},getEndpointSelection:function(){t.assert(false);return null},getLocatorCacheTimeout:function(){t.assert(false);return 0},getConnectionId:function(){t.assert(false);return""},changeContext:function(e){if(e===undefined||e===null){e=y._emptyContext}var t=this._instance.referenceFactory().copy(this);if(e.size===0){t._context=y._emptyContext}else{t._context=new i(e)}return t},changeMode:function(e){if(e===this._mode){return this}var t=this._instance.referenceFactory().copy(this);t._mode=e;return t},changeSecure:function(e){if(e===this._secure){return this}var t=this._instance.referenceFactory().copy(this);t._secure=e;return t},changeIdentity:function(e){if(e.equals(this._identity)){return this}var t=this._instance.referenceFactory().copy(this);t._identity=new f(e.name,e.category);return t},changeFacet:function(e){if(e===this._facet){return this}var t=this._instance.referenceFactory().copy(this);t._facet=e;return t},changeInvocationTimeout:function(e){if(e===this._invocationTimeout){return this}var t=this._instance.referenceFactory().copy(this);t._invocationTimeout=e;return t},changeEncoding:function(e){if(e.equals(this._encoding)){return this}var t=this._instance.referenceFactory().copy(this);t._encoding=e;return t},changeCompress:function(e){if(this._overrideCompress&&this._compress===e){return this}var t=this._instance.referenceFactory().copy(this);t._compress=e;t._overrideCompress=true;return t},changeAdapterId:function(e){t.assert(false);return null},changeEndpoints:function(e){t.assert(false);return null},changeLocator:function(e){t.assert(false);return null},changeRouter:function(e){t.assert(false);return null},changeCacheConnection:function(e){t.assert(false);return null},changePreferSecure:function(e){t.assert(false);return null},changeEndpointSelection:function(e){t.assert(false);return null},changeLocatorCacheTimeout:function(e){t.assert(false);return null},changeTimeout:function(e){t.assert(false);return null},changeConnectionId:function(e){t.assert(false);return null},hashCode:function(){if(this._hashInitialized){return this._hashValue}var e=5381;e=r.addNumber(e,this._mode);e=r.addBoolean(e,this._secure);e=r.addHashable(e,this._identity);if(this._context!==null&&this._context!==undefined){for(var t=this._context.entries;t!==null;t=t.next){e=r.addString(e,t.key);e=r.addString(e,t.value)}}e=r.addString(e,this._facet);e=r.addBoolean(e,this._overrideCompress);if(this._overrideCompress){e=r.addBoolean(e,this._compress)}e=r.addHashable(e,this._protocol);e=r.addHashable(e,this._encoding);e=r.addNumber(e,this._invocationTimeout);this._hashValue=e;this._hashInitialized=true;return this._hashValue},isIndirect:function(){t.assert(false);return false},isWellKnown:function(){t.assert(false);return false},streamWrite:function(e){if(this._facet.length===0){e.writeSize(0)}else{e.writeSize(1);e.writeString(this._facet)}e.writeByte(this._mode);e.writeBool(this._secure);if(!e.getWriteEncoding().equals(Ice.Encoding_1_0)){this._protocol.__write(e);this._encoding.__write(e)}},toString:function(){var e=[];var t=this._instance.identityToString(this._identity);if(t.search(/[ :@]/)!=-1){e.push('"');e.push(t);e.push('"')}else{e.push(t)}if(this._facet.length>0){e.push(" -f ");var n=u.escapeString(this._facet,"");if(n.search(/[ :@]/)!=-1){e.push('"');e.push(n);e.push('"')}else{e.push(n)}}switch(this._mode){case a.ModeTwoway:{e.push(" -t");break}case a.ModeOneway:{e.push(" -o");break}case a.ModeBatchOneway:{e.push(" -O");break}case a.ModeDatagram:{e.push(" -d");break}case a.ModeBatchDatagram:{e.push(" -D");break}}if(this._secure){e.push(" -s")}if(!this._protocol.equals(Ice.Protocol_1_0)){e.push(" -p ");e.push(Ice.protocolVersionToString(this._protocol))}e.push(" -e ");e.push(Ice.encodingVersionToString(this._encoding));return e.join("")},toProperty:function(e){t.assert(false);return null},getRequestHandler:function(e){t.assert(false)},getBatchRequestQueue:function(){t.assert(false)},equals:function(e){if(this._mode!==e._mode){return false}if(this._secure!==e._secure){return false}if(!this._identity.equals(e._identity)){return false}if(!this._context.equals(e._context)){return false}if(this._facet!==e._facet){return false}if(this._overrideCompress!==e._overrideCompress){return false}if(this._overrideCompress&&this._compress!==e._compress){return false}if(!this._protocol.equals(e._protocol)){return false}if(!this._encoding.equals(e._encoding)){return false}if(this._invocationTimeout!==e._invocationTimeout){return false}return true},clone:function(){t.assert(false);return null},copyMembers:function(e){e._context=this._context;e._overrideCompress=this._overrideCompress;e._compress=this._compress}});y._emptyContext=new i;y._emptyEndpoints=[];Ice.Reference=y;var w=g(y,{__init__:function(e,t,n,i,r,s,o,c){y.call(this,e,t,n,i,r,s,Ice.Protocol_1_0,o);this._fixedConnection=c},getEndpoints:function(){return y._emptyEndpoints},getAdapterId:function(){return""},getRouterInfo:function(){return null},getLocatorInfo:function(){return null},getCacheConnection:function(){return true},getPreferSecure:function(){return false},getEndpointSelection:function(){return h.Random},getLocatorCacheTimeout:function(){return 0},getConnectionId:function(){return""},changeAdapterId:function(e){throw new Ice.FixedProxyException},changeEndpoints:function(e){throw new Ice.FixedProxyException},changeLocator:function(e){throw new Ice.FixedProxyException},changeRouter:function(e){throw new Ice.FixedProxyException},changeCacheConnection:function(e){throw new Ice.FixedProxyException},changePreferSecure:function(e){throw new Ice.FixedProxyException},changeEndpointSelection:function(e){throw new Ice.FixedProxyException},changeLocatorCacheTimeout:function(e){throw new Ice.FixedProxyException},changeTimeout:function(e){throw new Ice.FixedProxyException},changeConnectionId:function(e){throw new Ice.FixedProxyException},isIndirect:function(){return false},isWellKnown:function(){return false},streamWrite:function(e){throw new Ice.FixedProxyException},toString:function(){throw new Ice.FixedProxyException},toProperty:function(e){throw new Ice.FixedProxyException},clone:function(){var e=new w(this.getInstance(),this.getCommunicator(),this.getIdentity(),this.getFacet(),this.getMode(),this.getSecure(),this.getEncoding(),this._fixedConnection);this.copyMembers(e);return e},getRequestHandler:function(e){switch(this.getMode()){case a.ModeTwoway:case a.ModeOneway:case a.ModeBatchOneway:{if(this._fixedConnection.endpoint().datagram()){throw new Ice.NoEndpointException("")}break}case a.ModeDatagram:case a.ModeBatchDatagram:{if(!this._fixedConnection.endpoint().datagram()){throw new Ice.NoEndpointException("")}break}}var t;var n=this.getInstance().defaultsAndOverrides();if(n.overrideSecure){t=n.overrideSecureValue}else{t=this.getSecure()}if(t&&!this._fixedConnection.endpoint().secure()){throw new Ice.NoEndpointException("")}this._fixedConnection.throwException();var i;if(n.overrideCompress){i=n.overrideCompressValue}else if(this._overrideCompress){i=this._compress}else{i=this._fixedConnection.endpoint().compress()}return e.__setRequestHandler(new I(this,this._fixedConnection,i))},getBatchRequestQueue:function(){return this._fixedConnection.getBatchRequestQueue()},equals:function(e){if(this===e){return true}if(!(e instanceof w)){return false}if(!y.prototype.equals.call(this,e)){return false}return this._fixedConnection.equals(e._fixedConnection)}});Ice.FixedReference=w;var E=g(y,{__init__:function(e,n,i,r,s,o,c,a,u,l,h,f,d,p,_,I,g){y.call(this,e,n,i,r,s,o,c,a,g);this._endpoints=u;this._adapterId=l;this._locatorInfo=h;this._routerInfo=f;this._cacheConnection=d;this._preferSecure=p;this._endpointSelection=_;this._locatorCacheTimeout=I;this._overrideTimeout=false;this._timeout=-1;if(this._endpoints===null){this._endpoints=y._emptyEndpoints}if(this._adapterId===null){this._adapterId=""}this._connectionId="";t.assert(this._adapterId.length===0||this._endpoints.length===0)},getEndpoints:function(){return this._endpoints},getAdapterId:function(){return this._adapterId},getRouterInfo:function(){return this._routerInfo},getLocatorInfo:function(){return this._locatorInfo},getCacheConnection:function(){return this._cacheConnection},getPreferSecure:function(){return this._preferSecure},getEndpointSelection:function(){return this._endpointSelection},getLocatorCacheTimeout:function(){return this._locatorCacheTimeout},getConnectionId:function(){return this._connectionId},changeEncoding:function(e){var t=y.prototype.changeEncoding.call(this,e);if(t!==this){var n=t._locatorInfo;if(n!==null&&!n.getLocator().ice_getEncodingVersion().equals(e)){t._locatorInfo=this.getInstance().locatorManager().find(n.getLocator().ice_encodingVersion(e))}}return t},changeCompress:function(e){var t=y.prototype.changeCompress.call(this,e);if(t!==this&&this._endpoints.length>0){var n=[];for(var i=0;i0){var n=[];for(var i=0;i0){var n=[];for(var i=0;i0){t.assert(this._adapterId.length===0);for(var n=0;n0){for(var t=0;t0){e.push(":");e.push(n)}}}else if(this._adapterId.length>0){e.push(" @ ");var i=u.escapeString(this._adapterId,null);if(i.search(/[ :@]/)!=-1){e.push('"');e.push(i);e.push('"')}else{e.push(i)}}return e.join("")},toProperty:function(e){var t=new i,n;t.set(e,this.toString());t.set(e+".CollocationOptimized","0");t.set(e+".ConnectionCached",this._cacheConnection?"1":"0");t.set(e+".PreferSecure",this._preferSecure?"1":"0");t.set(e+".EndpointSelection",this._endpointSelection===h.Random?"Random":"Ordered");t.set(e+".LocatorCacheTimeout",""+this._locatorCacheTimeout);t.set(e+".InvocationTimeout",""+this.getInvocationTimeout());if(this._routerInfo!==null){var r=this._routerInfo.getRouter();var s=r.__reference().toProperty(e+".Router");for(n=s.entries;n!==null;n=n.next){t.set(n.key,n.value)}}if(this._locatorInfo!==null){var o=this._locatorInfo.getLocator();var c=o.__reference().toProperty(e+".Locator");for(n=c.entries;n!==null;n=n.next){t.set(n.key,n.value)}}return t},hashCode:function(){if(!this._hashInitialized){y.prototype.hashCode.call(this);this._hashValue=r.addString(this._hashValue,this._adapterId)}return this._hashValue},equals:function(t){if(this===t){return true}if(!(t instanceof E)){return false}if(!y.prototype.equals.call(this,t)){return false}if(this._locatorInfo===null?t._locatorInfo!==null:!this._locatorInfo.equals(t._locatorInfo)){return false}if(this._routerInfo===null?t._routerInfo!==null:!this._routerInfo.equals(t._routerInfo)){return false}if(this._cacheConnection!==t._cacheConnection){return false}if(this._preferSecure!==t._preferSecure){return false}if(this._endpointSelection!==t._endpointSelection){return false}if(this._locatorCacheTimeout!==t._locatorCacheTimeout){return false}if(this._connectionId!==t._connectionId){return false}if(this._overrideTimeout!==t._overrideTimeout){return false}if(this._overrideTimeout&&this._timeout!==t._timeout){return false}if(!e.equals(this._endpoints,t._endpoints,function(e,t){return e.equals(t)})){return false}if(this._adapterId!==t._adapterId){return false}return true},getRequestHandler:function(e){return this._instance.requestHandlerFactory().getRequestHandler(this,e)},getBatchRequestQueue:function(){return new n(this._instance,this._mode===a.ModeBatchDatagram)},getConnection:function(){var e=new o;if(this._routerInfo!==null){var t=this;this._routerInfo.getClientEndpoints().then(function(n){if(n.length>0){t.applyOverrides(n);t.createConnection(n).then(function(t,n){e.succeed(t,n)},function(t){e.fail(t)})}else{t.getConnectionNoRouterInfo(e)}}).exception(function(t){e.fail(t)})}else{this.getConnectionNoRouterInfo(e)}return e},getConnectionNoRouterInfo:function(e){if(this._endpoints.length>0){this.createConnection(this._endpoints).then(function(t,n){e.succeed(t,n)}).exception(function(t){e.fail(t)});return}var n=this;if(this._locatorInfo!==null){this._locatorInfo.getEndpoints(this,null,this._locatorCacheTimeout).then(function(i,r){if(i.length===0){e.fail(new Ice.NoEndpointException(n.toString()));return}n.applyOverrides(i);n.createConnection(i).then(function(t,n){e.succeed(t,n)},function(i){if(i instanceof Ice.NoEndpointException){e.fail(i)}else{t.assert(n._locatorInfo!==null);n.getLocatorInfo().clearCache(n);if(r){var s=n.getInstance().traceLevels();if(s.retry>=2){var o="connection to cached endpoints failed\n"+"removing endpoints from cache and trying one more time\n"+i.toString();n.getInstance().initializationData().logger.trace(s.retryCat,o)}n.getConnectionNoRouterInfo(e);return}e.fail(i)}})}).exception(function(t){e.fail(t)})}else{e.fail(new Ice.NoEndpointException(this.toString()))}},clone:function(){var e=new E(this.getInstance(),this.getCommunicator(),this.getIdentity(),this.getFacet(),this.getMode(),this.getSecure(),this.getProtocol(),this.getEncoding(),this._endpoints,this._adapterId,this._locatorInfo,this._routerInfo,this._cacheConnection,this._preferSecure,this._endpointSelection,this._locatorCacheTimeout,this._invocationTimeout);this.copyMembers(e);return e},copyMembers:function(e){y.prototype.copyMembers.call(this,e);e._overrideTimeout=this._overrideTimeout;e._timeout=this._timeout;e._connectionId=this._connectionId},applyOverrides:function(e){for(var t=0;t0){throw new n("unrecognized argument `"+a[0]+"' in endpoint `"+e+"'")}return f}}if(u==="opaque"){var d=new i;d.initWithOptions(a);if(a.length>0){throw new n("unrecognized argument `"+a[0]+"' in endpoint `"+e+"'")}for(l=0,h=this._factories.length;l0){this._retryIntervals=[];for(var n=0;n0?r:0}}else{this._retryIntervals=[0]}},stringToProxy:function(e){var t=this._instance.referenceFactory().createFromString(e,null);return this.referenceToProxy(t)},proxyToString:function(e){if(e!==null){return e.__reference().toString()}else{return""}},propertyToProxy:function(e){var t=this._instance.initializationData().properties.getProperty(e);var n=this._instance.referenceFactory().createFromString(t,e);return this.referenceToProxy(n)},proxyToProperty:function(e,n){if(e!==null){return e.__reference().toProperty(n)}else{return new t}},streamToProxy:function(e,t){var n=new r;n.__read(e);var i=this._instance.referenceFactory().createFromStream(n,e);return this.referenceToProxy(i,t)},referenceToProxy:function(e,t){if(e!==null){var i=t?new t:new n;i.__setup(e);return i}else{return null}},proxyToStream:function(e,t){if(e!==null){var n=e.__reference();n.getIdentity().__write(t);n.streamWrite(t)}else{var i=new r("","");i.__write(t)}},checkRetryAfterException:function(t,n,i,r){var s=this._instance.traceLevels();var o=this._instance.initializationData().logger;if(n.getMode()===Ice.Reference.ModeBatchOneway||n.getMode()===Ice.Reference.ModeBatchDatagram){throw t}if(t instanceof Ice.ObjectNotExistException){var c=t;if(n.getRouterInfo()!==null&&c.operation==="ice_add_proxy"){n.getRouterInfo().clearCache(n);if(s.retry>=1){o.trace(s.retryCat,"retrying operation call to add proxy to router\n"+t.toString())}if(i!==null){i.value=0}return r}else if(n.isIndirect()){if(n.isWellKnown()){var a=n.getLocatorInfo();if(a!==null){a.clearCache(n)}}}else{throw t}}else if(t instanceof Ice.RequestFailedException){throw t}if(t instanceof Ice.MarshalException){throw t}if(t instanceof Ice.CommunicatorDestroyedException||t instanceof Ice.ObjectAdapterDeactivatedException){throw t}if(t instanceof Ice.InvocationTimeoutException||t instanceof Ice.InvocationCanceledException){throw t}++r;e.assert(r>0);var u;if(r===this._retryIntervals.length+1&&t instanceof Ice.CloseConnectionException){u=0}else if(r>this._retryIntervals.length){if(s.retry>=1){o.trace(s.retryCat,"cannot retry operation call because retry limit has been exceeded\n"+t.toString())}throw t}else{u=this._retryIntervals[r-1]}if(s.retry>=1){var l="retrying operation call";if(u>0){l+=" in "+u+"ms"}l+=" because of exception\n"+t.toString();o.trace(s.retryCat,l)}e.assert(i!==null);i.value=u;return r}});Ice.ProxyFactory=s})();(function(){var e=Ice.FormatType;var t=Ice.EndpointSelectionType;var n=Ice.Protocol;var i=function(i,r){this.defaultProtocol=i.getPropertyWithDefault("Ice.Default.Protocol",Ice.TcpEndpointFactory!==undefined?"tcp":"ws");var s=i.getProperty("Ice.Default.Host");this.defaultHost=s.length>0?s:null;s=i.getProperty("Ice.Default.SourceAddress");this.defaultSourceAddress=s.length>0?s:null;s=i.getProperty("Ice.Override.Timeout");if(s.length>0){this.overrideTimeout=true;this.overrideTimeoutValue=i.getPropertyAsInt("Ice.Override.Timeout");if(this.overrideTimeoutValue<1&&this.overrideTimeoutValue!==-1){this.overrideTimeoutValue=-1;r.warning("invalid value for Ice.Override.Timeout `"+i.getProperty("Ice.Override.Timeout")+"': defaulting to -1")}}else{this.overrideTimeout=false;this.overrideTimeoutValue=-1}s=i.getProperty("Ice.Override.ConnectTimeout");if(s.length>0){this.overrideConnectTimeout=true;this.overrideConnectTimeoutValue=i.getPropertyAsInt("Ice.Override.ConnectTimeout");if(this.overrideConnectTimeoutValue<1&&this.overrideConnectTimeoutValue!==-1){this.overrideConnectTimeoutValue=-1;r.warning("invalid value for Ice.Override.ConnectTimeout `"+i.getProperty("Ice.Override.ConnectTimeout")+"': defaulting to -1")}}else{this.overrideConnectTimeout=false;this.overrideConnectTimeoutValue=-1}s=i.getProperty("Ice.Override.CloseTimeout");if(s.length>0){this.overrideCloseTimeout=true;this.overrideCloseTimeoutValue=i.getPropertyAsInt("Ice.Override.CloseTimeout");if(this.overrideCloseTimeoutValue<1&&this.overrideCloseTimeoutValue!==-1){this.overrideCloseTimeoutValue=-1;r.warning("invalid value for Ice.Override.CloseTimeout `"+i.getProperty("Ice.Override.CloseTimeout")+"': defaulting to -1")}}else{this.overrideCloseTimeout=false;this.overrideCloseTimeoutValue=-1}this.overrideCompress=false;this.overrideSecure=false;s=i.getPropertyWithDefault("Ice.Default.EndpointSelection","Random");if(s==="Random"){this.defaultEndpointSelection=t.Random}else if(s==="Ordered"){this.defaultEndpointSelection=t.Ordered}else{var o=new Ice.EndpointSelectionTypeParseException;o.str="illegal value `"+s+"'; expected `Random' or `Ordered'";throw o}this.defaultTimeout=i.getPropertyAsIntWithDefault("Ice.Default.Timeout",6e4);if(this.defaultTimeout<1&&this.defaultTimeout!==-1){this.defaultTimeout=6e4;r.warning("invalid value for Ice.Default.Timeout `"+i.getProperty("Ice.Default.Timeout")+"': defaulting to 60000")}this.defaultLocatorCacheTimeout=i.getPropertyAsIntWithDefault("Ice.Default.LocatorCacheTimeout",-1);if(this.defaultLocatorCacheTimeout<-1){this.defaultLocatorCacheTimeout=-1;r.warning("invalid value for Ice.Default.LocatorCacheTimeout `"+i.getProperty("Ice.Default.LocatorCacheTimeout")+"': defaulting to -1")}this.defaultInvocationTimeout=i.getPropertyAsIntWithDefault("Ice.Default.InvocationTimeout",-1);if(this.defaultInvocationTimeout<1&&this.defaultInvocationTimeout!==-1){this.defaultInvocationTimeout=-1;r.warning("invalid value for Ice.Default.InvocationTimeout `"+i.getProperty("Ice.Default.InvocationTimeout")+"': defaulting to -1")}this.defaultPreferSecure=i.getPropertyAsIntWithDefault("Ice.Default.PreferSecure",0)>0;s=i.getPropertyWithDefault("Ice.Default.EncodingVersion",Ice.encodingVersionToString(n.currentEncoding));this.defaultEncoding=Ice.stringToEncodingVersion(s);n.checkSupportedEncoding(this.defaultEncoding);var c=i.getPropertyAsIntWithDefault("Ice.Default.SlicedFormat",0)>0;this.defaultFormat=c?e.SlicedFormat:e.CompactFormat};Ice.DefaultsAndOverrides=i})();(function(){var e=Ice.StringUtil;var t=Ice.Identity;var n=Ice.IdentityParseException;Ice.stringToIdentity=function(i){var r=new t;var s=-1;var o=0;while((o=i.indexOf("/",o))!==-1){var c=0;while(o-c>0&&i.charAt(o-c-1)=="\\"){c++}if(c%2===0){if(s==-1){s=o}else{var a=new n;a.str="unescaped backslash in identity `"+i+"'";throw a}}o++}if(s==-1){r.category="";try{r.name=e.unescapeString(i)}catch(u){var a=new n;a.str="invalid identity name `"+i+"': "+a.toString();throw a}}else{try{r.category=e.unescapeString(i,0,s)}catch(u){var a=new n;a.str="invalid category in identity `"+i+"': "+a.toString();throw a}if(s+10);var i=this.applyOverrides(e);try{var s={value:false};var c=this.findConnectionByEndpoint(i,s);if(c!==null){return(new o).succeed(c,s.value)}}catch(a){return(new o).fail(a)}var u=new f(this,i,t,n);return u.start()},setRouterInfo:function(e){var t=this;return Ice.Promise.try(function(){if(t._destroyed){throw new Ice.CommunicatorDestroyedException}return e.getClientEndpoints()}).then(function(n){var i=e.getAdapter();var r=t._instance.defaultsAndOverrides();for(var s=0;s0);for(var i=0;i=0);if(this._destroyed&&this._pendingConnectCount===0){this.checkFinished()}},getConnection:function(e,t,n){if(this._destroyed){throw new Ice.CommunicatorDestroyedException}var i=this._monitor.swapReapedConnections();if(i!==null){for(var r=0;r=2){var i=[];i.push("connection to endpoint failed");if(e instanceof Ice.CommunicatorDestroyedException){i.push("\n")}else{if(t){i.push(", trying next endpoint\n")}else{i.push(" and no more endpoints to try\n")}}i.push(e.toString());this._instance.initializationData().logger.trace(n.retryCat,i.join(""))}},handleException:function(e,t){var n=this._instance.traceLevels();if(n.retry>=2){var i=[];i.push("couldn't resolve endpoint host");if(e instanceof Ice.CommunicatorDestroyedException){i.push("\n")}else{if(t){i.push(", trying next endpoint\n")}else{i.push(" and no more endpoints to try\n")}}i.push(e.toString());this._instance.initializationData().logger.trace(n.retryCat,i.join(""))}},checkFinished:function(){if(!this._waitPromise||!this._destroyed||this._pending.size>0||this._pendingConnectCount>0){return}var e=this;o.all(e._connectionsByEndpoint.map(function(e){return e.waitUntilFinished().exception(function(e){r.assert(false)})})).then(function(){var t=e._monitor.swapReapedConnections();if(t!==null){var n=[];for(var i=e._connectionsByEndpoint.entries;i!==null;i=i.next){var s=i.value;for(var o=0;o=2){var t=[];t.push("trying to establish ");t.push(this._current.protocol());t.push(" connection to ");t.push(this._current.toConnectorString());this._factory._instance.initializationData().logger.trace(e.networkCat,t.join(""))}var n=this._factory.createConnection(this._current.connect(),this._current);var i=this;n.start().then(function(){i.connectionStartCompleted(n)},function(e){i.connectionStartFailed(n,e)})}catch(s){if(e.network>=2){var t=[];t.push("failed to establish ");t.push(this._current.protocol());t.push(" connection to ");t.push(this._current.toString());t.push("\n");t.push(s.toString());this._factory._instance.initializationData().logger.trace(e.networkCat,t.join(""))}if(this.connectionStartFailedImpl(s)){continue}}break}},connectionStartFailedImpl:function(e){if(e instanceof Ice.LocalException){this._factory.handleConnectionException(e,this._hasMore||this._index=1){this.getEndpointsTrace(t,c,true)}o.succeed(c,true);return o},clearCache:function(t){e.assert(t.isIndirect());if(!t.isWellKnown()){var n=this._table.removeAdapterEndpoints(t.getAdapterId());if(n!==null&&t.getInstance().traceLevels().location>=2){this.trace("removed endpoints from locator table\n",t,n)}}else{var i=this._table.removeObjectReference(t.getIdentity());if(i!==null){if(!i.isIndirect()){if(t.getInstance().traceLevels().location>=2){this.trace("removed endpoints from locator table",t,i.getEndpoints())}}else if(!i.isWellKnown()){this.clearCache(i)}}}},trace:function(t,n,i){e.assert(n.isIndirect());var r=[];r.push(t);r.push("\n");if(!n.isWellKnown()){r.push("adapter = ");r.push(n.getAdapterId());r.push("\n")}else{r.push("object = ");r.push(n.getInstance().identityToString(n.getIdentity()));r.push("\n")}r.push("endpoints = ");for(var s=0;s=1){r=[];r.push("adapter not found\n");r.push("adapter = ");r.push(t.getAdapterId());i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}s=new Ice.NotRegisteredException;s.kindOfObject="object adapter";s.id=t.getAdapterId();throw s}else if(o instanceof Ice.ObjectNotFoundException){if(i.traceLevels().location>=1){r=[];r.push("object not found\n");r.push("object = ");r.push(i.identityToString(t.getIdentity()));i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}s=new Ice.NotRegisteredException;s.kindOfObject="object";s.id=i.identityToString(t.getIdentity());throw s}else if(o instanceof Ice.NotRegisteredException){throw o}else if(o instanceof Ice.LocalException){if(i.traceLevels().location>=1){r=[];r.push("couldn't contact the locator to retrieve adapter endpoints\n");if(t.getAdapterId().length>0){r.push("adapter = ");r.push(t.getAdapterId());r.push("\n")}else{r.push("object = ");r.push(i.identityToString(t.getIdentity()));r.push("\n")}r.push("reason = "+o.toString());i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}throw o}else{e.assert(false)}}},getEndpointsTrace:function(e,t,n){if(t!==null&&t.length>0){if(n){this.trace("found endpoints in locator table",e,t)}else{this.trace("retrieved endpoints from locator, adding to locator table",e,t)}}else{var i=e.getInstance();var r=[];r.push("no endpoints configured for ");if(e.getAdapterId().length>0){r.push("adapter\n");r.push("adapter = ");r.push(e.getAdapterId());r.push("\n")}else{r.push("object\n");r.push("object = ");r.push(i.identityToString(e.getIdentity()));r.push("\n")}i.initializationData().logger.trace(i.traceLevels().locationCat,r.join(""))}},getAdapterRequest:function(e){if(e.getInstance().traceLevels().location>=1){var t=e.getInstance();var n=[];n.push("searching for adapter by id\n");n.push("adapter = ");n.push(e.getAdapterId());t.initializationData().logger.trace(t.traceLevels().locationCat,n.join(""))}var i=this._adapterRequests.get(e.getAdapterId());if(i!==undefined){return i}i=new l(this,e);this._adapterRequests.set(e.getAdapterId(),i);return i},getObjectRequest:function(e){if(e.getInstance().traceLevels().location>=1){var t=e.getInstance();var n=[];n.push("searching for object by id\n");n.push("object = ");n.push(t.identityToString(e.getIdentity()));t.initializationData().logger.trace(t.traceLevels().locationCat,n.join(""))}var i=this._objectRequests.get(e.getIdentity());if(i!==undefined){return i}i=new u(this,e);this._objectRequests.set(e.getIdentity(),i);return i},finishRequest:function(t,n,i,r){if(i===null||i.__reference().isIndirect()){for(var s=0;s=1){e.getEndpointsTrace(this._ref,n,false)}if(this._promise!==null){this._promise.succeed(n===null?[]:n,false)}},exception:function(e,t){try{e.getEndpointsException(this._ref,t)}catch(n){if(this._promise!==null){this._promise.fail(n)}}}});var a=s({__init__:function(e,t){this._locatorInfo=e;this._ref=t;this._callbacks=[];this._wellKnownRefs=[];this._sent=false;this._response=false;this._proxy=null;this._exception=null},addCallback:function(e,t,n,i){var r=new c(e,n,i);if(this._response){r.response(this._locatorInfo,this._proxy)}else if(this._exception!==null){r.exception(this._locatorInfo,this._exception)}else{this._callbacks.push(r);if(t!==null){this._wellKnownRefs.push(t)}if(!this._sent){this._sent=true;this.send()}}},response:function(e){this._locatorInfo.finishRequest(this._ref,this._wellKnownRefs,e,false);this._response=true;this._proxy=e;for(var t=0;t0){var d=["found unknown properties for object adapter `"+r+"':"];for(var p=0;p2147483647/1024){this._messageSizeMax=2147483647}else{this._messageSizeMax=m*1024}}try{if(o===null){o=Ice.RouterPrx.uncheckedCast(this._instance.proxyFactory().propertyToProxy(this._name+".Router"))}if(o!==null){this._routerInfo=this._instance.routerManager().find(o);t.assert(this._routerInfo!==null);if(this._routerInfo.getAdapter()!==null){throw new Ice.AlreadyRegisteredException("object adapter with router",this._instance.identityToString(o.ice_getIdentity()))}var y=this;this._routerInfo.getServerEndpoints().then(function(e){var t;for(t=0;t0){throw new Ice.FeatureNotSupportedException("object adapter endpoints not supported")}u.succeed(this,u)}}catch(_){this.destroy();throw _}},getName:function(){return this._noConfig?"":this._name},getCommunicator:function(){return this._communicator; +},activate:function(){},hold:function(){this.checkForDeactivation()},waitForHold:function(){var t=new e(this._communicator,"waitForHold",null,null,this);if(this.checkForDeactivation(t)){return t}return t.succeed(t)},deactivate:function(){var t=new e(this._communicator,"deactivate",null,null,this);if(this._state=u},destroy:function(){var t=new e(this._communicator,"destroy",null,null,this);var n=this;var i=function(){if(n._state=u){var t=new Ice.ObjectAdapterDeactivatedException;t.name=this.getName();if(e!==undefined){e.fail(t,e);return true}else{throw t}}return false},checkIdentity:function(e){if(e.name===undefined||e.name===null||e.name.length===0){throw new Ice.IllegalIdentityException(e)}if(e.category===undefined||e.category===null){e.category=""}},checkServant:function(e){if(e===undefined||e===null){throw new Ice.IllegalServantException("cannot add null servant to Object Adapter")}},filterProperties:function(e){var t=true,n;var i=this._name+".";for(n=0;n0;this._table=new e(e.compareEquals);this._locatorTables=new e(e.compareEquals)},destroy:function(){for(var e=this._table.entries;e!==null;e=e.next){e.value.destroy()}this._table.clear();this._locatorTables.clear()},find:function(e){if(e===null){return null}var r=i.uncheckedCast(e.ice_locator(null));var s=this._table.get(r);if(s===undefined){var o=this._locatorTables.get(r.ice_getIdentity());if(o===undefined){o=new n;this._locatorTables.set(r.ice_getIdentity(),o)}s=new t(r,o,this._background);this._table.set(r,s)}return s}});Ice.LocatorManager=r})();(function(){var e=Ice.AsyncResultBase;var t=Ice.ObjectAdapterI;var n=Ice.Promise;var i=Ice.Class({__init__:function(e,t){this._instance=e;this._communicator=t;this._adapters=[];this._adapterNamesInUse=[];this._shutdownPromise=new n},shutdown:function(){if(this._instance===null){return this._shutdownPromise}this._instance=null;this._communicator=null;this._shutdownPromise=n.all(this._adapters.map(function(e){return e.deactivate()}));return this._shutdownPromise},waitForShutdown:function(){var e=this;return this._shutdownPromise.then(function(){return n.all(e._adapters.map(function(e){return e.waitForDeactivate()}))})},isShutdown:function(){return this._instance===null},destroy:function(){var e=this;return this.waitForShutdown().then(function(){return n.all(e._adapters.map(function(e){return e.destroy()}))})},createObjectAdapter:function(e,n,i){if(this._instance===null){throw new Ice.ObjectAdapterDeactivatedException}var r=null;try{if(e.length===0){var s=Ice.generateUUID();r=new t(this._instance,this._communicator,this,s,null,true,i)}else{if(this._adapterNamesInUse.indexOf(e)!==-1){throw new Ice.AlreadyRegisteredException("object adapter",e)}r=new t(this._instance,this._communicator,this,e,n,false,i);this._adapterNamesInUse.push(e)}this._adapters.push(r)}catch(o){i.fail(o,i)}},removeObjectAdapter:function(e){if(this._instance===null){return}var t=this._adapters.indexOf(e);if(t!==-1){this._adapters.splice(t,1)}t=this._adapterNamesInUse.indexOf(e.getName());if(t!==-1){this._adapterNamesInUse.splice(t,1)}}});Ice.ObjectAdapterFactory=i})();(function(){t.defineDictionary(IceMX,"StringIntDict","StringIntDictHelper","Ice.StringHelper","Ice.IntHelper",false,undefined,undefined);IceMX.Metrics=t.defineObject(function(e,t,n,i,r){Ice.Object.call(this);this.id=e!==undefined?e:"";this.total=t!==undefined?t:new Ice.Long(0,0);this.current=n!==undefined?n:0;this.totalLifetime=i!==undefined?i:new Ice.Long(0,0);this.failures=r!==undefined?r:0},Ice.Object,undefined,1,["::Ice::Object","::IceMX::Metrics"],-1,function(e){e.writeString(this.id);e.writeLong(this.total);e.writeInt(this.current);e.writeLong(this.totalLifetime);e.writeInt(this.failures)},function(e){this.id=e.readString();this.total=e.readLong();this.current=e.readInt();this.totalLifetime=e.readLong();this.failures=e.readInt()},false);IceMX.MetricsPrx=t.defineProxy(Ice.ObjectPrx,IceMX.Metrics.ice_staticId,undefined);t.defineOperations(IceMX.Metrics,IceMX.MetricsPrx);IceMX.MetricsFailures=t.defineStruct(function(e,t){this.id=e!==undefined?e:"";this.failures=t!==undefined?t:null},false,function(e){e.writeString(this.id);IceMX.StringIntDictHelper.write(e,this.failures)},function(e){this.id=e.readString();this.failures=IceMX.StringIntDictHelper.read(e)},2,false);t.defineSequence(IceMX,"MetricsFailuresSeqHelper","IceMX.MetricsFailures",false);t.defineSequence(IceMX,"MetricsMapHelper","Ice.ObjectHelper",false,"IceMX.Metrics");t.defineDictionary(IceMX,"MetricsView","MetricsViewHelper","Ice.StringHelper","IceMX.MetricsMapHelper",false,undefined,undefined,Ice.ArrayUtil.equals);IceMX.UnknownMetricsView=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"IceMX::UnknownMetricsView",undefined,undefined,false,false);IceMX.MetricsAdmin=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::IceMX::MetricsAdmin"],-1,undefined,undefined,false);IceMX.MetricsAdminPrx=t.defineProxy(Ice.ObjectPrx,IceMX.MetricsAdmin.ice_staticId,undefined);t.defineOperations(IceMX.MetricsAdmin,IceMX.MetricsAdminPrx,{getMetricsViewNames:[,,,,2,["Ice.StringSeqHelper"],,[["Ice.StringSeqHelper"]],,,],enableMetricsView:[,,,,2,,[[7]],,[IceMX.UnknownMetricsView],,],disableMetricsView:[,,,,2,,[[7]],,[IceMX.UnknownMetricsView],,],getMetricsView:[,,,,2,["IceMX.MetricsViewHelper"],[[7]],[[4]],[IceMX.UnknownMetricsView],,true],getMapMetricsFailures:[,,,,2,["IceMX.MetricsFailuresSeqHelper"],[[7],[7]],,[IceMX.UnknownMetricsView],,],getMetricsFailures:[,,,,2,[IceMX.MetricsFailures],[[7],[7],[7]],,[IceMX.UnknownMetricsView],,]});IceMX.ThreadMetrics=t.defineObject(function(e,t,n,i,r,s,o,c){IceMX.Metrics.call(this,e,t,n,i,r);this.inUseForIO=s!==undefined?s:0;this.inUseForUser=o!==undefined?o:0;this.inUseForOther=c!==undefined?c:0},IceMX.Metrics,undefined,2,["::Ice::Object","::IceMX::Metrics","::IceMX::ThreadMetrics"],-1,function(e){e.writeInt(this.inUseForIO);e.writeInt(this.inUseForUser);e.writeInt(this.inUseForOther)},function(e){this.inUseForIO=e.readInt();this.inUseForUser=e.readInt();this.inUseForOther=e.readInt()},false);IceMX.ThreadMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ThreadMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ThreadMetrics,IceMX.ThreadMetricsPrx);IceMX.DispatchMetrics=t.defineObject(function(e,t,n,i,r,s,o,c){IceMX.Metrics.call(this,e,t,n,i,r);this.userException=s!==undefined?s:0;this.size=o!==undefined?o:new Ice.Long(0,0);this.replySize=c!==undefined?c:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::DispatchMetrics","::IceMX::Metrics"],-1,function(e){e.writeInt(this.userException);e.writeLong(this.size);e.writeLong(this.replySize)},function(e){this.userException=e.readInt();this.size=e.readLong();this.replySize=e.readLong()},false);IceMX.DispatchMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.DispatchMetrics.ice_staticId,undefined);t.defineOperations(IceMX.DispatchMetrics,IceMX.DispatchMetricsPrx);IceMX.ChildInvocationMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.Metrics.call(this,e,t,n,i,r);this.size=s!==undefined?s:new Ice.Long(0,0);this.replySize=o!==undefined?o:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::Metrics"],-1,function(e){e.writeLong(this.size);e.writeLong(this.replySize)},function(e){this.size=e.readLong();this.replySize=e.readLong()},false);IceMX.ChildInvocationMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ChildInvocationMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ChildInvocationMetrics,IceMX.ChildInvocationMetricsPrx);IceMX.CollocatedMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.ChildInvocationMetrics.call(this,e,t,n,i,r,s,o)},IceMX.ChildInvocationMetrics,undefined,2,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::CollocatedMetrics","::IceMX::Metrics"],-1,undefined,undefined,false);IceMX.CollocatedMetricsPrx=t.defineProxy(IceMX.ChildInvocationMetricsPrx,IceMX.CollocatedMetrics.ice_staticId,undefined);t.defineOperations(IceMX.CollocatedMetrics,IceMX.CollocatedMetricsPrx);IceMX.RemoteMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.ChildInvocationMetrics.call(this,e,t,n,i,r,s,o)},IceMX.ChildInvocationMetrics,undefined,3,["::Ice::Object","::IceMX::ChildInvocationMetrics","::IceMX::Metrics","::IceMX::RemoteMetrics"],-1,undefined,undefined,false);IceMX.RemoteMetricsPrx=t.defineProxy(IceMX.ChildInvocationMetricsPrx,IceMX.RemoteMetrics.ice_staticId,undefined);t.defineOperations(IceMX.RemoteMetrics,IceMX.RemoteMetricsPrx);IceMX.InvocationMetrics=t.defineObject(function(e,t,n,i,r,s,o,c,a){IceMX.Metrics.call(this,e,t,n,i,r);this.retry=s!==undefined?s:0;this.userException=o!==undefined?o:0;this.remotes=c!==undefined?c:null;this.collocated=a!==undefined?a:null},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::InvocationMetrics","::IceMX::Metrics"],-1,function(e){e.writeInt(this.retry);e.writeInt(this.userException);IceMX.MetricsMapHelper.write(e,this.remotes);IceMX.MetricsMapHelper.write(e,this.collocated)},function(e){this.retry=e.readInt();this.userException=e.readInt();this.remotes=IceMX.MetricsMapHelper.read(e);this.collocated=IceMX.MetricsMapHelper.read(e)},false);IceMX.InvocationMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.InvocationMetrics.ice_staticId,undefined);t.defineOperations(IceMX.InvocationMetrics,IceMX.InvocationMetricsPrx);IceMX.ConnectionMetrics=t.defineObject(function(e,t,n,i,r,s,o){IceMX.Metrics.call(this,e,t,n,i,r);this.receivedBytes=s!==undefined?s:new Ice.Long(0,0);this.sentBytes=o!==undefined?o:new Ice.Long(0,0)},IceMX.Metrics,undefined,1,["::Ice::Object","::IceMX::ConnectionMetrics","::IceMX::Metrics"],-1,function(e){e.writeLong(this.receivedBytes);e.writeLong(this.sentBytes)},function(e){this.receivedBytes=e.readLong();this.sentBytes=e.readLong()},false);IceMX.ConnectionMetricsPrx=t.defineProxy(IceMX.MetricsPrx,IceMX.ConnectionMetrics.ice_staticId,undefined);t.defineOperations(IceMX.ConnectionMetrics,IceMX.ConnectionMetricsPrx)})();(function(){var e=Ice.Debug;var t=Ice.HashMap;var n=Ice.ConnectRequestHandler;var i=Ice.Class({__init__:function(e){this._instance=e;this._handlers=new t(t.compareEquals)},getRequestHandler:function(e,t){var i=false;var r;if(e.getCacheConnection()){r=this._handlers.get(e);if(!r){r=new n(e,t);this._handlers.set(e,r);i=true}}else{i=true;r=new n(e,t)}if(i){e.getConnection().then(function(e,t){r.setConnection(e,t)},function(e){r.setException(e)})}return t.__setRequestHandler(r.connect(t))},removeRequestHandler:function(e,t){if(e.getCacheConnection()){if(this._handlers.get(e)===t){this._handlers.delete(e)}}}});Ice.RequestHandlerFactory=i})();(function(){Ice.Process=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::Process"],-1,undefined,undefined,false);Ice.ProcessPrx=t.defineProxy(Ice.ObjectPrx,Ice.Process.ice_staticId,undefined);t.defineOperations(Ice.Process,Ice.ProcessPrx,{shutdown:[,,,,,,,,,,],writeMessage:[,,,,,,[[7],[3]],,,,]})})();(function(){var e=Ice.TcpEndpointI;var t=Ice.Class({__init__:function(e){this._instance=e},type:function(){return this._instance.type()},protocol:function(){return this._instance.protocol()},create:function(t,n){var i=new e(this._instance);i.initWithOptions(t,n);return i},read:function(t){var n=new e(this._instance);n.initWithStream(t);return n},destroy:function(){this._instance=null},clone:function(e){return new t(e)}});Ice.TcpEndpointFactory=t})();(function(){t.defineDictionary(Ice,"PropertyDict","PropertyDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined);Ice.PropertiesAdmin=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::PropertiesAdmin"],-1,undefined,undefined,false);Ice.PropertiesAdminPrx=t.defineProxy(Ice.ObjectPrx,Ice.PropertiesAdmin.ice_staticId,undefined);t.defineOperations(Ice.PropertiesAdmin,Ice.PropertiesAdminPrx,{getProperty:[,,,,,[7],[[7]],,,,],getPropertiesForPrefix:[,,,,,["Ice.PropertyDictHelper"],[[7]],,,,],setProperties:[,,,1,,,[["Ice.PropertyDictHelper"]],,,,]})})();(function(){Ice.LogMessageType=t.defineEnum([["PrintMessage",0],["TraceMessage",1],["WarningMessage",2],["ErrorMessage",3]]);t.defineSequence(Ice,"LogMessageTypeSeqHelper","Ice.LogMessageType.__helper",false);Ice.LogMessage=t.defineStruct(function(e,t,n,i){this.type=e!==undefined?e:Ice.LogMessageType.PrintMessage;this.timestamp=t!==undefined?t:new Ice.Long(0,0);this.traceCategory=n!==undefined?n:"";this.message=i!==undefined?i:""},true,function(e){Ice.LogMessageType.__write(e,this.type);e.writeLong(this.timestamp);e.writeString(this.traceCategory);e.writeString(this.message)},function(e){this.type=Ice.LogMessageType.__read(e);this.timestamp=e.readLong();this.traceCategory=e.readString();this.message=e.readString()},11,false);t.defineSequence(Ice,"LogMessageSeqHelper","Ice.LogMessage",false);Ice.RemoteLogger=t.defineObject(undefined,Ice.Object,undefined,1,["::Ice::Object","::Ice::RemoteLogger"],-1,undefined,undefined,false);Ice.RemoteLoggerPrx=t.defineProxy(Ice.ObjectPrx,Ice.RemoteLogger.ice_staticId,undefined);t.defineOperations(Ice.RemoteLogger,Ice.RemoteLoggerPrx,{init:[,,,,,,[[7],["Ice.LogMessageSeqHelper"]],,,,],log:[,,,,,,[[Ice.LogMessage]],,,,]});Ice.RemoteLoggerAlreadyAttachedException=t.defineUserException(function(e){Ice.UserException.call(this,e)},Ice.UserException,"Ice::RemoteLoggerAlreadyAttachedException",undefined,undefined,false,false);Ice.LoggerAdmin=t.defineObject(undefined,Ice.Object,undefined,0,["::Ice::LoggerAdmin","::Ice::Object"],-1,undefined,undefined,false);Ice.LoggerAdminPrx=t.defineProxy(Ice.ObjectPrx,Ice.LoggerAdmin.ice_staticId,undefined);t.defineOperations(Ice.LoggerAdmin,Ice.LoggerAdminPrx,{attachRemoteLogger:[,,,,,,[["Ice.RemoteLoggerPrx"],["Ice.LogMessageTypeSeqHelper"],["Ice.StringSeqHelper"],[3]],,[Ice.RemoteLoggerAlreadyAttachedException],,],detachRemoteLogger:[,,,,,[1],[["Ice.RemoteLoggerPrx"]],,,,],getLog:[,,,,,["Ice.LogMessageSeqHelper"],[["Ice.LogMessageTypeSeqHelper"],["Ice.StringSeqHelper"],[3]],[[7]],,,]})})();(function(){var e=Ice.WSEndpoint;var t=Ice.Class({__init__:function(e,t){this._instance=e;this._delegate=t},type:function(){return this._instance.type()},protocol:function(){return this._instance.protocol()},create:function(t,n){var i=new e(this._instance,this._delegate.create(t,n));i.initWithOptions(t);return i},read:function(t){var n=new e(this._instance,this._delegate.read(t));n.initWithStream(t);return n},destroy:function(){this._delegate.destroy();this._instance=null}});Ice.WSEndpointFactory=t})();(function(){t.defineDictionary(Ice,"SliceChecksumDict","SliceChecksumDictHelper","Ice.StringHelper","Ice.StringHelper",false,undefined,undefined)})();(function(){var e=Ice.AsyncResultBase;var t=Ice.Debug;var n=Ice.DefaultsAndOverrides;var i=Ice.EndpointFactoryManager;var r=Ice.HashMap;var s=Ice.ImplicitContextI;var o=Ice.LocatorManager;var c=Ice.Logger;var a=Ice.ObjectAdapterFactory;var u=Ice.ObjectFactoryManager;var l=Ice.OutgoingConnectionFactory;var h=Ice.Promise;var f=Ice.Properties;var d=Ice.ProxyFactory;var p=Ice.RetryQueue;var _=Ice.RouterManager;var I=Ice.Timer;var g=Ice.TraceLevels;var v=Ice.ReferenceFactory;var m=Ice.RequestHandlerFactory;var y=Ice.ACMConfig;var w=0;var E=1;var x=2;var S=Ice.Class({__init__:function(e){this._state=w;this._initData=e;this._traceLevels=null;this._defaultsAndOverrides=null;this._messageSizeMax=0;this._batchAutoFlushSize=0;this._clientACM=null;this._implicitContext=null;this._routerManager=null;this._locatorManager=null;this._referenceFactory=null;this._requestHandlerFactory=null;this._proxyFactory=null;this._outgoingConnectionFactory=null;this._servantFactoryManager=null;this._objectAdapterFactory=null;this._retryQueue=null;this._endpointHostResolver=null;this._endpointFactoryManager=null},initializationData:function(){return this._initData},traceLevels:function(){t.assert(this._traceLevels!==null);return this._traceLevels},defaultsAndOverrides:function(){t.assert(this._defaultsAndOverrides!==null);return this._defaultsAndOverrides},routerManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._routerManager!==null);return this._routerManager},locatorManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._locatorManager!==null);return this._locatorManager},referenceFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._referenceFactory!==null);return this._referenceFactory},requestHandlerFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._requestHandlerFactory!==null);return this._requestHandlerFactory},proxyFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._proxyFactory!==null);return this._proxyFactory},outgoingConnectionFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._outgoingConnectionFactory!==null);return this._outgoingConnectionFactory},servantFactoryManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._servantFactoryManager!==null);return this._servantFactoryManager},objectAdapterFactory:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._objectAdapterFactory!==null);return this._objectAdapterFactory},retryQueue:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._retryQueue!==null);return this._retryQueue},timer:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._timer!==null);return this._timer},endpointFactoryManager:function(){if(this._state===x){throw new Ice.CommunicatorDestroyedException}t.assert(this._endpointFactoryManager!==null);return this._endpointFactoryManager},messageSizeMax:function(){return this._messageSizeMax},batchAutoFlushSize:function(){return this._batchAutoFlushSize},clientACM:function(){return this._clientACM},getImplicitContext:function(){return this._implicitContext},stringToIdentity:function(e){return Ice.stringToIdentity(e)},identityToString:function(e){return Ice.identityToString(e)},setDefaultLocator:function(e){if(this._state==x){throw new Ice.CommunicatorDestroyedException}this._referenceFactory=this._referenceFactory.setDefaultLocator(e)},setDefaultRouter:function(e){if(this._state==x){throw new Ice.CommunicatorDestroyedException}this._referenceFactory=this._referenceFactory.setDefaultRouter(e)},setLogger:function(e){this._initData.logger=e},finishSetup:function(e,t){try{if(this._initData.properties===null){this._initData.properties=f.createProperties()}if(Ice.__oneOfDone===undefined){Ice.__printStackTraces=this._initData.properties.getPropertyAsIntWithDefault("Ice.PrintStackTraces",0)>0;Ice.__oneOfDone=true}if(this._initData.logger===null){this._initData.logger=Ice.getProcessLogger()}this._traceLevels=new g(this._initData.properties);this._defaultsAndOverrides=new n(this._initData.properties,this._initData.logger);var r=1024;var c=this._initData.properties.getPropertyAsIntWithDefault("Ice.MessageSizeMax",r);if(c<1||c>2147483647/1024){this._messageSizeMax=2147483647}else{this._messageSizeMax=c*1024}if(this._initData.properties.getProperty("Ice.BatchAutoFlushSize").length===0&&this._initData.properties.getProperty("Ice.BatchAutoFlush").length>0){if(this._initData.properties.getPropertyAsInt("Ice.BatchAutoFlush")>0){this._batchAutoFlushSize=this._messageSizeMax}}else{c=this._initData.properties.getPropertyAsIntWithDefault("Ice.BatchAutoFlushSize",1024);if(c<1){this._batchAutoFlushSize=c}else if(c>2147483647/1024){this._batchAutoFlushSize=2147483647}else{this._batchAutoFlushSize=c*1024}}this._clientACM=new y(this._initData.properties,this._initData.logger,"Ice.ACM.Client",new y(this._initData.properties,this._initData.logger,"Ice.ACM",new y));this._implicitContext=s.create(this._initData.properties.getProperty("Ice.ImplicitContext"));this._routerManager=new _;this._locatorManager=new o(this._initData.properties);this._referenceFactory=new v(this,e);this._requestHandlerFactory=new m(this,e);this._proxyFactory=new d(this);this._endpointFactoryManager=new i(this);var h=new Ice.ProtocolInstance(this,Ice.TCPEndpointType,"tcp",false);var w=new Ice.TcpEndpointFactory(h);this._endpointFactoryManager.add(w);var E=new Ice.ProtocolInstance(this,Ice.WSEndpointType,"ws",false);var x=new Ice.WSEndpointFactory(E,w.clone(E));this._endpointFactoryManager.add(x);var S=new Ice.ProtocolInstance(this,IceSSL.EndpointType,"ssl",true);var b=new Ice.TcpEndpointFactory(S);this._endpointFactoryManager.add(b);var C=new Ice.ProtocolInstance(this,Ice.WSSEndpointType,"wss",true);var P=new Ice.WSEndpointFactory(C,b.clone(C));this._endpointFactoryManager.add(P);this._outgoingConnectionFactory=new l(e,this);this._servantFactoryManager=new u;this._objectAdapterFactory=new a(this,e);this._retryQueue=new p(this);this._timer=new I(this._initData.logger);var M=Ice.RouterPrx.uncheckedCast(this._proxyFactory.propertyToProxy("Ice.Default.Router"));if(M!==null){this._referenceFactory=this._referenceFactory.setDefaultRouter(M)}var O=Ice.LocatorPrx.uncheckedCast(this._proxyFactory.propertyToProxy("Ice.Default.Locator"));if(O!==null){this._referenceFactory=this._referenceFactory.setDefaultLocator(O)}if(t!==null){t.succeed(e)}}catch(k){if(t!==null){if(k instanceof Ice.LocalException){this.destroy().finally(function(){t.fail(k)})}else{t.fail(k)}}else{if(k instanceof Ice.LocalException){this.destroy()}throw k}}},destroy:function(){var t=new e(null,"destroy",null,this,null);if(this._state==E){if(!this._destroyPromises){this._destroyPromises=[]}this._destroyPromises.push(t);return t}this._state=E;var n=this;Ice.Promise.try(function(){if(n._objectAdapterFactory){return n._objectAdapterFactory.shutdown()}}).then(function(){if(n._outgoingConnectionFactory!==null){n._outgoingConnectionFactory.destroy()}if(n._objectAdapterFactory!==null){return n._objectAdapterFactory.destroy()}}).then(function(){if(n._outgoingConnectionFactory!==null){return n._outgoingConnectionFactory.waitUntilFinished()}}).then(function(){if(n._retryQueue){n._retryQueue.destroy()}if(n._timer){n._timer.destroy()}if(n._servantFactoryManager){n._servantFactoryManager.destroy()}if(n._routerManager){n._routerManager.destroy()}if(n._locatorManager){n._locatorManager.destroy()}if(n._endpointFactoryManager){n._endpointFactoryManager.destroy()}var e;if(n._initData.properties.getPropertyAsInt("Ice.Warn.UnusedProperties")>0){var i=n._initData.properties.getUnusedProperties();if(i.length>0){var r=[];r.push("The following properties were set but never read:");for(e=0;e Math.abs( eye.z ) ) this.activePlane = this.planes[ "XZ" ]; + + } + + if ( axis === "Y" ) { + + this.activePlane = this.planes[ "XY" ]; + + if ( Math.abs( eye.x ) > Math.abs( eye.z ) ) this.activePlane = this.planes[ "YZ" ]; + + } + + if ( axis === "Z" ) { + + this.activePlane = this.planes[ "XZ" ]; + + if ( Math.abs( eye.x ) > Math.abs( eye.y ) ) this.activePlane = this.planes[ "YZ" ]; + + } + + if ( axis === "XYZ" ) this.activePlane = this.planes[ "XYZE" ]; + + if ( axis === "XY" ) this.activePlane = this.planes[ "XY" ]; + + if ( axis === "YZ" ) this.activePlane = this.planes[ "YZ" ]; + + if ( axis === "XZ" ) this.activePlane = this.planes[ "XZ" ]; + + }; + + this.init(); + + }; + + THREE.TransformGizmoTranslate.prototype = Object.create( THREE.TransformGizmo.prototype ); + THREE.TransformGizmoTranslate.prototype.constructor = THREE.TransformGizmoTranslate; + + + THREE.JoyStickControls = function ( camera, domElement ) { + + // TODO: Make non-uniform scale and rotate play nice in hierarchies + // TODO: ADD RXYZ contol + + THREE.Object3D.call( this ); + + domElement = ( domElement !== undefined ) ? domElement : document; + + this.object = undefined; + this.visible = false; + this.snap = null; + this.space = "world"; + this.size = 1; + this.axis = null; + + var scope = this; + + var _mode = "translate"; + var _dragging = false; + var _plane = "XY"; + var _gizmo = { + + "translate": new THREE.TransformGizmoTranslate(), +// "rotate": new THREE.TransformGizmoRotate(), +// "scale": new THREE.TransformGizmoScale() + }; + + for ( var type in _gizmo ) { + + var gizmoObj = _gizmo[ type ]; + + gizmoObj.visible = ( type === _mode ); + this.add( gizmoObj ); + + } + + var changeEvent = { type: "change" }; + var mouseDownEvent = { type: "mouseDown" }; + var mouseUpEvent = { type: "mouseUp", mode: _mode }; + var objectChangeEvent = { type: "objectChange" }; + + var ray = new THREE.Raycaster(); + var pointerVector = new THREE.Vector2(); + + var point = new THREE.Vector3(); + var offset = new THREE.Vector3(); + + var rotation = new THREE.Vector3(); + var offsetRotation = new THREE.Vector3(); + var scale = 1; + + var lookAtMatrix = new THREE.Matrix4(); + var eye = new THREE.Vector3(); + + var tempMatrix = new THREE.Matrix4(); + var tempVector = new THREE.Vector3(); + var tempQuaternion = new THREE.Quaternion(); + var unitX = new THREE.Vector3( 1, 0, 0 ); + var unitY = new THREE.Vector3( 0, 1, 0 ); + var unitZ = new THREE.Vector3( 0, 0, 1 ); + + var quaternionXYZ = new THREE.Quaternion(); + var quaternionX = new THREE.Quaternion(); + var quaternionY = new THREE.Quaternion(); + var quaternionZ = new THREE.Quaternion(); + var quaternionE = new THREE.Quaternion(); + + var oldPosition = new THREE.Vector3(); + var oldScale = new THREE.Vector3(); + var oldRotationMatrix = new THREE.Matrix4(); + + var parentRotationMatrix = new THREE.Matrix4(); + var parentScale = new THREE.Vector3(); + + var worldPosition = new THREE.Vector3(); + var worldRotation = new THREE.Euler(); + var worldRotationMatrix = new THREE.Matrix4(); + var camPosition = new THREE.Vector3(); + var camRotation = new THREE.Euler(); + + + + this.attach = function ( object ) { + + this.object = object; + this.visible = true; + this.update(); + + }; + + this.detach = function () { + + this.object = undefined; + this.visible = false; + this.axis = null; + + }; + + this.setMode = function ( mode ) { + + _mode = mode ? mode : _mode; + + if ( _mode === "scale" ) scope.space = "local"; + + for ( var type in _gizmo ) _gizmo[ type ].visible = ( type === _mode ); + + this.update(); + scope.dispatchEvent( changeEvent ); + + }; + + this.setSnap = function ( snap ) { + + scope.snap = snap; + + }; + + this.setSize = function ( size ) { + + scope.size = size; + this.update(); + scope.dispatchEvent( changeEvent ); + + }; + + this.setSpace = function ( space ) { + + scope.space = space; + this.update(); + scope.dispatchEvent( changeEvent ); + + }; + + this.update = function () { + + if ( scope.object === undefined ) return; + + scope.object.updateMatrixWorld(); + worldPosition.setFromMatrixPosition( scope.object.matrixWorld ); + worldRotation.setFromRotationMatrix( tempMatrix.extractRotation( scope.object.matrixWorld ) ); + + camera.updateMatrixWorld(); + camPosition.setFromMatrixPosition( camera.matrixWorld ); + camRotation.setFromRotationMatrix( tempMatrix.extractRotation( camera.matrixWorld ) ); + + scale = worldPosition.distanceTo( camPosition ) / 6 * scope.size; + this.position.copy( worldPosition ); + this.scale.set( scale, scale, scale ); + + eye.copy( camPosition ).sub( worldPosition ).normalize(); + + if ( scope.space === "local" ) { + + _gizmo[ _mode ].update( worldRotation, eye ); + + } else if ( scope.space === "world" ) { + + _gizmo[ _mode ].update( new THREE.Euler(), eye ); + + } + + _gizmo[ _mode ].highlight( scope.axis ); + + }; + + this.onPointerHover = function ( event ) { + + if ( scope.object === undefined || _dragging === true || ( event.button !== undefined && event.button !== 0 ) ) return; + + var pointer = event.changedTouches ? event.changedTouches[ 0 ] : event; + + var intersect = intersectObjects( pointer, _gizmo[ _mode ].pickers.children ); + + var axis = null; + + if ( intersect ) { + + axis = intersect.object.name; + + event.preventDefault(); + + } + + if ( scope.axis !== axis ) { + + scope.axis = axis; + scope.update(); + scope.dispatchEvent( changeEvent ); + + } + + } + + this.onPointerDown = function ( event ) { + + if ( scope.object === undefined || _dragging === true || ( event.button !== undefined && event.button !== 0 ) ) return; + + var pointer = event.changedTouches ? event.changedTouches[ 0 ] : event; + + if ( pointer.button === 0 || pointer.button === undefined ) { + + var intersect = intersectObjects( pointer, _gizmo[ _mode ].pickers.children ); + + if ( intersect ) { + + event.preventDefault(); + event.stopPropagation(); + + scope.dispatchEvent( mouseDownEvent ); + + scope.axis = intersect.object.name; + + scope.update(); + + eye.copy( camPosition ).sub( worldPosition ).normalize(); + + _gizmo[ _mode ].setActivePlane( scope.axis, eye ); + + var planeIntersect = intersectObjects( pointer, [ _gizmo[ _mode ].activePlane ] ); + + if ( planeIntersect ) { + + oldPosition.copy( scope.object.position ); + oldScale.copy( scope.object.scale ); + + oldRotationMatrix.extractRotation( scope.object.matrix ); + worldRotationMatrix.extractRotation( scope.object.matrixWorld ); + + parentRotationMatrix.extractRotation( scope.object.parent.matrixWorld ); + parentScale.setFromMatrixScale( tempMatrix.getInverse( scope.object.parent.matrixWorld ) ); + + offset.copy( planeIntersect.point ); + + } + + } + + } + + _dragging = true; + + + } + + this.onPointerMove = function ( event ) { + + if ( scope.object === undefined || scope.axis === null || _dragging === false || ( event.button !== undefined && event.button !== 0 ) ) return; + + var pointer = event.changedTouches ? event.changedTouches[ 0 ] : event; + + var planeIntersect = intersectObjects( pointer, [ _gizmo[ _mode ].activePlane ] ); + + if ( planeIntersect === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + point.copy( planeIntersect.point ); + + if ( _mode === "translate" ) { + + point.sub( offset ); + point.multiply( parentScale ); + + if ( scope.space === "local" ) { + + point.applyMatrix4( tempMatrix.getInverse( worldRotationMatrix ) ); + + if ( scope.axis.search( "X" ) === - 1 ) point.x = 0; + if ( scope.axis.search( "Y" ) === - 1 ) point.y = 0; + if ( scope.axis.search( "Z" ) === - 1 ) point.z = 0; + + point.applyMatrix4( oldRotationMatrix ); + + scope.object.position.copy( oldPosition ); + scope.object.position.add( point ); + + } + + if ( scope.space === "world" || scope.axis.search( "XYZ" ) !== - 1 ) { + + if ( scope.axis.search( "X" ) === - 1 ) point.x = 0; + if ( scope.axis.search( "Y" ) === - 1 ) point.y = 0; + if ( scope.axis.search( "Z" ) === - 1 ) point.z = 0; + + point.applyMatrix4( tempMatrix.getInverse( parentRotationMatrix ) ); + + scope.object.position.copy( oldPosition ); + scope.object.position.add( point ); + + } + + if ( scope.snap !== null ) { + + if ( scope.axis.search( "X" ) !== - 1 ) scope.object.position.x = Math.round( scope.object.position.x / scope.snap ) * scope.snap; + if ( scope.axis.search( "Y" ) !== - 1 ) scope.object.position.y = Math.round( scope.object.position.y / scope.snap ) * scope.snap; + if ( scope.axis.search( "Z" ) !== - 1 ) scope.object.position.z = Math.round( scope.object.position.z / scope.snap ) * scope.snap; + + } + + } + + scope.update(); + scope.dispatchEvent( changeEvent ); + scope.dispatchEvent( objectChangeEvent ); + + } + + this.onPointerUp= function ( event ) { + + if ( event.button !== undefined && event.button !== 0 ) return; + + if ( _dragging && ( scope.axis !== null ) ) { + + mouseUpEvent.mode = _mode; + scope.dispatchEvent( mouseUpEvent ) + + } + + _dragging = false; + scope.onPointerHover( event ); + + }; + + function intersectObjects( pointer, objects ) { + + var rect = domElement.getBoundingClientRect(); + var x = ( pointer.clientX - rect.left ) / rect.width; + var y = ( pointer.clientY - rect.top ) / rect.height; + + pointerVector.set( ( x * 2 ) - 1, - ( y * 2 ) + 1 ); + ray.setFromCamera( pointerVector, camera ); + + var intersections = ray.intersectObjects( objects, true ); + return intersections[ 0 ] ? intersections[ 0 ] : false; + + } + + domElement.addEventListener( "mousedown", this.onPointerDown, false ); + domElement.addEventListener( "touchstart", this.onPointerDown, false ); + + domElement.addEventListener( "mousemove", this.onPointerHover, false ); + domElement.addEventListener( "touchmove", this.onPointerHover, false ); + + domElement.addEventListener( "mousemove",this.onPointerMove, false ); + domElement.addEventListener( "touchmove", this.onPointerMove, false ); + + domElement.addEventListener( "mouseup", this.onPointerUp, false ); + domElement.addEventListener( "mouseout", this.onPointerUp, false ); + domElement.addEventListener( "touchend", this.onPointerUp, false ); + domElement.addEventListener( "touchcancel", this.onPointerUp, false ); + domElement.addEventListener( "touchleave", this.onPointerUp, false ); + + this.dispose = function () { + + domElement.removeEventListener( "mousedown", this.onPointerDown ); + domElement.removeEventListener( "touchstart", this.onPointerDown ); + + domElement.removeEventListener( "mousemove", this.onPointerHover ); + domElement.removeEventListener( "touchmove", this.onPointerHover ); + + domElement.removeEventListener( "mousemove", this.onPointerMove ); + domElement.removeEventListener( "touchmove", this.onPointerMove ); + + domElement.removeEventListener( "mouseup", this.onPointerUp ); + domElement.removeEventListener( "mouseout", this.onPointerUp ); + domElement.removeEventListener( "touchend", this.onPointerUp ); + domElement.removeEventListener( "touchcancel", this.onPointerUp ); + domElement.removeEventListener( "touchleave", this.onPointerUp ); + + }; + + + }; + + THREE.JoyStickControls.prototype = Object.create( THREE.Object3D.prototype ); + THREE.JoyStickControls.prototype.constructor = THREE.JoyStickControls; + +}() ); diff --git a/src/tools/TurtlebotViewer-web/public/js/TrackballControls.js b/src/tools/TurtlebotViewer-web/public/js/TrackballControls.js new file mode 100644 index 000000000..ba95438c0 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/TrackballControls.js @@ -0,0 +1,634 @@ +/** + * @author Eberhard Graether / http://egraether.com/ + * @author Mark Lundin / http://mark-lundin.com + * @author Simone Manini / http://daron1337.github.io + * @author Luca Antiga / http://lantiga.github.io + */ + +THREE.TrackballControls = function ( object, domElement ) { + + var _this = this; + var STATE = { NONE: - 1, ROTATE: 0, ZOOM: 1, PAN: 2, TOUCH_ROTATE: 3, TOUCH_ZOOM_PAN: 4 }; + + this.object = object; + this.domElement = ( domElement !== undefined ) ? domElement : document; + + // API + + this.enabled = true; + + this.screen = { left: 0, top: 0, width: 0, height: 0 }; + + this.rotateSpeed = 1.0; + this.zoomSpeed = 1.2; + this.panSpeed = 0.3; + + this.noRotate = false; + this.noZoom = false; + this.noPan = false; + + this.staticMoving = false; + this.dynamicDampingFactor = 0.2; + + this.minDistance = 0; + this.maxDistance = Infinity; + + this.keys = [ 65 /*A*/, 83 /*S*/, 68 /*D*/ ]; + + // internals + + this.target = new THREE.Vector3(); + + var EPS = 0.000001; + + var lastPosition = new THREE.Vector3(); + + var _state = STATE.NONE, + _prevState = STATE.NONE, + + _eye = new THREE.Vector3(), + + _movePrev = new THREE.Vector2(), + _moveCurr = new THREE.Vector2(), + + _lastAxis = new THREE.Vector3(), + _lastAngle = 0, + + _zoomStart = new THREE.Vector2(), + _zoomEnd = new THREE.Vector2(), + + _touchZoomDistanceStart = 0, + _touchZoomDistanceEnd = 0, + + _panStart = new THREE.Vector2(), + _panEnd = new THREE.Vector2(); + + // for reset + + this.target0 = this.target.clone(); + this.position0 = this.object.position.clone(); + this.up0 = this.object.up.clone(); + + // events + + var changeEvent = { type: 'change' }; + var startEvent = { type: 'start' }; + var endEvent = { type: 'end' }; + + + // methods + + this.handleResize = function () { + + if ( this.domElement === document ) { + + this.screen.left = 0; + this.screen.top = 0; + this.screen.width = window.innerWidth; + this.screen.height = window.innerHeight; + + } else { + + var box = this.domElement.getBoundingClientRect(); + // adjustments come from similar code in the jquery offset() function + var d = this.domElement.ownerDocument.documentElement; + this.screen.left = box.left + window.pageXOffset - d.clientLeft; + this.screen.top = box.top + window.pageYOffset - d.clientTop; + this.screen.width = box.width; + this.screen.height = box.height; + + } + + }; + + this.handleEvent = function ( event ) { + + if ( typeof this[ event.type ] == 'function' ) { + + this[ event.type ]( event ); + + } + + }; + + var getMouseOnScreen = ( function () { + + var vector = new THREE.Vector2(); + + return function getMouseOnScreen( pageX, pageY ) { + + vector.set( + ( pageX - _this.screen.left ) / _this.screen.width, + ( pageY - _this.screen.top ) / _this.screen.height + ); + + return vector; + + }; + + }() ); + + var getMouseOnCircle = ( function () { + + var vector = new THREE.Vector2(); + + return function getMouseOnCircle( pageX, pageY ) { + + vector.set( + ( ( pageX - _this.screen.width * 0.5 - _this.screen.left ) / ( _this.screen.width * 0.5 ) ), + ( ( _this.screen.height + 2 * ( _this.screen.top - pageY ) ) / _this.screen.width ) // screen.width intentional + ); + + return vector; + + }; + + }() ); + + this.rotateCamera = ( function() { + + var axis = new THREE.Vector3(), + quaternion = new THREE.Quaternion(), + eyeDirection = new THREE.Vector3(), + objectUpDirection = new THREE.Vector3(), + objectSidewaysDirection = new THREE.Vector3(), + moveDirection = new THREE.Vector3(), + angle; + + return function rotateCamera() { + + moveDirection.set( _moveCurr.x - _movePrev.x, _moveCurr.y - _movePrev.y, 0 ); + angle = moveDirection.length(); + + if ( angle ) { + + _eye.copy( _this.object.position ).sub( _this.target ); + + eyeDirection.copy( _eye ).normalize(); + objectUpDirection.copy( _this.object.up ).normalize(); + objectSidewaysDirection.crossVectors( objectUpDirection, eyeDirection ).normalize(); + + objectUpDirection.setLength( _moveCurr.y - _movePrev.y ); + objectSidewaysDirection.setLength( _moveCurr.x - _movePrev.x ); + + moveDirection.copy( objectUpDirection.add( objectSidewaysDirection ) ); + + axis.crossVectors( moveDirection, _eye ).normalize(); + + angle *= _this.rotateSpeed; + quaternion.setFromAxisAngle( axis, angle ); + + _eye.applyQuaternion( quaternion ); + _this.object.up.applyQuaternion( quaternion ); + + _lastAxis.copy( axis ); + _lastAngle = angle; + + } else if ( ! _this.staticMoving && _lastAngle ) { + + _lastAngle *= Math.sqrt( 1.0 - _this.dynamicDampingFactor ); + _eye.copy( _this.object.position ).sub( _this.target ); + quaternion.setFromAxisAngle( _lastAxis, _lastAngle ); + _eye.applyQuaternion( quaternion ); + _this.object.up.applyQuaternion( quaternion ); + + } + + _movePrev.copy( _moveCurr ); + + }; + + }() ); + + + this.zoomCamera = function () { + + var factor; + + if ( _state === STATE.TOUCH_ZOOM_PAN ) { + + factor = _touchZoomDistanceStart / _touchZoomDistanceEnd; + _touchZoomDistanceStart = _touchZoomDistanceEnd; + _eye.multiplyScalar( factor ); + + } else { + + factor = 1.0 + ( _zoomEnd.y - _zoomStart.y ) * _this.zoomSpeed; + + if ( factor !== 1.0 && factor > 0.0 ) { + + _eye.multiplyScalar( factor ); + + if ( _this.staticMoving ) { + + _zoomStart.copy( _zoomEnd ); + + } else { + + _zoomStart.y += ( _zoomEnd.y - _zoomStart.y ) * this.dynamicDampingFactor; + + } + + } + + } + + }; + + this.panCamera = ( function() { + + var mouseChange = new THREE.Vector2(), + objectUp = new THREE.Vector3(), + pan = new THREE.Vector3(); + + return function panCamera() { + + mouseChange.copy( _panEnd ).sub( _panStart ); + + if ( mouseChange.lengthSq() ) { + + mouseChange.multiplyScalar( _eye.length() * _this.panSpeed ); + + pan.copy( _eye ).cross( _this.object.up ).setLength( mouseChange.x ); + pan.add( objectUp.copy( _this.object.up ).setLength( mouseChange.y ) ); + + _this.object.position.add( pan ); + _this.target.add( pan ); + + if ( _this.staticMoving ) { + + _panStart.copy( _panEnd ); + + } else { + + _panStart.add( mouseChange.subVectors( _panEnd, _panStart ).multiplyScalar( _this.dynamicDampingFactor ) ); + + } + + } + + }; + + }() ); + + this.checkDistances = function () { + + if ( ! _this.noZoom || ! _this.noPan ) { + + if ( _eye.lengthSq() > _this.maxDistance * _this.maxDistance ) { + + _this.object.position.addVectors( _this.target, _eye.setLength( _this.maxDistance ) ); + _zoomStart.copy( _zoomEnd ); + + } + + if ( _eye.lengthSq() < _this.minDistance * _this.minDistance ) { + + _this.object.position.addVectors( _this.target, _eye.setLength( _this.minDistance ) ); + _zoomStart.copy( _zoomEnd ); + + } + + } + + }; + + this.update = function () { + + _eye.subVectors( _this.object.position, _this.target ); + + if ( ! _this.noRotate ) { + + _this.rotateCamera(); + + } + + if ( ! _this.noZoom ) { + + _this.zoomCamera(); + + } + + if ( ! _this.noPan ) { + + _this.panCamera(); + + } + + _this.object.position.addVectors( _this.target, _eye ); + + _this.checkDistances(); + + _this.object.lookAt( _this.target ); + + if ( lastPosition.distanceToSquared( _this.object.position ) > EPS ) { + + _this.dispatchEvent( changeEvent ); + + lastPosition.copy( _this.object.position ); + + } + + }; + + this.reset = function () { + + _state = STATE.NONE; + _prevState = STATE.NONE; + + _this.target.copy( _this.target0 ); + _this.object.position.copy( _this.position0 ); + _this.object.up.copy( _this.up0 ); + + _eye.subVectors( _this.object.position, _this.target ); + + _this.object.lookAt( _this.target ); + + _this.dispatchEvent( changeEvent ); + + lastPosition.copy( _this.object.position ); + + }; + + // listeners + + function keydown( event ) { + + if ( _this.enabled === false ) return; + + window.removeEventListener( 'keydown', keydown ); + + _prevState = _state; + + if ( _state !== STATE.NONE ) { + + return; + + } else if ( event.keyCode === _this.keys[ STATE.ROTATE ] && ! _this.noRotate ) { + + _state = STATE.ROTATE; + + } else if ( event.keyCode === _this.keys[ STATE.ZOOM ] && ! _this.noZoom ) { + + _state = STATE.ZOOM; + + } else if ( event.keyCode === _this.keys[ STATE.PAN ] && ! _this.noPan ) { + + _state = STATE.PAN; + + } + + } + + function keyup( event ) { + + if ( _this.enabled === false ) return; + + _state = _prevState; + + window.addEventListener( 'keydown', keydown, false ); + + } + + function mousedown( event ) { + + if ( _this.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + if ( _state === STATE.NONE ) { + + _state = event.button; + + } + + if ( _state === STATE.ROTATE && ! _this.noRotate ) { + + _moveCurr.copy( getMouseOnCircle( event.pageX, event.pageY ) ); + _movePrev.copy( _moveCurr ); + + } else if ( _state === STATE.ZOOM && ! _this.noZoom ) { + + _zoomStart.copy( getMouseOnScreen( event.pageX, event.pageY ) ); + _zoomEnd.copy( _zoomStart ); + + } else if ( _state === STATE.PAN && ! _this.noPan ) { + + _panStart.copy( getMouseOnScreen( event.pageX, event.pageY ) ); + _panEnd.copy( _panStart ); + + } + + document.addEventListener( 'mousemove', mousemove, false ); + document.addEventListener( 'mouseup', mouseup, false ); + + _this.dispatchEvent( startEvent ); + + } + + function mousemove( event ) { + + if ( _this.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + if ( _state === STATE.ROTATE && ! _this.noRotate ) { + + _movePrev.copy( _moveCurr ); + _moveCurr.copy( getMouseOnCircle( event.pageX, event.pageY ) ); + + } else if ( _state === STATE.ZOOM && ! _this.noZoom ) { + + _zoomEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) ); + + } else if ( _state === STATE.PAN && ! _this.noPan ) { + + _panEnd.copy( getMouseOnScreen( event.pageX, event.pageY ) ); + + } + + } + + function mouseup( event ) { + + if ( _this.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + _state = STATE.NONE; + + document.removeEventListener( 'mousemove', mousemove ); + document.removeEventListener( 'mouseup', mouseup ); + _this.dispatchEvent( endEvent ); + + } + + function mousewheel( event ) { + + if ( _this.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + var delta = 0; + + if ( event.wheelDelta ) { + + // WebKit / Opera / Explorer 9 + + delta = event.wheelDelta / 40; + + } else if ( event.detail ) { + + // Firefox + + delta = - event.detail / 3; + + } + + _zoomStart.y += delta * 0.01; + _this.dispatchEvent( startEvent ); + _this.dispatchEvent( endEvent ); + + } + + function touchstart( event ) { + + if ( _this.enabled === false ) return; + + switch ( event.touches.length ) { + + case 1: + _state = STATE.TOUCH_ROTATE; + _moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); + _movePrev.copy( _moveCurr ); + break; + + case 2: + _state = STATE.TOUCH_ZOOM_PAN; + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + _touchZoomDistanceEnd = _touchZoomDistanceStart = Math.sqrt( dx * dx + dy * dy ); + + var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; + var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; + _panStart.copy( getMouseOnScreen( x, y ) ); + _panEnd.copy( _panStart ); + break; + + default: + _state = STATE.NONE; + + } + _this.dispatchEvent( startEvent ); + + + } + + function touchmove( event ) { + + if ( _this.enabled === false ) return; + + event.preventDefault(); + event.stopPropagation(); + + switch ( event.touches.length ) { + + case 1: + _movePrev.copy( _moveCurr ); + _moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); + break; + + case 2: + var dx = event.touches[ 0 ].pageX - event.touches[ 1 ].pageX; + var dy = event.touches[ 0 ].pageY - event.touches[ 1 ].pageY; + _touchZoomDistanceEnd = Math.sqrt( dx * dx + dy * dy ); + + var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; + var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; + _panEnd.copy( getMouseOnScreen( x, y ) ); + break; + + default: + _state = STATE.NONE; + + } + + } + + function touchend( event ) { + + if ( _this.enabled === false ) return; + + switch ( event.touches.length ) { + + case 1: + _movePrev.copy( _moveCurr ); + _moveCurr.copy( getMouseOnCircle( event.touches[ 0 ].pageX, event.touches[ 0 ].pageY ) ); + break; + + case 2: + _touchZoomDistanceStart = _touchZoomDistanceEnd = 0; + + var x = ( event.touches[ 0 ].pageX + event.touches[ 1 ].pageX ) / 2; + var y = ( event.touches[ 0 ].pageY + event.touches[ 1 ].pageY ) / 2; + _panEnd.copy( getMouseOnScreen( x, y ) ); + _panStart.copy( _panEnd ); + break; + + } + + _state = STATE.NONE; + _this.dispatchEvent( endEvent ); + + } + + function contextmenu( event ) { + + event.preventDefault(); + + } + + this.dispose = function() { + + this.domElement.removeEventListener( 'contextmenu', contextmenu, false ); + this.domElement.removeEventListener( 'mousedown', mousedown, false ); + this.domElement.removeEventListener( 'mousewheel', mousewheel, false ); + this.domElement.removeEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox + + this.domElement.removeEventListener( 'touchstart', touchstart, false ); + this.domElement.removeEventListener( 'touchend', touchend, false ); + this.domElement.removeEventListener( 'touchmove', touchmove, false ); + + document.removeEventListener( 'mousemove', mousemove, false ); + document.removeEventListener( 'mouseup', mouseup, false ); + + window.removeEventListener( 'keydown', keydown, false ); + window.removeEventListener( 'keyup', keyup, false ); + + } + + this.domElement.addEventListener( 'contextmenu', contextmenu, false ); + this.domElement.addEventListener( 'mousedown', mousedown, false ); + this.domElement.addEventListener( 'mousewheel', mousewheel, false ); + this.domElement.addEventListener( 'DOMMouseScroll', mousewheel, false ); // firefox + + this.domElement.addEventListener( 'touchstart', touchstart, false ); + this.domElement.addEventListener( 'touchend', touchend, false ); + this.domElement.addEventListener( 'touchmove', touchmove, false ); + + window.addEventListener( 'keydown', keydown, false ); + window.addEventListener( 'keyup', keyup, false ); + + this.handleResize(); + + // force an update at start + this.update(); + +}; + +THREE.TrackballControls.prototype = Object.create( THREE.EventDispatcher.prototype ); +THREE.TrackballControls.prototype.constructor = THREE.TrackballControls; diff --git a/src/tools/TurtlebotViewer-web/public/js/api.js b/src/tools/TurtlebotViewer-web/public/js/api.js new file mode 100644 index 000000000..6fe4b05e9 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/api.js @@ -0,0 +1,543 @@ +var API = API || {}; + +/* + * API.Camera's Constructor. + * Params: + * - config (contents client's Config)={server,id,epname,fpsid,imgFormat}: + * + id (canvas' id to show RGB camera) + * + fpsid (id of element to show fps, is optional) + * + server (server's direction and port)={dir:direction,port: port} + * + epname (name of camera endpoint, default cameraA) + * + imgFormat (format of image that is going to request to the server, default RGB8) + */ +API.Camera = function (config) { + var conf = config || {}; + + + this.workerFile = "js/api_workers/camera_worker.js"; + this.w = undefined; + this.onmessage = undefined; + this.isRunning = false; + + + this.conPromise = undefined; + + this.description = undefined; + this.data = undefined; + + this.imgFormat = conf.imgFormat || "RGB8"; + this.epname = conf.epname || "cameraA"; + this.server = conf.server; + + this.toError = undefined; // connection error message timeout + this.timeoutE = 3000; + + + + var self = this; + + + this.createWork = function () { + this.w = new Worker(this.workerFile); + this.w.onerror = function (err) { + console.log ("worker error: "+ err.message); + }; + }; + + this.deleteWork = function () { + if (this.w){ + this.w.terminate(); + this.w = undefined; + } + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.connect = function () { + this.conPromise = new Promise( + // The resolver function is called with the ability to resolve or + // reject the promise + function(resolve, reject) { + self.w.onmessage = function(mes) { + if (mes.data){ + self.isRunning = true; + resolve(); + }else{ + self.isRunning = false; + reject(); + } + }; + self.w.postMessage({func:"connect",serv:self.server,epname: self.epname}); + }); + }; + + this.disconnect = function (){ + this.w.postMessage({func:"disconnect"}); + this.isRunning = false; + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.startStreaming = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"startImageStream", imgFormat: self.imgFormat}); + self.toError=setTimeout(self.conErr, self.timeoutE); + }); + }; + + this.getImage = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"getImage", imgFormat: self.imgFormat}); + }); + }; + + this.stopStreaming = function(){ + this.conPromise.then( + function() { + self.w.postMessage({func:"stopImageStream"}); + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }); + }; + + this.getDescription = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"getCameraDescription"}); + }); + }; + + this.onmessageDefault = function(event) { + if (self.toError){ + clearTimeout(self.toError); + self.toError=setTimeout(self.conErr, self.timeoutE+10); + } + self.data=event.data.img; + self.description=event.data.desc || self.description; + if (event.data.delay){ + var tt = new Date().getTime(); + self.delay = event.data.delay; + self.delay.worker = tt - event.data.delay._ctime; + } + }; + + /* + * conErr + * Displays an error message and closes the webworker + */ + this.conErr=function(){ + alert ("connection to server "+self.epname+" "+self.server.dir+":"+self.server.port+" failed"); + self.deleteWork(); + }; + + this.createWork(); + +}; + +/* + * API.Motors's Constructor. + * Params: + * - config (contents client's Config)={server,epname,onmessage}: + * + server (server's direction and port)={dir:direction,port: port} + * + epname (name of motor endpoint, default Motors) + */ +API.Motors = function (config){ + var conf = config || {}; + + this.id = conf.id; + + this.workerFile = "js/api_workers/motors_worker.js"; + this.w = undefined; + this.onmessage = undefined; + this.isRunning = false; + + this.conPromise = undefined; + + this.data=undefined; + + this.epname = conf.epname || "Motors"; + this.server = conf.server; + + var self = this; + + + this.createWork = function(){ + this.w = new Worker(this.workerFile); + this.w.onerror = function (err){ + console.log ("worker error: "+ err.message); + }; + }; + + this.deleteWork = function (){ + if (this.w){ + this.w.terminate(); + this.w = undefined; + } + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.connect = function (){ + this.conPromise = new Promise( + // The resolver function is called with the ability to resolve or + // reject the promise + function(resolve, reject) { + self.w.onmessage = function(mes){ + if (mes.data){ + self.isRunning = true; + resolve(); + }else{ + self.isRunning = false; + reject(); + } + }; + self.w.postMessage({func:"connect",serv:self.server,epname: self.epname}); + }); + + }; + + this.disconnect = function (){ + this.w.postMessage({func:"disconnect"}); + this.isRunning = false; + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + + + this.getAll = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func: "getAll"}); + }); + }; + + this.getV = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func: "getV"}); + }); + }; + + this.getW = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func: "getW"}); + }); + }; + + this.getL = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func: "getL"}); + }); + }; + + this.setAll = function(v,w,l){ + this.conPromise.then( + function() { + var data = {v:v,w:w,l:l}; + self.w.postMessage({func: "setAll", data: data}); + }); + }; + + this.setV = function(v){ + this.conPromise.then( + function() { + self.w.postMessage({func: "setV", data: v}); + }); + }; + + this.setW = function(w){ + this.conPromise.then( + function() { + self.w.postMessage({func: "setW", data: w}); + }); + }; + + this.setL = function(l){ + this.conPromise.then( + function() { + self.w.postMessage({func: "setL", data: l}); + }); + }; + + + this.onmessageDefault = function(event) { + self.data=event.data; + }; + + this.createWork(); +}; + +/* + * API.Pose3D's Constructor. + * Params: + * - config (contents client's Config)={server,id,epname}: + * + server (server's direction and port)={dir:direction,port: port} + * + epname (name of pose3d endpoint, default Pose3D) + */ +API.Pose3D= function (config){ + var conf = config || {}; + + this.workerFile = "js/api_workers/pose3d_worker.js"; + this.w = undefined; + this.onmessage = undefined; + this.isRunning = false; + + this.conPromise = undefined; + + this.data = undefined; + this.update = false; + + this.epname = conf.epname || "Pose3D"; + this.server = conf.server; + + this.toError = undefined; // connection error message timeout + this.timeoutE = 3000; + + var self = this; + + + this.createWork = function(){ + this.w = new Worker(this.workerFile); + this.w.onerror = function (err){ + console.log ("worker error: "+ err.message); + }; + }; + + this.deleteWork = function (){ + if (this.w){ + this.w.terminate(); + this.w = undefined; + } + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.connect = function (){ + this.conPromise = new Promise( + // The resolver function is called with the ability to resolve or + // reject the promise + function(resolve, reject) { + self.w.onmessage = function(mes){ + if (mes.data){ + self.isRunning = true; + resolve(); + }else{ + self.isRunning = false; + reject(); + } + }; + self.w.postMessage({func:"connect",serv:self.server,epname: self.epname}); + }); + }; + + this.disconnect = function (){ + this.w.postMessage({func:"disconnect"}); + this.isRunning = false; + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.getPose3D = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"getPose3D"}); + }); + }; + + this.startStreaming = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"startPose3DStream"}); + self.toError=setTimeout(self.conErr, self.timeoutE); + }); + }; + + this.stopStreaming = function(){ + this.conPromise.then( + function() { + self.w.postMessage({func:"stopPose3DStream"}); + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }); + }; + + + this.onmessageDefault = function(event) { + if (self.toError){ + clearTimeout(this.toError); + self.toError=setTimeout(self.conErr, self.timeoutE); + } + var respwork=event.data; + self.data= respwork; + }; + /* + * conErr + * Displays an error message and closes the webworker + */ + this.conErr=function(){ + alert ("connection to server "+self.epname+" "+self.server.dir+":"+self.server.port+" failed"); + self.deleteWork(); + }; + + this.createWork(); +}; + +/* + * API.Laser's Constructor. + * Params: + * - config (contents client's Config)={server,id,epname}: + * + server (server's direction and port)={dir:direction,port: port} + * + epname (name of laser endpoint, default Laser) + * + convertUpAxis (height is represented in Y instead of Z in 3d) + * + scale3d (scale of laser 3d representation ) + * + canv2dWidth (canvas' width to show laser in 2D, default 360 ) + */ +API.Laser= function (config){ + var conf = config || {}; + + this.workerFile = "js/api_workers/laser_worker.js"; + this.w = undefined; + this.onmessage = undefined; + this.isRunning = false; + + this.conPromise = undefined; + + this.data = undefined; + this.update = false; + + this.epname = conf.epname || "Laser"; + this.server = conf.server; + this.canv2dWidth = conf.canv2dWidth || 360; + this.scale3d = conf.scale3d || 1; + this.convertUpAxis = conf.convertUpAxis || false; + + this.toError = undefined; // connection error message timeout + this.timeoutE = 3000; + + var self = this; + + + this.createWork = function(){ + this.w = new Worker(this.workerFile); + this.w.onerror = function (err){ + console.log ("worker error: "+ err.message); + }; + }; + + this.deleteWork = function (){ + if (this.w){ + this.w.terminate(); + this.w = undefined; + } + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.connect = function (){ + this.conPromise = new Promise( + // The resolver function is called with the ability to resolve or + // reject the promise + function(resolve, reject) { + self.w.onmessage = function(mes){ + if (mes.data){ + self.isRunning = true; + resolve(); + }else{ + self.isRunning = false; + reject(); + } + }; + self.w.postMessage({func:"connect",serv:self.server,epname: self.epname}); + }); + }; + + this.disconnect = function (){ + this.w.postMessage({func:"disconnect"}); + this.isRunning = false; + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }; + + this.getLaser = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"getLaser",convertUpAxis:self.convertUpAxis,canv2dWidth:self.canv2dWidth, scale3d: self.scale3d, height3d: self.height3d}); + }); + }; + + this.startStreaming = function(){ + this.conPromise.then( + function() { + self.w.onmessage = self.onmessage || self.onmessageDefault; + self.w.postMessage({func:"startLaserStream",convertUpAxis:self.convertUpAxis,canv2dWidth:self.canv2dWidth, scale3d: self.scale3d , height3d: self.height3d}); + self.toError=setTimeout(self.conErr, self.timeoutE); + }); + }; + + this.stopStreaming = function(){ + this.conPromise.then( + function() { + self.w.postMessage({func:"stopLaserStream"}); + if(self.toError){ + clearTimeout(self.toError); + toError=undefined; + } + }); + }; + + + this.onmessageDefault = function(event) { + if (self.toError){ + clearTimeout(this.toError); + self.toError=setTimeout(self.conErr, self.timeoutE); + } + var respwork=event.data; + self.data= respwork; + }; + /* + * conErr + * Displays an error message and closes the webworker + */ + this.conErr=function(){ + alert ("connection to server "+self.epname+" "+self.server.dir+":"+self.server.port+" failed"); + // self.deleteWork(); + }; + + this.createWork(); + +}; diff --git a/src/tools/TurtlebotViewer-web/public/js/api_workers/camera_worker.js b/src/tools/TurtlebotViewer-web/public/js/api_workers/camera_worker.js new file mode 100644 index 000000000..5aea7ffb3 --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/api_workers/camera_worker.js @@ -0,0 +1,195 @@ +// variables to make believe to ICE that is in the main thread +var window=self; +var global=self; + +// importing required files +importScripts('../Ice.min.js'); +importScripts('../jderobot/datetime.js'); +importScripts('../jderobot/exceptions.js'); +importScripts('../jderobot/containers.js'); +importScripts('../jderobot/common.js'); +importScripts('../jderobot/image.js'); +importScripts('../jderobot/camera.js'); + + +// variables related to the configuration and connection of ICE +var id = new Ice.InitializationData(); +var communicator; + +var Promise; +var Prx = jderobot.CameraPrx; +var stream = false; +var srv; + +var oldFrameTime = undefined; +var frameCount = 0; + +var description = undefined; +var img = undefined; + +function calculateFPS(){ + var fps = undefined; + var d = new Date(); + var currentFrameTime = d.getTime(); + var diff = (currentFrameTime - oldFrameTime); + if (diff < 1000){ + frameCount+=1; + }else{ + oldFrameTime = currentFrameTime; + fps = frameCount*1000.0/diff; + frameCount=0; + } + return fps; + } + +function calculateDelay(time) { + var d = new Date(); + var currentTime = d.getTime(); + return currentTime - time; + +} + +var procesar = []; + +procesar["RGB8"] = function (pixelData, width, height){ + // Once received the image (RGB), I adapt it to the format that canvas needs (RGBA) + var imgData=new Uint8Array(4*width*height); + var j=0; + var length = imgData.length; + + for (var i=0;i=1.0){ + rotateY=math.PI/2.0; + } else if(rotateYa0<=-1.0){ + rotateY=-Math.PI/2.0 + } else { + rotateY=Math.asin(rotateYa0) + } + + return rotateY; +} + +function connect (config){ + + id.properties = Ice.createProperties(); + //id.properties.setProperty("Ice.Trace.Network", "3"); + //id.properties.setProperty("Ice.Trace.Protocol", "1"); + communicator = Ice.initialize(id); + + + // Create the proxy to connect + var proxy = communicator.stringToProxy(config.epname+":ws -h " + config.server.dir + " -p " + config.server.port); + // connects to the proxy and asks the image + Promise = Prx.checkedCast(proxy).then( + function(ar){ + console.log("Pose3D connected: " + ar); + srv = ar; + + postMessage(true); + }, + function(ex, ar){ + console.log("Pose3D NOT connected: " + ex); + postMessage(false); + }); +} + + +function getPose3D(){ + srv.getPose3DData().then(function (data){ + var response={}; + response.x=data.x; + response.y=data.y; + response.z=data.z; + response.q0=data.q0; + response.q1=data.q1; + response.q2=data.q2; + response.q3=data.q3; + response.yaw=getYaw(data.q0,data.q1,data.q2,data.q3); + response.pitch=getPitch(data.q0,data.q1,data.q2,data.q3); + response.roll=getRoll(data.q0,data.q1,data.q2,data.q3); + postMessage(response); + if (stream){ + getPose3D(); + } + + },function(err){console.log(err);}); +} + + +onmessage = function(e) { + var config={}; + // Collects the data provided by the main thread and initialized ICE + config.server = e.data.serv; + config.epname = e.data.epname; + + switch (e.data.func){ + case "getPose3D": + getPose3D(); + break; + case "setPose3D": + //setPose3D(config); + break; + case "startPose3DStream": + stream = true; + getPose3D(); + break; + case "stopPose3DStream": + stream = false; + break; + case "connect": + connect(config); + break; + case "disconnect": + srv = undefined; + break; + default: + + } +} diff --git a/src/tools/TurtlebotViewer-web/public/js/bootstrap-toggle.min.js b/src/tools/TurtlebotViewer-web/public/js/bootstrap-toggle.min.js new file mode 100644 index 000000000..37113200b --- /dev/null +++ b/src/tools/TurtlebotViewer-web/public/js/bootstrap-toggle.min.js @@ -0,0 +1,9 @@ +/*! ======================================================================== + * Bootstrap Toggle: bootstrap-toggle.js v2.2.0 + * http://www.bootstraptoggle.com + * ======================================================================== + * Copyright 2014 Min Hur, The New York Times Company + * Licensed under MIT + * ======================================================================== */ ++function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.toggle"),f="object"==typeof b&&b;e||d.data("bs.toggle",e=new c(this,f)),"string"==typeof b&&e[b]&&e[b]()})}var c=function(b,c){this.$element=a(b),this.options=a.extend({},this.defaults(),c),this.render()};c.VERSION="2.2.0",c.DEFAULTS={on:"On",off:"Off",onstyle:"primary",offstyle:"default",size:"normal",style:"",width:null,height:null},c.prototype.defaults=function(){return{on:this.$element.attr("data-on")||c.DEFAULTS.on,off:this.$element.attr("data-off")||c.DEFAULTS.off,onstyle:this.$element.attr("data-onstyle")||c.DEFAULTS.onstyle,offstyle:this.$element.attr("data-offstyle")||c.DEFAULTS.offstyle,size:this.$element.attr("data-size")||c.DEFAULTS.size,style:this.$element.attr("data-style")||c.DEFAULTS.style,width:this.$element.attr("data-width")||c.DEFAULTS.width,height:this.$element.attr("data-height")||c.DEFAULTS.height}},c.prototype.render=function(){this._onstyle="btn-"+this.options.onstyle,this._offstyle="btn-"+this.options.offstyle;var b="large"===this.options.size?"btn-lg":"small"===this.options.size?"btn-sm":"mini"===this.options.size?"btn-xs":"",c=a('