{ "errors": [], "warnings": [ "asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).\nThis can impact web performance.\nAssets: \n index.bundle.js (749 KiB)\n npm.webp-hero.chunk.js (310 KiB)", "entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.\nEntrypoints:\n index (1.07 MiB)\n npm.aes-js.chunk.js\n npm.jsbn.chunk.js\n npm.leemon.chunk.js\n npm.lottie-web.chunk.js\n npm.web-streams-polyfill.chunk.js\n vendors~index.chunk.js\n index.bundle.js\n webp (317 KiB)\n npm.webp-hero.chunk.js\n webp.bundle.js\n", "webpack performance recommendations: \nYou can limit the size of your bundles by using import() or require.ensure to lazy load some parts of your application.\nFor more info visit https://webpack.js.org/guides/code-splitting/" ], "version": "4.41.2", "hash": "e28785388f6334731d60", "time": 8981, "builtAt": 1581916641211, "publicPath": "", "outputPath": "/Users/kuzmenko/Documents/projects/tweb/public", "assetsByChunkName": { "index": "index.bundle.js", "npm.aes-js": "npm.aes-js.chunk.js", "npm.jsbn": "npm.jsbn.chunk.js", "npm.leemon": "npm.leemon.chunk.js", "npm.lottie-web": "npm.lottie-web.chunk.js", "npm.web-streams-polyfill": "npm.web-streams-polyfill.chunk.js", "npm.webp-hero": "npm.webp-hero.chunk.js", "vendors~index": "vendors~index.chunk.js", "webp": "webp.bundle.js" }, "assets": [ { "name": "69d45fed4230730b6030.worker.js", "size": 79262, "chunks": [], "chunkNames": [], "info": { "immutable": true }, "emitted": true }, { "name": "69d45fed4230730b6030.worker.js.gz", "size": 26698, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/fonts/tgico.eot", "size": 23516, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/fonts/tgico.svg", "size": 85141, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/fonts/tgico.svg.gz", "size": 24074, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/fonts/tgico.ttf", "size": 23352, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/fonts/tgico.woff", "size": 23428, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/img/camomile.jpg", "size": 107703, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/img/doc-in.svg", "size": 1080, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/img/msg-tail-left.svg", "size": 325, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "assets/img/msg-tail-right.svg", "size": 328, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "index.bundle.js", "size": 767165, "chunks": [ 0 ], "chunkNames": [ "index" ], "info": {}, "emitted": true, "isOverSizeLimit": true }, { "name": "index.bundle.js.gz", "size": 172484, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "index.html", "size": 24479, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "index.html.gz", "size": 5560, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.aes-js.chunk.js", "size": 43937, "chunks": [ 1 ], "chunkNames": [ "npm.aes-js" ], "info": {}, "emitted": true }, { "name": "npm.aes-js.chunk.js.gz", "size": 18149, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.jsbn.chunk.js", "size": 19047, "chunks": [ 2 ], "chunkNames": [ "npm.jsbn" ], "info": {}, "emitted": true }, { "name": "npm.jsbn.chunk.js.gz", "size": 6583, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.leemon.chunk.js", "size": 14391, "chunks": [ 3 ], "chunkNames": [ "npm.leemon" ], "info": {}, "emitted": true }, { "name": "npm.leemon.chunk.js.gz", "size": 4668, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.lottie-web.chunk.js", "size": 202543, "chunks": [ 4 ], "chunkNames": [ "npm.lottie-web" ], "info": {}, "emitted": true }, { "name": "npm.lottie-web.chunk.js.gz", "size": 52399, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.web-streams-polyfill.chunk.js", "size": 42988, "chunks": [ 5 ], "chunkNames": [ "npm.web-streams-polyfill" ], "info": {}, "emitted": true }, { "name": "npm.web-streams-polyfill.chunk.js.gz", "size": 9949, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "npm.webp-hero.chunk.js", "size": 317799, "chunks": [ 6 ], "chunkNames": [ "npm.webp-hero" ], "info": {}, "emitted": true, "isOverSizeLimit": true }, { "name": "npm.webp-hero.chunk.js.gz", "size": 96803, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "vendors~index.chunk.js", "size": 29816, "chunks": [ 7 ], "chunkNames": [ "vendors~index" ], "info": {}, "emitted": true }, { "name": "vendors~index.chunk.js.gz", "size": 10700, "chunks": [], "chunkNames": [], "info": {}, "emitted": true }, { "name": "webp.bundle.js", "size": 7173, "chunks": [ 8 ], "chunkNames": [ "webp" ], "info": {}, "emitted": true } ], "filteredAssets": 0, "entrypoints": { "index": { "chunks": [ 1, 2, 3, 4, 5, 7, 0 ], "assets": [ "npm.aes-js.chunk.js", "npm.jsbn.chunk.js", "npm.leemon.chunk.js", "npm.lottie-web.chunk.js", "npm.web-streams-polyfill.chunk.js", "vendors~index.chunk.js", "index.bundle.js" ], "children": {}, "childAssets": {}, "isOverSizeLimit": true }, "webp": { "chunks": [ 6, 8 ], "assets": [ "npm.webp-hero.chunk.js", "webp.bundle.js" ], "children": {}, "childAssets": {}, "isOverSizeLimit": true } }, "namedChunkGroups": { "index": { "chunks": [ 1, 2, 3, 4, 5, 7, 0 ], "assets": [ "npm.aes-js.chunk.js", "npm.jsbn.chunk.js", "npm.leemon.chunk.js", "npm.lottie-web.chunk.js", "npm.web-streams-polyfill.chunk.js", "vendors~index.chunk.js", "index.bundle.js" ], "children": {}, "childAssets": {}, "isOverSizeLimit": true }, "webp": { "chunks": [ 6, 8 ], "assets": [ "npm.webp-hero.chunk.js", "webp.bundle.js" ], "children": {}, "childAssets": {}, "isOverSizeLimit": true } }, "chunks": [ { "id": 0, "rendered": true, "initial": true, "entry": true, "size": 1315562, "names": [ "index" ], "files": [ "index.bundle.js" ], "hash": "235eb41a21132db1e2b8", "siblings": [ 1, 2, 3, 4, 5, 7 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 0, "identifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/utils.js", "name": "./src/lib/utils.js", "index": 18, "index2": 17, "size": 22613, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "27:16-35" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony side effect evaluation", "userRequest": "./utils", "loc": "1:0-65" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "347:32-36" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "369:11-25" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "400:8-22" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "428:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "441:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "459:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "470:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "472:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "485:18-32" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "492:12-26" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "517:56-70" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "523:82-96" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "543:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "545:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "566:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "572:65-79" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "573:10-24" }, { "moduleId": 3, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "module": "./src/lib/richtextprocessor.js", "moduleName": "./src/lib/richtextprocessor.js", "type": "harmony import specifier", "userRequest": "./utils", "loc": "583:12-26" }, { "moduleId": 4, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "module": "./src/lib/appManagers/appUsersManager.ts", "moduleName": "./src/lib/appManagers/appUsersManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "6:16-35" }, { "moduleId": 5, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/misc.ts", "module": "./src/components/misc.ts", "moduleName": "./src/components/misc.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "7:16-39" }, { "moduleId": 10, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPeersManager.ts", "module": "./src/lib/appManagers/appPeersManager.ts", "moduleName": "./src/lib/appManagers/appPeersManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "8:16-35" }, { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "16:16-35" }, { "moduleId": 12, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appChatsManager.ts", "module": "./src/lib/appManagers/appChatsManager.ts", "moduleName": "./src/lib/appManagers/appChatsManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "6:16-35" }, { "moduleId": 14, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/scrollable.ts", "module": "./src/components/scrollable.ts", "moduleName": "./src/components/scrollable.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "3:16-39" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "15:16-35" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "../utils", "loc": "15:16-35" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "23:16-35" }, { "moduleId": 20, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/lottieLoader.ts", "module": "./src/lib/lottieLoader.ts", "moduleName": "./src/lib/lottieLoader.ts", "type": "cjs require", "userRequest": "./utils", "loc": "19:16-34" }, { "moduleId": 23, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/serverTimeManager.ts", "module": "./src/lib/mtproto/serverTimeManager.ts", "moduleName": "./src/lib/mtproto/serverTimeManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "7:16-35" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "../utils", "loc": "20:16-35" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "8:16-35" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "17:16-35" }, { "moduleId": 29, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/preloader.ts", "module": "./src/components/preloader.ts", "moduleName": "./src/components/preloader.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "3:16-39" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "20:16-39" }, { "moduleId": 35, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/tl_utils.ts", "module": "./src/lib/tl_utils.ts", "moduleName": "./src/lib/tl_utils.ts", "type": "cjs require", "userRequest": "./utils", "loc": "17:16-34" }, { "moduleId": 36, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/timeManager.ts", "module": "./src/lib/mtproto/timeManager.ts", "moduleName": "./src/lib/mtproto/timeManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "7:16-35" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "6:16-35" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "17:16-39" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "../utils", "loc": "19:16-35" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../utils", "loc": "8:16-35" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "../utils", "loc": "14:16-35" }, { "moduleId": 48, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/lazyLoadQueue.ts", "module": "./src/components/lazyLoadQueue.ts", "moduleName": "./src/components/lazyLoadQueue.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "12:16-39" }, { "moduleId": 49, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebPagesManager.ts", "module": "./src/lib/appManagers/appWebPagesManager.ts", "moduleName": "./src/lib/appManagers/appWebPagesManager.ts", "type": "cjs require", "userRequest": "../utils", "loc": "6:16-35" }, { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./lib/utils", "loc": "23:16-38" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../utils", "loc": "22:16-35" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/utils", "loc": "18:16-39" } ], "usedExports": true, "providedExports": [ "dT", "checkClick", "isInDOM", "checkDragEvent", "cancelEvent", "onCtrlEnter", "setFieldSelection", "getFieldSelection", "getRichValue", "placeCaretAtEnd", "getRichValueWithCaret", "getRichElementValue", "setRichFocus", "getSelectedText", "$rootScope", "langPack", "_", "isObject", "tsNow", "safeReplaceObject", "numberWithCommas", "findUpClassName", "findUpTag", "isElementInViewport", "isScrolledIntoView", "whichChild", "copy", "formatBytes", "formatNumber", "deepEqual", "listMergeSorted", "listUniqSorted", "encodeEntities", "calcImageInBox", "countryCodeEmoji", "unifiedCountryCodeEmoji", "SearchIndexManager" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/components/emoticonsDropdown.ts (referenced with cjs require), ./src/components/lazyLoadQueue.ts (referenced with cjs require), ./src/components/misc.ts (referenced with cjs require), ./src/components/pageSignIn.ts (referenced with cjs require), ./src/components/preloader.ts (referenced with cjs require), ./src/components/scrollable.ts (referenced with cjs require), ./src/components/wrappers.ts (referenced with cjs require), ./src/index.ts (referenced with cjs require), ./src/lib/appManagers/apiUpdatesManager.ts (referenced with cjs require), ./src/lib/appManagers/appChatsManager.ts (referenced with cjs require), ./src/lib/appManagers/appDialogsManager.ts (referenced with cjs require), ./src/lib/appManagers/appImManager.ts (referenced with cjs require), ./src/lib/appManagers/appMediaViewer.ts (referenced with cjs require), ./src/lib/appManagers/appMessagesManager.ts (referenced with cjs require), ./src/lib/appManagers/appPeersManager.ts (referenced with cjs require), ./src/lib/appManagers/appPhotosManager.ts (referenced with cjs require), ./src/lib/appManagers/appProfileManager.ts (referenced with cjs require), ./src/lib/appManagers/appSidebarLeft.ts (referenced with cjs require), ./src/lib/appManagers/appSidebarRight.ts (referenced with cjs require), ./src/lib/appManagers/appUsersManager.ts (referenced with cjs require), ./src/lib/appManagers/appWebPagesManager.ts (referenced with cjs require), ./src/lib/lottieLoader.ts (referenced with cjs require), ./src/lib/mtproto/apiManager.ts (referenced with cjs require), ./src/lib/mtproto/authorizer.ts (referenced with cjs require), ./src/lib/mtproto/mtproto.ts (referenced with cjs require), ./src/lib/mtproto/networker.ts (referenced with cjs require), ./src/lib/mtproto/serverTimeManager.ts (referenced with cjs require), ./src/lib/mtproto/timeManager.ts (referenced with cjs require), ./src/lib/tl_utils.ts (referenced with cjs require)" ], "depth": 1, "source": "/*!\r\n * Webogram v0.7.0 - messaging web application for MTProto\r\n * https://github.com/zhukov/webogram\r\n * Copyright (C) 2014 Igor Zhukov \r\n * https://github.com/zhukov/webogram/blob/master/LICENSE\r\n */\r\nvar _logTimer = (new Date()).getTime()\r\nexport function dT () {\r\n return '[' + (((new Date()).getTime() - _logTimer) / 1000).toFixed(3) + ']'\r\n}\r\n\r\nexport function checkClick (e, noprevent) {\r\n if (e.which == 1 && (e.ctrlKey || e.metaKey) || e.which == 2) {\r\n return true\r\n }\r\n\r\n if (!noprevent) {\r\n e.preventDefault()\r\n }\r\n\r\n return false\r\n}\r\n\r\nexport function isInDOM (element, parentNode) {\r\n if (!element) {\r\n return false\r\n }\r\n parentNode = parentNode || document.body\r\n if (element == parentNode) {\r\n return true\r\n }\r\n return isInDOM(element.parentNode, parentNode)\r\n}\r\n\r\nexport function checkDragEvent(e) {\r\n if (!e || e.target && (e.target.tagName == 'IMG' || e.target.tagName == 'A')) return false\r\n if (e.dataTransfer && e.dataTransfer.types) {\r\n for (var i = 0; i < e.dataTransfer.types.length; i++) {\r\n if (e.dataTransfer.types[i] == 'Files') {\r\n return true\r\n }\r\n }\r\n } else {\r\n return true\r\n }\r\n\r\n return false\r\n}\r\n\r\nexport function cancelEvent (event) {\r\n event = event || window.event\r\n if (event) {\r\n event = event.originalEvent || event\r\n\r\n if (event.stopPropagation) event.stopPropagation()\r\n if (event.preventDefault) event.preventDefault()\r\n event.returnValue = false\r\n event.cancelBubble = true\r\n }\r\n\r\n return false\r\n}\r\n\r\nexport function onCtrlEnter (textarea, cb) {\r\n $(textarea).on('keydown', function (e) {\r\n if (e.keyCode == 13 && (e.ctrlKey || e.metaKey)) {\r\n cb()\r\n return cancelEvent(e)\r\n }\r\n })\r\n}\r\n\r\nexport function setFieldSelection (field, from, to) {\r\n field = $(field)[0]\r\n try {\r\n field.focus()\r\n if (from === undefined || from === false) {\r\n from = field.value.length\r\n }\r\n if (to === undefined || to === false) {\r\n to = from\r\n }\r\n if (field.createTextRange) {\r\n var range = field.createTextRange()\r\n range.collapse(true)\r\n range.moveEnd('character', to)\r\n range.moveStart('character', from)\r\n range.select()\r\n }\r\n else if (field.setSelectionRange) {\r\n field.setSelectionRange(from, to)\r\n }\r\n } catch(e) {}\r\n}\r\n\r\nexport function getFieldSelection (field) {\r\n if (field.selectionStart) {\r\n return field.selectionStart\r\n }\r\n else if (!document.selection) {\r\n return 0\r\n }\r\n\r\n var c = '\\x01'\r\n var sel = document.selection.createRange()\r\n var txt = sel.text\r\n var dup = sel.duplicate()\r\n var len = 0\r\n\r\n try {\r\n dup.moveToElementText(field)\r\n } catch(e) {\r\n return 0\r\n }\r\n\r\n sel.text = txt + c\r\n len = dup.text.indexOf(c)\r\n sel.moveStart('character', -1)\r\n sel.text = ''\r\n\r\n // if (browser.msie && len == -1) {\r\n // return field.value.length\r\n // }\r\n return len\r\n}\r\n\r\nexport function getRichValue (field) {\r\n if (!field) {\r\n return ''\r\n }\r\n var lines = []\r\n var line = []\r\n\r\n getRichElementValue(field, lines, line)\r\n if (line.length) {\r\n lines.push(line.join(''))\r\n }\r\n\r\n var value = lines.join('\\n')\r\n value = value.replace(/\\u00A0/g, ' ')\r\n\r\n return value\r\n}\r\n\r\nexport function placeCaretAtEnd(el) {\r\n el.focus();\r\n if (typeof window.getSelection != \"undefined\"\r\n && typeof document.createRange != \"undefined\") {\r\n var range = document.createRange();\r\n range.selectNodeContents(el);\r\n range.collapse(false);\r\n var sel = window.getSelection();\r\n sel.removeAllRanges();\r\n sel.addRange(range);\r\n } else if (typeof document.body.createTextRange != \"undefined\") {\r\n var textRange = document.body.createTextRange();\r\n textRange.moveToElementText(el);\r\n textRange.collapse(false);\r\n textRange.select();\r\n }\r\n}\r\n\r\nexport function getRichValueWithCaret (field) {\r\n if (!field) {\r\n return []\r\n }\r\n var lines = []\r\n var line = []\r\n\r\n var sel = window.getSelection ? window.getSelection() : false\r\n var selNode\r\n var selOffset\r\n if (sel && sel.rangeCount) {\r\n var range = sel.getRangeAt(0)\r\n /* if (range.startContainer &&\r\n range.startContainer == range.endContainer &&\r\n range.startOffset == range.endOffset) { */\r\n selNode = range.startContainer\r\n selOffset = range.startOffset\r\n //}\r\n }\r\n\r\n getRichElementValue(field, lines, line, selNode, selOffset)\r\n\r\n if (line.length) {\r\n lines.push(line.join(''))\r\n }\r\n\r\n var value = lines.join('\\n')\r\n var caretPos = value.indexOf('\\x01')\r\n if (caretPos != -1) {\r\n value = value.substr(0, caretPos) + value.substr(caretPos + 1)\r\n }\r\n value = value.replace(/\\u00A0/g, ' ')\r\n\r\n return [value, caretPos]\r\n}\r\n\r\nexport function getRichElementValue (node, lines, line, selNode, selOffset) {\r\n if (node.nodeType == 3) { // TEXT\r\n if (selNode === node) {\r\n var value = node.nodeValue\r\n line.push(value.substr(0, selOffset) + '\\x01' + value.substr(selOffset))\r\n } else {\r\n line.push(node.nodeValue)\r\n }\r\n return\r\n }\r\n if (node.nodeType != 1) { // NON-ELEMENT\r\n return\r\n }\r\n var isSelected = (selNode === node)\r\n var isBlock = node.tagName == 'DIV' || node.tagName == 'P'\r\n var curChild\r\n if (isBlock && line.length || node.tagName == 'BR') {\r\n lines.push(line.join(''))\r\n line.splice(0, line.length)\r\n }\r\n else if (node.tagName == 'IMG') {\r\n if (node.alt) {\r\n line.push(node.alt)\r\n }\r\n }\r\n if (isSelected && !selOffset) {\r\n line.push('\\x01')\r\n }\r\n var curChild = node.firstChild\r\n while (curChild) {\r\n getRichElementValue(curChild, lines, line, selNode, selOffset)\r\n curChild = curChild.nextSibling\r\n }\r\n if (isSelected && selOffset) {\r\n line.push('\\x01')\r\n }\r\n if (isBlock && line.length) {\r\n lines.push(line.join(''))\r\n line.splice(0, line.length)\r\n }\r\n}\r\n\r\nexport function setRichFocus (field, selectNode, noCollapse) {\r\n field.focus()\r\n if (selectNode &&\r\n selectNode.parentNode == field &&\r\n !selectNode.nextSibling &&\r\n !noCollapse) {\r\n field.removeChild(selectNode)\r\n selectNode = null\r\n }\r\n if (window.getSelection && document.createRange) {\r\n var range = document.createRange()\r\n if (selectNode) {\r\n range.selectNode(selectNode)\r\n } else {\r\n range.selectNodeContents(field)\r\n }\r\n if (!noCollapse) {\r\n range.collapse(false)\r\n }\r\n\r\n var sel = window.getSelection()\r\n sel.removeAllRanges()\r\n sel.addRange(range)\r\n }\r\n else if (document.body.createTextRange !== undefined) {\r\n var textRange = document.body.createTextRange()\r\n textRange.moveToElementText(selectNode || field)\r\n if (!noCollapse) {\r\n textRange.collapse(false)\r\n }\r\n textRange.select()\r\n }\r\n}\r\n\r\nexport function getSelectedText() {\r\n var sel = (\r\n window.getSelection && window.getSelection() ||\r\n document.getSelection && document.getSelection() ||\r\n document.selection && document.selection.createRange().text || ''\r\n ).toString().replace(/^\\s+|\\s+$/g, '')\r\n\r\n return sel\r\n}\r\n\r\n/* if (Config.Modes.animations &&\r\n typeof window.requestAnimationFrame == 'function') {\r\n window.onAnimationFrameCallback = function (cb) {\r\n return (function () {\r\n window.requestAnimationFrame(cb)\r\n })\r\n }\r\n} else {\r\n window.onAnimationFrameCallback = function (cb) {\r\n return cb\r\n }\r\n} */\r\n\r\nexport const $rootScope = {\r\n $broadcast: (name/* : string */, detail/*? : any */) => {\r\n ////console.log(dT(), 'Broadcasting ' + name + ' event, with args:', detail);\r\n //console.trace();\r\n let myCustomEvent = new CustomEvent(name, {detail});\r\n document.dispatchEvent(myCustomEvent);\r\n },\r\n $on: (name/* : string */, callback/* : any */) => {\r\n document.addEventListener(name, callback);\r\n },\r\n\r\n selectedPeerID: 0,\r\n idle: {\r\n isIDLE: false\r\n }\r\n};\r\n\r\nexport const langPack = {\r\n \"messageActionChatCreate\": \"created the group\",\r\n\t\"messageActionChatEditTitle\": \"changed group name\",\r\n\t\"messageActionChatEditPhoto\": \"changed group photo\",\r\n\t\"messageActionChatDeletePhoto\": \"removed group photo\",\r\n\t\"messageActionChatReturn\": \"returned to group\",\r\n\t\"messageActionChatJoined\": \"joined the group\",\r\n \"messageActionChatAddUser\": \"invited {user}\",\r\n \"messageActionChatAddUsers\": \"invited {} users\",\r\n\t\"messageActionChatLeave\": \"left group\",\r\n\t\"messageActionChatDeleteUser\": \"removed user\",\r\n\t\"messageActionChatJoinedByLink\": \"joined the group\",\r\n\t\"messageActionPinMessage\": \"pinned message\",\r\n\t\"messageActionChannelCreate\": \"Channel created\",\r\n\t\"messageActionChannelEditTitle\": \"Channel renamed\",\r\n\t\"messageActionChannelEditPhoto\": \"Channel photo updated\",\r\n \"messageActionChannelDeletePhoto\": \"Channel photo removed\",\r\n \"messageActionHistoryClear\": \"History cleared\",\r\n\r\n \"messageActionPhoneCall.in_ok\": \"Incoming Call\",\r\n\t\"messageActionPhoneCall.out_ok\": \"Outgoing Call\",\r\n\t\"messageActionPhoneCall.in_missed\": \"Missed Call\",\r\n\t\"messageActionPhoneCall.out_missed\": \"Cancelled Call\",\r\n};\r\n\r\nexport const _ = (str/* : string */) => {\r\n str = str.replace('_raw', '');\r\n\r\n return langPack[str] ? langPack[str] : str;\r\n};\r\n\r\nexport function isObject(object) {\r\n return typeof(object) === 'object' && object !== null;\r\n}\r\n\r\nexport function tsNow (seconds) {\r\n var t = +new Date() + (window.tsOffset || 0)\r\n return seconds ? Math.floor(t / 1000) : t\r\n}\r\n\r\nexport function safeReplaceObject (wasObject, newObject) {\r\n for (var key in wasObject) {\r\n if (!newObject.hasOwnProperty(key) && key.charAt(0) != '$') {\r\n delete wasObject[key]\r\n }\r\n }\r\n for (var key in newObject) {\r\n if (newObject.hasOwnProperty(key)) {\r\n wasObject[key] = newObject[key]\r\n }\r\n }\r\n}\r\n\r\nexport function numberWithCommas(x) {\r\n var parts = x.toString().split(\".\");\r\n parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n return parts.join(\".\");\r\n}\r\n\r\nexport function findUpClassName(el, className) {\r\n if(el.classList.contains(className)) return el; // 03.02.2020\r\n\r\n while(el.parentNode) {\r\n el = el.parentNode;\r\n if(el.classList.contains(className)) \r\n return el;\r\n }\r\n return null;\r\n}\r\n\r\nexport function findUpTag(el, tag) {\r\n if(el.tagName == tag) return el; // 03.02.2020\r\n\r\n while(el.parentNode) {\r\n el = el.parentNode;\r\n if(el.tagName === tag) \r\n return el;\r\n }\r\n return null;\r\n}\r\n\r\nexport function isElementInViewport(el) {\r\n var rect = el.getBoundingClientRect(),\r\n vWidth = window.innerWidth || document.documentElement.clientWidth,\r\n vHeight = window.innerHeight || document.documentElement.clientHeight,\r\n efp = function(x, y) { return document.elementFromPoint(x, y) }; \r\n\r\n // Return false if it's not in the viewport\r\n if(rect.right < 0 || rect.bottom < 0 \r\n || rect.left > vWidth || rect.top > vHeight \r\n || !rect.width || !rect.height) {\r\n return false;\r\n }\r\n\r\n let elements = [\r\n efp(rect.left + 1, rect.top + 1),\r\n efp(rect.right - 1, rect.top + 1),\r\n efp(rect.right - 1, rect.bottom - 1),\r\n efp(rect.left + 1, rect.bottom - 1)\r\n ];\r\n\r\n // Return true if any of its four corners are visible\r\n return elements.find(e => el.contains(e) || el.parentElement == e) !== undefined;\r\n}\r\n\r\nexport function isScrolledIntoView(el) {\r\n var rect = el.getBoundingClientRect();\r\n var elemTop = rect.top;\r\n var elemBottom = rect.bottom;\r\n\r\n // Only completely visible elements return true:\r\n //var isVisible = (elemTop >= 0) && (elemBottom <= window.innerHeight);\r\n // Partially visible elements return true:\r\n var isVisible = elemTop < window.innerHeight && elemBottom >= 0;\r\n return isVisible;\r\n}\r\n\r\n/* export function isScrolledIntoView(el) {\r\n var rect = el.getBoundingClientRect(), top = rect.top, height = rect.height, \r\n el = el.parentNode\r\n // Check if bottom of the element is off the page\r\n if (rect.bottom < 0) return false\r\n // Check its within the document viewport\r\n if (top > document.documentElement.clientHeight) return false\r\n do {\r\n rect = el.getBoundingClientRect()\r\n if (top <= rect.bottom === false) return false\r\n // Check if the element is out of view due to a container scrolling\r\n if ((top + height) <= rect.top) return false\r\n el = el.parentNode\r\n } while (el != document.body)\r\n return true\r\n}; */\r\n\r\nexport function whichChild(elem/* : Node */) {\r\n let i = 0;\r\n // @ts-ignore\r\n while((elem = elem.previousElementSibling) != null) ++i;\r\n return i;\r\n};\r\n\r\nexport function copy(obj) {\r\n //in case of premitives\r\n if(obj===null || typeof obj !== \"object\"){\r\n return obj;\r\n }\r\n \r\n //date objects should be \r\n if(obj instanceof Date){\r\n return new Date(obj.getTime());\r\n }\r\n \r\n //handle Array\r\n if(Array.isArray(obj)){\r\n var clonedArr = [];\r\n obj.forEach(function(element){\r\n clonedArr.push(copy(element))\r\n });\r\n return clonedArr;\r\n }\r\n \r\n //lastly, handle objects\r\n let clonedObj = new obj.constructor();\r\n for(var prop in obj){\r\n if(obj.hasOwnProperty(prop)){\r\n clonedObj[prop] = copy(obj[prop]);\r\n }\r\n }\r\n return clonedObj;\r\n}\r\n\r\n/* export function ripple(elem) {\r\n elem.addEventListener('mousedown', function(e) {\r\n let rect = this.getBoundingClientRect();\r\n\r\n const startTime = Date.now();\r\n const animationTime = 350;\r\n\r\n let X = e.clientX - rect.left;\r\n let Y = e.clientY - rect.top;\r\n let rippleDiv = document.createElement(\"div\");\r\n rippleDiv.classList.add(\"ripple\");\r\n rippleDiv.setAttribute(\"style\", \"top:\" + Y + \"px; left:\" + X + \"px;\");\r\n this.appendChild(rippleDiv);\r\n\r\n elem.addEventListener('mouseup', () => {\r\n let elapsed = Date.now() - startTime;\r\n\r\n setTimeout(() => {\r\n rippleDiv.parentElement.removeChild(rippleDiv);\r\n }, elapsed < animationTime ? animationTime - elapsed : 0);\r\n }, {once: true});\r\n });\r\n}; */\r\n\r\nexport function formatBytes(bytes, decimals = 2) {\r\n if (bytes === 0) return '0 Bytes';\r\n\r\n const k = 1024;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];\r\n}\r\n\r\nexport function formatNumber(bytes, decimals = 2) {\r\n if(bytes === 0) return '0';\r\n\r\n const k = 1000;\r\n const dm = decimals < 0 ? 0 : decimals;\r\n const sizes = ['', 'K', 'M', 'B', 'T'];\r\n\r\n const i = Math.floor(Math.log(bytes) / Math.log(k));\r\n\r\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + sizes[i];\r\n}\r\n\r\nexport function deepEqual(x, y) {\r\n const ok = Object.keys, tx = typeof x, ty = typeof y;\r\n return x && y && tx === 'object' && tx === ty ? (\r\n ok(x).length === ok(y).length &&\r\n ok(x).every(key => deepEqual(x[key], y[key]))\r\n ) : (x === y);\r\n}\r\n\r\nexport function listMergeSorted (list1, list2) {\r\n list1 = list1 || []\r\n list2 = list2 || []\r\n\r\n var result = copy(list1);\r\n\r\n var minID = list1.length ? list1[list1.length - 1] : 0xFFFFFFFF\r\n for (var i = 0; i < list2.length; i++) {\r\n if (list2[i] < minID) {\r\n result.push(list2[i])\r\n }\r\n }\r\n\r\n return result\r\n}\r\n\r\nexport function listUniqSorted (list) {\r\n list = list || []\r\n var resultList = []\r\n var prev = false\r\n for (var i = 0; i < list.length; i++) {\r\n if (list[i] !== prev) {\r\n resultList.push(list[i])\r\n }\r\n prev = list[i]\r\n }\r\n\r\n return resultList\r\n}\r\n\r\nexport function encodeEntities (value) {\r\n return value.replace(/&/g, '&').replace(/[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g, function (value) {\r\n var hi = value.charCodeAt(0)\r\n var low = value.charCodeAt(1)\r\n return '&#' + (((hi - 0xD800) * 0x400) + (low - 0xDC00) + 0x10000) + ';'\r\n }).replace(/([^\\#-~| |!])/g, function (value) { // non-alphanumeric\r\n return '&#' + value.charCodeAt(0) + ';'\r\n }).replace(//g, '>')\r\n}\r\n\r\nexport function calcImageInBox (imageW, imageH, boxW, boxH, noZooom) {\r\n if(imageW < boxW && imageH < boxH) {\r\n return {w: imageW, h: imageH};\r\n }\r\n\r\n var boxedImageW = boxW\r\n var boxedImageH = boxH\r\n\r\n if((imageW / imageH) > (boxW / boxH)) {\r\n boxedImageH = parseInt(imageH * boxW / imageW)\r\n } else {\r\n boxedImageW = parseInt(imageW * boxH / imageH)\r\n if(boxedImageW > boxW) {\r\n boxedImageH = parseInt(boxedImageH * boxW / boxedImageW)\r\n boxedImageW = boxW\r\n }\r\n }\r\n\r\n // if (Config.Navigator.retina) {\r\n // imageW = Math.floor(imageW / 2)\r\n // imageH = Math.floor(imageH / 2)\r\n // }\r\n\r\n if(noZooom && boxedImageW >= imageW && boxedImageH >= imageH) {\r\n boxedImageW = imageW\r\n boxedImageH = imageH\r\n }\r\n\r\n return {w: boxedImageW, h: boxedImageH}\r\n}\r\n\r\n/**\r\n * emojiUnicode\r\n * Get the unicode code of an emoji in base 16.\r\n *\r\n * @name emojiUnicode\r\n * @function\r\n * @param {String} input The emoji character.\r\n * @returns {String} The base 16 unicode code.\r\n */\r\n/* export function emojiUnicode (input) {\r\n let pairs = emojiUnicode.raw(input).split(' ').map(val => parseInt(val).toString(16));\r\n if(pairs[0].length == 2) pairs[0] = '00' + pairs[0];\r\n return pairs.join('-').toUpperCase();\r\n} */\r\n\r\n/**\r\n* emojiunicode.raw\r\n* Get the unicode code points of an emoji in base 16.\r\n*\r\n* @name emojiunicode.raw\r\n* @function\r\n* @param {String} input The emoji character.\r\n* @returns {String} The unicode code points.\r\n*/\r\n/* emojiUnicode.raw = function (input) {\r\n if(input.length === 1) {\r\n return input.charCodeAt(0).toString();\r\n } else if(input.length > 1) {\r\n const pairs = [];\r\n for(var i = 0; i < input.length; i++) {\r\n // high surrogate\r\n if(input.charCodeAt(i) >= 0xd800 && input.charCodeAt(i) <= 0xdbff) {\r\n if(input.charCodeAt(i + 1) >= 0xdc00 && input.charCodeAt(i + 1) <= 0xdfff) {\r\n // low surrogate\r\n pairs.push(\r\n (input.charCodeAt(i) - 0xd800) * 0x400\r\n + (input.charCodeAt(i + 1) - 0xdc00) + 0x10000\r\n );\r\n }\r\n } else if (input.charCodeAt(i) < 0xd800 || input.charCodeAt(i) > 0xdfff) {\r\n // modifiers and joiners\r\n pairs.push(input.charCodeAt(i))\r\n }\r\n }\r\n\r\n return pairs.join(' ');\r\n }\r\n\r\n return '';\r\n}; */\r\n\r\n// country code regex\r\nconst CC_REGEX = /^[a-z]{2}$/i;\r\n\r\n// offset between uppercase ascii and regional indicator symbols\r\nconst OFFSET = 127397;\r\n\r\n/**\r\n * convert country code to corresponding emoji flag\r\n * @param {string} cc - country code string\r\n * @returns {string} country code emoji\r\n */\r\nexport function countryCodeEmoji(cc/* : string */) {\r\n if(!CC_REGEX.test(cc)) {\r\n const type = typeof cc;\r\n throw new TypeError(\r\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\r\n type === 'string' ? cc : type\r\n }' instead.`,\r\n );\r\n }\r\n\r\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt(0) + OFFSET);\r\n //console.log(chars);\r\n return String.fromCodePoint(...chars);\r\n}\r\n\r\nexport function unifiedCountryCodeEmoji(cc/* : string */) {\r\n if(!CC_REGEX.test(cc)) {\r\n const type = typeof cc;\r\n throw new TypeError(\r\n `cc argument must be an ISO 3166-1 alpha-2 string, but got '${\r\n type === 'string' ? cc : type\r\n }' instead.`,\r\n );\r\n }\r\n\r\n const chars = [...cc.toUpperCase()].map(c => c.charCodeAt(0) + OFFSET);\r\n return chars.map(c => c.toString(16).toUpperCase()).join('-');\r\n}\r\n\r\nfunction versionCompare (ver1, ver2) {\r\n if (typeof ver1 !== 'string') {\r\n ver1 = ''\r\n }\r\n if (typeof ver2 !== 'string') {\r\n ver2 = ''\r\n }\r\n ver1 = ver1.replace(/^\\s+|\\s+$/g, '').split('.')\r\n ver2 = ver2.replace(/^\\s+|\\s+$/g, '').split('.')\r\n\r\n var a = Math.max(ver1.length, ver2.length), i\r\n\r\n for (i = 0; i < a; i++) {\r\n if (ver1[i] == ver2[i]) {\r\n continue\r\n }\r\n if (ver1[i] > ver2[i]) {\r\n return 1\r\n } else {\r\n return -1\r\n }\r\n }\r\n\r\n return 0\r\n}\r\n\r\n\r\n var badCharsRe = /[`~!@#$%^&*()\\-_=+\\[\\]\\\\|{}'\";:\\/?.>,<\\s]+/g,\r\n trimRe = /^\\s+|\\s$/g\r\n\r\n function createIndex () {\r\n return {\r\n shortIndexes: {},\r\n fullTexts: {}\r\n }\r\n }\r\n\r\n function cleanSearchText (text) {\r\n var hasTag = text.charAt(0) == '%'\r\n text = text.replace(badCharsRe, ' ').replace(trimRe, '')\r\n text = text.replace(/[^A-Za-z0-9]/g, function (ch) {\r\n var latinizeCh = Config.LatinizeMap[ch]\r\n return latinizeCh !== undefined ? latinizeCh : ch\r\n })\r\n text = text.toLowerCase()\r\n if (hasTag) {\r\n text = '%' + text\r\n }\r\n\r\n return text\r\n }\r\n\r\n function cleanUsername (username) {\r\n return username && username.toLowerCase() || ''\r\n }\r\n\r\n function indexObject (id, searchText, searchIndex) {\r\n if (searchIndex.fullTexts[id] !== undefined) {\r\n return false\r\n }\r\n\r\n searchText = cleanSearchText(searchText)\r\n\r\n if (!searchText.length) {\r\n return false\r\n }\r\n\r\n var shortIndexes = searchIndex.shortIndexes\r\n\r\n searchIndex.fullTexts[id] = searchText\r\n\r\n searchText.split(' ').forEach(function(searchWord) {\r\n var len = Math.min(searchWord.length, 3),\r\n wordPart, i\r\n for (i = 1; i <= len; i++) {\r\n wordPart = searchWord.substr(0, i)\r\n if (shortIndexes[wordPart] === undefined) {\r\n shortIndexes[wordPart] = [id]\r\n } else {\r\n shortIndexes[wordPart].push(id)\r\n }\r\n }\r\n })\r\n }\r\n\r\n function search (query, searchIndex) {\r\n var shortIndexes = searchIndex.shortIndexes\r\n var fullTexts = searchIndex.fullTexts\r\n\r\n query = cleanSearchText(query)\r\n\r\n var queryWords = query.split(' ')\r\n var foundObjs = false,\r\n newFoundObjs, i\r\n var j, searchText\r\n var found\r\n\r\n for (i = 0; i < queryWords.length; i++) {\r\n newFoundObjs = shortIndexes[queryWords[i].substr(0, 3)]\r\n if (!newFoundObjs) {\r\n foundObjs = []\r\n break\r\n }\r\n if (foundObjs === false || foundObjs.length > newFoundObjs.length) {\r\n foundObjs = newFoundObjs\r\n }\r\n }\r\n\r\n newFoundObjs = {}\r\n\r\n for (j = 0; j < foundObjs.length; j++) {\r\n found = true\r\n searchText = fullTexts[foundObjs[j]]\r\n for (i = 0; i < queryWords.length; i++) {\r\n if (searchText.indexOf(queryWords[i]) == -1) {\r\n found = false\r\n break\r\n }\r\n }\r\n if (found) {\r\n newFoundObjs[foundObjs[j]] = true\r\n }\r\n }\r\n\r\n return newFoundObjs\r\n }\r\n\r\n let SearchIndexManager = {\r\n createIndex: createIndex,\r\n indexObject: indexObject,\r\n cleanSearchText: cleanSearchText,\r\n cleanUsername: cleanUsername,\r\n search: search\r\n };\r\n window.SearchIndexManager = SearchIndexManager;\r\n\r\n export {SearchIndexManager};\r\n//})(window)\r\n" }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "index": 23, "index2": 47, "size": 15303, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "issuerId": 40, "issuerName": "./src/components/pageSignIn.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 392, "building": 505, "dependencies": 2 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 4, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "module": "./src/lib/appManagers/appUsersManager.ts", "moduleName": "./src/lib/appManagers/appUsersManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "9:37-69" }, { "moduleId": 5, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/misc.ts", "module": "./src/components/misc.ts", "moduleName": "./src/components/misc.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "6:37-73" }, { "moduleId": 9, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "module": "./src/lib/mtproto/apiFileManager.ts", "moduleName": "./src/lib/mtproto/apiFileManager.ts", "type": "cjs require", "userRequest": "./apiManager", "loc": "18:37-60" }, { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "20:37-69" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "32:37-69" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./apiManager", "loc": "23:37-60" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "22:37-69" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "6:37-69" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "15:37-69" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "15:37-69" }, { "moduleId": 38, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appStickersManager.ts", "module": "./src/lib/appManagers/appStickersManager.ts", "moduleName": "./src/lib/appManagers/appStickersManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiManager", "loc": "16:37-69" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "19:37-73" }, { "moduleId": 41, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "module": "./src/lib/mtproto/passwordManager.ts", "moduleName": "./src/lib/mtproto/passwordManager.ts", "type": "cjs require", "userRequest": "./apiManager", "loc": "15:37-60" }, { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "21:37-73" }, { "moduleId": 78, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "module": "./src/components/pageSignUp.ts", "moduleName": "./src/components/pageSignUp.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "11:37-73" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "21:37-73" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiManager", "loc": "20:37-73" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst bin_utils_1 = require(\"../bin_utils\");\nconst networkerFactory_1 = __importDefault(require(\"./networkerFactory\"));\nconst mtproto_1 = require(\"./mtproto\");\nconst authorizer_1 = __importDefault(require(\"./authorizer\"));\nconst utils_1 = require(\"../utils\");\nconst Config = __importStar(require(\"../config\"));\nconst dcConfigurator_1 = __importDefault(require(\"./dcConfigurator\"));\nconst http_1 = __importDefault(require(\"./transports/http\"));\nconst polyfill_1 = require(\"../polyfill\");\nclass ApiManager {\n constructor() {\n //MtpSingleInstanceService.start();\n this.cachedNetworkers = {};\n this.cachedUploadNetworkers = {};\n this.cachedExportPromise = {};\n this.gettingNetworkers = {};\n this.baseDcID = 0;\n this.telegramMeNotified = false;\n this.log = polyfill_1.logger('API');\n /* AppStorage.get('dc').then((dcID) => {\n if(dcID) {\n this.baseDcID = dcID;\n }\n }); */\n }\n telegramMeNotify(newValue) {\n if (this.telegramMeNotified !== newValue) {\n this.telegramMeNotified = newValue;\n mtproto_1.telegramMeWebService.setAuthorized(this.telegramMeNotified);\n }\n }\n // mtpSetUserAuth\n setUserAuth(userAuth) {\n var fullUserAuth = Object.assign({ dcID: this.baseDcID }, userAuth);\n storage_1.default.set({\n dc: this.baseDcID,\n user_auth: fullUserAuth\n });\n this.telegramMeNotify(true);\n utils_1.$rootScope.$broadcast('user_auth', fullUserAuth);\n }\n // mtpLogOut\n logOut() {\n return __awaiter(this, void 0, void 0, function* () {\n let storageKeys = [];\n let prefix = Config.Modes.test ? 't_dc' : 'dc';\n for (let dcID = 1; dcID <= 5; dcID++) {\n storageKeys.push(prefix + dcID + '_auth_key');\n //storageKeys.push('dc' + dcID + '_auth_keyID');\n //storageKeys.push('t_dc' + dcID + '_auth_key');\n //storageKeys.push('t_dc' + dcID + '_auth_keyID');\n }\n // WebPushApiManager.forceUnsubscribe(); // WARNING\n let storageResult = yield storage_1.default.get(storageKeys);\n let logoutPromises = [];\n for (let i = 0; i < storageResult.length; i++) {\n if (storageResult[i]) {\n logoutPromises.push(this.invokeApi('auth.logOut', {}, { dcID: i + 1, ignoreErrors: true }));\n }\n }\n return Promise.all(logoutPromises).then(() => {\n storage_1.default.remove('dc', 'user_auth', 'stickerSets');\n this.baseDcID = 0;\n this.telegramMeNotify(false);\n return this.mtpClearStorage();\n }, (error) => {\n storageKeys.push('dc', 'user_auth', 'stickerSets');\n storage_1.default.remove(storageKeys);\n this.baseDcID = 0;\n error.handled = true;\n this.telegramMeNotify(false);\n return this.mtpClearStorage();\n });\n });\n }\n mtpClearStorage() {\n var saveKeys = ['user_auth', 't_user_auth', 'dc', 't_dc'];\n for (var dcID = 1; dcID <= 5; dcID++) {\n saveKeys.push('dc' + dcID + '_auth_key');\n saveKeys.push('dc' + dcID + '_auth_keyID');\n saveKeys.push('dc' + dcID + '_server_salt'); // new\n saveKeys.push('t_dc' + dcID + '_auth_key');\n saveKeys.push('t_dc' + dcID + '_auth_keyID');\n saveKeys.push('t_dc' + dcID + '_server_salt'); // new\n }\n storage_1.default.noPrefix();\n storage_1.default.get(saveKeys).then((values) => {\n storage_1.default.clear().then(() => {\n var restoreObj = {};\n saveKeys.forEach((key, i) => {\n var value = values[i];\n if (value !== false && value !== undefined) {\n restoreObj[key] = value;\n }\n });\n storage_1.default.noPrefix();\n return storage_1.default.set(restoreObj);\n });\n });\n }\n // mtpGetNetworker\n getNetworker(dcID, options = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n let upload = (options.fileUpload || options.fileDownload)\n && (dcConfigurator_1.default.chooseServer(dcID, true) instanceof http_1.default || Config.Modes.multipleConnections);\n let cache = upload ? this.cachedUploadNetworkers : this.cachedNetworkers;\n if (!dcID) {\n throw new Error('get Networker without dcID');\n }\n if (cache[dcID] !== undefined) {\n return cache[dcID];\n }\n let getKey = dcID + '-' + +upload;\n if (this.gettingNetworkers[getKey]) {\n return this.gettingNetworkers[getKey];\n }\n return this.gettingNetworkers[getKey] = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n var ak = 'dc' + dcID + '_auth_key';\n var akID = 'dc' + dcID + '_auth_keyID';\n var ss = 'dc' + dcID + '_server_salt';\n let result = yield storage_1.default.get([ak, akID, ss]);\n let [authKeyHex, authKeyIDHex, serverSaltHex] = result;\n if (authKeyHex && !authKeyIDHex && serverSaltHex) {\n this.log.warn('Updating to new version (+akID)');\n yield storage_1.default.remove(ak, akID, ss);\n authKeyHex = serverSaltHex = '';\n }\n if (authKeyHex && authKeyHex.length == 512) {\n if (!serverSaltHex || serverSaltHex.length != 16) {\n serverSaltHex = 'AAAAAAAAAAAAAAAA';\n }\n var authKey = bin_utils_1.bytesFromHex(authKeyHex);\n var authKeyID = new Uint8Array(bin_utils_1.bytesFromHex(authKeyIDHex));\n var serverSalt = bin_utils_1.bytesFromHex(serverSaltHex);\n resolve(cache[dcID] = networkerFactory_1.default.getNetworker(dcID, authKey, authKeyID, serverSalt, options));\n }\n else\n try {\n let auth = yield authorizer_1.default.auth(dcID);\n let storeObj = {\n [ak]: bin_utils_1.bytesToHex(auth.authKey),\n [akID]: auth.authKeyID.hex,\n [ss]: bin_utils_1.bytesToHex(auth.serverSalt)\n };\n storage_1.default.set(storeObj);\n resolve(cache[dcID] = networkerFactory_1.default.getNetworker(dcID, auth.authKey, auth.authKeyID, auth.serverSalt, options));\n }\n catch (error) {\n this.log('Get networker error', error, error.stack);\n reject(error);\n }\n delete this.gettingNetworkers[getKey];\n }));\n });\n }\n // mtpInvokeApi\n invokeApi(method, params = {}, options = {}) {\n ///////this.log('Invoke api', method, params, options);\n return new Promise((resolve, reject) => {\n let rejectPromise = (error) => {\n if (!error) {\n error = { type: 'ERROR_EMPTY' };\n }\n else if (!utils_1.isObject(error)) {\n error = { message: error };\n }\n reject(error);\n if (options.ignoreErrors) {\n return;\n }\n if (error.code == 406) {\n error.handled = true;\n }\n if (!options.noErrorBox) {\n error.input = method;\n error.stack = stack || (error.originalError && error.originalError.stack) || error.stack || (new Error()).stack;\n setTimeout(() => {\n if (!error.handled) {\n if (error.code == 401) {\n // @ts-ignore WARNING!\n this.logOut().finally(() => {\n if (location.protocol == 'http:' &&\n !Config.Modes.http &&\n Config.App.domains.indexOf(location.hostname) != -1) {\n location.href = location.href.replace(/^http:/, 'https:');\n }\n else {\n location.hash = '/login';\n // AppRuntimeManager.reload(); // WARNING\n }\n });\n }\n else {\n // ErrorService.show({error: error}); // WARNING\n }\n error.handled = true;\n }\n }, 100);\n }\n };\n var dcID;\n var cachedNetworker;\n var stack = (new Error()).stack || 'empty stack';\n var performRequest = (networker) => {\n return (cachedNetworker = networker)\n .wrapApiCall(method, params, options)\n .then(resolve, (error) => {\n this.log.error('Error', error.code, error.type, this.baseDcID, dcID);\n if (error.code == 401 && this.baseDcID == dcID) {\n storage_1.default.remove('dc', 'user_auth');\n this.telegramMeNotify(false);\n rejectPromise(error);\n }\n else if (error.code == 401 && this.baseDcID && dcID != this.baseDcID) {\n if (this.cachedExportPromise[dcID] === undefined) {\n let promise = new Promise((exportResolve, exportReject) => {\n this.invokeApi('auth.exportAuthorization', { dc_id: dcID }, { noErrorBox: true }).then((exportedAuth) => {\n this.invokeApi('auth.importAuthorization', {\n id: exportedAuth.id,\n bytes: exportedAuth.bytes\n }, { dcID: dcID, noErrorBox: true }).then(exportResolve, exportReject);\n }, exportReject);\n });\n this.cachedExportPromise[dcID] = promise;\n }\n this.cachedExportPromise[dcID].then(() => {\n (cachedNetworker = networker).wrapApiCall(method, params, options).then(resolve, rejectPromise);\n }, rejectPromise);\n }\n else if (error.code == 303) {\n var newDcID = error.type.match(/^(PHONE_MIGRATE_|NETWORK_MIGRATE_|USER_MIGRATE_)(\\d+)/)[2];\n if (newDcID != dcID) {\n if (options.dcID) {\n options.dcID = newDcID;\n }\n else {\n storage_1.default.set({ dc: this.baseDcID = newDcID });\n }\n this.getNetworker(newDcID, options).then((networker) => {\n networker.wrapApiCall(method, params, options).then(resolve, rejectPromise);\n }, rejectPromise);\n }\n }\n else if (!options.rawError && error.code == 420) {\n var waitTime = error.type.match(/^FLOOD_WAIT_(\\d+)/)[1] || 10;\n if (waitTime > (options.timeout || 60)) {\n return rejectPromise(error);\n }\n setTimeout(() => {\n performRequest(cachedNetworker);\n }, (waitTime + 5) * 1000); // 03.02.2020\n }\n else if (!options.rawError && (error.code == 500 || error.type == 'MSG_WAIT_FAILED')) {\n var now = utils_1.tsNow();\n if (options.stopTime) {\n if (now >= options.stopTime) {\n return rejectPromise(error);\n }\n }\n else {\n options.stopTime = now + (options.timeout !== undefined ? options.timeout : 10) * 1000;\n }\n options.waitTime = options.waitTime ? Math.min(60, options.waitTime * 1.5) : 1;\n setTimeout(() => {\n performRequest(cachedNetworker);\n }, options.waitTime * 1000);\n }\n else {\n rejectPromise(error);\n }\n });\n };\n if (dcID = (options.dcID || this.baseDcID)) {\n this.getNetworker(dcID, options).then(performRequest, rejectPromise);\n }\n else {\n storage_1.default.get('dc').then((baseDcID) => {\n this.getNetworker(this.baseDcID = dcID = baseDcID || Config.App.baseDcID, options).then(performRequest, rejectPromise);\n });\n }\n });\n }\n // mtpGetUserID\n getUserID() {\n return storage_1.default.get('user_auth').then((auth) => {\n this.telegramMeNotify(auth && auth.id > 0 || false);\n return auth.id || 0;\n });\n }\n}\nexports.ApiManager = ApiManager;\nexports.default = new ApiManager();\n" }, { "id": 2, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/bin_utils.ts", "name": "./src/lib/bin_utils.ts", "index": 24, "index2": 22, "size": 10929, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "23:20-43" }, { "moduleId": 7, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/cryptoworker.ts", "module": "./src/lib/crypto/cryptoworker.ts", "moduleName": "./src/lib/crypto/cryptoworker.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "10:20-43" }, { "moduleId": 8, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/polyfill.ts", "module": "./src/lib/polyfill.ts", "moduleName": "./src/lib/polyfill.ts", "type": "cjs require", "userRequest": "./bin_utils", "loc": "3:20-42" }, { "moduleId": 9, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "module": "./src/lib/mtproto/apiFileManager.ts", "moduleName": "./src/lib/mtproto/apiFileManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "15:20-43" }, { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "18:20-43" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "20:20-43" }, { "moduleId": 24, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/filemanager.ts", "module": "./src/lib/filemanager.ts", "moduleName": "./src/lib/filemanager.ts", "type": "cjs require", "userRequest": "./bin_utils", "loc": "15:20-42" }, { "moduleId": 34, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/http.ts", "module": "./src/lib/mtproto/transports/http.ts", "moduleName": "./src/lib/mtproto/transports/http.ts", "type": "cjs require", "userRequest": "../../bin_utils", "loc": "7:20-46" }, { "moduleId": 35, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/tl_utils.ts", "module": "./src/lib/tl_utils.ts", "moduleName": "./src/lib/tl_utils.ts", "type": "cjs require", "userRequest": "./bin_utils", "loc": "16:20-42" }, { "moduleId": 36, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/timeManager.ts", "module": "./src/lib/mtproto/timeManager.ts", "moduleName": "./src/lib/mtproto/timeManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "8:20-43" }, { "moduleId": 41, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "module": "./src/lib/mtproto/passwordManager.ts", "moduleName": "./src/lib/mtproto/passwordManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "16:20-43" }, { "moduleId": 43, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/rsaKeysManager.ts", "module": "./src/lib/mtproto/rsaKeysManager.ts", "moduleName": "./src/lib/mtproto/rsaKeysManager.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "16:20-43" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "17:20-43" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../bin_utils", "loc": "23:20-43" }, { "moduleId": 73, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/abridged.ts", "module": "./src/lib/mtproto/transports/abridged.ts", "moduleName": "./src/lib/mtproto/transports/abridged.ts", "type": "cjs require", "userRequest": "../../bin_utils", "loc": "3:20-46" }, { "moduleId": 74, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/idb.ts", "module": "./src/lib/idb.ts", "moduleName": "./src/lib/idb.ts", "type": "cjs require", "userRequest": "./bin_utils", "loc": "6:20-42" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\n/*!\n * Webogram v0.7.0 - messaging web application for MTProto\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// @ts-ignore\nconst jsbn_1 = require(\"jsbn\");\n// @ts-ignore\nconst pako_inflate_min_js_1 = __importDefault(require(\"pako/dist/pako_inflate.min.js\"));\n//import { dT } from './utils.js';\n/* import './closure_long.js';\n//var goog = window ? window.goog as any : this.goog;\nvar goog = typeof(window) !== 'undefined' ? window.goog : this.goog; */\nvar _logTimer = (new Date()).getTime();\nfunction dT() {\n return '[' + (((new Date()).getTime() - _logTimer) / 1000).toFixed(3) + ']';\n}\nexports.dT = dT;\nfunction bigint(num) {\n return new jsbn_1.BigInteger(num.toString(16), 16);\n}\nexports.bigint = bigint;\nfunction bigStringInt(strNum) {\n return new jsbn_1.BigInteger(strNum, 10);\n}\nexports.bigStringInt = bigStringInt;\nfunction bytesToHex(bytes) {\n bytes = bytes || [];\n var arr = [];\n for (var i = 0; i < bytes.length; i++) {\n arr.push((bytes[i] < 16 ? '0' : '') + (bytes[i] || 0).toString(16));\n }\n return arr.join('');\n}\nexports.bytesToHex = bytesToHex;\nfunction bytesFromHex(hexString) {\n var len = hexString.length, i;\n var start = 0;\n var bytes = [];\n if (hexString.length % 2) {\n bytes.push(parseInt(hexString.charAt(0), 16));\n start++;\n }\n for (i = start; i < len; i += 2) {\n bytes.push(parseInt(hexString.substr(i, 2), 16));\n }\n return bytes;\n}\nexports.bytesFromHex = bytesFromHex;\nfunction bytesToBase64(bytes) {\n var mod3;\n var result = '';\n for (var nLen = bytes.length, nUint24 = 0, nIdx = 0; nIdx < nLen; nIdx++) {\n mod3 = nIdx % 3;\n nUint24 |= bytes[nIdx] << (16 >>> mod3 & 24);\n if (mod3 === 2 || nLen - nIdx === 1) {\n result += String.fromCharCode(uint6ToBase64(nUint24 >>> 18 & 63), uint6ToBase64(nUint24 >>> 12 & 63), uint6ToBase64(nUint24 >>> 6 & 63), uint6ToBase64(nUint24 & 63));\n nUint24 = 0;\n }\n }\n return result.replace(/A(?=A$|$)/g, '=');\n}\nexports.bytesToBase64 = bytesToBase64;\nfunction uint6ToBase64(nUint6) {\n return nUint6 < 26\n ? nUint6 + 65\n : nUint6 < 52\n ? nUint6 + 71\n : nUint6 < 62\n ? nUint6 - 4\n : nUint6 === 62\n ? 43\n : nUint6 === 63\n ? 47\n : 65;\n}\nexports.uint6ToBase64 = uint6ToBase64;\nfunction base64ToBlob(base64str, mimeType) {\n var sliceSize = 1024;\n var byteCharacters = atob(base64str);\n var bytesLength = byteCharacters.length;\n var slicesCount = Math.ceil(bytesLength / sliceSize);\n var byteArrays = new Array(slicesCount);\n for (var sliceIndex = 0; sliceIndex < slicesCount; ++sliceIndex) {\n var begin = sliceIndex * sliceSize;\n var end = Math.min(begin + sliceSize, bytesLength);\n var bytes = new Array(end - begin);\n for (var offset = begin, i = 0; offset < end; ++i, ++offset) {\n bytes[i] = byteCharacters[offset].charCodeAt(0);\n }\n byteArrays[sliceIndex] = new Uint8Array(bytes);\n }\n return blobConstruct(byteArrays, mimeType);\n}\nexports.base64ToBlob = base64ToBlob;\nfunction dataUrlToBlob(url) {\n // var name = 'b64blob ' + url.length\n // console.time(name)\n var urlParts = url.split(',');\n var base64str = urlParts[1];\n var mimeType = urlParts[0].split(':')[1].split(';')[0];\n var blob = base64ToBlob(base64str, mimeType);\n // console.timeEnd(name)\n return blob;\n}\nexports.dataUrlToBlob = dataUrlToBlob;\nfunction blobConstruct(blobParts, mimeType = '') {\n var blob;\n var safeMimeType = blobSafeMimeType(mimeType);\n try {\n blob = new Blob(blobParts, { type: safeMimeType });\n }\n catch (e) {\n // @ts-ignore\n var bb = new BlobBuilder;\n blobParts.forEach(function (blobPart) {\n bb.append(blobPart);\n });\n blob = bb.getBlob(safeMimeType);\n }\n return blob;\n}\nexports.blobConstruct = blobConstruct;\nfunction blobSafeMimeType(mimeType) {\n if ([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/bmp',\n 'video/mp4',\n 'video/webm',\n 'video/quicktime',\n 'audio/ogg',\n 'audio/mpeg',\n 'audio/mp4',\n ].indexOf(mimeType) === -1) {\n return 'application/octet-stream';\n }\n return mimeType;\n}\nexports.blobSafeMimeType = blobSafeMimeType;\nfunction bytesCmp(bytes1, bytes2) {\n var len = bytes1.length;\n if (len != bytes2.length) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n if (bytes1[i] != bytes2[i]) {\n return false;\n }\n }\n return true;\n}\nexports.bytesCmp = bytesCmp;\nfunction bytesXor(bytes1, bytes2) {\n var len = bytes1.length;\n var bytes = [];\n for (var i = 0; i < len; ++i) {\n bytes[i] = bytes1[i] ^ bytes2[i];\n }\n return bytes;\n}\nexports.bytesXor = bytesXor;\nfunction bytesFromBigInt(bigInt, len) {\n var bytes = bigInt.toByteArray();\n if (len && bytes.length < len) {\n var padding = [];\n for (var i = 0, needPadding = len - bytes.length; i < needPadding; i++) {\n padding[i] = 0;\n }\n if (bytes instanceof ArrayBuffer) {\n bytes = bufferConcat(padding, bytes);\n }\n else {\n bytes = padding.concat(bytes);\n }\n }\n else {\n while (!bytes[0] && (!len || bytes.length > len)) {\n bytes = bytes.slice(1);\n }\n }\n return bytes;\n}\nexports.bytesFromBigInt = bytesFromBigInt;\nfunction bytesToArrayBuffer(b) {\n return (new Uint8Array(b)).buffer;\n}\nexports.bytesToArrayBuffer = bytesToArrayBuffer;\nfunction convertToArrayBuffer(bytes) {\n // Be careful with converting subarrays!!\n if (bytes instanceof ArrayBuffer) {\n return bytes;\n }\n if (bytes.buffer !== undefined &&\n bytes.buffer.byteLength == bytes.length * bytes.BYTES_PER_ELEMENT) {\n return bytes.buffer;\n }\n return bytesToArrayBuffer(bytes);\n}\nexports.convertToArrayBuffer = convertToArrayBuffer;\nfunction convertToUint8Array(bytes) {\n if (bytes.buffer !== undefined) {\n return bytes;\n }\n return new Uint8Array(bytes);\n}\nexports.convertToUint8Array = convertToUint8Array;\nfunction convertToByteArray(bytes) {\n if (Array.isArray(bytes)) {\n return bytes;\n }\n bytes = convertToUint8Array(bytes);\n var newBytes = [];\n for (var i = 0, len = bytes.length; i < len; i++) {\n newBytes.push(bytes[i]);\n }\n return newBytes;\n}\nexports.convertToByteArray = convertToByteArray;\nfunction bytesFromArrayBuffer(buffer) {\n var len = buffer.byteLength;\n var byteView = new Uint8Array(buffer);\n var bytes = [];\n for (var i = 0; i < len; ++i) {\n bytes[i] = byteView[i];\n }\n return bytes;\n}\nexports.bytesFromArrayBuffer = bytesFromArrayBuffer;\nfunction bufferConcat(buffer1, buffer2) {\n var l1 = buffer1.byteLength || buffer1.length;\n var l2 = buffer2.byteLength || buffer2.length;\n var tmp = new Uint8Array(l1 + l2);\n tmp.set(buffer1 instanceof ArrayBuffer ? new Uint8Array(buffer1) : buffer1, 0);\n tmp.set(buffer2 instanceof ArrayBuffer ? new Uint8Array(buffer2) : buffer2, l1);\n return tmp.buffer;\n}\nexports.bufferConcat = bufferConcat;\nfunction bufferConcats(...args) {\n let length = 0;\n args.forEach(b => length += b.byteLength || b.length);\n var tmp = new Uint8Array(length);\n let lastLength = 0;\n args.forEach(b => {\n tmp.set(b instanceof ArrayBuffer ? new Uint8Array(b) : b, lastLength);\n lastLength += b.byteLength || b.length;\n });\n return tmp /* .buffer */;\n}\nexports.bufferConcats = bufferConcats;\nfunction longToInts(sLong) {\n var divRem = bigStringInt(sLong).divideAndRemainder(bigint(0x100000000));\n return [divRem[0].intValue(), divRem[1].intValue()];\n}\nexports.longToInts = longToInts;\nfunction bytesFromWords(wordArray) {\n var words = wordArray.words;\n var sigBytes = wordArray.sigBytes;\n var bytes = [];\n for (var i = 0; i < sigBytes; i++) {\n bytes.push((words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff);\n }\n return bytes;\n}\nexports.bytesFromWords = bytesFromWords;\nfunction longToBytes(sLong) {\n return bytesFromWords({ words: longToInts(sLong), sigBytes: 8 }).reverse();\n}\nexports.longToBytes = longToBytes;\nfunction longFromInts(high, low) {\n return bigint(high).shiftLeft(32).add(bigint(low)).toString(10);\n}\nexports.longFromInts = longFromInts;\nfunction intToUint(val) {\n if (typeof (val) === 'string')\n val = parseInt(val);\n if (val < 0) {\n val = val + 4294967296;\n }\n return val;\n}\nexports.intToUint = intToUint;\nfunction uintToInt(val) {\n if (val > 2147483647) {\n val = val - 4294967296;\n }\n return val;\n}\nexports.uintToInt = uintToInt;\nfunction addPadding(bytes, blockSize = 16, zeroes, full = false, prepend = false) {\n let len = bytes.byteLength || bytes.length;\n let needPadding = blockSize - (len % blockSize);\n if (needPadding > 0 && (needPadding < blockSize || full)) {\n ////console.log('addPadding()', len, blockSize, needPadding);\n let padding = new Array(needPadding);\n if (zeroes) {\n for (let i = 0; i < needPadding; i++) {\n padding[i] = 0;\n }\n }\n else {\n (new jsbn_1.SecureRandom()).nextBytes(padding);\n }\n if (bytes instanceof ArrayBuffer) {\n bytes = prepend ? bufferConcat(padding, bytes) : bufferConcat(bytes, padding);\n }\n else if (bytes instanceof Uint8Array) {\n let _bytes = new Uint8Array(bytes.length + padding.length);\n if (prepend) {\n _bytes.set(padding);\n _bytes.set(bytes, padding.length);\n }\n else {\n _bytes.set(bytes);\n _bytes.set(padding, bytes.length);\n }\n bytes = _bytes;\n }\n else {\n bytes = prepend ? padding.concat(bytes) : bytes.concat(padding);\n }\n }\n return bytes;\n}\nexports.addPadding = addPadding;\nfunction gzipUncompress(bytes, toString) {\n //console.log(dT(), 'Gzip uncompress start');\n var result = pako_inflate_min_js_1.default.inflate(bytes, toString ? { to: 'string' } : undefined);\n //console.log(dT(), 'Gzip uncompress finish'/* , result */);\n return result;\n}\nexports.gzipUncompress = gzipUncompress;\nfunction nextRandomInt(maxValue) {\n return Math.floor(Math.random() * maxValue);\n}\nexports.nextRandomInt = nextRandomInt;\n" }, { "id": 3, "identifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/richtextprocessor.js", "name": "./src/lib/richtextprocessor.js", "index": 52, "index2": 50, "size": 38942, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "issuerId": 40, "issuerName": "./src/components/pageSignIn.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 392, "building": 505, "dependencies": 2 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 4, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "module": "./src/lib/appManagers/appUsersManager.ts", "moduleName": "./src/lib/appManagers/appUsersManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "7:28-59" }, { "moduleId": 10, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPeersManager.ts", "module": "./src/lib/appManagers/appPeersManager.ts", "moduleName": "./src/lib/appManagers/appPeersManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "9:28-59" }, { "moduleId": 12, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appChatsManager.ts", "module": "./src/lib/appManagers/appChatsManager.ts", "moduleName": "./src/lib/appManagers/appChatsManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "7:28-59" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "19:28-59" }, { "moduleId": 18, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDocsManager.ts", "module": "./src/lib/appManagers/appDocsManager.ts", "moduleName": "./src/lib/appManagers/appDocsManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "17:28-59" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "30:28-59" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "22:28-59" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/richtextprocessor", "loc": "25:28-63" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "11:28-59" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "../lib/richtextprocessor", "loc": "15:28-63" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "14:28-59" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "10:28-59" }, { "moduleId": 49, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebPagesManager.ts", "module": "./src/lib/appManagers/appWebPagesManager.ts", "moduleName": "./src/lib/appManagers/appWebPagesManager.ts", "type": "cjs require", "userRequest": "../richtextprocessor", "loc": "9:28-59" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/richtextprocessor", "loc": "19:28-63" } ], "usedExports": true, "providedExports": [ "RichTextProcessor" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/components/emoticonsDropdown.ts (referenced with cjs require), ./src/components/pageSignIn.ts (referenced with cjs require), ./src/components/wrappers.ts (referenced with cjs require), ./src/lib/appManagers/appChatsManager.ts (referenced with cjs require), ./src/lib/appManagers/appDialogsManager.ts (referenced with cjs require), ./src/lib/appManagers/appDocsManager.ts (referenced with cjs require), ./src/lib/appManagers/appImManager.ts (referenced with cjs require), ./src/lib/appManagers/appMediaViewer.ts (referenced with cjs require), ./src/lib/appManagers/appMessagesManager.ts (referenced with cjs require), ./src/lib/appManagers/appPeersManager.ts (referenced with cjs require), ./src/lib/appManagers/appProfileManager.ts (referenced with cjs require), ./src/lib/appManagers/appSidebarRight.ts (referenced with cjs require), ./src/lib/appManagers/appUsersManager.ts (referenced with cjs require), ./src/lib/appManagers/appWebPagesManager.ts (referenced with cjs require)" ], "depth": 2, "source": "import {encodeEntities, copy/* , emojiUnicode */} from './utils';\r\n\r\nvar EmojiHelper = {\r\n emojiMap: (code) => { return code; },\r\n shortcuts: [],\r\n emojis: []\r\n};\r\n\r\nvar emojiData = Config.Emoji;\r\nvar emojiIconSize = emojiData.img_size;\r\nvar emojiSupported = navigator.userAgent.search(/OS X|iPhone|iPad|iOS|Android/i) != -1/* && false */,\r\n emojiCode;\r\n//var emojiRegExp = '\\\\u0023\\\\u20E3|\\\\u00a9|\\\\u00ae|\\\\u203c|\\\\u2049|\\\\u2139|[\\\\u2194-\\\\u2199]|\\\\u21a9|\\\\u21aa|\\\\u231a|\\\\u231b|\\\\u23e9|[\\\\u23ea-\\\\u23ec]|\\\\u23f0|\\\\u24c2|\\\\u25aa|\\\\u25ab|\\\\u25b6|\\\\u2611|\\\\u2614|\\\\u26fd|\\\\u2705|\\\\u2709|[\\\\u2795-\\\\u2797]|\\\\u27a1|\\\\u27b0|\\\\u27bf|\\\\u2934|\\\\u2935|[\\\\u2b05-\\\\u2b07]|\\\\u2b1b|\\\\u2b1c|\\\\u2b50|\\\\u2b55|\\\\u3030|\\\\u303d|\\\\u3297|\\\\u3299|[\\\\uE000-\\\\uF8FF\\\\u270A-\\\\u2764\\\\u2122\\\\u25C0\\\\u25FB-\\\\u25FE\\\\u2615\\\\u263a\\\\u2648-\\\\u2653\\\\u2660-\\\\u2668\\\\u267B\\\\u267F\\\\u2693\\\\u261d\\\\u26A0-\\\\u26FA\\\\u2708\\\\u2702\\\\u2601\\\\u260E]|[\\\\u2600\\\\u26C4\\\\u26BE\\\\u23F3\\\\u2764]|\\\\uD83D[\\\\uDC00-\\\\uDFFF]|\\\\uD83C[\\\\uDDE8-\\\\uDDFA\\uDDEC]\\\\uD83C[\\\\uDDEA-\\\\uDDFA\\uDDE7]|[0-9]\\\\u20e3|\\\\uD83C[\\\\uDC00-\\\\uDFFF]';\r\n//var emojiRegExp = '\\\\u00a9|\\\\u00ae|[\\\\u2000-\\\\u3300]|\\\\ud83c[\\\\ud000-\\\\udfff]|\\\\ud83d[\\\\ud000-\\\\udfff]|\\\\ud83e[\\\\ud000-\\\\udfff]';\r\nvar emojiRegExp = '\\\\uD83C\\\\uDFF4\\\\uDB40\\\\uDC67\\\\uDB40\\\\uDC62(?:\\\\uDB40\\\\uDC77\\\\uDB40\\\\uDC6C\\\\uDB40\\\\uDC73|\\\\uDB40\\\\uDC73\\\\uDB40\\\\uDC63\\\\uDB40\\\\uDC74|\\\\uDB40\\\\uDC65\\\\uDB40\\\\uDC6E\\\\uDB40\\\\uDC67)\\\\uDB40\\\\uDC7F|(?:\\\\uD83E\\\\uDDD1\\\\uD83C\\\\uDFFB\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1|\\\\uD83D\\\\uDC69\\\\uD83C\\\\uDFFC\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC69)\\\\uD83C\\\\uDFFB|\\\\uD83D\\\\uDC68(?:\\\\uD83C\\\\uDFFC\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68\\\\uD83C\\\\uDFFB|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFF\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFE])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFE\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFD])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFD\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB\\\\uDFFC])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\u200D(?:\\\\u2764\\\\uFE0F\\\\u200D(?:\\\\uD83D\\\\uDC8B\\\\u200D)?\\\\uD83D\\\\uDC68|(?:\\\\uD83D[\\\\uDC68\\\\uDC69])\\\\u200D(?:\\\\uD83D\\\\uDC66\\\\u200D\\\\uD83D\\\\uDC66|\\\\uD83D\\\\uDC67\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67]))|\\\\uD83D\\\\uDC66\\\\u200D\\\\uD83D\\\\uDC66|\\\\uD83D\\\\uDC67\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67])|(?:\\\\uD83D[\\\\uDC68\\\\uDC69])\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67])|[\\\\u2695\\\\u2696\\\\u2708]\\\\uFE0F|\\\\uD83D[\\\\uDC66\\\\uDC67]|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|(?:\\\\uD83C\\\\uDFFB\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFF\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFE\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFD\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFC\\\\u200D[\\\\u2695\\\\u2696\\\\u2708])\\\\uFE0F|\\\\uD83C\\\\uDFFB\\\\u200D(?:\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|\\\\uD83E\\\\uDDD1(?:\\\\uD83C\\\\uDFFF\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1)|\\\\uD83D\\\\uDC69(?:\\\\uD83C\\\\uDFFE\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFD\\\\uDFFF])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFD\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB\\\\uDFFC\\\\uDFFE\\\\uDFFF])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFC\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFB\\\\uDFFD-\\\\uDFFF])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFB\\\\u200D(?:\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC68(?:\\\\uD83C[\\\\uDFFC-\\\\uDFFF])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\u200D(?:\\\\u2764\\\\uFE0F\\\\u200D(?:\\\\uD83D\\\\uDC8B\\\\u200D(?:\\\\uD83D[\\\\uDC68\\\\uDC69])|\\\\uD83D[\\\\uDC68\\\\uDC69])|\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD])|\\\\uD83C\\\\uDFFF\\\\u200D(?:\\\\uD83C[\\\\uDF3E\\\\uDF73\\\\uDF93\\\\uDFA4\\\\uDFA8\\\\uDFEB\\\\uDFED]|\\\\uD83D[\\\\uDCBB\\\\uDCBC\\\\uDD27\\\\uDD2C\\\\uDE80\\\\uDE92]|\\\\uD83E[\\\\uDDAF-\\\\uDDB3\\\\uDDBC\\\\uDDBD]))|(?:\\\\uD83E\\\\uDDD1\\\\uD83C\\\\uDFFE\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1|\\\\uD83D\\\\uDC69\\\\uD83C\\\\uDFFF\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D(?:\\\\uD83D[\\\\uDC68\\\\uDC69]))(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFE])|(?:\\\\uD83E\\\\uDDD1\\\\uD83C\\\\uDFFD\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1|\\\\uD83D\\\\uDC69\\\\uD83C\\\\uDFFE\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC69)(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFD])|(?:\\\\uD83E\\\\uDDD1\\\\uD83C\\\\uDFFC\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83E\\\\uDDD1|\\\\uD83D\\\\uDC69\\\\uD83C\\\\uDFFD\\\\u200D\\\\uD83E\\\\uDD1D\\\\u200D\\\\uD83D\\\\uDC69)(?:\\\\uD83C[\\\\uDFFB\\\\uDFFC])|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC69\\\\u200D(?:\\\\uD83D\\\\uDC66\\\\u200D\\\\uD83D\\\\uDC66|\\\\uD83D\\\\uDC67\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67]))|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC66\\\\u200D\\\\uD83D\\\\uDC66|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC69\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67])|(?:\\\\uD83D\\\\uDC41\\\\uFE0F\\\\u200D\\\\uD83D\\\\uDDE8|\\\\uD83D\\\\uDC69(?:\\\\uD83C\\\\uDFFF\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFE\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFD\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFC\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\uD83C\\\\uDFFB\\\\u200D[\\\\u2695\\\\u2696\\\\u2708]|\\\\u200D[\\\\u2695\\\\u2696\\\\u2708])|(?:\\\\uD83C[\\\\uDFC3\\\\uDFC4\\\\uDFCA]|\\\\uD83D[\\\\uDC6E\\\\uDC71\\\\uDC73\\\\uDC77\\\\uDC81\\\\uDC82\\\\uDC86\\\\uDC87\\\\uDE45-\\\\uDE47\\\\uDE4B\\\\uDE4D\\\\uDE4E\\\\uDEA3\\\\uDEB4-\\\\uDEB6]|\\\\uD83E[\\\\uDD26\\\\uDD37-\\\\uDD39\\\\uDD3D\\\\uDD3E\\\\uDDB8\\\\uDDB9\\\\uDDCD-\\\\uDDCF\\\\uDDD6-\\\\uDDDD])(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])\\\\u200D[\\\\u2640\\\\u2642]|(?:\\\\u26F9|\\\\uD83C[\\\\uDFCB\\\\uDFCC]|\\\\uD83D\\\\uDD75)(?:\\\\uFE0F\\\\u200D[\\\\u2640\\\\u2642]|(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])\\\\u200D[\\\\u2640\\\\u2642])|\\\\uD83C\\\\uDFF4\\\\u200D\\\\u2620|(?:\\\\uD83C[\\\\uDFC3\\\\uDFC4\\\\uDFCA]|\\\\uD83D[\\\\uDC6E\\\\uDC6F\\\\uDC71\\\\uDC73\\\\uDC77\\\\uDC81\\\\uDC82\\\\uDC86\\\\uDC87\\\\uDE45-\\\\uDE47\\\\uDE4B\\\\uDE4D\\\\uDE4E\\\\uDEA3\\\\uDEB4-\\\\uDEB6]|\\\\uD83E[\\\\uDD26\\\\uDD37-\\\\uDD39\\\\uDD3C-\\\\uDD3E\\\\uDDB8\\\\uDDB9\\\\uDDCD-\\\\uDDCF\\\\uDDD6-\\\\uDDDF])\\\\u200D[\\\\u2640\\\\u2642])\\\\uFE0F|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC67\\\\u200D(?:\\\\uD83D[\\\\uDC66\\\\uDC67])|\\\\uD83C\\\\uDFF3\\\\uFE0F\\\\u200D\\\\uD83C\\\\uDF08|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC67|\\\\uD83D\\\\uDC69\\\\u200D\\\\uD83D\\\\uDC66|\\\\uD83D\\\\uDC15\\\\u200D\\\\uD83E\\\\uDDBA|\\\\uD83C\\\\uDDFD\\\\uD83C\\\\uDDF0|\\\\uD83C\\\\uDDF6\\\\uD83C\\\\uDDE6|\\\\uD83C\\\\uDDF4\\\\uD83C\\\\uDDF2|\\\\uD83E\\\\uDDD1(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|\\\\uD83D\\\\uDC69(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|\\\\uD83C\\\\uDDFF(?:\\\\uD83C[\\\\uDDE6\\\\uDDF2\\\\uDDFC])|\\\\uD83C\\\\uDDFE(?:\\\\uD83C[\\\\uDDEA\\\\uDDF9])|\\\\uD83C\\\\uDDFC(?:\\\\uD83C[\\\\uDDEB\\\\uDDF8])|\\\\uD83C\\\\uDDFB(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8\\\\uDDEA\\\\uDDEC\\\\uDDEE\\\\uDDF3\\\\uDDFA])|\\\\uD83C\\\\uDDFA(?:\\\\uD83C[\\\\uDDE6\\\\uDDEC\\\\uDDF2\\\\uDDF3\\\\uDDF8\\\\uDDFE\\\\uDDFF])|\\\\uD83C\\\\uDDF9(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8\\\\uDDE9\\\\uDDEB-\\\\uDDED\\\\uDDEF-\\\\uDDF4\\\\uDDF7\\\\uDDF9\\\\uDDFB\\\\uDDFC\\\\uDDFF])|\\\\uD83C\\\\uDDF8(?:\\\\uD83C[\\\\uDDE6-\\\\uDDEA\\\\uDDEC-\\\\uDDF4\\\\uDDF7-\\\\uDDF9\\\\uDDFB\\\\uDDFD-\\\\uDDFF])|\\\\uD83C\\\\uDDF7(?:\\\\uD83C[\\\\uDDEA\\\\uDDF4\\\\uDDF8\\\\uDDFA\\\\uDDFC])|\\\\uD83C\\\\uDDF5(?:\\\\uD83C[\\\\uDDE6\\\\uDDEA-\\\\uDDED\\\\uDDF0-\\\\uDDF3\\\\uDDF7-\\\\uDDF9\\\\uDDFC\\\\uDDFE])|\\\\uD83C\\\\uDDF3(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8\\\\uDDEA-\\\\uDDEC\\\\uDDEE\\\\uDDF1\\\\uDDF4\\\\uDDF5\\\\uDDF7\\\\uDDFA\\\\uDDFF])|\\\\uD83C\\\\uDDF2(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8-\\\\uDDED\\\\uDDF0-\\\\uDDFF])|\\\\uD83C\\\\uDDF1(?:\\\\uD83C[\\\\uDDE6-\\\\uDDE8\\\\uDDEE\\\\uDDF0\\\\uDDF7-\\\\uDDFB\\\\uDDFE])|\\\\uD83C\\\\uDDF0(?:\\\\uD83C[\\\\uDDEA\\\\uDDEC-\\\\uDDEE\\\\uDDF2\\\\uDDF3\\\\uDDF5\\\\uDDF7\\\\uDDFC\\\\uDDFE\\\\uDDFF])|\\\\uD83C\\\\uDDEF(?:\\\\uD83C[\\\\uDDEA\\\\uDDF2\\\\uDDF4\\\\uDDF5])|\\\\uD83C\\\\uDDEE(?:\\\\uD83C[\\\\uDDE8-\\\\uDDEA\\\\uDDF1-\\\\uDDF4\\\\uDDF6-\\\\uDDF9])|\\\\uD83C\\\\uDDED(?:\\\\uD83C[\\\\uDDF0\\\\uDDF2\\\\uDDF3\\\\uDDF7\\\\uDDF9\\\\uDDFA])|\\\\uD83C\\\\uDDEC(?:\\\\uD83C[\\\\uDDE6\\\\uDDE7\\\\uDDE9-\\\\uDDEE\\\\uDDF1-\\\\uDDF3\\\\uDDF5-\\\\uDDFA\\\\uDDFC\\\\uDDFE])|\\\\uD83C\\\\uDDEB(?:\\\\uD83C[\\\\uDDEE-\\\\uDDF0\\\\uDDF2\\\\uDDF4\\\\uDDF7])|\\\\uD83C\\\\uDDEA(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8\\\\uDDEA\\\\uDDEC\\\\uDDED\\\\uDDF7-\\\\uDDFA])|\\\\uD83C\\\\uDDE9(?:\\\\uD83C[\\\\uDDEA\\\\uDDEC\\\\uDDEF\\\\uDDF0\\\\uDDF2\\\\uDDF4\\\\uDDFF])|\\\\uD83C\\\\uDDE8(?:\\\\uD83C[\\\\uDDE6\\\\uDDE8\\\\uDDE9\\\\uDDEB-\\\\uDDEE\\\\uDDF0-\\\\uDDF5\\\\uDDF7\\\\uDDFA-\\\\uDDFF])|\\\\uD83C\\\\uDDE7(?:\\\\uD83C[\\\\uDDE6\\\\uDDE7\\\\uDDE9-\\\\uDDEF\\\\uDDF1-\\\\uDDF4\\\\uDDF6-\\\\uDDF9\\\\uDDFB\\\\uDDFC\\\\uDDFE\\\\uDDFF])|\\\\uD83C\\\\uDDE6(?:\\\\uD83C[\\\\uDDE8-\\\\uDDEC\\\\uDDEE\\\\uDDF1\\\\uDDF2\\\\uDDF4\\\\uDDF6-\\\\uDDFA\\\\uDDFC\\\\uDDFD\\\\uDDFF])|[#\\\\*0-9]\\\\uFE0F\\\\u20E3|(?:\\\\uD83C[\\\\uDFC3\\\\uDFC4\\\\uDFCA]|\\\\uD83D[\\\\uDC6E\\\\uDC71\\\\uDC73\\\\uDC77\\\\uDC81\\\\uDC82\\\\uDC86\\\\uDC87\\\\uDE45-\\\\uDE47\\\\uDE4B\\\\uDE4D\\\\uDE4E\\\\uDEA3\\\\uDEB4-\\\\uDEB6]|\\\\uD83E[\\\\uDD26\\\\uDD37-\\\\uDD39\\\\uDD3D\\\\uDD3E\\\\uDDB8\\\\uDDB9\\\\uDDCD-\\\\uDDCF\\\\uDDD6-\\\\uDDDD])(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|(?:\\\\u26F9|\\\\uD83C[\\\\uDFCB\\\\uDFCC]|\\\\uD83D\\\\uDD75)(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|(?:[\\\\u261D\\\\u270A-\\\\u270D]|\\\\uD83C[\\\\uDF85\\\\uDFC2\\\\uDFC7]|\\\\uD83D[\\\\uDC42\\\\uDC43\\\\uDC46-\\\\uDC50\\\\uDC66\\\\uDC67\\\\uDC6B-\\\\uDC6D\\\\uDC70\\\\uDC72\\\\uDC74-\\\\uDC76\\\\uDC78\\\\uDC7C\\\\uDC83\\\\uDC85\\\\uDCAA\\\\uDD74\\\\uDD7A\\\\uDD90\\\\uDD95\\\\uDD96\\\\uDE4C\\\\uDE4F\\\\uDEC0\\\\uDECC]|\\\\uD83E[\\\\uDD0F\\\\uDD18-\\\\uDD1C\\\\uDD1E\\\\uDD1F\\\\uDD30-\\\\uDD36\\\\uDDB5\\\\uDDB6\\\\uDDBB\\\\uDDD2-\\\\uDDD5])(?:\\\\uD83C[\\\\uDFFB-\\\\uDFFF])|(?:[\\\\u231A\\\\u231B\\\\u23E9-\\\\u23EC\\\\u23F0\\\\u23F3\\\\u25FD\\\\u25FE\\\\u2614\\\\u2615\\\\u2648-\\\\u2653\\\\u267F\\\\u2693\\\\u26A1\\\\u26AA\\\\u26AB\\\\u26BD\\\\u26BE\\\\u26C4\\\\u26C5\\\\u26CE\\\\u26D4\\\\u26EA\\\\u26F2\\\\u26F3\\\\u26F5\\\\u26FA\\\\u26FD\\\\u2705\\\\u270A\\\\u270B\\\\u2728\\\\u274C\\\\u274E\\\\u2753-\\\\u2755\\\\u2757\\\\u2795-\\\\u2797\\\\u27B0\\\\u27BF\\\\u2B1B\\\\u2B1C\\\\u2B50\\\\u2B55]|\\\\uD83C[\\\\uDC04\\\\uDCCF\\\\uDD8E\\\\uDD91-\\\\uDD9A\\\\uDDE6-\\\\uDDFF\\\\uDE01\\\\uDE1A\\\\uDE2F\\\\uDE32-\\\\uDE36\\\\uDE38-\\\\uDE3A\\\\uDE50\\\\uDE51\\\\uDF00-\\\\uDF20\\\\uDF2D-\\\\uDF35\\\\uDF37-\\\\uDF7C\\\\uDF7E-\\\\uDF93\\\\uDFA0-\\\\uDFCA\\\\uDFCF-\\\\uDFD3\\\\uDFE0-\\\\uDFF0\\\\uDFF4\\\\uDFF8-\\\\uDFFF]|\\\\uD83D[\\\\uDC00-\\\\uDC3E\\\\uDC40\\\\uDC42-\\\\uDCFC\\\\uDCFF-\\\\uDD3D\\\\uDD4B-\\\\uDD4E\\\\uDD50-\\\\uDD67\\\\uDD7A\\\\uDD95\\\\uDD96\\\\uDDA4\\\\uDDFB-\\\\uDE4F\\\\uDE80-\\\\uDEC5\\\\uDECC\\\\uDED0-\\\\uDED2\\\\uDED5\\\\uDEEB\\\\uDEEC\\\\uDEF4-\\\\uDEFA\\\\uDFE0-\\\\uDFEB]|\\\\uD83E[\\\\uDD0D-\\\\uDD3A\\\\uDD3C-\\\\uDD45\\\\uDD47-\\\\uDD71\\\\uDD73-\\\\uDD76\\\\uDD7A-\\\\uDDA2\\\\uDDA5-\\\\uDDAA\\\\uDDAE-\\\\uDDCA\\\\uDDCD-\\\\uDDFF\\\\uDE70-\\\\uDE73\\\\uDE78-\\\\uDE7A\\\\uDE80-\\\\uDE82\\\\uDE90-\\\\uDE95])|(?:[#\\\\*0-9\\\\xA9\\\\xAE\\\\u203C\\\\u2049\\\\u2122\\\\u2139\\\\u2194-\\\\u2199\\\\u21A9\\\\u21AA\\\\u231A\\\\u231B\\\\u2328\\\\u23CF\\\\u23E9-\\\\u23F3\\\\u23F8-\\\\u23FA\\\\u24C2\\\\u25AA\\\\u25AB\\\\u25B6\\\\u25C0\\\\u25FB-\\\\u25FE\\\\u2600-\\\\u2604\\\\u260E\\\\u2611\\\\u2614\\\\u2615\\\\u2618\\\\u261D\\\\u2620\\\\u2622\\\\u2623\\\\u2626\\\\u262A\\\\u262E\\\\u262F\\\\u2638-\\\\u263A\\\\u2640\\\\u2642\\\\u2648-\\\\u2653\\\\u265F\\\\u2660\\\\u2663\\\\u2665\\\\u2666\\\\u2668\\\\u267B\\\\u267E\\\\u267F\\\\u2692-\\\\u2697\\\\u2699\\\\u269B\\\\u269C\\\\u26A0\\\\u26A1\\\\u26AA\\\\u26AB\\\\u26B0\\\\u26B1\\\\u26BD\\\\u26BE\\\\u26C4\\\\u26C5\\\\u26C8\\\\u26CE\\\\u26CF\\\\u26D1\\\\u26D3\\\\u26D4\\\\u26E9\\\\u26EA\\\\u26F0-\\\\u26F5\\\\u26F7-\\\\u26FA\\\\u26FD\\\\u2702\\\\u2705\\\\u2708-\\\\u270D\\\\u270F\\\\u2712\\\\u2714\\\\u2716\\\\u271D\\\\u2721\\\\u2728\\\\u2733\\\\u2734\\\\u2744\\\\u2747\\\\u274C\\\\u274E\\\\u2753-\\\\u2755\\\\u2757\\\\u2763\\\\u2764\\\\u2795-\\\\u2797\\\\u27A1\\\\u27B0\\\\u27BF\\\\u2934\\\\u2935\\\\u2B05-\\\\u2B07\\\\u2B1B\\\\u2B1C\\\\u2B50\\\\u2B55\\\\u3030\\\\u303D\\\\u3297\\\\u3299]|\\\\uD83C[\\\\uDC04\\\\uDCCF\\\\uDD70\\\\uDD71\\\\uDD7E\\\\uDD7F\\\\uDD8E\\\\uDD91-\\\\uDD9A\\\\uDDE6-\\\\uDDFF\\\\uDE01\\\\uDE02\\\\uDE1A\\\\uDE2F\\\\uDE32-\\\\uDE3A\\\\uDE50\\\\uDE51\\\\uDF00-\\\\uDF21\\\\uDF24-\\\\uDF93\\\\uDF96\\\\uDF97\\\\uDF99-\\\\uDF9B\\\\uDF9E-\\\\uDFF0\\\\uDFF3-\\\\uDFF5\\\\uDFF7-\\\\uDFFF]|\\\\uD83D[\\\\uDC00-\\\\uDCFD\\\\uDCFF-\\\\uDD3D\\\\uDD49-\\\\uDD4E\\\\uDD50-\\\\uDD67\\\\uDD6F\\\\uDD70\\\\uDD73-\\\\uDD7A\\\\uDD87\\\\uDD8A-\\\\uDD8D\\\\uDD90\\\\uDD95\\\\uDD96\\\\uDDA4\\\\uDDA5\\\\uDDA8\\\\uDDB1\\\\uDDB2\\\\uDDBC\\\\uDDC2-\\\\uDDC4\\\\uDDD1-\\\\uDDD3\\\\uDDDC-\\\\uDDDE\\\\uDDE1\\\\uDDE3\\\\uDDE8\\\\uDDEF\\\\uDDF3\\\\uDDFA-\\\\uDE4F\\\\uDE80-\\\\uDEC5\\\\uDECB-\\\\uDED2\\\\uDED5\\\\uDEE0-\\\\uDEE5\\\\uDEE9\\\\uDEEB\\\\uDEEC\\\\uDEF0\\\\uDEF3-\\\\uDEFA\\\\uDFE0-\\\\uDFEB]|\\\\uD83E[\\\\uDD0D-\\\\uDD3A\\\\uDD3C-\\\\uDD45\\\\uDD47-\\\\uDD71\\\\uDD73-\\\\uDD76\\\\uDD7A-\\\\uDDA2\\\\uDDA5-\\\\uDDAA\\\\uDDAE-\\\\uDDCA\\\\uDDCD-\\\\uDDFF\\\\uDE70-\\\\uDE73\\\\uDE78-\\\\uDE7A\\\\uDE80-\\\\uDE82\\\\uDE90-\\\\uDE95])\\\\uFE0F|(?:[\\\\u261D\\\\u26F9\\\\u270A-\\\\u270D]|\\\\uD83C[\\\\uDF85\\\\uDFC2-\\\\uDFC4\\\\uDFC7\\\\uDFCA-\\\\uDFCC]|\\\\uD83D[\\\\uDC42\\\\uDC43\\\\uDC46-\\\\uDC50\\\\uDC66-\\\\uDC78\\\\uDC7C\\\\uDC81-\\\\uDC83\\\\uDC85-\\\\uDC87\\\\uDC8F\\\\uDC91\\\\uDCAA\\\\uDD74\\\\uDD75\\\\uDD7A\\\\uDD90\\\\uDD95\\\\uDD96\\\\uDE45-\\\\uDE47\\\\uDE4B-\\\\uDE4F\\\\uDEA3\\\\uDEB4-\\\\uDEB6\\\\uDEC0\\\\uDECC]|\\\\uD83E[\\\\uDD0F\\\\uDD18-\\\\uDD1F\\\\uDD26\\\\uDD30-\\\\uDD39\\\\uDD3C-\\\\uDD3E\\\\uDDB5\\\\uDDB6\\\\uDDB8\\\\uDDB9\\\\uDDBB\\\\uDDCD-\\\\uDDCF\\\\uDDD1-\\\\uDDDD])';\r\nvar alphaCharsRegExp = 'a-z' +\r\n '\\\\u00c0-\\\\u00d6\\\\u00d8-\\\\u00f6\\\\u00f8-\\\\u00ff' + // Latin-1\r\n '\\\\u0100-\\\\u024f' + // Latin Extended A and B\r\n '\\\\u0253\\\\u0254\\\\u0256\\\\u0257\\\\u0259\\\\u025b\\\\u0263\\\\u0268\\\\u026f\\\\u0272\\\\u0289\\\\u028b' + // IPA Extensions\r\n '\\\\u02bb' + // Hawaiian\r\n '\\\\u0300-\\\\u036f' + // Combining diacritics\r\n '\\\\u1e00-\\\\u1eff' + // Latin Extended Additional (mostly for Vietnamese)\r\n '\\\\u0400-\\\\u04ff\\\\u0500-\\\\u0527' + // Cyrillic\r\n '\\\\u2de0-\\\\u2dff\\\\ua640-\\\\ua69f' + // Cyrillic Extended A/B\r\n '\\\\u0591-\\\\u05bf\\\\u05c1-\\\\u05c2\\\\u05c4-\\\\u05c5\\\\u05c7' +\r\n '\\\\u05d0-\\\\u05ea\\\\u05f0-\\\\u05f4' + // Hebrew\r\n '\\\\ufb1d-\\\\ufb28\\\\ufb2a-\\\\ufb36\\\\ufb38-\\\\ufb3c\\\\ufb3e\\\\ufb40-\\\\ufb41' +\r\n '\\\\ufb43-\\\\ufb44\\\\ufb46-\\\\ufb4f' + // Hebrew Pres. Forms\r\n '\\\\u0610-\\\\u061a\\\\u0620-\\\\u065f\\\\u066e-\\\\u06d3\\\\u06d5-\\\\u06dc' +\r\n '\\\\u06de-\\\\u06e8\\\\u06ea-\\\\u06ef\\\\u06fa-\\\\u06fc\\\\u06ff' + // Arabic\r\n '\\\\u0750-\\\\u077f\\\\u08a0\\\\u08a2-\\\\u08ac\\\\u08e4-\\\\u08fe' + // Arabic Supplement and Extended A\r\n '\\\\ufb50-\\\\ufbb1\\\\ufbd3-\\\\ufd3d\\\\ufd50-\\\\ufd8f\\\\ufd92-\\\\ufdc7\\\\ufdf0-\\\\ufdfb' + // Pres. Forms A\r\n '\\\\ufe70-\\\\ufe74\\\\ufe76-\\\\ufefc' + // Pres. Forms B\r\n '\\\\u200c' + // Zero-Width Non-Joiner\r\n '\\\\u0e01-\\\\u0e3a\\\\u0e40-\\\\u0e4e' + // Thai\r\n '\\\\u1100-\\\\u11ff\\\\u3130-\\\\u3185\\\\uA960-\\\\uA97F\\\\uAC00-\\\\uD7AF\\\\uD7B0-\\\\uD7FF' + // Hangul (Korean)\r\n '\\\\u3003\\\\u3005\\\\u303b' + // Kanji/Han iteration marks\r\n '\\\\uff21-\\\\uff3a\\\\uff41-\\\\uff5a' + // full width Alphabet\r\n '\\\\uff66-\\\\uff9f' + // half width Katakana\r\n '\\\\uffa1-\\\\uffdc'; // half width Hangul (Korean)\r\nvar alphaNumericRegExp = '0-9\\_' + alphaCharsRegExp;\r\nvar domainAddChars = '\\u00b7';\r\n// Based on Regular Expression for URL validation by Diego Perini\r\nvar urlRegExp = '((?:https?|ftp)://|mailto:)?' +\r\n // user:pass authentication\r\n '(?:\\\\S{1,64}(?::\\\\S{0,64})?@)?' +\r\n '(?:' +\r\n // sindresorhus/ip-regexp\r\n '(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\\\\.(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])){3}' +\r\n '|' +\r\n // host name\r\n '[' + alphaCharsRegExp + '0-9][' + alphaCharsRegExp + domainAddChars + '0-9\\-]{0,64}' +\r\n // domain name\r\n '(?:\\\\.[' + alphaCharsRegExp + '0-9][' + alphaCharsRegExp + domainAddChars + '0-9\\-]{0,64}){0,10}' +\r\n // TLD identifier\r\n '(?:\\\\.(xn--[0-9a-z]{2,16}|[' + alphaCharsRegExp + ']{2,24}))' +\r\n ')' +\r\n // port number\r\n '(?::\\\\d{2,5})?' +\r\n // resource path\r\n '(?:/(?:\\\\S{0,255}[^\\\\s.;,(\\\\[\\\\]{}<>\"\\'])?)?'\r\nvar usernameRegExp = '[a-zA-Z\\\\d_]{5,32}'\r\nvar botCommandRegExp = '\\\\/([a-zA-Z\\\\d_]{1,32})(?:@(' + usernameRegExp + '))?(\\\\b|$)'\r\nvar fullRegExp = new RegExp('(^| )(@)(' + usernameRegExp + ')|(' + urlRegExp + ')|(\\\\n)|(' + emojiRegExp + ')|(^|[\\\\s\\\\(\\\\]])(#[' + alphaNumericRegExp + ']{2,64})|(^|\\\\s)' + botCommandRegExp, 'i')\r\nvar emailRegExp = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/\r\nvar youtubeRegExp = /^(?:https?:\\/\\/)?(?:www\\.)?youtu(?:|\\.be|be\\.com|\\.b)(?:\\/v\\/|\\/watch\\\\?v=|e\\/|(?:\\/\\??#)?\\/watch(?:.+)v=)(.{11})(?:\\&[^\\s]*)?/\r\nvar vimeoRegExp = /^(?:https?:\\/\\/)?(?:www\\.)?vimeo\\.com\\/(\\d+)/\r\nvar instagramRegExp = /^https?:\\/\\/(?:instagr\\.am\\/p\\/|instagram\\.com\\/p\\/)([a-zA-Z0-9\\-\\_]+)/i\r\nvar vineRegExp = /^https?:\\/\\/vine\\.co\\/v\\/([a-zA-Z0-9\\-\\_]+)/i\r\nvar twitterRegExp = /^https?:\\/\\/twitter\\.com\\/.+?\\/status\\/\\d+/i\r\nvar facebookRegExp = /^https?:\\/\\/(?:www\\.|m\\.)?facebook\\.com\\/(?:.+?\\/posts\\/\\d+|(?:story\\.php|permalink\\.php)\\?story_fbid=(\\d+)(?:&substory_index=\\d+)?&id=(\\d+))/i\r\nvar gplusRegExp = /^https?:\\/\\/plus\\.google\\.com\\/\\d+\\/posts\\/[a-zA-Z0-9\\-\\_]+/i\r\nvar soundcloudRegExp = /^https?:\\/\\/(?:soundcloud\\.com|snd\\.sc)\\/([a-zA-Z0-9%\\-\\_]+)\\/([a-zA-Z0-9%\\-\\_]+)/i\r\nvar spotifyRegExp = /(https?:\\/\\/(open\\.spotify\\.com|play\\.spotify\\.com|spoti\\.fi)\\/(.+)|spotify:(.+))/i\r\nvar markdownTestRegExp = /[`_*@]/\r\nvar markdownRegExp = /(^|\\s|\\n)(````?)([\\s\\S]+?)(````?)([\\s\\n\\.,:?!;]|$)|(^|\\s)(`|\\*\\*|__)([^\\n]+?)\\7([\\s\\.,:?!;]|$)|@(\\d+)\\s*\\((.+?)\\)/m\r\nvar siteHashtags = {\r\n Telegram: 'tg://search_hashtag?hashtag={1}',\r\n Twitter: 'https://twitter.com/hashtag/{1}',\r\n Instagram: 'https://instagram.com/explore/tags/{1}/',\r\n 'Google Plus': 'https://plus.google.com/explore/{1}'\r\n}\r\nvar siteMentions = {\r\n Telegram: '#/im?p=%40{1}',\r\n Twitter: 'https://twitter.com/{1}',\r\n Instagram: 'https://instagram.com/{1}/',\r\n GitHub: 'https://github.com/{1}'\r\n}\r\nvar markdownEntities = {\r\n '`': 'messageEntityCode',\r\n '**': 'messageEntityBold',\r\n '__': 'messageEntityItalic'\r\n}\r\nfunction getEmojiSpritesheetCoords(emojiCode) {\r\n //////////////emojiCode = emojiUnicode(emojiCode);\r\n\r\n let emojiInfo = emojiData.emoji[emojiCode];\r\n if(!emojiInfo) {\r\n //console.error('no emoji by code:', emojiCode, emojiCode.length, new TextEncoder().encode(emojiCode));\r\n return null;\r\n }\r\n\r\n let sheetX = 0;\r\n let sheetNo = '';\r\n if(emojiData.splitted) {\r\n sheetX = emojiInfo[emojiData.keyX] % 6;\r\n sheetNo = (emojiInfo[emojiData.keyX] / 6 | 0) + 1;\r\n } else {\r\n sheetX = emojiInfo[emojiData.keyX];\r\n }\r\n\r\n /* let xPos = 100 * (((emojiInfo.sheet_x * (img_size + 2)) + 1) / (sheetSizeX - img_size));\r\n let yPos = 100 * (((emojiInfo.sheet_y * (img_size + 2)) + 1) / (sheetSizeY - img_size)); */\r\n let xPos = sheetX * emojiData.multiplyX;\r\n let yPos = 100 / emojiData.side * emojiInfo[emojiData.keyY];\r\n\r\n if(emojiData.splitted) {\r\n /* if(sheetX != 2 && sheetX != 3) {\r\n xPos += ((sheetX + 1) > (6 / 2) ? -1 : 1) * 100 / 204;\r\n } */\r\n\r\n if(sheetNo == 9) {\r\n xPos = sheetX * 100 / 5;\r\n } else {\r\n xPos = sheetX * 100 / 6;\r\n }\r\n }\r\n\r\n //console.log({row: yPos, column: xPos, sheetNo});\r\n\r\n return {row: yPos, column: xPos, sheetNo};\r\n}\r\nfunction parseEntities (text, options) {\r\n options = options || {}\r\n var match\r\n var raw = text,\r\n url\r\n var entities = [],\r\n emojiCode = '',\r\n emojiCoords,\r\n matchIndex\r\n var rawOffset = 0\r\n // var start = tsNow()\r\n while ((match = raw.match(fullRegExp))) {\r\n matchIndex = rawOffset + match.index;\r\n\r\n if(match[3]) { // mentions\r\n entities.push({\r\n _: 'messageEntityMention',\r\n offset: matchIndex + match[1].length,\r\n length: match[2].length + match[3].length\r\n });\r\n } else if(match[4]) {\r\n if(emailRegExp.test(match[4])) { // email\r\n entities.push({\r\n _: 'messageEntityEmail',\r\n offset: matchIndex,\r\n length: match[4].length\r\n });\r\n } else {\r\n var url = false;\r\n var protocol = match[5];\r\n var tld = match[6];\r\n var excluded = '';\r\n if(tld) { // URL\r\n if(!protocol && (tld.substr(0, 4) === 'xn--' || Config.TLD.indexOf(tld.toLowerCase()) !== -1)) {\r\n protocol = 'http://';\r\n }\r\n\r\n if(protocol) {\r\n var balanced = checkBrackets(match[4]);\r\n if (balanced.length !== match[4].length) {\r\n excluded = match[4].substring(balanced.length);\r\n match[4] = balanced;\r\n }\r\n\r\n url = (match[5] ? '' : protocol) + match[4];\r\n }\r\n } else { // IP address\r\n url = (match[5] ? '' : 'http://') + match[4];\r\n }\r\n\r\n if (url) {\r\n entities.push({\r\n _: 'messageEntityUrl',\r\n offset: matchIndex,\r\n length: match[4].length\r\n });\r\n }\r\n }\r\n } else if(match[7]) { // New line\r\n entities.push({\r\n _: 'messageEntityLinebreak',\r\n offset: matchIndex,\r\n length: 1\r\n });\r\n } else if(match[8]/* && !emojiSupported */) { // Emoji\r\n if(emojiCode) matchIndex -= match[8].length;\r\n emojiCode += match[8];\r\n //console.log('hit', match[8], emojiCode.length);\r\n if((emojiCoords = getEmojiSpritesheetCoords(emojiCode))) {\r\n entities.push({\r\n _: 'messageEntityEmoji',\r\n offset: matchIndex,\r\n length: emojiCode.length,\r\n coords: emojiCoords/* ,\r\n title: emojiData[emojiCode][1][0] */\r\n });\r\n\r\n emojiCode = '';\r\n }\r\n } else if(match[10]) { // Hashtag\r\n entities.push({\r\n _: 'messageEntityHashtag',\r\n offset: matchIndex + match[9].length,\r\n length: match[10].length\r\n });\r\n } else if(match[12]) { // Bot command\r\n entities.push({\r\n _: 'messageEntityBotCommand',\r\n offset: matchIndex + match[11].length,\r\n length: 1 + match[12].length + (match[13] ? 1 + match[13].length : 0)\r\n });\r\n }\r\n\r\n raw = raw.substr(match.index + match[0].length);\r\n rawOffset += match.index + match[0].length;\r\n }\r\n\r\n // if (entities.length) {\r\n // console.log('parse entities', text, entities.slice())\r\n // }\r\n return entities\r\n}\r\nfunction parseEmojis (text) {\r\n return text.replace(/:([a-z0-9\\-\\+\\*_]+?):/gi, function (all, shortcut) {\r\n var emojiCode = EmojiHelper.shortcuts[shortcut]\r\n if (emojiCode !== undefined) {\r\n return EmojiHelper.emojis[emojiCode][0]\r\n }\r\n return all\r\n })\r\n}\r\nfunction parseMarkdown (text, entities, noTrim) {\r\n  if (!markdownTestRegExp.test(text)) {\r\n return noTrim ? text : text.trim()\r\n }\r\n var raw = text\r\n var match\r\n var newText = []\r\n var rawOffset = 0\r\n var matchIndex\r\n while (match = raw.match(markdownRegExp)) {\r\n matchIndex = rawOffset + match.index\r\n newText.push(raw.substr(0, match.index))\r\n var text = (match[3] || match[8] || match[11])\r\n rawOffset -= text.length\r\n text = text.replace(/^\\s+|\\s+$/g, '')\r\n rawOffset += text.length\r\n if (text.match(/^`*$/)) {\r\n newText.push(match[0])\r\n }\r\n else if (match[3]) { // pre\r\n if (match[5] == '\\n') {\r\n match[5] = ''\r\n rawOffset -= 1\r\n }\r\n newText.push(match[1] + text + match[5])\r\n entities.push({\r\n _: 'messageEntityPre',\r\n language: '',\r\n offset: matchIndex + match[1].length,\r\n length: text.length\r\n })\r\n rawOffset -= match[2].length + match[4].length\r\n } else if (match[7]) { // code|italic|bold\r\n newText.push(match[6] + text + match[9])\r\n entities.push({\r\n _: markdownEntities[match[7]],\r\n offset: matchIndex + match[6].length,\r\n length: text.length\r\n })\r\n rawOffset -= match[7].length * 2\r\n } else if (match[11]) { // custom mention\r\n newText.push(text)\r\n entities.push({\r\n _: 'messageEntityMentionName',\r\n user_id: match[10],\r\n offset: matchIndex,\r\n length: text.length\r\n })\r\n rawOffset -= match[0].length - text.length\r\n }\r\n raw = raw.substr(match.index + match[0].length)\r\n rawOffset += match.index + match[0].length\r\n }\r\n newText.push(raw)\r\n newText = newText.join('')\r\n if (!newText.replace(/\\s+/g, '').length) {\r\n newText = text\r\n entities.splice(0, entities.length)\r\n }\r\n if (!entities.length && !noTrim) {\r\n newText = newText.trim()\r\n }\r\n return newText\r\n}\r\nfunction mergeEntities (currentEntities, newEntities, fromApi) {\r\n var totalEntities = newEntities.slice()\r\n var i\r\n var len = currentEntities.length\r\n var j\r\n var len2 = newEntities.length\r\n var startJ = 0\r\n var curEntity\r\n var newEntity\r\n var start, end\r\n var cStart, cEnd\r\n var bad\r\n for (i = 0; i < len; i++) {\r\n curEntity = currentEntities[i]\r\n if (fromApi &&\r\n curEntity._ != 'messageEntityLinebreak' &&\r\n curEntity._ != 'messageEntityEmoji') {\r\n continue\r\n }\r\n // console.log('s', curEntity, newEntities)\r\n start = curEntity.offset\r\n end = start + curEntity.length\r\n bad = false\r\n for (j = startJ; j < len2; j++) {\r\n newEntity = newEntities[j]\r\n cStart = newEntity.offset\r\n cEnd = cStart + newEntity.length\r\n if (cStart <= start) {\r\n startJ = j\r\n }\r\n if (start >= cStart && start < cEnd ||\r\n end > cStart && end <= cEnd) {\r\n // console.log('bad', curEntity, newEntity)\r\n if (fromApi &&\r\n start >= cStart && end <= cEnd) {\r\n if (newEntity.nested === undefined) {\r\n newEntity.nested = []\r\n }\r\n curEntity.offset -= cStart\r\n newEntity.nested.push(copy(curEntity))\r\n }\r\n bad = true\r\n break\r\n }\r\n if (cStart >= end) {\r\n break\r\n }\r\n }\r\n if (bad) {\r\n continue\r\n }\r\n totalEntities.push(curEntity)\r\n }\r\n totalEntities.sort(function (a, b) {\r\n return a.offset - b.offset\r\n })\r\n // console.log('merge', currentEntities, newEntities, totalEntities)\r\n return totalEntities\r\n}\r\nfunction wrapRichNestedText (text, nested, options) {\r\n if (nested === undefined) {\r\n return encodeEntities(text)\r\n }\r\n options.hasNested = true\r\n return wrapRichText(text, {entities: nested, nested: true})\r\n}\r\nfunction wrapRichText (text, options = {}) {\r\n if(!text || !text.length) {\r\n return ''\r\n }\r\n\r\n var entities = options.entities;\r\n var contextSite = options.contextSite || 'Telegram';\r\n var contextExternal = contextSite != 'Telegram';\r\n var emojiFound = false;\r\n if(entities === undefined) {\r\n entities = parseEntities(text, options);\r\n }\r\n\r\n //console.log('wrapRichText got entities:', text, entities);\r\n var len = entities.length;\r\n var entity;\r\n var entityText;\r\n var skipEntity;\r\n var url;\r\n var html = [];\r\n var lastOffset = 0;\r\n var curEmojiSize = options.emojiIconSize || emojiIconSize;\r\n for(var i = 0; i < len; i++) {\r\n entity = entities[i];\r\n if(entity.offset > lastOffset) {\r\n html.push(\r\n encodeEntities(text.substr(lastOffset, entity.offset - lastOffset))\r\n );\r\n } else if(entity.offset < lastOffset) {\r\n continue;\r\n }\r\n\r\n skipEntity = false;\r\n entityText = text.substr(entity.offset, entity.length);\r\n switch(entity._) {\r\n case 'messageEntityMention':\r\n var contextUrl = !options.noLinks && siteMentions[contextSite]\r\n if (!contextUrl) {\r\n skipEntity = true\r\n break\r\n }\r\n var username = entityText.substr(1)\r\n var attr = ''\r\n if (options.highlightUsername &&\r\n options.highlightUsername.toLowerCase() == username.toLowerCase()) {\r\n attr = 'class=\"im_message_mymention\"'\r\n }\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityMentionName':\r\n if (options.noLinks) {\r\n skipEntity = true\r\n break\r\n }\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityHashtag':\r\n var contextUrl = !options.noLinks && siteHashtags[contextSite]\r\n if (!contextUrl) {\r\n skipEntity = true\r\n break\r\n }\r\n var hashtag = entityText.substr(1)\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityEmail':\r\n if (options.noLinks) {\r\n skipEntity = true\r\n break\r\n }\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityUrl':\r\n case 'messageEntityTextUrl':\r\n var inner\r\n if (entity._ == 'messageEntityTextUrl') {\r\n url = entity.url\r\n url = wrapUrl(url, true)\r\n inner = wrapRichNestedText(entityText, entity.nested, options)\r\n } else {\r\n url = wrapUrl(entityText, false)\r\n inner = encodeEntities(replaceUrlEncodings(entityText))\r\n }\r\n if (options.noLinks) {\r\n html.push(inner);\r\n } else {\r\n html.push(\r\n '',\r\n inner,\r\n ''\r\n )\r\n }\r\n break\r\n case 'messageEntityLinebreak':\r\n html.push(options.noLinebreaks ? ' ' : '
')\r\n break\r\n case 'messageEntityEmoji':\r\n \r\n /* var inner = `${encodeEntities(entityText)}`; */\r\n /* var inner = `\\u200B`; */\r\n\r\n /* if(emojiSupported) {\r\n html.push(encodeEntities(entityText));\r\n } else {\r\n *///html.push(`${emojiSupported ? encodeEntities(entityText) : inner}\\u200B`);\r\n //}\r\n\r\n inner = `\"${encodeEntities(entityText)}\"`;\r\n\r\n //html.push(`${emojiSupported ? encodeEntities(entityText) : inner}\\u200B`);\r\n\r\n html.push(emojiSupported ? `${encodeEntities(entityText)}` : inner);\r\n\r\n emojiFound = true;\r\n break\r\n case 'messageEntityBotCommand':\r\n if (options.noLinks || options.noCommands || contextExternal) {\r\n skipEntity = true\r\n break\r\n }\r\n var command = entityText.substr(1)\r\n var bot\r\n var atPos\r\n if ((atPos = command.indexOf('@')) != -1) {\r\n bot = command.substr(atPos + 1)\r\n command = command.substr(0, atPos)\r\n } else {\r\n bot = options.fromBot\r\n }\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityBold':\r\n html.push(\r\n '',\r\n wrapRichNestedText(entityText, entity.nested, options),\r\n ''\r\n )\r\n break\r\n case 'messageEntityItalic':\r\n html.push(\r\n '',\r\n wrapRichNestedText(entityText, entity.nested, options),\r\n ''\r\n )\r\n break\r\n case 'messageEntityCode':\r\n html.push(\r\n '',\r\n encodeEntities(entityText),\r\n ''\r\n )\r\n break\r\n case 'messageEntityPre':\r\n html.push(\r\n '
',\r\n          encodeEntities(entityText),\r\n          '
'\r\n )\r\n break\r\n default:\r\n skipEntity = true\r\n }\r\n lastOffset = entity.offset + (skipEntity ? 0 : entity.length)\r\n }\r\n\r\n html.push(encodeEntities(text.substr(lastOffset))); // may be empty string\r\n //console.log(html);\r\n text = html.join('')//$sanitize(html.join(''))\r\n /* if (!options.nested && (emojiFound || options.hasNested)) {\r\n text = text.replace(/\\ufe0f|️|�|‍/g, '', text)\r\n var emojiSizeClass = curEmojiSize == 18 ? '' : (' emoji-w' + curEmojiSize)\r\n text = text.replace(/]*)?) class=\"emoji emoji-(\\d)-(\\d+)-(\\d+)\"(.+?)<\\/span>/g,\r\n '')\r\n } */\r\n return text;//$sce.trustAs('html', text)\r\n}\r\nfunction wrapDraftText (text, options) {\r\n if (!text || !text.length) {\r\n return ''\r\n }\r\n options = options || {}\r\n var entities = options.entities\r\n if (entities === undefined) {\r\n entities = parseEntities(text, options)\r\n }\r\n var i = 0\r\n var len = entities.length\r\n var entity\r\n var entityText\r\n var skipEntity\r\n var code = []\r\n var lastOffset = 0\r\n for (i = 0; i < len; i++) {\r\n entity = entities[i]\r\n if (entity.offset > lastOffset) {\r\n code.push(\r\n text.substr(lastOffset, entity.offset - lastOffset)\r\n )\r\n }\r\n else if (entity.offset < lastOffset) {\r\n continue\r\n }\r\n skipEntity = false\r\n entityText = text.substr(entity.offset, entity.length)\r\n switch (entity._) {\r\n case 'messageEntityEmoji':\r\n code.push(\r\n ':',\r\n entity.title,\r\n ':'\r\n )\r\n break\r\n case 'messageEntityCode':\r\n code.push(\r\n '`', entityText, '`'\r\n )\r\n break\r\n case 'messageEntityBold':\r\n code.push(\r\n '**', entityText, '**'\r\n )\r\n break\r\n case 'messageEntityItalic':\r\n code.push(\r\n '__', entityText, '__'\r\n )\r\n break\r\n case 'messageEntityPre':\r\n code.push(\r\n '```', entityText, '```'\r\n )\r\n break\r\n case 'messageEntityMentionName':\r\n code.push(\r\n '@', entity.user_id, ' (', entityText, ')'\r\n )\r\n break\r\n default:\r\n skipEntity = true\r\n }\r\n lastOffset = entity.offset + (skipEntity ? 0 : entity.length)\r\n }\r\n code.push(text.substr(lastOffset))\r\n return code.join('')\r\n}\r\nfunction checkBrackets (url) {\r\n var urlLength = url.length\r\n var urlOpenBrackets = url.split('(').length - 1\r\n var urlCloseBrackets = url.split(')').length - 1\r\n while (urlCloseBrackets > urlOpenBrackets &&\r\n url.charAt(urlLength - 1) === ')') {\r\n url = url.substr(0, urlLength - 1)\r\n urlCloseBrackets--\r\n urlLength--\r\n }\r\n if (urlOpenBrackets > urlCloseBrackets) {\r\n url = url.replace(/\\)+$/, '')\r\n }\r\n return url\r\n}\r\n\r\nfunction replaceUrlEncodings(urlWithEncoded) {\r\n return urlWithEncoded.replace(/(%[A-Z\\d]{2})+/g, function (str) {\r\n try {\r\n return decodeURIComponent(str);\r\n } catch (e) {\r\n return str;\r\n }\r\n });\r\n}\r\n\r\nfunction wrapPlainText(text, options = {}) {\r\n if(emojiSupported) {\r\n return text;\r\n }\r\n\r\n if(!text || !text.length) {\r\n return '';\r\n }\r\n\r\n text = text.replace(/\\ufe0f/g, '', text);\r\n var match;\r\n var raw = text;\r\n var text = [],\r\n emojiTitle;\r\n while((match = raw.match(fullRegExp))) {\r\n text.push(raw.substr(0, match.index))\r\n if(match[8]) {\r\n if((emojiCode = EmojiHelper.emojiMap[match[8]]) &&\r\n (emojiTitle = emojiData[emojiCode][1][0])) {\r\n text.push(':' + emojiTitle + ':');\r\n } else {\r\n text.push(match[0]);\r\n }\r\n } else {\r\n text.push(match[0]);\r\n }\r\n\r\n raw = raw.substr(match.index + match[0].length);\r\n }\r\n text.push(raw);\r\n return text.join('');\r\n}\r\nfunction wrapEmojiText(text) {\r\n if(!text) return '';\r\n\r\n let entities = parseEntities(text).filter(e => e._ == 'messageEntityEmoji');\r\n return wrapRichText(text, {entities});\r\n}\r\nfunction wrapUrl (url, unsafe) {\r\n if (!url.match(/^https?:\\/\\//i)) {\r\n url = 'http://' + url\r\n }\r\n var tgMeMatch\r\n var telescoPeMatch\r\n if (unsafe == 2) {\r\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url)\r\n }\r\n else if ((tgMeMatch = url.match(/^https?:\\/\\/t(?:elegram)?\\.me\\/(.+)/))) {\r\n var fullPath = tgMeMatch[1]\r\n var path = fullPath.split('/')\r\n switch (path[0]) {\r\n case 'joinchat':\r\n url = 'tg://join?invite=' + path[1]\r\n break\r\n case 'addstickers':\r\n url = 'tg://addstickers?set=' + path[1]\r\n break\r\n default:\r\n if (path[1] && path[1].match(/^\\d+$/)) {\r\n url = 'tg://resolve?domain=' + path[0] + '&post=' + path[1]\r\n }\r\n else if (path.length == 1) {\r\n var domainQuery = path[0].split('?')\r\n var domain = domainQuery[0]\r\n var query = domainQuery[1]\r\n if (domain == 'iv') {\r\n var match = (query || '').match(/url=([^&=]+)/)\r\n if (match) {\r\n url = match[1]\r\n try {\r\n url = decodeURIComponent(url)\r\n } catch (e) {}\r\n return wrapUrl(url, unsafe)\r\n }\r\n }\r\n url = 'tg://resolve?domain=' + domain + (query ? '&' + query : '')\r\n }\r\n }\r\n }\r\n else if ((telescoPeMatch = url.match(/^https?:\\/\\/telesco\\.pe\\/([^/?]+)\\/(\\d+)/))) {\r\n url = 'tg://resolve?domain=' + telescoPeMatch[1] + '&post=' + telescoPeMatch[2]\r\n }\r\n else if (unsafe) {\r\n url = 'tg://unsafe_url?url=' + encodeURIComponent(url)\r\n }\r\n return url\r\n}\r\n\r\nlet RichTextProcessor = {\r\n wrapRichText: wrapRichText,\r\n wrapPlainText: wrapPlainText,\r\n wrapDraftText: wrapDraftText,\r\n wrapUrl: wrapUrl,\r\n wrapEmojiText: wrapEmojiText,\r\n parseEntities: parseEntities,\r\n parseMarkdown: parseMarkdown,\r\n parseEmojis: parseEmojis,\r\n mergeEntities: mergeEntities,\r\n getEmojiSpritesheetCoords: getEmojiSpritesheetCoords,\r\n emojiSupported: emojiSupported\r\n};\r\n\r\nwindow.RichTextProcessor = RichTextProcessor;\r\n\r\nexport {RichTextProcessor};\r\n\r\n" }, { "id": 4, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "name": "./src/lib/appManagers/appUsersManager.ts", "index": 62, "index2": 54, "size": 16398, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 10, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPeersManager.ts", "module": "./src/lib/appManagers/appPeersManager.ts", "moduleName": "./src/lib/appManagers/appPeersManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "6:42-70" }, { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "15:42-70" }, { "moduleId": 12, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appChatsManager.ts", "module": "./src/lib/appManagers/appChatsManager.ts", "moduleName": "./src/lib/appManagers/appChatsManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "8:42-70" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "18:42-70" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "24:42-70" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "23:42-70" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "10:42-70" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "21:42-70" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "10:42-70" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appUsersManager", "loc": "12:42-70" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appUsersManager", "loc": "7:42-82" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst serverTimeManager_1 = __importDefault(require(\"../mtproto/serverTimeManager\"));\nclass AppUsersManager {\n constructor() {\n this.users = {};\n this.usernames = {};\n this.userAccess = {};\n this.cachedPhotoLocations = {};\n this.contactsIndex = utils_1.SearchIndexManager.createIndex();\n apiManager_1.default.getUserID().then((id) => {\n this.myID = id;\n });\n utils_1.$rootScope.$on('user_auth', (e) => {\n let userAuth = e.detail;\n this.myID = userAuth ? userAuth.id : 0;\n });\n setInterval(this.updateUsersStatuses.bind(this), 60000);\n utils_1.$rootScope.$on('stateSynchronized', this.updateUsersStatuses.bind(this));\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n let update = e.detail;\n //console.log('on apiUpdate', update);\n switch (update._) {\n case 'updateUserStatus':\n var userID = update.user_id;\n var user = this.users[userID];\n if (user) {\n user.status = update.status;\n if (user.status) {\n if (user.status.expires) {\n user.status.expires -= serverTimeManager_1.default.serverTimeOffset;\n }\n if (user.status.was_online) {\n user.status.was_online -= serverTimeManager_1.default.serverTimeOffset;\n }\n }\n user.sortStatus = this.getUserStatusForSort(user.status);\n utils_1.$rootScope.$broadcast('user_update', userID);\n } //////else console.warn('No user by id:', userID);\n break;\n case 'updateUserPhoto':\n var userID = update.user_id;\n var user = this.users[userID];\n if (user) {\n this.forceUserOnline(userID);\n if (!user.photo) {\n user.photo = update.photo;\n }\n else {\n utils_1.safeReplaceObject(user.photo, update.photo);\n }\n if (this.cachedPhotoLocations[userID] !== undefined) {\n utils_1.safeReplaceObject(this.cachedPhotoLocations[userID], update.photo ?\n update.photo : { empty: true });\n }\n utils_1.$rootScope.$broadcast('user_update', userID);\n }\n else\n console.warn('No user by id:', userID);\n break;\n case 'updateContactLink':\n this.onContactUpdated(update.user_id, update.my_link._ == 'contactLinkContact');\n break;\n }\n });\n }\n /* public fillContacts () {\n if(this.contactsFillPromise) {\n return this.contactsFillPromise;\n }\n \n return this.contactsFillPromise = MTProto.apiManager.invokeApi('contacts.getContacts', {\n hash: 0\n }).then((result: any) => {\n var userID, searchText;\n var i;\n this.contactsList = [];\n this.saveApiUsers(result.users);\n \n for(var i = 0; i < result.contacts.length; i++) {\n userID = result.contacts[i].user_id\n this.contactsList.push(userID);\n //SearchIndexManager.indexObject(userID, getUserSearchText(userID), contactsIndex); WARNING\n }\n \n return this.contactsList;\n })\n } */\n getUserSearchText(id) {\n var user = this.users[id];\n if (!user) {\n return false;\n }\n var serviceText = '';\n if (user.pFlags.self) {\n serviceText = 'user_name_saved_msgs_raw';\n }\n return (user.first_name || '') +\n ' ' + (user.last_name || '') +\n ' ' + (user.phone || '') +\n ' ' + (user.username || '') +\n ' ' + serviceText;\n }\n /* function getContacts (query) {\n return fillContacts().then(function (contactsList) {\n if (angular.isString(query) && query.length) {\n var results = SearchIndexManager.search(query, contactsIndex)\n var filteredContactsList = []\n \n for (var i = 0; i < contactsList.length; i++) {\n if (results[contactsList[i]]) {\n filteredContactsList.push(contactsList[i])\n }\n }\n contactsList = filteredContactsList\n }\n \n contactsList.sort(function (userID1, userID2) {\n var sortName1 = (users[userID1] || {}.sortName) || ''\n var sortName2 = (users[userID2] || {}.sortName) || ''\n if (sortName1 == sortName2) {\n return 0\n }\n return sortName1 > sortName2 ? 1 : -1\n })\n \n return contactsList\n })\n } */\n resolveUsername(username) {\n return this.usernames[username] || 0;\n }\n saveApiUsers(apiUsers) {\n apiUsers.forEach((user) => this.saveApiUser(user));\n }\n saveApiUser(apiUser, noReplace) {\n if (!utils_1.isObject(apiUser) ||\n noReplace && utils_1.isObject(this.users[apiUser.id]) && this.users[apiUser.id].first_name) {\n return;\n }\n var userID = apiUser.id;\n var result = this.users[userID];\n if (apiUser.pFlags === undefined) {\n apiUser.pFlags = {};\n }\n if (apiUser.pFlags.min) {\n if (result !== undefined) {\n return;\n }\n }\n if (apiUser.phone) {\n //apiUser.rPhone = $filter('phoneNumber')(apiUser.phone); // warning\n }\n apiUser.num = (Math.abs(userID) % 8) + 1;\n if (apiUser.first_name) {\n apiUser.rFirstName = richtextprocessor_1.RichTextProcessor.wrapRichText(apiUser.first_name, { noLinks: true, noLinebreaks: true });\n apiUser.rFullName = apiUser.last_name ? richtextprocessor_1.RichTextProcessor.wrapRichText(apiUser.first_name + ' ' + (apiUser.last_name || ''), { noLinks: true, noLinebreaks: true }) : apiUser.rFirstName;\n }\n else {\n apiUser.rFirstName = richtextprocessor_1.RichTextProcessor.wrapRichText(apiUser.last_name, { noLinks: true, noLinebreaks: true }) || apiUser.rPhone || 'user_first_name_deleted';\n apiUser.rFullName = richtextprocessor_1.RichTextProcessor.wrapRichText(apiUser.last_name, { noLinks: true, noLinebreaks: true }) || apiUser.rPhone || 'user_name_deleted';\n }\n if (apiUser.username) {\n var searchUsername = utils_1.SearchIndexManager.cleanUsername(apiUser.username);\n this.usernames[searchUsername] = userID;\n }\n apiUser.sortName = apiUser.pFlags.deleted ? '' : utils_1.SearchIndexManager.cleanSearchText(apiUser.first_name + ' ' + (apiUser.last_name || ''));\n var nameWords = apiUser.sortName.split(' ');\n var firstWord = nameWords.shift();\n var lastWord = nameWords.pop();\n apiUser.initials = firstWord.charAt(0) + (lastWord ? lastWord.charAt(0) : firstWord.charAt(1));\n if (apiUser.status) {\n if (apiUser.status.expires) {\n apiUser.status.expires -= serverTimeManager_1.default.serverTimeOffset;\n }\n if (apiUser.status.was_online) {\n apiUser.status.was_online -= serverTimeManager_1.default.serverTimeOffset;\n }\n }\n if (apiUser.pFlags.bot) {\n apiUser.sortStatus = -1;\n }\n else {\n apiUser.sortStatus = this.getUserStatusForSort(apiUser.status);\n }\n var result = this.users[userID];\n if (result === undefined) {\n result = this.users[userID] = apiUser;\n }\n else {\n utils_1.safeReplaceObject(result, apiUser);\n }\n utils_1.$rootScope.$broadcast('user_update', userID);\n if (this.cachedPhotoLocations[userID] !== undefined) {\n utils_1.safeReplaceObject(this.cachedPhotoLocations[userID], apiUser &&\n apiUser.photo ? apiUser.photo : { empty: true });\n }\n }\n saveUserAccess(id, accessHash) {\n this.userAccess[id] = accessHash;\n }\n getUserStatusForSort(status) {\n if (status) {\n var expires = status.expires || status.was_online;\n if (expires) {\n return expires;\n }\n var timeNow = utils_1.tsNow(true);\n switch (status._) {\n case 'userStatusRecently':\n return timeNow - 86400 * 3;\n case 'userStatusLastWeek':\n return timeNow - 86400 * 7;\n case 'userStatusLastMonth':\n return timeNow - 86400 * 30;\n }\n }\n return 0;\n }\n getUser(id) {\n if (utils_1.isObject(id)) {\n return id;\n }\n return this.users[id] || { id: id, deleted: true, num: 1, access_hash: this.userAccess[id] };\n }\n getSelf() {\n return this.getUser(this.myID);\n }\n isBot(id) {\n return this.users[id] && this.users[id].pFlags.bot;\n }\n hasUser(id, allowMin) {\n var user = this.users[id];\n return utils_1.isObject(user) && (allowMin || !user.pFlags.min);\n }\n getUserPhoto(id) {\n var user = this.getUser(id);\n if (this.cachedPhotoLocations[id] === undefined) {\n this.cachedPhotoLocations[id] = user && user.photo ? user.photo : { empty: true };\n }\n return this.cachedPhotoLocations[id];\n }\n getUserString(id) {\n var user = this.getUser(id);\n return 'u' + id + (user.access_hash ? '_' + user.access_hash : '');\n }\n getUserInput(id) {\n var user = this.getUser(id);\n if (user.pFlags && user.pFlags.self) {\n return { _: 'inputUserSelf' };\n }\n return {\n _: 'inputUser',\n user_id: id,\n access_hash: user.access_hash || 0\n };\n }\n updateUsersStatuses() {\n var timestampNow = utils_1.tsNow(true);\n for (let i in this.users) {\n let user = this.users[i];\n if (user.status &&\n user.status._ == 'userStatusOnline' &&\n user.status.expires < timestampNow) {\n user.status = user.status.wasStatus || { _: 'userStatusOffline', was_online: user.status.expires };\n delete user.status.wasStatus;\n utils_1.$rootScope.$broadcast('user_update', user.id);\n }\n }\n }\n forceUserOnline(id) {\n if (this.isBot(id)) {\n return;\n }\n var user = this.getUser(id);\n if (user &&\n user.status &&\n user.status._ != 'userStatusOnline' &&\n user.status._ != 'userStatusEmpty') {\n var wasStatus;\n if (user.status._ != 'userStatusOffline') {\n delete user.status.wasStatus;\n wasStatus = utils_1.copy(user.status);\n }\n user.status = {\n _: 'userStatusOnline',\n expires: utils_1.tsNow(true) + 60,\n wasStatus: wasStatus\n };\n user.sortStatus = this.getUserStatusForSort(user.status);\n utils_1.$rootScope.$broadcast('user_update', id);\n }\n }\n wrapForFull(id) {\n var user = this.getUser(id);\n return user;\n }\n /* function importContact (phone, firstName, lastName) {\n return MtpApiManager.invokeApi('contacts.importContacts', {\n contacts: [{\n _: 'inputPhoneContact',\n client_id: '1',\n phone: phone,\n first_name: firstName,\n last_name: lastName\n }],\n replace: false\n }).then(function (importedContactsResult) {\n saveApiUsers(importedContactsResult.users)\n \n var foundUserID = false\n angular.forEach(importedContactsResult.imported, function (importedContact) {\n onContactUpdated(foundUserID = importedContact.user_id, true)\n })\n \n return foundUserID || false\n })\n }\n \n function importContacts (contacts) {\n var inputContacts = [],\n i\n var j\n \n for (i = 0; i < contacts.length; i++) {\n for (j = 0; j < contacts[i].phones.length; j++) {\n inputContacts.push({\n _: 'inputPhoneContact',\n client_id: (i << 16 | j).toString(10),\n phone: contacts[i].phones[j],\n first_name: contacts[i].first_name,\n last_name: contacts[i].last_name\n })\n }\n }\n \n return MtpApiManager.invokeApi('contacts.importContacts', {\n contacts: inputContacts,\n replace: false\n }).then(function (importedContactsResult) {\n saveApiUsers(importedContactsResult.users)\n \n var result = []\n angular.forEach(importedContactsResult.imported, function (importedContact) {\n onContactUpdated(importedContact.user_id, true)\n result.push(importedContact.user_id)\n })\n \n return result\n })\n } */\n deleteContacts(userIDs) {\n var ids = [];\n userIDs.forEach((userID) => {\n ids.push(this.getUserInput(userID));\n });\n return apiManager_1.default.invokeApi('contacts.deleteContacts', {\n id: ids\n }).then(() => {\n userIDs.forEach((userID) => {\n this.onContactUpdated(userID, false);\n });\n });\n }\n getTopPeers() {\n return apiManager_1.default.invokeApi('contacts.getTopPeers', {\n flags: 1,\n correspondents: true,\n offset: 0,\n limit: 5,\n hash: 0,\n }).then((peers) => {\n //console.log(peers);\n this.saveApiUsers(peers.users);\n appChatsManager_1.default.saveApiChats(peers.chats);\n return peers.categories;\n });\n }\n searchContacts(query, limit = 20) {\n return apiManager_1.default.invokeApi('contacts.search', {\n q: query,\n limit\n }).then((peers) => {\n //console.log(peers);\n this.saveApiUsers(peers.users);\n appChatsManager_1.default.saveApiChats(peers.chats);\n return peers;\n });\n }\n onContactUpdated(userID, isContact) {\n userID = parseInt('' + userID);\n if (Array.isArray(this.contactsList)) {\n var curPos = this.contactsList.indexOf(userID);\n var curIsContact = curPos != -1;\n if (isContact != curIsContact) {\n if (isContact) {\n this.contactsList.push(userID);\n utils_1.SearchIndexManager.indexObject(userID, this.getUserSearchText(userID), this.contactsIndex);\n }\n else {\n this.contactsList.splice(curPos, 1);\n }\n utils_1.$rootScope.$broadcast('contacts_update', userID);\n }\n }\n }\n setUserStatus(userID, offline) {\n if (this.isBot(userID)) {\n return;\n }\n var user = this.users[userID];\n if (user) {\n var status = offline ? {\n _: 'userStatusOffline',\n was_online: utils_1.tsNow(true)\n } : {\n _: 'userStatusOnline',\n expires: utils_1.tsNow(true) + 500\n };\n user.status = status;\n user.sortStatus = this.getUserStatusForSort(user.status);\n utils_1.$rootScope.$broadcast('user_update', userID);\n }\n }\n}\nexports.AppUsersManager = AppUsersManager;\nexports.default = new AppUsersManager();\n" }, { "id": 5, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/misc.ts", "name": "./src/components/misc.ts", "index": 22, "index2": 48, "size": 7241, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../../components/misc", "loc": "44:15-47" }, { "moduleId": 25, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "module": "./src/components/pageIm.ts", "moduleName": "./src/components/pageIm.ts", "type": "cjs require", "userRequest": "./misc", "loc": "14:15-32" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "../../components/misc", "loc": "16:15-47" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "../../components/misc", "loc": "23:15-47" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "./misc", "loc": "13:15-32" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../../components/misc", "loc": "6:15-47" }, { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./components/misc", "loc": "77:63-91" }, { "moduleId": 78, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "module": "./src/components/pageSignUp.ts", "moduleName": "./src/components/pageSignUp.ts", "type": "cjs require", "userRequest": "./misc", "loc": "6:15-32" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "./misc", "loc": "15:15-32" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "./misc", "loc": "17:15-32" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nconst utils_1 = require(\"../lib/utils\");\nlet onRippleClick = function (e) {\n var $circle = this.firstElementChild; //this.querySelector('.c-ripple__circle') as HTMLSpanElement;\n var rect = this.parentElement.getBoundingClientRect();\n var x = e.clientX - rect.left; //x position within the element.\n var y = e.clientY - rect.top;\n /* var x = e.pageX - this.parentElement.offsetLeft;\n var y = e.pageY - this.parentElement.offsetTop - this.parentElement.scrollHeight; */\n $circle.style.top = y + 'px';\n $circle.style.left = x + 'px';\n this.classList.add('active');\n //console.log('onrippleclick', e/* e.pageY, this.parentElement.offsetTop */);\n};\nfunction ripple(elem) {\n /* elem.addEventListener('click', function(e) {\n var $circle = elem.querySelector('.c-ripple__circle') as HTMLSpanElement;\n \n var x = e.pageX - elem.offsetLeft;\n var y = e.pageY - elem.offsetTop;\n \n $circle.style.top = y + 'px';\n $circle.style.left = x + 'px';\n \n elem.classList.add('active');\n }); */\n let r = document.createElement('div');\n r.classList.add('c-ripple');\n let span = document.createElement('span');\n span.classList.add('c-ripple__circle');\n r.append(span);\n elem.append(r);\n r.addEventListener('click', onRippleClick);\n let onEnd = () => {\n r.classList.remove('active');\n };\n for (let type of ['animationend', 'webkitAnimationEnd', 'oanimationend', 'MSAnimationEnd']) {\n r.addEventListener(type, onEnd);\n }\n}\nexports.ripple = ripple;\nfunction putPreloader(elem) {\n const html = `\r\n \r\n \r\n `;\n elem.innerHTML += html;\n}\nexports.putPreloader = putPreloader;\nfunction horizontalMenu(tabs, content, onClick, onTransitionEnd) {\n let hideTimeout = 0;\n let prevTabContent = null;\n let prevId = -1;\n tabs.addEventListener('click', function (e) {\n let target = e.target;\n if (target.tagName != 'LI') {\n target = utils_1.findUpTag(target, 'LI');\n }\n ///////console.log('tabs click:', target);\n if (!target || target.classList.contains('active'))\n return false;\n let prev = tabs.querySelector('li.active');\n prev && prev.classList.remove('active');\n target.classList.add('active');\n let id = utils_1.whichChild(target);\n if (id == prevId)\n return false;\n let tabContent = content.children[id];\n tabContent.classList.add('active');\n /////console.log('mambo rap', prevId, id);\n //content.style.marginLeft = id > 0 ? (-id * 100) + '%' : '';\n let toRight = prevId < id;\n if (prevId != -1) {\n content.style.width = '200%';\n //////console.log('mambo rap setting', toRight);\n content.classList.remove('animated');\n if (toRight) {\n content.classList.add('animated');\n content.style.marginLeft = '-100%';\n }\n else {\n content.style.marginLeft = '-100%';\n setTimeout(() => {\n content.classList.add('animated');\n content.style.marginLeft = '';\n }, 10);\n }\n }\n prevId = id;\n let p = prevTabContent;\n clearTimeout(hideTimeout);\n if (p)\n hideTimeout = setTimeout(() => {\n if (toRight) {\n p.classList.remove('active');\n content.classList.remove('animated');\n content.style.width = '100%';\n }\n /* content.style.marginLeft = '0%';\n content.style.width = '100%'; */\n if (!toRight) {\n p.classList.remove('active');\n content.classList.remove('animated');\n content.style.width = '100%';\n }\n content.style.marginLeft = '';\n if (onTransitionEnd)\n onTransitionEnd();\n }, 200);\n if (onClick)\n onClick(id, tabContent);\n prevTabContent = tabContent;\n });\n}\nexports.horizontalMenu = horizontalMenu;\nfunction getNearestDc() {\n return apiManager_1.default.invokeApi('help.getNearestDc').then((nearestDcResult) => {\n if (nearestDcResult.nearest_dc != nearestDcResult.this_dc) {\n //MTProto.apiManager.baseDcID = nearestDcResult.nearest_dc;\n apiManager_1.default.getNetworker(nearestDcResult.nearest_dc);\n }\n return nearestDcResult;\n });\n}\nexports.getNearestDc = getNearestDc;\nfunction formatPhoneNumber(str) {\n str = str.replace(/\\D/g, '');\n let phoneCode = str.slice(0, 6);\n ////console.log('str', str, phoneCode);\n let sortedCountries = Config.Countries.slice().sort((a, b) => b.phoneCode.length - a.phoneCode.length);\n let country = sortedCountries.find((c) => {\n return c.phoneCode.split(' and ').find((c) => phoneCode.indexOf(c.replace(/\\D/g, '')) == 0);\n });\n let pattern = country ? country.pattern || country.phoneCode : '';\n if (country) {\n pattern.split('').forEach((symbol, idx) => {\n if (symbol == ' ' && str[idx] != ' ' && str.length > idx) {\n str = str.slice(0, idx) + ' ' + str.slice(idx);\n }\n });\n if (country.pattern) {\n str = str.slice(0, country.pattern.length);\n }\n }\n return { formatted: str, country };\n}\nexports.formatPhoneNumber = formatPhoneNumber;\nlet onMouseMove = (e) => {\n let rect = openedMenu.getBoundingClientRect();\n let { clientX, clientY } = e;\n let diffX = clientX >= rect.right ? clientX - rect.right : rect.left - clientX;\n let diffY = clientY >= rect.bottom ? clientY - rect.bottom : rect.top - clientY;\n if (diffX >= 100 || diffY >= 100) {\n openedMenu.classList.remove('active');\n openedMenu.parentElement.classList.remove('menu-open');\n //openedMenu.parentElement.click();\n }\n //console.log('mousemove', diffX, diffY);\n};\nlet openedMenu = null;\nfunction openBtnMenu(menuElement) {\n if (openedMenu) {\n openedMenu.classList.remove('active');\n openedMenu.parentElement.classList.remove('menu-open');\n }\n openedMenu = menuElement;\n openedMenu.classList.add('active');\n openedMenu.parentElement.classList.add('menu-open');\n window.addEventListener('click', () => {\n if (openedMenu) {\n openedMenu.parentElement.classList.remove('menu-open');\n openedMenu.classList.remove('active');\n openedMenu = null;\n }\n window.removeEventListener('mousemove', onMouseMove);\n }, { once: true });\n window.addEventListener('mousemove', onMouseMove);\n}\nexports.openBtnMenu = openBtnMenu;\n" }, { "id": 6, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/storage.ts", "name": "./src/lib/storage.ts", "index": 19, "index2": 19, "size": 1074, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "22:34-55" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "24:34-55" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "../storage", "loc": "14:34-55" }, { "moduleId": 23, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/serverTimeManager.ts", "module": "./src/lib/mtproto/serverTimeManager.ts", "moduleName": "./src/lib/mtproto/serverTimeManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "6:34-55" }, { "moduleId": 36, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/timeManager.ts", "module": "./src/lib/mtproto/timeManager.ts", "moduleName": "./src/lib/mtproto/timeManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "6:34-55" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "14:34-55" }, { "moduleId": 38, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appStickersManager.ts", "module": "./src/lib/appManagers/appStickersManager.ts", "moduleName": "./src/lib/appManagers/appStickersManager.ts", "type": "cjs require", "userRequest": "../storage", "loc": "15:34-55" }, { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./lib/storage", "loc": "67:70-94" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../storage", "loc": "27:34-55" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst config_1 = require(\"./config\");\nclass AppStorage {\n setPrefix(newPrefix) {\n config_1.Storage.prefix(newPrefix);\n }\n noPrefix() {\n config_1.Storage.noPrefix();\n }\n proxy(methodName, ..._args) {\n let args = Array.prototype.slice.call(_args);\n let promise = new Promise((resolve, reject) => {\n args.push((result) => {\n resolve(result);\n });\n config_1.Storage[methodName].apply(config_1.Storage, args);\n });\n return promise;\n }\n get(...args) {\n return this.proxy('get', ...args);\n }\n set(...args) {\n //console.trace(...args);\n return this.proxy('set', ...args);\n }\n remove(...args) {\n return this.proxy('remove', ...args);\n }\n clear(...args) {\n return this.proxy('clear', ...args);\n }\n constructor() {\n if (config_1.Modes.test) {\n this.setPrefix('t_');\n }\n }\n}\nexports.default = new AppStorage();\n" }, { "id": 7, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/cryptoworker.ts", "name": "./src/lib/crypto/cryptoworker.ts", "index": 31, "index2": 24, "size": 6765, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "issuerId": 77, "issuerName": "./src/components/pageAuthCode.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 278, "building": 994, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/crypto/cryptoworker", "loc": "16:39-76" }, { "moduleId": 41, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "module": "./src/lib/mtproto/passwordManager.ts", "moduleName": "./src/lib/mtproto/passwordManager.ts", "type": "cjs require", "userRequest": "../crypto/cryptoworker", "loc": "17:39-72" }, { "moduleId": 43, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/rsaKeysManager.ts", "module": "./src/lib/mtproto/rsaKeysManager.ts", "moduleName": "./src/lib/mtproto/rsaKeysManager.ts", "type": "cjs require", "userRequest": "../crypto/cryptoworker", "loc": "17:39-72" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "../crypto/cryptoworker", "loc": "23:39-72" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../crypto/cryptoworker", "loc": "26:39-72" }, { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "../lib/crypto/cryptoworker", "loc": "19:39-76" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/crypto/cryptoworker", "loc": "22:39-76" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "../lib/crypto/cryptoworker", "loc": "16:39-76" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"../bin_utils\");\nclass CryptoWorker {\n // @ts-ignore\n // private webCrypto = Config.Modes.webcrypto && window.crypto && (window.crypto.subtle || window.crypto.webkitSubtle); /* || window.msCrypto && window.msCrypto.subtle*/\n // private useSha1Crypto = this.webCrypto && this.webCrypto.digest !== undefined;\n // private useSha256Crypto = this.webCrypto && this.webCrypto.digest !== undefined;\n constructor() {\n this.webWorker = false;\n this.taskID = 0;\n this.awaiting = {};\n this.pending = [];\n this.debug = false;\n console.log(bin_utils_1.dT(), 'CW constructor');\n if (window.Worker /* && 1 == 2 */) {\n Promise.resolve().then(() => __importStar(require('./crypto.worker.js'))).then((CryptoWebWorker) => {\n //console.log(CryptoWebWorker);\n var tmpWorker = new CryptoWebWorker.default();\n //var tmpWorker = new Worker();\n tmpWorker.onmessage = (e) => {\n if (!this.webWorker) {\n this.webWorker = tmpWorker;\n console.info(bin_utils_1.dT(), 'CW set webWorker');\n this.releasePending();\n }\n else {\n this.finalizeTask(e.data.taskID, e.data.result);\n }\n };\n tmpWorker.onerror = (error) => {\n console.error('CW error', error /* , error.stack */);\n this.webWorker = false;\n };\n });\n }\n }\n finalizeTask(taskID, result) {\n let deferred = this.awaiting[taskID];\n if (deferred !== undefined) {\n this.debug && console.log(bin_utils_1.dT(), 'CW done', deferred.taskName, result);\n deferred.resolve(result);\n delete this.awaiting[taskID];\n }\n }\n performTaskWorker(task, ...args) {\n this.debug && console.log(bin_utils_1.dT(), 'CW start', task, args);\n return new Promise((resolve, reject) => {\n this.awaiting[this.taskID] = { resolve, reject, taskName: task };\n let params = {\n task,\n taskID: this.taskID,\n args\n };\n //(this.webWorker as Worker).postMessage(params);\n this.pending.push(params);\n this.releasePending();\n this.taskID++;\n });\n }\n releasePending() {\n if (this.webWorker) {\n this.pending.forEach(pending => {\n this.webWorker.postMessage(pending);\n });\n this.pending.length = 0;\n }\n }\n sha1Hash(bytes) {\n //if(this.webWorker) {\n return this.performTaskWorker('sha1-hash', bytes);\n //}\n /* if(this.useSha1Crypto) {\n console.error('usesha1crypto');\n // We don't use buffer since typedArray.subarray(...).buffer gives the whole buffer and not sliced one. webCrypto.digest supports typed array\n return new Promise((resolve, reject) => {\n var bytesTyped = Array.isArray(bytes) ? convertToUint8Array(bytes) : bytes;\n // console.log(dT(), 'Native sha1 start')\n \n this.webCrypto.digest({name: 'SHA-1'}, bytesTyped).then((digest: ArrayBuffer) => {\n // console.log(dT(), 'Native sha1 done')\n resolve(digest);\n }, (e: ErrorEvent) => {\n console.error('Crypto digest error', e);\n this.useSha1Crypto = false;\n resolve(sha1HashSync(bytes));\n })\n });\n }\n \n return Promise.resolve(sha1HashSync(bytes)); */\n }\n sha256Hash(bytes) {\n //if(this.webWorker) {\n return this.performTaskWorker('sha256-hash', bytes);\n //}\n /* if(this.useSha256Crypto) {\n return new Promise((resolve, reject) => {\n var bytesTyped = Array.isArray(bytes) ? convertToUint8Array(bytes) : bytes;\n // console.log(dT(), 'Native sha1 start')\n this.webCrypto.digest({name: 'SHA-256'}, bytesTyped).then((digest: ArrayBuffer) => {\n // console.log(dT(), 'Native sha1 done')\n resolve(digest);\n }, (e: ErrorEvent) => {\n console.error('Crypto digest error', e);\n this.useSha256Crypto = false;\n resolve(sha256HashSync(bytes));\n })\n });\n }\n \n return Promise.resolve(sha256HashSync(bytes)); */\n }\n pbkdf2(buffer, salt, iterations) {\n //if(this.webWorker) {\n return this.performTaskWorker('pbkdf2', buffer, salt, iterations);\n //}\n //return hash_pbkdf2(buffer, salt, iterations);\n }\n aesEncrypt(bytes, keyBytes, ivBytes) {\n //if(this.webWorker) {\n return this.performTaskWorker('aes-encrypt', bin_utils_1.convertToArrayBuffer(bytes), bin_utils_1.convertToArrayBuffer(keyBytes), bin_utils_1.convertToArrayBuffer(ivBytes));\n //}\n //return Promise.resolve(convertToArrayBuffer(aesEncryptSync(bytes, keyBytes, ivBytes)));\n }\n aesDecrypt(encryptedBytes, keyBytes, ivBytes) {\n //if(this.webWorker) {\n return this.performTaskWorker('aes-decrypt', encryptedBytes, keyBytes, ivBytes)\n .then(bytes => bin_utils_1.convertToArrayBuffer(bytes));\n //}\n //return Promise.resolve(convertToArrayBuffer(aesDecryptSync(encryptedBytes, keyBytes, ivBytes)));\n }\n rsaEncrypt(publicKey, bytes) {\n return this.performTaskWorker('rsa-encrypt', publicKey, bytes);\n }\n factorize(bytes) {\n bytes = bin_utils_1.convertToByteArray(bytes);\n //if(this.webWorker) {\n return this.performTaskWorker('factorize', bytes);\n //}\n //return Promise.resolve(pqPrimeFactorization(bytes));\n }\n modPow(x, y, m) {\n //if(this.webWorker) {\n return this.performTaskWorker('mod-pow', x, y, m);\n //}\n //return Promise.resolve(bytesModPow(x, y, m));\n }\n gzipUncompress(bytes, toString) {\n //if(this.webWorker) {\n return this.performTaskWorker('unzip', bytes, toString);\n //}\n //return Promise.resolve(gzipUncompress(bytes, toString) as T);\n }\n}\nconst cryptoWorker = new CryptoWorker();\nwindow.CryptoWorker = cryptoWorker;\nexports.default = cryptoWorker;\n" }, { "id": 8, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/polyfill.ts", "name": "./src/lib/polyfill.ts", "index": 39, "index2": 30, "size": 1324, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "31:19-41" }, { "moduleId": 9, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "module": "./src/lib/mtproto/apiFileManager.ts", "moduleName": "./src/lib/mtproto/apiFileManager.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "19:19-41" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "34:19-41" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "15:19-41" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "15:19-41" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "11:19-41" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../polyfill", "loc": "33:19-41" }, { "moduleId": 71, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "module": "./src/lib/mtproto/transports/websocket.ts", "moduleName": "./src/lib/mtproto/transports/websocket.ts", "type": "cjs require", "userRequest": "../../polyfill", "loc": "9:19-44" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"./bin_utils\");\nconst mtproto_1 = require(\"./mtproto/mtproto\");\nfunction logger(prefix) {\n function Log(...args) {\n return console.log(bin_utils_1.dT(), '[' + prefix + ']:', ...args);\n }\n Log.warn = function (...args) {\n return console.warn(bin_utils_1.dT(), '[' + prefix + ']:', ...args);\n };\n Log.info = function (...args) {\n return console.info(bin_utils_1.dT(), '[' + prefix + ']:', ...args);\n };\n Log.error = function (...args) {\n return console.error(bin_utils_1.dT(), '[' + prefix + ']:', ...args);\n };\n Log.trace = function (...args) {\n return console.trace(bin_utils_1.dT(), '[' + prefix + ']:', ...args);\n };\n return Log;\n}\nexports.logger = logger;\n;\nObject.defineProperty(Uint8Array.prototype, 'hex', {\n get: function () {\n return bin_utils_1.bytesToHex([...this]);\n },\n set: function (str) {\n this.set(bin_utils_1.bytesFromHex(str));\n },\n enumerable: true,\n configurable: true\n});\nUint8Array.prototype.randomize = function () {\n mtproto_1.MTProto.secureRandom.nextBytes(this);\n return this;\n};\nUint8Array.prototype.concat = function (...args) {\n return bin_utils_1.bufferConcats(this, ...args);\n};\n" }, { "id": 9, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "name": "./src/lib/mtproto/apiFileManager.ts", "index": 46, "index2": 43, "size": 22788, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "issuerId": 78, "issuerName": "./src/components/pageSignUp.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 78, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "name": "./src/components/pageSignUp.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } } ], "profile": { "factory": 1027, "building": 121, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiFileManager", "loc": "19:41-77" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiFileManager", "loc": "27:41-77" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./apiFileManager", "loc": "24:41-68" }, { "moduleId": 18, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDocsManager.ts", "module": "./src/lib/appManagers/appDocsManager.ts", "moduleName": "./src/lib/appManagers/appDocsManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiFileManager", "loc": "15:41-77" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiFileManager", "loc": "16:41-77" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiFileManager", "loc": "22:41-81" }, { "moduleId": 38, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appStickersManager.ts", "module": "./src/lib/appManagers/appStickersManager.ts", "moduleName": "./src/lib/appManagers/appStickersManager.ts", "type": "cjs require", "userRequest": "../mtproto/apiFileManager", "loc": "17:41-77" }, { "moduleId": 78, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "module": "./src/components/pageSignUp.ts", "moduleName": "./src/components/pageSignUp.ts", "type": "cjs require", "userRequest": "../lib/mtproto/apiFileManager", "loc": "12:41-81" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"../bin_utils\");\nconst idb_1 = __importDefault(require(\"../idb\"));\nconst filemanager_1 = __importDefault(require(\"../filemanager\"));\nconst apiManager_1 = __importDefault(require(\"./apiManager\"));\nconst polyfill_1 = require(\"../polyfill\");\nclass ApiFileManager {\n constructor() {\n this.cachedFs = false;\n this.cachedFsPromise = false;\n this.cachedSavePromises = {};\n this.cachedDownloadPromises = {};\n this.cachedDownloads = {};\n this.downloadPulls = {};\n this.downloadActives = {};\n this.index = 0;\n this.log = polyfill_1.logger('AFM');\n }\n downloadRequest(dcID, cb, activeDelta) {\n if (this.downloadPulls[dcID] === undefined) {\n this.downloadPulls[dcID] = [];\n this.downloadActives[dcID] = 0;\n }\n var downloadPull = this.downloadPulls[dcID];\n let promise = new Promise((resolve, reject) => {\n // WARNING deferred!\n downloadPull.push({ cb: cb, deferred: { resolve, reject }, activeDelta: activeDelta });\n }).catch(() => { });\n setTimeout(() => {\n this.downloadCheck(dcID);\n }, 0);\n return promise;\n }\n downloadCheck(dcID) {\n var downloadPull = this.downloadPulls[dcID];\n var downloadLimit = dcID == 'upload' ? 11 : 5;\n if (this.downloadActives[dcID] >= downloadLimit || !downloadPull || !downloadPull.length) {\n return false;\n }\n var data = downloadPull.shift();\n var activeDelta = data.activeDelta || 1;\n this.downloadActives[dcID] += activeDelta;\n this.index++;\n data.cb()\n .then((result) => {\n this.downloadActives[dcID] -= activeDelta;\n this.downloadCheck(dcID);\n data.deferred.resolve(result);\n }, (error) => {\n if (error) {\n this.log.error('downloadCheck error:', error);\n }\n this.downloadActives[dcID] -= activeDelta;\n this.downloadCheck(dcID);\n data.deferred.reject(error);\n });\n }\n getFileName(location) {\n switch (location._) {\n case 'inputDocumentFileLocation':\n var fileName = (location.file_name || '').split('.');\n var ext = fileName[fileName.length - 1] || '';\n if (location.stickerType == 1 /* && !WebpManager.isWebpSupported() */) { // warning\n ext += 'webp'; /* 'png'; */\n }\n else if (location.stickerType == 2) {\n ext += 'tgs';\n }\n var versionPart = location.version ? ('v' + location.version) : '';\n return (fileName[0] ? fileName[0] + '_' : '') + location.id + versionPart + (ext ? '.' + ext : ext);\n default:\n if (!location.volume_id && !location.file_reference) {\n this.log.trace('Empty location', location);\n }\n var ext = 'jpg';\n if (location.stickerType == 1) {\n ext = 'webp' /* WebpManager.isWebpSupported() ? 'webp' : 'png'*/;\n }\n else if (location.stickerType == 2) {\n ext += 'tgs';\n }\n if (location.volume_id) {\n return location.volume_id + '_' + location.local_id /* + '_' + location.secret */ + '.' + ext;\n }\n else {\n return location.id + '_' + location.access_hash + '.' + ext;\n }\n }\n }\n getTempFileName(file) {\n var size = file.size || -1;\n var random = bin_utils_1.nextRandomInt(0xFFFFFFFF);\n return '_temp' + random + '_' + size;\n }\n getCachedFile(location) {\n if (!location) {\n return false;\n }\n var fileName = this.getFileName(location);\n return this.cachedDownloads[fileName] || false;\n }\n getFileStorage() {\n if (!Config.Modes.memory_only) {\n /* if(TmpfsFileStorage.isAvailable()) {\n return TmpfsFileStorage;\n } */\n if (idb_1.default.isAvailable()) {\n return idb_1.default;\n }\n }\n return idb_1.default /* MemoryFileStorage */;\n }\n saveSmallFile(location, bytes) {\n var fileName = this.getFileName(location);\n if (!this.cachedSavePromises[fileName]) {\n this.cachedSavePromises[fileName] = this.getFileStorage().saveFile(fileName, bytes).then((blob) => {\n return this.cachedDownloads[fileName] = blob;\n }, (error) => {\n delete this.cachedSavePromises[fileName];\n });\n }\n return this.cachedSavePromises[fileName];\n }\n downloadSmallFile(location, options = {}) {\n if (!filemanager_1.default.isAvailable()) {\n return Promise.reject({ type: 'BROWSER_BLOB_NOT_SUPPORTED' });\n }\n //this.log('downloadSmallFile', location, options);\n let dcID = options.dcID || location.dc_id;\n let mimeType = options.mimeType || 'image/jpeg';\n var fileName = this.getFileName(location);\n var cachedPromise = this.cachedSavePromises[fileName] || this.cachedDownloadPromises[fileName];\n //this.log('downloadSmallFile!', location, options, fileName, cachedPromise);\n if (cachedPromise) {\n return cachedPromise;\n }\n var fileStorage = this.getFileStorage();\n return this.cachedDownloadPromises[fileName] = fileStorage.getFile(fileName).then((blob) => {\n return this.cachedDownloads[fileName] = blob;\n }, () => {\n var downloadPromise = this.downloadRequest(dcID, () => {\n var inputLocation = location;\n if (!inputLocation._ || inputLocation._ == 'fileLocation') {\n inputLocation = Object.assign({}, location, { _: 'inputFileLocation' });\n }\n let params = {\n flags: 0,\n location: inputLocation,\n offset: 0,\n limit: 1024 * 1024\n };\n //this.log('next small promise', params);\n return apiManager_1.default.invokeApi('upload.getFile', params, {\n dcID: dcID,\n fileDownload: true,\n noErrorBox: true\n });\n }, dcID);\n var processDownloaded = (bytes) => {\n //this.log('processDownloaded', location, bytes);\n return Promise.resolve(bytes);\n /* if(!location.sticker || WebpManager.isWebpSupported()) {\n return qSync.when(bytes);\n }\n \n return WebpManager.getPngBlobFromWebp(bytes); */\n };\n return fileStorage.getFileWriter(fileName, mimeType).then((fileWriter) => {\n return downloadPromise.then((result) => {\n return processDownloaded(result.bytes).then((proccessedResult) => {\n return filemanager_1.default.write(fileWriter, proccessedResult).then(() => {\n return this.cachedDownloads[fileName] = fileWriter.finalize();\n });\n });\n });\n });\n });\n }\n getDownloadedFile(location, size) {\n var fileStorage = this.getFileStorage();\n var fileName = typeof (location) !== 'string' ? this.getFileName(location) : location;\n //console.log('getDownloadedFile', location, fileName);\n return fileStorage.getFile(fileName, size);\n }\n downloadFile(dcID, location, size, options = {}) {\n if (!filemanager_1.default.isAvailable()) {\n return Promise.reject({ type: 'BROWSER_BLOB_NOT_SUPPORTED' });\n }\n /* var processSticker = false;\n if(location.sticker && !WebpManager.isWebpSupported()) {\n if(options.toFileEntry || size > 524288) {\n delete location.sticker;\n } else {\n processSticker = true;\n options.mime = 'image/png';\n }\n } */\n // this.log('Dload file', dcID, location, size)\n var fileName = this.getFileName(location);\n var toFileEntry = options.toFileEntry || null;\n var cachedPromise = this.cachedSavePromises[fileName] || this.cachedDownloadPromises[fileName];\n var fileStorage = this.getFileStorage();\n //this.log('downloadFile', fileStorage.name, fileName, fileName.length, location, arguments);\n if (cachedPromise) {\n if (toFileEntry) {\n /* let blob = await cachedPromise;\n return FileManager.copy(blob, toFileEntry) as Promise; */\n return cachedPromise.then((blob) => {\n return filemanager_1.default.copy(blob, toFileEntry);\n });\n }\n //this.log('downloadFile cachedPromise');\n if (size) {\n /* let blob = await cachedPromise;\n if(blob.size < size) {\n this.log('downloadFile need to deleteFile, wrong size:', blob.size, size);\n await this.deleteFile(location);\n } else {\n return cachedPromise;\n } */\n return cachedPromise.then((blob) => {\n if (blob.size < size) {\n this.log('downloadFile need to deleteFile, wrong size:', blob.size, size);\n return this.deleteFile(location).then(() => {\n return this.downloadFile(dcID, location, size, options);\n }).catch(() => {\n return this.downloadFile(dcID, location, size, options);\n });\n }\n else {\n //return cachedPromise;\n return blob;\n }\n });\n }\n else {\n return cachedPromise;\n }\n }\n //this.log('arriba');\n //var deferred = $q.defer()\n let deferredHelper = { notify: () => { } };\n let deferred = new Promise((resolve, reject) => {\n deferredHelper.resolve = resolve;\n deferredHelper.reject = reject;\n });\n Object.assign(deferred, deferredHelper);\n //return;\n var canceled = false;\n var resolved = false;\n var mimeType = options.mimeType || 'image/jpeg', cacheFileWriter;\n var errorHandler = (error) => {\n deferred.reject(error);\n errorHandler = () => { };\n if (cacheFileWriter && (!error || error.type != 'DOWNLOAD_CANCELED')) {\n cacheFileWriter.truncate(0);\n }\n };\n fileStorage.getFile(fileName, size).then((blob) => __awaiter(this, void 0, void 0, function* () {\n //this.log('is that i wanted');\n if (blob.size < size) {\n this.log('downloadFile need to deleteFile 2, wrong size:', blob.size, size);\n yield this.deleteFile(location);\n throw false;\n }\n if (toFileEntry) {\n filemanager_1.default.copy(blob, toFileEntry).then(() => {\n deferred.resolve();\n }, errorHandler);\n }\n else {\n deferred.resolve(this.cachedDownloads[fileName] = blob);\n }\n //}, () => {\n })).catch(() => {\n //this.log('not i wanted');\n //var fileWriterPromise = toFileEntry ? FileManager.getFileWriter(toFileEntry) : fileStorage.getFileWriter(fileName, mimeType);\n var fileWriterPromise = toFileEntry ? Promise.resolve(toFileEntry) : fileStorage.getFileWriter(fileName, mimeType);\n var processDownloaded = (bytes) => {\n return Promise.resolve(bytes);\n /* if(!processSticker) {\n return Promise.resolve(bytes);\n }\n \n return WebpManager.getPngBlobFromWebp(bytes); */\n };\n fileWriterPromise.then((fileWriter) => {\n cacheFileWriter = fileWriter;\n var limit = options.limitPart || 524288, offset;\n var startOffset = 0;\n var writeFilePromise = Promise.resolve(), writeFileDeferred;\n if (fileWriter.length) {\n startOffset = fileWriter.length;\n if (startOffset >= size) {\n if (toFileEntry) {\n deferred.resolve();\n }\n else {\n deferred.resolve(this.cachedDownloads[fileName] = fileWriter.finalize());\n }\n return;\n }\n fileWriter.seek(startOffset);\n deferred.notify({ done: startOffset, total: size });\n /////this.log('deferred notify 1:', {done: startOffset, total: size});\n }\n for (offset = startOffset; offset < size; offset += limit) {\n //writeFileDeferred = $q.defer();\n let writeFileDeferredHelper = {};\n writeFileDeferred = new Promise((resolve, reject) => {\n writeFileDeferredHelper.resolve = resolve;\n writeFileDeferredHelper.reject = reject;\n });\n Object.assign(writeFileDeferred, writeFileDeferredHelper);\n ////this.log('offset:', startOffset);\n ;\n ((isFinal, offset, writeFileDeferred, writeFilePromise) => {\n return this.downloadRequest(dcID, () => {\n if (canceled) {\n return Promise.resolve();\n }\n return apiManager_1.default.invokeApi('upload.getFile', {\n flags: 0,\n location: location,\n offset: offset,\n limit: limit\n }, {\n dcID: dcID,\n fileDownload: true,\n singleInRequest: 'safari' in window\n });\n }, dcID).then((result) => {\n writeFilePromise.then(() => {\n if (canceled) {\n return Promise.resolve();\n }\n return processDownloaded(result.bytes).then((processedResult) => {\n return filemanager_1.default.write(fileWriter, processedResult).then(() => {\n writeFileDeferred.resolve();\n }, errorHandler).then(() => {\n if (isFinal) {\n resolved = true;\n if (toFileEntry) {\n deferred.resolve();\n }\n else {\n deferred.resolve(this.cachedDownloads[fileName] = fileWriter.finalize());\n }\n }\n else {\n ////this.log('deferred notify 2:', {done: offset + limit, total: size}, deferred);\n deferred.notify({ done: offset + limit, total: size });\n }\n });\n });\n });\n });\n })(offset + limit >= size, offset, writeFileDeferred, writeFilePromise);\n writeFilePromise = writeFileDeferred;\n }\n });\n });\n deferred.cancel = () => {\n if (!canceled && !resolved) {\n canceled = true;\n delete this.cachedDownloadPromises[fileName];\n errorHandler({ type: 'DOWNLOAD_CANCELED' });\n if (toFileEntry) {\n toFileEntry.abort();\n }\n }\n };\n //console.log(deferred, deferred.notify, deferred.cancel);\n if (!toFileEntry) {\n this.cachedDownloadPromises[fileName] = deferred;\n }\n return deferred;\n }\n deleteFile(fileName) {\n fileName = typeof (fileName) == 'string' ? fileName : this.getFileName(fileName);\n this.log('will delete file:', fileName);\n delete this.cachedDownloadPromises[fileName];\n delete this.cachedDownloads[fileName];\n delete this.cachedSavePromises[fileName];\n return this.getFileStorage().deleteFile(fileName);\n }\n uploadFile(file) {\n var fileSize = file.size, isBigFile = fileSize >= 10485760, canceled = false, resolved = false, doneParts = 0, partSize = 262144, // 256 Kb\n activeDelta = 2;\n if (fileSize > 67108864) {\n partSize = 524288;\n activeDelta = 4;\n }\n else if (fileSize < 102400) {\n partSize = 32768;\n activeDelta = 1;\n }\n var totalParts = Math.ceil(fileSize / partSize);\n var fileID = [bin_utils_1.nextRandomInt(0xFFFFFFFF), bin_utils_1.nextRandomInt(0xFFFFFFFF)];\n //var deferred = $q.defer();\n var _part = 0, resultInputFile = {\n _: isBigFile ? 'inputFileBig' : 'inputFile',\n id: fileID,\n parts: totalParts,\n name: file instanceof File ? file.name : '',\n md5_checksum: ''\n };\n /* let deferred: {\n then?: any,\n resolve?: (input: typeof resultInputFile) => void,\n reject?: (error: any) => void,\n promise?: any,\n \n cancel?: () => void,\n notify?: (details: {done: number, total: number}) => void\n } = {\n \n };\n \n deferred.promise = new Promise((resolve, reject) => {\n deferred.resolve = resolve;\n deferred.reject = reject;\n }); */\n let deferredHelper = {\n notify: (details) => { }\n };\n let deferred = new Promise((resolve, reject) => {\n if (totalParts > 3000) {\n return reject({ type: 'FILE_TOO_BIG' });\n }\n deferredHelper.resolve = resolve;\n deferredHelper.reject = reject;\n //return Promise.resolve();\n });\n Object.assign(deferred, deferredHelper);\n if (totalParts > 3000) {\n return deferred;\n }\n let errorHandler = (error) => {\n this.log.error('Up Error', error);\n deferred.reject(error);\n canceled = true;\n errorHandler = () => { };\n };\n let method = isBigFile ? 'upload.saveBigFilePart' : 'upload.saveFilePart';\n for (let offset = 0; offset < fileSize; offset += partSize) {\n let part = _part++; // 0, 1\n this.downloadRequest('upload', () => {\n return new Promise((uploadResolve, uploadReject) => {\n var reader = new FileReader();\n var blob = file.slice(offset, offset + partSize);\n reader.onloadend = (e) => {\n if (canceled) {\n uploadReject();\n return;\n }\n if (e.target.readyState != FileReader.DONE) {\n this.log.error('wrong readyState!');\n return;\n }\n //////this.log('Starting to upload file, isBig:', isBigFile, fileID, part, e.target.result);\n apiManager_1.default.invokeApi(method, {\n file_id: fileID,\n file_part: part,\n file_total_parts: totalParts,\n bytes: e.target.result\n }, {\n startMaxLength: partSize + 256,\n fileUpload: true,\n singleInRequest: true\n }).then((result) => {\n doneParts++;\n uploadResolve();\n //////this.log('Progress', doneParts * partSize / fileSize);\n if (doneParts >= totalParts) {\n deferred.resolve(resultInputFile);\n resolved = true;\n }\n else {\n deferred.notify({ done: doneParts * partSize, total: fileSize });\n }\n }, errorHandler);\n };\n reader.readAsArrayBuffer(blob);\n });\n }, activeDelta);\n }\n deferred.cancel = () => {\n this.log('cancel upload', canceled, resolved);\n if (!canceled && !resolved) {\n canceled = true;\n errorHandler({ type: 'UPLOAD_CANCELED' });\n }\n };\n return deferred;\n }\n}\nexports.ApiFileManager = ApiFileManager;\nexports.default = new ApiFileManager();\n" }, { "id": 10, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPeersManager.ts", "name": "./src/lib/appManagers/appPeersManager.ts", "index": 64, "index2": 56, "size": 5756, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "25:42-70" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "26:42-70" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "9:42-70" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "19:42-70" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "12:42-70" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "11:42-70" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "./appPeersManager", "loc": "6:42-70" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appPeersManager", "loc": "16:42-82" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nconst utils_1 = require(\"../utils\");\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\n// https://github.com/eelcohn/Telegram-API/wiki/Calculating-color-for-a-Telegram-user-on-IRC\n/*\n HTML-color IRC-color Description\n #c03d33 4 red\n #4fad2d 3 green\n #d09306 7 yellow\n #168acd 10 blue\n #8544d6 6 purple\n #cd4073 13 pink\n #2996ad 11 sea\n #ce671b 5 orange\n */\nconst DialogColorsFg = ['#c03d33', '#4fad2d', '#d09306', '#168acd', '#8544d6', '#cd4073', '#2996ad', '#ce671b'];\nconst DialogColors = ['#e17076', '#7bc862', '#e5ca77', '#65AADD', '#a695e7', '#ee7aae', '#6ec9cb', '#faa774'];\nconst DialogColorsMap = [0, 7, 4, 1, 6, 3, 5];\nconst AppPeersManager = {\n getPeerPhoto: (peerID) => {\n return peerID > 0\n ? appUsersManager_1.default.getUserPhoto(peerID)\n : appChatsManager_1.default.getChatPhoto(-peerID);\n },\n getPeerMigratedTo: (peerID) => {\n if (peerID >= 0) {\n return false;\n }\n var chat = appChatsManager_1.default.getChat(-peerID);\n if (chat && chat.migrated_to && chat.pFlags.deactivated) {\n return AppPeersManager.getPeerID(chat.migrated_to);\n }\n return false;\n },\n getPeerTitle: (peerID, plainText = false) => {\n let peer = {};\n if (!utils_1.isObject(peerID)) {\n peer = AppPeersManager.getPeer(peerID);\n }\n else\n peer = peerID;\n let title = '';\n if (peerID > 0) {\n if (peer.first_name)\n title += peer.first_name;\n if (peer.last_name)\n title += ' ' + peer.last_name;\n if (!title)\n title = peer.pFlags.deleted ? 'Deleted account' : peer.username;\n else\n title = title.trim();\n }\n else {\n title = peer.title;\n }\n return plainText ? title : richtextprocessor_1.RichTextProcessor.wrapEmojiText(title);\n },\n getOutputPeer: (peerID) => {\n if (peerID > 0) {\n return { _: 'peerUser', user_id: peerID };\n }\n var chatID = -peerID;\n if (appChatsManager_1.default.isChannel(chatID)) {\n return { _: 'peerChannel', channel_id: chatID };\n }\n return { _: 'peerChat', chat_id: chatID };\n },\n getPeerString: (peerID) => {\n if (peerID > 0) {\n return appUsersManager_1.default.getUserString(peerID);\n }\n return appChatsManager_1.default.getChatString(-peerID);\n },\n getPeerUsername: (peerID) => {\n if (peerID > 0) {\n return appUsersManager_1.default.getUser(peerID).username || '';\n }\n return appChatsManager_1.default.getChat(-peerID).username || '';\n },\n getPeer: (peerID) => {\n return peerID > 0\n ? appUsersManager_1.default.getUser(peerID)\n : appChatsManager_1.default.getChat(-peerID);\n },\n getPeerID: (peerString) => {\n if (utils_1.isObject(peerString)) {\n return peerString.user_id\n ? peerString.user_id\n : -(peerString.channel_id || peerString.chat_id);\n }\n var isUser = peerString.charAt(0) == 'u';\n var peerParams = peerString.substr(1).split('_');\n return isUser ? peerParams[0] : -peerParams[0] || 0;\n },\n isChannel: (peerID) => {\n return (peerID < 0) && appChatsManager_1.default.isChannel(-peerID);\n },\n isMegagroup: (peerID) => {\n return (peerID < 0) && appChatsManager_1.default.isMegagroup(-peerID);\n },\n isAnyGroup: (peerID) => {\n return (peerID < 0) && !appChatsManager_1.default.isBroadcast(-peerID);\n },\n isBroadcast: (id) => {\n return AppPeersManager.isChannel(id) && !AppPeersManager.isMegagroup(id);\n },\n isBot: (peerID) => {\n return (peerID > 0) && appUsersManager_1.default.isBot(peerID);\n },\n getInputPeerByID: (peerID) => {\n if (!peerID) {\n return { _: 'inputPeerEmpty' };\n }\n if (peerID < 0) {\n var chatID = -peerID;\n if (!appChatsManager_1.default.isChannel(chatID)) {\n return {\n _: 'inputPeerChat',\n chat_id: chatID\n };\n }\n else {\n return {\n _: 'inputPeerChannel',\n channel_id: chatID,\n access_hash: appChatsManager_1.default.getChat(chatID).access_hash || 0\n };\n }\n }\n return {\n _: 'inputPeerUser',\n user_id: peerID,\n access_hash: appUsersManager_1.default.getUser(peerID).access_hash || 0\n };\n },\n getPeerColorByID: (peerID, pic = true) => {\n let idx = DialogColorsMap[(peerID < 0 ? -peerID : peerID) % 7];\n let color = (pic ? DialogColors : DialogColorsFg)[idx];\n return color;\n },\n getPeerSearchText: (peerID) => {\n var text;\n if (peerID > 0) {\n text = '%pu ' + appUsersManager_1.default.getUserSearchText(peerID);\n }\n else if (peerID < 0) {\n var chat = appChatsManager_1.default.getChat(-peerID);\n text = '%pg ' + (chat.title || '');\n }\n return text;\n }\n};\nexports.default = AppPeersManager;\n" }, { "id": 11, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "name": "./src/lib/appManagers/appPhotosManager.ts", "index": 65, "index2": 58, "size": 15031, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "23:43-72" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "31:43-72" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appPhotosManager", "loc": "15:43-89" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "9:43-72" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "10:43-72" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "8:43-72" }, { "moduleId": 49, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebPagesManager.ts", "module": "./src/lib/appManagers/appWebPagesManager.ts", "moduleName": "./src/lib/appManagers/appWebPagesManager.ts", "type": "cjs require", "userRequest": "./appPhotosManager", "loc": "7:43-72" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appPhotosManager", "loc": "11:43-84" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst utils_1 = require(\"../utils\");\nconst filemanager_1 = __importDefault(require(\"../filemanager\"));\nconst bin_utils_1 = require(\"../bin_utils\");\nconst apiFileManager_1 = __importDefault(require(\"../mtproto/apiFileManager\"));\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nclass AppPhotosManager {\n constructor() {\n this.photos = {};\n this.windowW = document.body.scrollWidth;\n this.windowH = document.body.scrollHeight;\n window.addEventListener('resize', (e) => {\n this.windowW = document.body.scrollWidth;\n this.windowH = document.body.scrollHeight;\n //console.log(`Set windowW, windowH: ${this.windowW}x${this.windowH}`);\n });\n /* $rootScope.openPhoto = openPhoto\n $rootScope.preloadPhoto = preloadPhoto; */\n }\n savePhoto(apiPhoto, context) {\n if (context) {\n Object.assign(apiPhoto, context);\n }\n if (!apiPhoto.id) {\n console.warn('no apiPhoto.id', apiPhoto);\n }\n else\n this.photos[apiPhoto.id] = apiPhoto;\n if (!('sizes' in apiPhoto))\n return;\n apiPhoto.sizes.forEach((photoSize) => {\n if (photoSize._ == 'photoCachedSize') {\n apiFileManager_1.default.saveSmallFile(photoSize.location, photoSize.bytes);\n console.log('clearing photo cached size', apiPhoto);\n // Memory\n photoSize.size = photoSize.bytes.length;\n delete photoSize.bytes;\n photoSize._ = 'photoSize';\n }\n });\n }\n choosePhotoSize(photo, width = 0, height = 0) {\n if (Config.Navigator.retina) {\n width *= 2;\n height *= 2;\n }\n /*\n s\tbox\t100x100\n m\tbox\t320x320\n x\tbox\t800x800\n y\tbox\t1280x1280\n w\tbox\t2560x2560\n a\tcrop\t160x160\n b\tcrop\t320x320\n c\tcrop\t640x640\n d\tcrop\t1280x1280 */\n let bestPhotoSize = { _: 'photoSizeEmpty' };\n let bestDiff = 0xFFFFFF;\n //console.log('choosePhotoSize', photo);\n let sizes = photo.sizes || photo.thumbs;\n if (!sizes)\n return bestPhotoSize;\n sizes.forEach((photoSize) => {\n if (!photoSize.w || !photoSize.h)\n return;\n let diff = Math.abs(photoSize.w * photoSize.h - width * height);\n if (diff < bestDiff) {\n bestPhotoSize = photoSize;\n bestDiff = diff;\n }\n //console.log('diff', diff, photoSize, bestPhotoSize);\n });\n //console.log('choosing', photo, width, height, bestPhotoSize);\n return bestPhotoSize;\n }\n getUserPhotos(userID, maxID, limit) {\n var inputUser = appUsersManager_1.default.getUserInput(userID);\n return apiManager_1.default.invokeApi('photos.getUserPhotos', {\n user_id: inputUser,\n offset: 0,\n limit: limit || 20,\n max_id: maxID || 0\n }).then((photosResult) => {\n appUsersManager_1.default.saveApiUsers(photosResult.users);\n var photoIDs = [];\n var context = { user_id: userID };\n for (var i = 0; i < photosResult.photos.length; i++) {\n this.savePhoto(photosResult.photos[i], context);\n photoIDs.push(photosResult.photos[i].id);\n }\n return {\n count: photosResult.count || photosResult.photos.length,\n photos: photoIDs\n };\n });\n }\n setAttachmentPreview(bytes, div, isSticker = false, background = false) {\n //image.src = \"data:image/jpeg;base64,\" + bytesToBase64(photo.sizes[0].bytes);\n //photo.sizes[0].bytes = new Uint8Array([...photo.sizes[0].bytes].reverse());\n let arr;\n if (!isSticker) {\n arr = AppPhotosManager.jf.concat(bytes.slice(3), AppPhotosManager.Df);\n arr[164] = bytes[1];\n arr[166] = bytes[2];\n }\n else {\n arr = bytes;\n }\n //console.log('setAttachmentPreview', bytes, arr, div, isSticker);\n let blob = new Blob([arr], { type: \"image/jpeg\" });\n if (background) {\n div.style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';\n }\n else {\n let image = new Image();\n image.src = URL.createObjectURL(blob);\n image.style.width = '100%';\n image.style.height = '100%';\n div.append(image);\n }\n }\n setAttachmentSize(photoID, div, boxWidth = 380, boxHeight = 380, isSticker = false) {\n let photo = /* MTDocument | MTPhoto */ null;\n if (typeof (photoID) === 'string') {\n photo = this.photos[photoID];\n if (!photo)\n return { _: 'photoEmpty' };\n }\n else {\n photo = photoID;\n }\n let photoSize = this.choosePhotoSize(photo, boxWidth, boxHeight);\n //console.log('setAttachmentSize', photo, photo.sizes[0].bytes, div);\n let sizes = photo.sizes || photo.thumbs;\n if (sizes && sizes[0].bytes) {\n this.setAttachmentPreview(sizes[0].bytes, div, isSticker);\n }\n if (photo._ == 'document' /* && photo.type != 'video' */ /* && photo.type != 'gif' */) {\n let { w, h } = utils_1.calcImageInBox(photo.w || 512, photo.h || 512, boxWidth, boxHeight);\n div.style.width = w + 'px';\n div.style.height = h + 'px';\n }\n else {\n let { w, h } = utils_1.calcImageInBox(photoSize.w || 100, photoSize.h || 100, boxWidth, boxHeight);\n div.style.width = w + 'px';\n div.style.height = h + 'px';\n }\n return photoSize;\n }\n preloadPhoto(photoID, photoSize) {\n return __awaiter(this, void 0, void 0, function* () {\n let photo = null;\n if (typeof (photoID) === 'string') {\n photo = this.photos[photoID];\n if (!photo)\n return Promise.reject();\n }\n else {\n photo = photoID;\n }\n if (!photoSize) {\n let fullWidth = this.windowW /* - (Config.Mobile ? 20 : 32) */;\n let fullHeight = this.windowH /* - (Config.Mobile ? 150 : 116) */;\n photoSize = this.choosePhotoSize(photo, fullWidth, fullHeight);\n }\n if (photoSize && photoSize._ != 'photoSizeEmpty') {\n photoSize.preloaded = true;\n // maybe it's a thumb\n let isPhoto = photoSize.size && photo.access_hash && photo.file_reference;\n let location = isPhoto ? {\n _: photo._ == 'document' ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference,\n thumb_size: photoSize.type\n } : photoSize.location;\n /* if(overwrite) {\n await apiFileManager.deleteFile(location);\n console.log('Photos deleted file!');\n } */\n if (isPhoto /* && photoSize.size >= 1e6 */) {\n //console.log('Photos downloadFile exec', photo);\n /* let promise = apiFileManager.downloadFile(photo.dc_id, location, photoSize.size);\n \n let blob = await promise;\n if(blob.size < photoSize.size && overwrite) {\n await apiFileManager.deleteFile(location);\n console.log('Photos deleted file!');\n return apiFileManager.downloadFile(photo.dc_id, location, photoSize.size);\n }\n \n return blob; */\n return apiFileManager_1.default.downloadFile(photo.dc_id, location, photoSize.size);\n }\n else {\n //console.log('Photos downloadSmallFile exec', photo, location);\n return apiFileManager_1.default.downloadSmallFile(location);\n }\n }\n else\n return Promise.reject('no photoSize');\n });\n }\n getPhoto(photoID) {\n return this.photos[photoID] || { _: 'photoEmpty' };\n }\n wrapForHistory(photoID, options = {}) {\n var photo = utils_1.copy(this.photos[photoID]) || { _: 'photoEmpty' };\n var width = options.website ? 64 : Math.min(this.windowW - 80, Config.Mobile ? 210 : 260);\n var height = options.website ? 64 : Math.min(this.windowH - 100, Config.Mobile ? 210 : 260);\n var thumbPhotoSize = this.choosePhotoSize(photo, width, height);\n var thumb = {\n width: width,\n height: height\n };\n if (options.website && Config.Mobile) {\n width = 50;\n height = 50;\n }\n // console.log('chosen photo size', photoID, thumbPhotoSize)\n if (thumbPhotoSize && thumbPhotoSize._ != 'photoSizeEmpty') {\n var dim = utils_1.calcImageInBox(thumbPhotoSize.w, thumbPhotoSize.h, width, height);\n thumb.width = dim.w;\n thumb.height = dim.h;\n thumb.location = thumbPhotoSize.location;\n thumb.size = thumbPhotoSize.size;\n }\n else {\n thumb.width = 100;\n thumb.height = 100;\n }\n photo.thumb = thumb;\n return photo;\n }\n /* public wrapForFull(photoID: string) {\n var photo = this.wrapForHistory(photoID);\n var fullWidth = document.body.scrollWidth - (Config.Mobile ? 0 : 32);\n var fullHeight = document.body.scrollHeight - (Config.Mobile ? 0 : 116);\n if (!Config.Mobile && fullWidth > 800) {\n fullWidth -= 208;\n }\n var fullPhotoSize = this.choosePhotoSize(photo, fullWidth, fullHeight);\n var full: any = {};\n \n full.width = fullWidth;\n full.height = fullHeight;\n \n if (fullPhotoSize && fullPhotoSize._ != 'photoSizeEmpty') {\n var wh = calcImageInBox(fullPhotoSize.w, fullPhotoSize.h, fullWidth, fullHeight, true);\n full.width = wh.w;\n full.height = wh.h;\n \n full.modalWidth = Math.max(full.width, Math.min(400, fullWidth));\n \n full.location = fullPhotoSize.location;\n full.size = fullPhotoSize.size;\n }\n \n photo.full = full;\n \n return photo;\n } */\n downloadPhoto(photoID) {\n var photo = this.photos[photoID];\n var ext = 'jpg';\n var mimeType = 'image/jpeg';\n var fileName = 'photo' + photoID + '.' + ext;\n var fullWidth = this.windowW;\n var fullHeight = this.windowH;\n var fullPhotoSize = this.choosePhotoSize(photo, fullWidth, fullHeight);\n var inputFileLocation = {\n // @ts-ignore\n _: photo._ == 'document' ? 'inputDocumentFileLocation' : 'inputPhotoFileLocation',\n id: photo.id,\n access_hash: photo.access_hash,\n file_reference: photo.file_reference,\n thumb_size: fullPhotoSize.type\n };\n try { // photo.dc_id, location, photoSize.size\n let writer = filemanager_1.default.chooseSaveFile(fileName, ext, mimeType, fullPhotoSize.size);\n writer.ready.then(() => {\n console.log('ready');\n apiFileManager_1.default.downloadFile(photo.dc_id, inputFileLocation, fullPhotoSize.size, {\n mimeType: mimeType,\n toFileEntry: writer\n }).then(() => {\n writer.close();\n //writer.abort();\n console.log('file save done', fileName, ext, mimeType, writer);\n }, (e) => {\n console.log('photo download failed', e);\n });\n });\n }\n catch (err) {\n console.error('err', err);\n var cachedBlob = apiFileManager_1.default.getCachedFile(inputFileLocation);\n if (cachedBlob) {\n return filemanager_1.default.download(cachedBlob, mimeType, fileName);\n }\n apiFileManager_1.default.downloadFile(photo.dc_id, inputFileLocation, fullPhotoSize.size, { mimeType: mimeType })\n .then((blob) => {\n filemanager_1.default.download(blob, mimeType, fileName);\n }, (e) => {\n console.log('photo download failed', e);\n });\n }\n }\n}\nexports.AppPhotosManager = AppPhotosManager;\nAppPhotosManager.jf = new Uint8Array(bin_utils_1.bytesFromHex('ffd8ffe000104a46494600010100000100010000ffdb004300281c1e231e19282321232d2b28303c64413c37373c7b585d4964918099968f808c8aa0b4e6c3a0aadaad8a8cc8ffcbdaeef5ffffff9bc1fffffffaffe6fdfff8ffdb0043012b2d2d3c353c76414176f8a58ca5f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8f8ffc00011080000000003012200021101031101ffc4001f0000010501010101010100000000000000000102030405060708090a0bffc400b5100002010303020403050504040000017d01020300041105122131410613516107227114328191a1082342b1c11552d1f02433627282090a161718191a25262728292a3435363738393a434445464748494a535455565758595a636465666768696a737475767778797a838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae1e2e3e4e5e6e7e8e9eaf1f2f3f4f5f6f7f8f9faffc4001f0100030101010101010101010000000000000102030405060708090a0bffc400b51100020102040403040705040400010277000102031104052131061241510761711322328108144291a1b1c109233352f0156272d10a162434e125f11718191a262728292a35363738393a434445464748494a535455565758595a636465666768696a737475767778797a82838485868788898a92939495969798999aa2a3a4a5a6a7a8a9aab2b3b4b5b6b7b8b9bac2c3c4c5c6c7c8c9cad2d3d4d5d6d7d8d9dae2e3e4e5e6e7e8e9eaf2f3f4f5f6f7f8f9faffda000c03010002110311003f00'));\nAppPhotosManager.Df = bin_utils_1.bytesFromHex('ffd9');\nexports.default = new AppPhotosManager();\n" }, { "id": 12, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appChatsManager.ts", "name": "./src/lib/appManagers/appChatsManager.ts", "index": 61, "index2": 55, "size": 8364, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 4, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "module": "./src/lib/appManagers/appUsersManager.ts", "moduleName": "./src/lib/appManagers/appUsersManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "8:42-70" }, { "moduleId": 10, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPeersManager.ts", "module": "./src/lib/appManagers/appPeersManager.ts", "moduleName": "./src/lib/appManagers/appPeersManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "7:42-70" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "17:42-70" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "38:42-70" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "11:42-70" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./appChatsManager", "loc": "8:42-70" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appChatsManager", "loc": "8:42-82" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nclass AppChatsManager {\n constructor() {\n this.chats = {};\n this.usernames = {};\n this.channelAccess = {};\n this.megagroups = {};\n this.cachedPhotoLocations = {};\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n // console.log('on apiUpdate', update)\n let update = e.detail;\n switch (update._) {\n case 'updateChannel':\n var channelID = update.channel_id;\n utils_1.$rootScope.$broadcast('channel_settings', { channelID: channelID });\n break;\n }\n });\n }\n saveApiChats(apiChats) {\n apiChats.forEach(chat => this.saveApiChat(chat));\n }\n saveApiChat(apiChat) {\n if (!utils_1.isObject(apiChat)) {\n return;\n }\n apiChat.rTitle = apiChat.title || 'chat_title_deleted';\n apiChat.rTitle = richtextprocessor_1.RichTextProcessor.wrapRichText(apiChat.title, { noLinks: true, noLinebreaks: true }) || 'chat_title_deleted';\n var result = this.chats[apiChat.id];\n var titleWords = utils_1.SearchIndexManager.cleanSearchText(apiChat.title || '').split(' ');\n var firstWord = titleWords.shift();\n var lastWord = titleWords.pop();\n apiChat.initials = firstWord.charAt(0) + (lastWord ? lastWord.charAt(0) : firstWord.charAt(1));\n apiChat.num = (Math.abs(apiChat.id >> 1) % 8) + 1;\n if (apiChat.pFlags === undefined) {\n apiChat.pFlags = {};\n }\n if (apiChat.pFlags.min) {\n if (result !== undefined) {\n return;\n }\n }\n if (apiChat._ == 'channel' &&\n apiChat.participants_count === undefined &&\n result !== undefined &&\n result.participants_count) {\n apiChat.participants_count = result.participants_count;\n }\n if (apiChat.username) {\n var searchUsername = utils_1.SearchIndexManager.cleanUsername(apiChat.username);\n this.usernames[searchUsername] = apiChat.id;\n }\n if (result === undefined) {\n result = this.chats[apiChat.id] = apiChat;\n }\n else {\n utils_1.safeReplaceObject(result, apiChat);\n utils_1.$rootScope.$broadcast('chat_update', apiChat.id);\n }\n if (this.cachedPhotoLocations[apiChat.id] !== undefined) {\n utils_1.safeReplaceObject(this.cachedPhotoLocations[apiChat.id], apiChat &&\n apiChat.photo ? apiChat.photo : { empty: true });\n }\n }\n getChat(id) {\n return this.chats[id] || { id: id, deleted: true, access_hash: this.channelAccess[id] };\n }\n hasRights(id, action) {\n if (!(id in this.chats)) {\n return false;\n }\n var chat = this.getChat(id);\n if (chat._ == 'chatForbidden' ||\n chat._ == 'channelForbidden' ||\n chat.pFlags.kicked ||\n chat.pFlags.left) {\n return false;\n }\n if (chat.pFlags.creator) {\n return true;\n }\n switch (action) {\n case 'send':\n if (chat._ == 'channel' &&\n !chat.pFlags.megagroup &&\n !chat.pFlags.editor) {\n return false;\n }\n break;\n case 'edit_title':\n case 'edit_photo':\n case 'invite':\n if (chat._ == 'channel') {\n if (chat.pFlags.megagroup) {\n if (!chat.pFlags.editor &&\n !(action == 'invite' && chat.pFlags.democracy)) {\n return false;\n }\n }\n else {\n return false;\n }\n }\n else {\n if (chat.pFlags.admins_enabled &&\n !chat.pFlags.admin) {\n return false;\n }\n }\n break;\n }\n return true;\n }\n resolveUsername(username) {\n return this.usernames[username] || 0;\n }\n saveChannelAccess(id, accessHash) {\n this.channelAccess[id] = accessHash;\n }\n saveIsMegagroup(id) {\n this.megagroups[id] = true;\n }\n isChannel(id) {\n var chat = this.chats[id];\n if (chat && (chat._ == 'channel' || chat._ == 'channelForbidden') ||\n this.channelAccess[id]) {\n return true;\n }\n return false;\n }\n isMegagroup(id) {\n if (this.megagroups[id]) {\n return true;\n }\n var chat = this.chats[id];\n if (chat && chat._ == 'channel' && chat.pFlags.megagroup) {\n return true;\n }\n return false;\n }\n isBroadcast(id) {\n return this.isChannel(id) && !this.isMegagroup(id);\n }\n getChatInput(id) {\n return id || 0;\n }\n getChannelInput(id) {\n if (!id) {\n return { _: 'inputChannelEmpty' };\n }\n return {\n _: 'inputChannel',\n channel_id: id,\n access_hash: this.getChat(id).access_hash || this.channelAccess[id] || 0\n };\n }\n hasChat(id, allowMin) {\n var chat = this.chats[id];\n return utils_1.isObject(chat) && (allowMin || !chat.pFlags.min);\n }\n getChatPhoto(id) {\n var chat = this.getChat(id);\n if (this.cachedPhotoLocations[id] === undefined) {\n this.cachedPhotoLocations[id] = chat && chat.photo ? chat.photo : { empty: true };\n }\n return this.cachedPhotoLocations[id];\n }\n getChatString(id) {\n var chat = this.getChat(id);\n if (this.isChannel(id)) {\n return (this.isMegagroup(id) ? 's' : 'c') + id + '_' + chat.access_hash;\n }\n return 'g' + id;\n }\n wrapForFull(id, fullChat) {\n var chatFull = utils_1.copy(fullChat);\n var chat = this.getChat(id);\n if (!chatFull.participants_count) {\n chatFull.participants_count = chat.participants_count;\n }\n if (chatFull.participants &&\n chatFull.participants._ == 'chatParticipants') {\n chatFull.participants.participants = this.wrapParticipants(id, chatFull.participants.participants);\n }\n if (chatFull.about) {\n chatFull.rAbout = richtextprocessor_1.RichTextProcessor.wrapRichText(chatFull.about, { noLinebreaks: true });\n }\n chatFull.peerString = this.getChatString(id);\n chatFull.chat = chat;\n return chatFull;\n }\n wrapParticipants(id, participants) {\n var chat = this.getChat(id);\n var myID = appUsersManager_1.default.getSelf().id;\n if (this.isChannel(id)) {\n var isAdmin = chat.pFlags.creator || chat.pFlags.editor || chat.pFlags.moderator;\n participants.forEach((participant) => {\n participant.canLeave = myID == participant.user_id;\n participant.canKick = isAdmin && participant._ == 'channelParticipant';\n // just for order by last seen\n participant.user = appUsersManager_1.default.getUser(participant.user_id);\n });\n }\n else {\n var isAdmin = chat.pFlags.creator || chat.pFlags.admins_enabled && chat.pFlags.admin;\n participants.forEach((participant) => {\n participant.canLeave = myID == participant.user_id;\n participant.canKick = !participant.canLeave && (chat.pFlags.creator ||\n participant._ == 'chatParticipant' && (isAdmin || myID == participant.inviter_id));\n // just for order by last seen\n participant.user = appUsersManager_1.default.getUser(participant.user_id);\n });\n }\n return participants;\n }\n}\nexports.AppChatsManager = AppChatsManager;\nexports.default = new AppChatsManager();\n" }, { "id": 13, "identifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/config.js", "name": "./src/lib/config.js", "index": 20, "index2": 18, "size": 400030, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/storage.ts", "issuerId": 6, "issuerName": "./src/lib/storage.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 6, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/storage.ts", "name": "./src/lib/storage.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 559, "building": 559 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "../config", "loc": "28:28-48" }, { "moduleId": 6, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/storage.ts", "module": "./src/lib/storage.ts", "moduleName": "./src/lib/storage.ts", "type": "cjs require", "userRequest": "./config", "loc": "3:17-36" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "../config", "loc": "13:28-48" }, { "moduleId": 35, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/tl_utils.ts", "module": "./src/lib/tl_utils.ts", "moduleName": "./src/lib/tl_utils.ts", "type": "cjs require", "userRequest": "./config", "loc": "18:28-47" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "../lib/config", "loc": "16:28-52" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../config", "loc": "28:28-48" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "/*!\r\n * Webogram v0.7.0 - messaging web application for MTProto\r\n * https://github.com/zhukov/webogram\r\n * Copyright (C) 2014 Igor Zhukov \r\n * https://github.com/zhukov/webogram/blob/master/LICENSE\r\n */\r\n\r\nConfig = window.Config || {};\r\n\r\n/*\r\n\r\n IMPORTANT NOTICE\r\n ================\r\n\r\n Do not publish your Webogram fork with my app credentials (below), or your application may be blocked.\r\n You can get your own api_id, api_hash at https://my.telegram.org, see manual at https://core.telegram.org/api/obtaining_api_id.\r\n\r\n*/\r\n\r\nConfig.App = {\r\n id: 1025907,\r\n hash: '452b0359b988148995f22ff0f4229750',\r\n version: '0.3.0',\r\n domains: [],\r\n baseDcID: 2\r\n};\r\n\r\nConfig.Modes = {\r\n test: location.search.indexOf('test=1') > 0/* || true */,\r\n debug: location.search.indexOf('debug=1') > 0,\r\n http: location.search.indexOf('http=1') > 0,\r\n ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:' && location.search.indexOf('ssl=0') == -1,\r\n force_mobile: location.search.indexOf('mobile=1') > 0,\r\n force_desktop: location.search.indexOf('desktop=1') > 0,\r\n webcrypto: location.search.indexOf('webcrypto=0') == -1 && 1 == 2,\r\n packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:',\r\n ios_standalone: window.navigator.standalone && navigator.userAgent.match(/iOS|iPhone|iPad/),\r\n chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false,\r\n animations: true,\r\n memory_only: false,\r\n allow_tmpfs: location.search.indexOf('tmpfs=yeahImSureIknowWhatImDoing') > 0 || false,\r\n push_api: location.search.indexOf('push=1') == -1,\r\n multipleConnections: true\r\n};\r\n\r\nConfig.Mobile = false;\r\n\r\nConfig.Navigator = {\r\n nativeEmoji: /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform || ''),\r\n osX: (navigator.platform || '').toLowerCase().indexOf('mac') != -1 ||\r\n (navigator.userAgent || '').toLowerCase().indexOf('mac') != -1,\r\n msie: (navigator.userAgent || '').search(/MSIE | Trident\\/|Edge\\//) != -1,\r\n retina: window.devicePixelRatio > 1,\r\n ffos: navigator.userAgent.search(/mobi.+Gecko/i) != -1,\r\n ffos2p: navigator.userAgent.search(/mobi.+Gecko\\/[34567]/i) != -1,\r\n touch: screen.width <= 768 || ('ontouchstart' in window) || window.DocumentTouch && document instanceof DocumentTouch,\r\n mobile: screen.width && screen.width < 480 || navigator.userAgent.search(/iOS|iPhone OS|Android|BlackBerry|BB10|Series ?[64]0|J2ME|MIDP|opera mini|opera mobi|mobi.+Gecko|Windows Phone/i) != -1\r\n};\r\n\r\nConfig.ExtCredentials = {\r\n gmaps: {\r\n api_key: 'AIzaSyC72t5GDcP-dob20d-ARwSwOQ41-zgbArg'\r\n }\r\n};\r\n\r\n{\r\n /* let img_size = 32;\r\n let side = 52;\r\n let sheetUrl = `assets/img/sheet_apple_${img_size}_`; // #.png\r\n let multiplyX = 100 / 6;\r\n let sheetSizeX = 6 * (img_size + 2); // size of image in pixels\r\n let sheetSizeY = side * (img_size + 2); // size of image in pixels\r\n let sizeX = 100 * (sheetSizeX / img_size);\r\n let sizeY = 100 * (sheetSizeY / img_size);\r\n let splitted = true; */\r\n\r\n let img_size = 64;\r\n let side = 56;\r\n let sheetUrl = `assets/img/sheet_apple_${img_size}`; // #.png\r\n let multiplyX = 100 / side;\r\n let sheetSizeX = side * (img_size + 2); // size of image in pixels\r\n let sheetSizeY = side * (img_size + 2); // size of image in pixels\r\n let sizeX = 100 * (sheetSizeX / img_size);\r\n let sizeY = 100 * (sheetSizeY / img_size);\r\n let splitted = false;\r\n\r\n Config.Emoji = {\r\n img_size,\r\n sheetUrl,\r\n multiplyX,\r\n sheetSizeX,\r\n sheetSizeY,\r\n sizeX,\r\n sizeY,\r\n side,\r\n splitted,\r\n keyCategory: 'category',\r\n keyX: 'sheet_x',\r\n keyY: 'sheet_y',\r\n /* keyCategory: '2',\r\n keyX: '0', // 'sheet_x'\r\n keyY: '1', // 'sheet_y' */\r\n\r\n emoji: {\"#️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":0,\"sort_order\":132},\"*️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":1,\"sort_order\":133},\"0️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":2,\"sort_order\":134},\"1️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":3,\"sort_order\":135},\"2️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":4,\"sort_order\":136},\"3️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":5,\"sort_order\":137},\"4️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":6,\"sort_order\":138},\"5️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":7,\"sort_order\":139},\"6️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":8,\"sort_order\":140},\"7️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":9,\"sort_order\":141},\"8️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":10,\"sort_order\":142},\"9️⃣\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":11,\"sort_order\":143},\"©️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":12,\"sort_order\":129},\"®️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":13,\"sort_order\":130},\"🀄\":{\"category\":\"Activities\",\"sheet_x\":0,\"sheet_y\":14,\"sort_order\":73},\"🃏\":{\"category\":\"Activities\",\"sheet_x\":0,\"sheet_y\":15,\"sort_order\":72},\"🅰️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":16,\"sort_order\":150},\"🅱️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":17,\"sort_order\":152},\"🅾️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":18,\"sort_order\":161},\"🅿️\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":19,\"sort_order\":163},\"🆎\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":20,\"sort_order\":151},\"🆑\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":21,\"sort_order\":153},\"🆒\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":22,\"sort_order\":154},\"🆓\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":23,\"sort_order\":155},\"🆔\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":24,\"sort_order\":157},\"🆕\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":25,\"sort_order\":159},\"🆖\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":26,\"sort_order\":160},\"🆗\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":27,\"sort_order\":162},\"🆘\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":28,\"sort_order\":164},\"🆙\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":29,\"sort_order\":165},\"🆚\":{\"category\":\"Symbols\",\"sheet_x\":0,\"sheet_y\":30,\"sort_order\":166},\"🇦🇨\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":31,\"sort_order\":8},\"🇦🇩\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":32,\"sort_order\":9},\"🇦🇪\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":33,\"sort_order\":10},\"🇦🇫\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":34,\"sort_order\":11},\"🇦🇬\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":35,\"sort_order\":12},\"🇦🇮\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":36,\"sort_order\":13},\"🇦🇱\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":37,\"sort_order\":14},\"🇦🇲\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":38,\"sort_order\":15},\"🇦🇴\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":39,\"sort_order\":16},\"🇦🇶\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":40,\"sort_order\":17},\"🇦🇷\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":41,\"sort_order\":18},\"🇦🇸\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":42,\"sort_order\":19},\"🇦🇹\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":43,\"sort_order\":20},\"🇦🇺\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":44,\"sort_order\":21},\"🇦🇼\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":45,\"sort_order\":22},\"🇦🇽\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":46,\"sort_order\":23},\"🇦🇿\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":47,\"sort_order\":24},\"🇧🇦\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":48,\"sort_order\":25},\"🇧🇧\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":49,\"sort_order\":26},\"🇧🇩\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":50,\"sort_order\":27},\"🇧🇪\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":51,\"sort_order\":28},\"🇧🇫\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":52,\"sort_order\":29},\"🇧🇬\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":53,\"sort_order\":30},\"🇧🇭\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":54,\"sort_order\":31},\"🇧🇮\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":55,\"sort_order\":32},\"🇧🇯\":{\"category\":\"Flags\",\"sheet_x\":0,\"sheet_y\":56,\"sort_order\":33},\"🇧🇱\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":0,\"sort_order\":34},\"🇧🇲\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":1,\"sort_order\":35},\"🇧🇳\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":2,\"sort_order\":36},\"🇧🇴\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":3,\"sort_order\":37},\"🇧🇶\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":4,\"sort_order\":38},\"🇧🇷\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":5,\"sort_order\":39},\"🇧🇸\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":6,\"sort_order\":40},\"🇧🇹\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":7,\"sort_order\":41},\"🇧🇻\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":8,\"sort_order\":42},\"🇧🇼\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":9,\"sort_order\":43},\"🇧🇾\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":10,\"sort_order\":44},\"🇧🇿\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":11,\"sort_order\":45},\"🇨🇦\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":12,\"sort_order\":46},\"🇨🇨\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":13,\"sort_order\":47},\"🇨🇩\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":14,\"sort_order\":48},\"🇨🇫\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":15,\"sort_order\":49},\"🇨🇬\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":16,\"sort_order\":50},\"🇨🇭\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":17,\"sort_order\":51},\"🇨🇮\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":18,\"sort_order\":52},\"🇨🇰\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":19,\"sort_order\":53},\"🇨🇱\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":20,\"sort_order\":54},\"🇨🇲\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":21,\"sort_order\":55},\"🇨🇳\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":22,\"sort_order\":56},\"🇨🇴\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":23,\"sort_order\":57},\"🇨🇵\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":24,\"sort_order\":58},\"🇨🇷\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":25,\"sort_order\":59},\"🇨🇺\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":26,\"sort_order\":60},\"🇨🇻\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":27,\"sort_order\":61},\"🇨🇼\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":28,\"sort_order\":62},\"🇨🇽\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":29,\"sort_order\":63},\"🇨🇾\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":30,\"sort_order\":64},\"🇨🇿\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":31,\"sort_order\":65},\"🇩🇪\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":32,\"sort_order\":66},\"🇩🇬\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":33,\"sort_order\":67},\"🇩🇯\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":34,\"sort_order\":68},\"🇩🇰\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":35,\"sort_order\":69},\"🇩🇲\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":36,\"sort_order\":70},\"🇩🇴\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":37,\"sort_order\":71},\"🇩🇿\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":38,\"sort_order\":72},\"🇪🇦\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":39,\"sort_order\":73},\"🇪🇨\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":40,\"sort_order\":74},\"🇪🇪\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":41,\"sort_order\":75},\"🇪🇬\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":42,\"sort_order\":76},\"🇪🇭\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":43,\"sort_order\":77},\"🇪🇷\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":44,\"sort_order\":78},\"🇪🇸\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":45,\"sort_order\":79},\"🇪🇹\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":46,\"sort_order\":80},\"🇪🇺\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":47,\"sort_order\":81},\"🇫🇮\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":48,\"sort_order\":82},\"🇫🇯\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":49,\"sort_order\":83},\"🇫🇰\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":50,\"sort_order\":84},\"🇫🇲\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":51,\"sort_order\":85},\"🇫🇴\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":52,\"sort_order\":86},\"🇫🇷\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":53,\"sort_order\":87},\"🇬🇦\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":54,\"sort_order\":88},\"🇬🇧\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":55,\"sort_order\":89},\"🇬🇩\":{\"category\":\"Flags\",\"sheet_x\":1,\"sheet_y\":56,\"sort_order\":90},\"🇬🇪\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":0,\"sort_order\":91},\"🇬🇫\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":1,\"sort_order\":92},\"🇬🇬\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":2,\"sort_order\":93},\"🇬🇭\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":3,\"sort_order\":94},\"🇬🇮\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":4,\"sort_order\":95},\"🇬🇱\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":5,\"sort_order\":96},\"🇬🇲\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":6,\"sort_order\":97},\"🇬🇳\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":7,\"sort_order\":98},\"🇬🇵\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":8,\"sort_order\":99},\"🇬🇶\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":9,\"sort_order\":100},\"🇬🇷\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":10,\"sort_order\":101},\"🇬🇸\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":11,\"sort_order\":102},\"🇬🇹\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":12,\"sort_order\":103},\"🇬🇺\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":13,\"sort_order\":104},\"🇬🇼\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":14,\"sort_order\":105},\"🇬🇾\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":15,\"sort_order\":106},\"🇭🇰\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":16,\"sort_order\":107},\"🇭🇲\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":17,\"sort_order\":108},\"🇭🇳\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":18,\"sort_order\":109},\"🇭🇷\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":19,\"sort_order\":110},\"🇭🇹\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":20,\"sort_order\":111},\"🇭🇺\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":21,\"sort_order\":112},\"🇮🇨\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":22,\"sort_order\":113},\"🇮🇩\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":23,\"sort_order\":114},\"🇮🇪\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":24,\"sort_order\":115},\"🇮🇱\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":25,\"sort_order\":116},\"🇮🇲\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":26,\"sort_order\":117},\"🇮🇳\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":27,\"sort_order\":118},\"🇮🇴\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":28,\"sort_order\":119},\"🇮🇶\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":29,\"sort_order\":120},\"🇮🇷\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":30,\"sort_order\":121},\"🇮🇸\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":31,\"sort_order\":122},\"🇮🇹\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":32,\"sort_order\":123},\"🇯🇪\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":33,\"sort_order\":124},\"🇯🇲\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":34,\"sort_order\":125},\"🇯🇴\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":35,\"sort_order\":126},\"🇯🇵\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":36,\"sort_order\":127},\"🇰🇪\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":37,\"sort_order\":128},\"🇰🇬\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":38,\"sort_order\":129},\"🇰🇭\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":39,\"sort_order\":130},\"🇰🇮\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":40,\"sort_order\":131},\"🇰🇲\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":41,\"sort_order\":132},\"🇰🇳\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":42,\"sort_order\":133},\"🇰🇵\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":43,\"sort_order\":134},\"🇰🇷\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":44,\"sort_order\":135},\"🇰🇼\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":45,\"sort_order\":136},\"🇰🇾\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":46,\"sort_order\":137},\"🇰🇿\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":47,\"sort_order\":138},\"🇱🇦\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":48,\"sort_order\":139},\"🇱🇧\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":49,\"sort_order\":140},\"🇱🇨\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":50,\"sort_order\":141},\"🇱🇮\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":51,\"sort_order\":142},\"🇱🇰\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":52,\"sort_order\":143},\"🇱🇷\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":53,\"sort_order\":144},\"🇱🇸\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":54,\"sort_order\":145},\"🇱🇹\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":55,\"sort_order\":146},\"🇱🇺\":{\"category\":\"Flags\",\"sheet_x\":2,\"sheet_y\":56,\"sort_order\":147},\"🇱🇻\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":0,\"sort_order\":148},\"🇱🇾\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":1,\"sort_order\":149},\"🇲🇦\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":2,\"sort_order\":150},\"🇲🇨\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":3,\"sort_order\":151},\"🇲🇩\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":4,\"sort_order\":152},\"🇲🇪\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":5,\"sort_order\":153},\"🇲🇫\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":6,\"sort_order\":154},\"🇲🇬\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":7,\"sort_order\":155},\"🇲🇭\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":8,\"sort_order\":156},\"🇲🇰\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":9,\"sort_order\":157},\"🇲🇱\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":10,\"sort_order\":158},\"🇲🇲\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":11,\"sort_order\":159},\"🇲🇳\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":12,\"sort_order\":160},\"🇲🇴\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":13,\"sort_order\":161},\"🇲🇵\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":14,\"sort_order\":162},\"🇲🇶\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":15,\"sort_order\":163},\"🇲🇷\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":16,\"sort_order\":164},\"🇲🇸\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":17,\"sort_order\":165},\"🇲🇹\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":18,\"sort_order\":166},\"🇲🇺\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":19,\"sort_order\":167},\"🇲🇻\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":20,\"sort_order\":168},\"🇲🇼\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":21,\"sort_order\":169},\"🇲🇽\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":22,\"sort_order\":170},\"🇲🇾\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":23,\"sort_order\":171},\"🇲🇿\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":24,\"sort_order\":172},\"🇳🇦\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":25,\"sort_order\":173},\"🇳🇨\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":26,\"sort_order\":174},\"🇳🇪\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":27,\"sort_order\":175},\"🇳🇫\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":28,\"sort_order\":176},\"🇳🇬\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":29,\"sort_order\":177},\"🇳🇮\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":30,\"sort_order\":178},\"🇳🇱\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":31,\"sort_order\":179},\"🇳🇴\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":32,\"sort_order\":180},\"🇳🇵\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":33,\"sort_order\":181},\"🇳🇷\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":34,\"sort_order\":182},\"🇳🇺\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":35,\"sort_order\":183},\"🇳🇿\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":36,\"sort_order\":184},\"🇴🇲\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":37,\"sort_order\":185},\"🇵🇦\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":38,\"sort_order\":186},\"🇵🇪\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":39,\"sort_order\":187},\"🇵🇫\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":40,\"sort_order\":188},\"🇵🇬\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":41,\"sort_order\":189},\"🇵🇭\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":42,\"sort_order\":190},\"🇵🇰\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":43,\"sort_order\":191},\"🇵🇱\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":44,\"sort_order\":192},\"🇵🇲\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":45,\"sort_order\":193},\"🇵🇳\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":46,\"sort_order\":194},\"🇵🇷\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":47,\"sort_order\":195},\"🇵🇸\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":48,\"sort_order\":196},\"🇵🇹\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":49,\"sort_order\":197},\"🇵🇼\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":50,\"sort_order\":198},\"🇵🇾\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":51,\"sort_order\":199},\"🇶🇦\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":52,\"sort_order\":200},\"🇷🇪\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":53,\"sort_order\":201},\"🇷🇴\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":54,\"sort_order\":202},\"🇷🇸\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":55,\"sort_order\":203},\"🇷🇺\":{\"category\":\"Flags\",\"sheet_x\":3,\"sheet_y\":56,\"sort_order\":204},\"🇷🇼\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":0,\"sort_order\":205},\"🇸🇦\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":1,\"sort_order\":206},\"🇸🇧\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":2,\"sort_order\":207},\"🇸🇨\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":3,\"sort_order\":208},\"🇸🇩\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":4,\"sort_order\":209},\"🇸🇪\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":5,\"sort_order\":210},\"🇸🇬\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":6,\"sort_order\":211},\"🇸🇭\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":7,\"sort_order\":212},\"🇸🇮\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":8,\"sort_order\":213},\"🇸🇯\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":9,\"sort_order\":214},\"🇸🇰\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":10,\"sort_order\":215},\"🇸🇱\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":11,\"sort_order\":216},\"🇸🇲\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":12,\"sort_order\":217},\"🇸🇳\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":13,\"sort_order\":218},\"🇸🇴\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":14,\"sort_order\":219},\"🇸🇷\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":15,\"sort_order\":220},\"🇸🇸\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":16,\"sort_order\":221},\"🇸🇹\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":17,\"sort_order\":222},\"🇸🇻\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":18,\"sort_order\":223},\"🇸🇽\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":19,\"sort_order\":224},\"🇸🇾\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":20,\"sort_order\":225},\"🇸🇿\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":21,\"sort_order\":226},\"🇹🇦\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":22,\"sort_order\":227},\"🇹🇨\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":23,\"sort_order\":228},\"🇹🇩\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":24,\"sort_order\":229},\"🇹🇫\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":25,\"sort_order\":230},\"🇹🇬\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":26,\"sort_order\":231},\"🇹🇭\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":27,\"sort_order\":232},\"🇹🇯\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":28,\"sort_order\":233},\"🇹🇰\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":29,\"sort_order\":234},\"🇹🇱\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":30,\"sort_order\":235},\"🇹🇲\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":31,\"sort_order\":236},\"🇹🇳\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":32,\"sort_order\":237},\"🇹🇴\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":33,\"sort_order\":238},\"🇹🇷\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":34,\"sort_order\":239},\"🇹🇹\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":35,\"sort_order\":240},\"🇹🇻\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":36,\"sort_order\":241},\"🇹🇼\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":37,\"sort_order\":242},\"🇹🇿\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":38,\"sort_order\":243},\"🇺🇦\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":39,\"sort_order\":244},\"🇺🇬\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":40,\"sort_order\":245},\"🇺🇲\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":41,\"sort_order\":246},\"🇺🇳\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":42,\"sort_order\":247},\"🇺🇸\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":43,\"sort_order\":248},\"🇺🇾\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":44,\"sort_order\":249},\"🇺🇿\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":45,\"sort_order\":250},\"🇻🇦\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":46,\"sort_order\":251},\"🇻🇨\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":47,\"sort_order\":252},\"🇻🇪\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":48,\"sort_order\":253},\"🇻🇬\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":49,\"sort_order\":254},\"🇻🇮\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":50,\"sort_order\":255},\"🇻🇳\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":51,\"sort_order\":256},\"🇻🇺\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":52,\"sort_order\":257},\"🇼🇫\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":53,\"sort_order\":258},\"🇼🇸\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":54,\"sort_order\":259},\"🇽🇰\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":55,\"sort_order\":260},\"🇾🇪\":{\"category\":\"Flags\",\"sheet_x\":4,\"sheet_y\":56,\"sort_order\":261},\"🇾🇹\":{\"category\":\"Flags\",\"sheet_x\":5,\"sheet_y\":0,\"sort_order\":262},\"🇿🇦\":{\"category\":\"Flags\",\"sheet_x\":5,\"sheet_y\":1,\"sort_order\":263},\"🇿🇲\":{\"category\":\"Flags\",\"sheet_x\":5,\"sheet_y\":2,\"sort_order\":264},\"🇿🇼\":{\"category\":\"Flags\",\"sheet_x\":5,\"sheet_y\":3,\"sort_order\":265},\"🈁\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":4,\"sort_order\":167},\"🈂️\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":5,\"sort_order\":168},\"🈚\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":6,\"sort_order\":174},\"🈯\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":7,\"sort_order\":171},\"🈲\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":8,\"sort_order\":175},\"🈳\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":9,\"sort_order\":179},\"🈴\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":10,\"sort_order\":178},\"🈵\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":11,\"sort_order\":183},\"🈶\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":12,\"sort_order\":170},\"🈷️\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":13,\"sort_order\":169},\"🈸\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":14,\"sort_order\":177},\"🈹\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":15,\"sort_order\":173},\"🈺\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":16,\"sort_order\":182},\"🉐\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":17,\"sort_order\":172},\"🉑\":{\"category\":\"Symbols\",\"sheet_x\":5,\"sheet_y\":18,\"sort_order\":176},\"🌀\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":19,\"sort_order\":197},\"🌁\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":20,\"sort_order\":49},\"🌂\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":21,\"sort_order\":199},\"🌃\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":22,\"sort_order\":50},\"🌄\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":23,\"sort_order\":52},\"🌅\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":24,\"sort_order\":53},\"🌆\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":25,\"sort_order\":54},\"🌇\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":26,\"sort_order\":55},\"🌈\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":27,\"sort_order\":198},\"🌉\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":28,\"sort_order\":56},\"🌊\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":29,\"sort_order\":210},\"🌋\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":30,\"sort_order\":10},\"🌌\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":31,\"sort_order\":184},\"🌍\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":32,\"sort_order\":1},\"🌎\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":33,\"sort_order\":2},\"🌏\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":34,\"sort_order\":3},\"🌐\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":35,\"sort_order\":4},\"🌑\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":36,\"sort_order\":164},\"🌒\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":37,\"sort_order\":165},\"🌓\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":38,\"sort_order\":166},\"🌔\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":39,\"sort_order\":167},\"🌕\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":40,\"sort_order\":168},\"🌖\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":41,\"sort_order\":169},\"🌗\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":42,\"sort_order\":170},\"🌘\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":43,\"sort_order\":171},\"🌙\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":44,\"sort_order\":172},\"🌚\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":45,\"sort_order\":173},\"🌛\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":46,\"sort_order\":174},\"🌜\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":47,\"sort_order\":175},\"🌝\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":48,\"sort_order\":178},\"🌞\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":49,\"sort_order\":179},\"🌟\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":50,\"sort_order\":182},\"🌠\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":51,\"sort_order\":183},\"🌡️\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":52,\"sort_order\":176},\"🌤️\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":53,\"sort_order\":188},\"🌥️\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":54,\"sort_order\":189},\"🌦️\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":55,\"sort_order\":190},\"🌧️\":{\"category\":\"Travel & Places\",\"sheet_x\":5,\"sheet_y\":56,\"sort_order\":191},\"🌨️\":{\"category\":\"Travel & Places\",\"sheet_x\":6,\"sheet_y\":0,\"sort_order\":192},\"🌩️\":{\"category\":\"Travel & Places\",\"sheet_x\":6,\"sheet_y\":1,\"sort_order\":193},\"🌪️\":{\"category\":\"Travel & Places\",\"sheet_x\":6,\"sheet_y\":2,\"sort_order\":194},\"🌫️\":{\"category\":\"Travel & Places\",\"sheet_x\":6,\"sheet_y\":3,\"sort_order\":195},\"🌬️\":{\"category\":\"Travel & Places\",\"sheet_x\":6,\"sheet_y\":4,\"sort_order\":196},\"🌭\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":5,\"sort_order\":47},\"🌮\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":6,\"sort_order\":49},\"🌯\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":7,\"sort_order\":50},\"🌰\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":8,\"sort_order\":31},\"🌱\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":9,\"sort_order\":116},\"🌲\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":10,\"sort_order\":117},\"🌳\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":11,\"sort_order\":118},\"🌴\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":12,\"sort_order\":119},\"🌵\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":13,\"sort_order\":120},\"🌶️\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":14,\"sort_order\":23},\"🌷\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":15,\"sort_order\":115},\"🌸\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":16,\"sort_order\":107},\"🌹\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":17,\"sort_order\":110},\"🌺\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":18,\"sort_order\":112},\"🌻\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":19,\"sort_order\":113},\"🌼\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":20,\"sort_order\":114},\"🌽\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":21,\"sort_order\":22},\"🌾\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":22,\"sort_order\":121},\"🌿\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":23,\"sort_order\":122},\"🍀\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":24,\"sort_order\":124},\"🍁\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":25,\"sort_order\":125},\"🍂\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":26,\"sort_order\":126},\"🍃\":{\"category\":\"Animals & Nature\",\"sheet_x\":6,\"sheet_y\":27,\"sort_order\":127},\"🍄\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":28,\"sort_order\":29},\"🍅\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":29,\"sort_order\":16},\"🍆\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":30,\"sort_order\":19},\"🍇\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":31,\"sort_order\":1},\"🍈\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":32,\"sort_order\":2},\"🍉\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":33,\"sort_order\":3},\"🍊\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":34,\"sort_order\":4},\"🍋\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":35,\"sort_order\":5},\"🍌\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":36,\"sort_order\":6},\"🍍\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":37,\"sort_order\":7},\"🍎\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":38,\"sort_order\":9},\"🍏\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":39,\"sort_order\":10},\"🍐\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":40,\"sort_order\":11},\"🍑\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":41,\"sort_order\":12},\"🍒\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":42,\"sort_order\":13},\"🍓\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":43,\"sort_order\":14},\"🍔\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":44,\"sort_order\":44},\"🍕\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":45,\"sort_order\":46},\"🍖\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":46,\"sort_order\":40},\"🍗\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":47,\"sort_order\":41},\"🍘\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":48,\"sort_order\":64},\"🍙\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":49,\"sort_order\":65},\"🍚\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":50,\"sort_order\":66},\"🍛\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":51,\"sort_order\":67},\"🍜\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":52,\"sort_order\":68},\"🍝\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":53,\"sort_order\":69},\"🍞\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":54,\"sort_order\":32},\"🍟\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":55,\"sort_order\":45},\"🍠\":{\"category\":\"Food & Drink\",\"sheet_x\":6,\"sheet_y\":56,\"sort_order\":70},\"🍡\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":0,\"sort_order\":76},\"🍢\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":1,\"sort_order\":71},\"🍣\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":2,\"sort_order\":72},\"🍤\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":3,\"sort_order\":73},\"🍥\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":4,\"sort_order\":74},\"🍦\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":5,\"sort_order\":85},\"🍧\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":6,\"sort_order\":86},\"🍨\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":7,\"sort_order\":87},\"🍩\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":8,\"sort_order\":88},\"🍪\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":9,\"sort_order\":89},\"🍫\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":10,\"sort_order\":94},\"🍬\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":11,\"sort_order\":95},\"🍭\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":12,\"sort_order\":96},\"🍮\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":13,\"sort_order\":97},\"🍯\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":14,\"sort_order\":98},\"🍰\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":15,\"sort_order\":91},\"🍱\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":16,\"sort_order\":63},\"🍲\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":17,\"sort_order\":56},\"🍳\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":18,\"sort_order\":54},\"🍴\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":19,\"sort_order\":118},\"🍵\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":20,\"sort_order\":102},\"🍶\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":21,\"sort_order\":103},\"🍷\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":22,\"sort_order\":105},\"🍸\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":23,\"sort_order\":106},\"🍹\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":24,\"sort_order\":107},\"🍺\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":25,\"sort_order\":108},\"🍻\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":26,\"sort_order\":109},\"🍼\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":27,\"sort_order\":99},\"🍽️\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":28,\"sort_order\":117},\"🍾\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":29,\"sort_order\":104},\"🍿\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":30,\"sort_order\":59},\"🎀\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":31,\"sort_order\":17},\"🎁\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":32,\"sort_order\":18},\"🎂\":{\"category\":\"Food & Drink\",\"sheet_x\":7,\"sheet_y\":33,\"sort_order\":90},\"🎃\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":34,\"sort_order\":1},\"🎄\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":35,\"sort_order\":2},\"🎅\":{\"category\":\"People & Body\",\"sheet_x\":7,\"sheet_y\":36,\"sort_order\":177},\"🎆\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":42,\"sort_order\":3},\"🎇\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":43,\"sort_order\":4},\"🎈\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":44,\"sort_order\":7},\"🎉\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":45,\"sort_order\":8},\"🎊\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":46,\"sort_order\":9},\"🎋\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":47,\"sort_order\":10},\"🎌\":{\"category\":\"Flags\",\"sheet_x\":7,\"sheet_y\":48,\"sort_order\":3},\"🎍\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":49,\"sort_order\":11},\"🎎\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":50,\"sort_order\":12},\"🎏\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":51,\"sort_order\":13},\"🎐\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":52,\"sort_order\":14},\"🎑\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":53,\"sort_order\":15},\"🎒\":{\"category\":\"Objects\",\"sheet_x\":7,\"sheet_y\":54,\"sort_order\":25},\"🎓\":{\"category\":\"Objects\",\"sheet_x\":7,\"sheet_y\":55,\"sort_order\":37},\"🎖️\":{\"category\":\"Activities\",\"sheet_x\":7,\"sheet_y\":56,\"sort_order\":22},\"🎗️\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":0,\"sort_order\":19},\"🎙️\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":1,\"sort_order\":56},\"🎚️\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":2,\"sort_order\":57},\"🎛️\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":3,\"sort_order\":58},\"🎞️\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":4,\"sort_order\":89},\"🎟️\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":5,\"sort_order\":20},\"🎠\":{\"category\":\"Travel & Places\",\"sheet_x\":8,\"sheet_y\":6,\"sort_order\":58},\"🎡\":{\"category\":\"Travel & Places\",\"sheet_x\":8,\"sheet_y\":7,\"sort_order\":59},\"🎢\":{\"category\":\"Travel & Places\",\"sheet_x\":8,\"sheet_y\":8,\"sort_order\":60},\"🎣\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":9,\"sort_order\":49},\"🎤\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":10,\"sort_order\":59},\"🎥\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":11,\"sort_order\":88},\"🎦\":{\"category\":\"Symbols\",\"sheet_x\":8,\"sheet_y\":12,\"sort_order\":91},\"🎧\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":13,\"sort_order\":60},\"🎨\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":14,\"sort_order\":77},\"🎩\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":15,\"sort_order\":36},\"🎪\":{\"category\":\"Travel & Places\",\"sheet_x\":8,\"sheet_y\":16,\"sort_order\":62},\"🎫\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":17,\"sort_order\":21},\"🎬\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":18,\"sort_order\":91},\"🎭\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":19,\"sort_order\":75},\"🎮\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":20,\"sort_order\":61},\"🎯\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":21,\"sort_order\":55},\"🎰\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":22,\"sort_order\":63},\"🎱\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":23,\"sort_order\":58},\"🎲\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":24,\"sort_order\":64},\"🎳\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":25,\"sort_order\":37},\"🎴\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":26,\"sort_order\":74},\"🎵\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":27,\"sort_order\":54},\"🎶\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":28,\"sort_order\":55},\"🎷\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":29,\"sort_order\":62},\"🎸\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":30,\"sort_order\":63},\"🎹\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":31,\"sort_order\":64},\"🎺\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":32,\"sort_order\":65},\"🎻\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":33,\"sort_order\":66},\"🎼\":{\"category\":\"Objects\",\"sheet_x\":8,\"sheet_y\":34,\"sort_order\":53},\"🎽\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":35,\"sort_order\":51},\"🎾\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":36,\"sort_order\":35},\"🎿\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":37,\"sort_order\":52},\"🏀\":{\"category\":\"Activities\",\"sheet_x\":8,\"sheet_y\":38,\"sort_order\":31},\"🏁\":{\"category\":\"Flags\",\"sheet_x\":8,\"sheet_y\":39,\"sort_order\":1},\"🏂\":{\"category\":\"People & Body\",\"sheet_x\":8,\"sheet_y\":40,\"sort_order\":248},\"🏃‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":8,\"sheet_y\":46,\"sort_order\":232},\"🏃‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":8,\"sheet_y\":52,\"sort_order\":231},\"🏃\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":1,\"sort_order\":230},\"🏄‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":7,\"sort_order\":254},\"🏄‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":13,\"sort_order\":253},\"🏄\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":19,\"sort_order\":252},\"🏅\":{\"category\":\"Activities\",\"sheet_x\":9,\"sheet_y\":25,\"sort_order\":24},\"🏆\":{\"category\":\"Activities\",\"sheet_x\":9,\"sheet_y\":26,\"sort_order\":23},\"🏇\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":27,\"sort_order\":246},\"🏈\":{\"category\":\"Activities\",\"sheet_x\":9,\"sheet_y\":33,\"sort_order\":33},\"🏉\":{\"category\":\"Activities\",\"sheet_x\":9,\"sheet_y\":34,\"sort_order\":34},\"🏊‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":35,\"sort_order\":260},\"🏊‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":41,\"sort_order\":259},\"🏊\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":47,\"sort_order\":258},\"🏋️‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":9,\"sheet_y\":53,\"sort_order\":266},\"🏋️‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":10,\"sheet_y\":2,\"sort_order\":265},\"🏋️\":{\"category\":\"People & Body\",\"sheet_x\":10,\"sheet_y\":8,\"sort_order\":264},\"🏌️‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":10,\"sheet_y\":14,\"sort_order\":251},\"🏌️‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":10,\"sheet_y\":20,\"sort_order\":250},\"🏌️\":{\"category\":\"People & Body\",\"sheet_x\":10,\"sheet_y\":26,\"sort_order\":249},\"🏍️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":32,\"sort_order\":92},\"🏎️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":33,\"sort_order\":91},\"🏏\":{\"category\":\"Activities\",\"sheet_x\":10,\"sheet_y\":34,\"sort_order\":38},\"🏐\":{\"category\":\"Activities\",\"sheet_x\":10,\"sheet_y\":35,\"sort_order\":32},\"🏑\":{\"category\":\"Activities\",\"sheet_x\":10,\"sheet_y\":36,\"sort_order\":39},\"🏒\":{\"category\":\"Activities\",\"sheet_x\":10,\"sheet_y\":37,\"sort_order\":40},\"🏓\":{\"category\":\"Activities\",\"sheet_x\":10,\"sheet_y\":38,\"sort_order\":42},\"🏔️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":39,\"sort_order\":8},\"🏕️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":40,\"sort_order\":12},\"🏖️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":41,\"sort_order\":13},\"🏗️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":42,\"sort_order\":19},\"🏘️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":43,\"sort_order\":21},\"🏙️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":44,\"sort_order\":51},\"🏚️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":45,\"sort_order\":22},\"🏛️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":46,\"sort_order\":18},\"🏜️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":47,\"sort_order\":14},\"🏝️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":48,\"sort_order\":15},\"🏞️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":49,\"sort_order\":16},\"🏟️\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":50,\"sort_order\":17},\"🏠\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":51,\"sort_order\":23},\"🏡\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":52,\"sort_order\":24},\"🏢\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":53,\"sort_order\":25},\"🏣\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":54,\"sort_order\":26},\"🏤\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":55,\"sort_order\":27},\"🏥\":{\"category\":\"Travel & Places\",\"sheet_x\":10,\"sheet_y\":56,\"sort_order\":28},\"🏦\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":0,\"sort_order\":29},\"🏧\":{\"category\":\"Symbols\",\"sheet_x\":11,\"sheet_y\":1,\"sort_order\":1},\"🏨\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":2,\"sort_order\":30},\"🏩\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":3,\"sort_order\":31},\"🏪\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":4,\"sort_order\":32},\"🏫\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":5,\"sort_order\":33},\"🏬\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":6,\"sort_order\":34},\"🏭\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":7,\"sort_order\":35},\"🏮\":{\"category\":\"Objects\",\"sheet_x\":11,\"sheet_y\":8,\"sort_order\":102},\"🏯\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":9,\"sort_order\":36},\"🏰\":{\"category\":\"Travel & Places\",\"sheet_x\":11,\"sheet_y\":10,\"sort_order\":37},\"🏳️‍🌈\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":11,\"sort_order\":6},\"🏳️\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":12,\"sort_order\":5},\"🏴‍☠️\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":13,\"sort_order\":7},\"🏴󠁧󠁢󠁥󠁮󠁧󠁿\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":14,\"sort_order\":266},\"🏴󠁧󠁢󠁳󠁣󠁴󠁿\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":15,\"sort_order\":267},\"🏴󠁧󠁢󠁷󠁬󠁳󠁿\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":16,\"sort_order\":268},\"🏴\":{\"category\":\"Flags\",\"sheet_x\":11,\"sheet_y\":17,\"sort_order\":4},\"🏵️\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":18,\"sort_order\":109},\"🏷️\":{\"category\":\"Objects\",\"sheet_x\":11,\"sheet_y\":19,\"sort_order\":120},\"🏸\":{\"category\":\"Activities\",\"sheet_x\":11,\"sheet_y\":20,\"sort_order\":43},\"🏹\":{\"category\":\"Objects\",\"sheet_x\":11,\"sheet_y\":21,\"sort_order\":189},\"🏺\":{\"category\":\"Food & Drink\",\"sheet_x\":11,\"sheet_y\":22,\"sort_order\":121},\"🏻\":{\"category\":\"Skin Tones\",\"sheet_x\":11,\"sheet_y\":23,\"sort_order\":1},\"🏼\":{\"category\":\"Skin Tones\",\"sheet_x\":11,\"sheet_y\":24,\"sort_order\":2},\"🏽\":{\"category\":\"Skin Tones\",\"sheet_x\":11,\"sheet_y\":25,\"sort_order\":3},\"🏾\":{\"category\":\"Skin Tones\",\"sheet_x\":11,\"sheet_y\":26,\"sort_order\":4},\"🏿\":{\"category\":\"Skin Tones\",\"sheet_x\":11,\"sheet_y\":27,\"sort_order\":5},\"🐀\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":28,\"sort_order\":44},\"🐁\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":29,\"sort_order\":43},\"🐂\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":30,\"sort_order\":25},\"🐃\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":31,\"sort_order\":26},\"🐄\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":32,\"sort_order\":27},\"🐅\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":33,\"sort_order\":17},\"🐆\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":34,\"sort_order\":18},\"🐇\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":35,\"sort_order\":47},\"🐈\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":36,\"sort_order\":14},\"🐉\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":37,\"sort_order\":82},\"🐊\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":38,\"sort_order\":77},\"🐋\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":39,\"sort_order\":86},\"🐌\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":40,\"sort_order\":94},\"🐍\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":41,\"sort_order\":80},\"🐎\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":42,\"sort_order\":20},\"🐏\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":43,\"sort_order\":32},\"🐐\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":44,\"sort_order\":34},\"🐑\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":45,\"sort_order\":33},\"🐒\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":46,\"sort_order\":2},\"🐓\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":47,\"sort_order\":62},\"🐔\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":48,\"sort_order\":61},\"🐕‍🦺\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":49,\"sort_order\":8},\"🐕\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":50,\"sort_order\":6},\"🐖\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":51,\"sort_order\":29},\"🐗\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":52,\"sort_order\":30},\"🐘\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":53,\"sort_order\":39},\"🐙\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":54,\"sort_order\":92},\"🐚\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":55,\"sort_order\":93},\"🐛\":{\"category\":\"Animals & Nature\",\"sheet_x\":11,\"sheet_y\":56,\"sort_order\":96},\"🐜\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":0,\"sort_order\":97},\"🐝\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":1,\"sort_order\":98},\"🐞\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":2,\"sort_order\":99},\"🐟\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":3,\"sort_order\":88},\"🐠\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":4,\"sort_order\":89},\"🐡\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":5,\"sort_order\":90},\"🐢\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":6,\"sort_order\":78},\"🐣\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":7,\"sort_order\":63},\"🐤\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":8,\"sort_order\":64},\"🐥\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":9,\"sort_order\":65},\"🐦\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":10,\"sort_order\":66},\"🐧\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":11,\"sort_order\":67},\"🐨\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":12,\"sort_order\":52},\"🐩\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":13,\"sort_order\":9},\"🐪\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":14,\"sort_order\":35},\"🐫\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":15,\"sort_order\":36},\"🐬\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":16,\"sort_order\":87},\"🐭\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":17,\"sort_order\":42},\"🐮\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":18,\"sort_order\":24},\"🐯\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":19,\"sort_order\":16},\"🐰\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":20,\"sort_order\":46},\"🐱\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":21,\"sort_order\":13},\"🐲\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":22,\"sort_order\":81},\"🐳\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":23,\"sort_order\":85},\"🐴\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":24,\"sort_order\":19},\"🐵\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":25,\"sort_order\":1},\"🐶\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":26,\"sort_order\":5},\"🐷\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":27,\"sort_order\":28},\"🐸\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":28,\"sort_order\":76},\"🐹\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":29,\"sort_order\":45},\"🐺\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":30,\"sort_order\":10},\"🐻\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":31,\"sort_order\":51},\"🐼\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":32,\"sort_order\":53},\"🐽\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":33,\"sort_order\":31},\"🐾\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":34,\"sort_order\":59},\"🐿️\":{\"category\":\"Animals & Nature\",\"sheet_x\":12,\"sheet_y\":35,\"sort_order\":48},\"👀\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":36,\"sort_order\":45},\"👁️‍🗨️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":12,\"sheet_y\":37,\"sort_order\":145},\"👁️\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":38,\"sort_order\":46},\"👂\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":39,\"sort_order\":39},\"👃\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":45,\"sort_order\":41},\"👄\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":51,\"sort_order\":48},\"👅\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":52,\"sort_order\":47},\"👆\":{\"category\":\"People & Body\",\"sheet_x\":12,\"sheet_y\":53,\"sort_order\":15},\"👇\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":2,\"sort_order\":17},\"👈\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":8,\"sort_order\":13},\"👉\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":14,\"sort_order\":14},\"👊\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":20,\"sort_order\":22},\"👋\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":26,\"sort_order\":1},\"👌\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":32,\"sort_order\":6},\"👍\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":38,\"sort_order\":19},\"👎\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":44,\"sort_order\":20},\"👏\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":50,\"sort_order\":25},\"👐\":{\"category\":\"People & Body\",\"sheet_x\":13,\"sheet_y\":56,\"sort_order\":27},\"👑\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":5,\"sort_order\":34},\"👒\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":6,\"sort_order\":35},\"👓\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":7,\"sort_order\":1},\"👔\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":8,\"sort_order\":6},\"👕\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":9,\"sort_order\":7},\"👖\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":10,\"sort_order\":8},\"👗\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":11,\"sort_order\":13},\"👘\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":12,\"sort_order\":14},\"👙\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":13,\"sort_order\":19},\"👚\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":14,\"sort_order\":20},\"👛\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":15,\"sort_order\":21},\"👜\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":16,\"sort_order\":22},\"👝\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":17,\"sort_order\":23},\"👞\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":18,\"sort_order\":26},\"👟\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":19,\"sort_order\":27},\"👠\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":20,\"sort_order\":30},\"👡\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":21,\"sort_order\":31},\"👢\":{\"category\":\"Objects\",\"sheet_x\":14,\"sheet_y\":22,\"sort_order\":33},\"👣\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":23,\"sort_order\":334},\"👤\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":24,\"sort_order\":332},\"👥\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":25,\"sort_order\":333},\"👦\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":26,\"sort_order\":51},\"👧\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":32,\"sort_order\":52},\"👨‍🌾\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":38,\"sort_order\":118},\"👨‍🍳\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":44,\"sort_order\":121},\"👨‍🎓\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":50,\"sort_order\":109},\"👨‍🎤\":{\"category\":\"People & Body\",\"sheet_x\":14,\"sheet_y\":56,\"sort_order\":139},\"👨‍🎨\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":5,\"sort_order\":142},\"👨‍🏫\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":11,\"sort_order\":112},\"👨‍🏭\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":17,\"sort_order\":127},\"👨‍👦‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":23,\"sort_order\":322},\"👨‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":24,\"sort_order\":321},\"👨‍👧‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":25,\"sort_order\":324},\"👨‍👧‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":26,\"sort_order\":325},\"👨‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":27,\"sort_order\":323},\"👨‍👨‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":28,\"sort_order\":311},\"👨‍👨‍👦‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":29,\"sort_order\":314},\"👨‍👨‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":30,\"sort_order\":312},\"👨‍👨‍👧‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":31,\"sort_order\":313},\"👨‍👨‍👧‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":32,\"sort_order\":315},\"👨‍👩‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":33,\"sort_order\":306},\"👨‍👩‍👦‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":34,\"sort_order\":309},\"👨‍👩‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":35,\"sort_order\":307},\"👨‍👩‍👧‍👦\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":36,\"sort_order\":308},\"👨‍👩‍👧‍👧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":37,\"sort_order\":310},\"👨‍💻\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":38,\"sort_order\":136},\"👨‍💼\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":44,\"sort_order\":130},\"👨‍🔧\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":50,\"sort_order\":124},\"👨‍🔬\":{\"category\":\"People & Body\",\"sheet_x\":15,\"sheet_y\":56,\"sort_order\":133},\"👨‍🚀\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":5,\"sort_order\":148},\"👨‍🚒\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":11,\"sort_order\":151},\"👨‍🦯\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":17,\"sort_order\":222},\"👨‍🦰\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":23,\"sort_order\":57},\"👨‍🦱\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":29,\"sort_order\":58},\"👨‍🦲\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":35,\"sort_order\":60},\"👨‍🦳\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":41,\"sort_order\":59},\"👨‍🦼\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":47,\"sort_order\":225},\"👨‍🦽\":{\"category\":\"People & Body\",\"sheet_x\":16,\"sheet_y\":53,\"sort_order\":228},\"👨‍⚕️\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":2,\"sort_order\":106},\"👨‍⚖️\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":8,\"sort_order\":115},\"👨‍✈️\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":14,\"sort_order\":145},\"👨‍❤️‍👨\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":20,\"sort_order\":303},\"👨‍❤️‍💋‍👨\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":21,\"sort_order\":299},\"👨\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":22,\"sort_order\":55},\"👩‍🌾\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":28,\"sort_order\":119},\"👩‍🍳\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":34,\"sort_order\":122},\"👩‍🎓\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":40,\"sort_order\":110},\"👩‍🎤\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":46,\"sort_order\":140},\"👩‍🎨\":{\"category\":\"People & Body\",\"sheet_x\":17,\"sheet_y\":52,\"sort_order\":143},\"👩‍🏫\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":1,\"sort_order\":113},\"👩‍🏭\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":7,\"sort_order\":128},\"👩‍👦‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":13,\"sort_order\":327},\"👩‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":14,\"sort_order\":326},\"👩‍👧‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":15,\"sort_order\":329},\"👩‍👧‍👧\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":16,\"sort_order\":330},\"👩‍👧\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":17,\"sort_order\":328},\"👩‍👩‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":18,\"sort_order\":316},\"👩‍👩‍👦‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":19,\"sort_order\":319},\"👩‍👩‍👧\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":20,\"sort_order\":317},\"👩‍👩‍👧‍👦\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":21,\"sort_order\":318},\"👩‍👩‍👧‍👧\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":22,\"sort_order\":320},\"👩‍💻\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":23,\"sort_order\":137},\"👩‍💼\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":29,\"sort_order\":131},\"👩‍🔧\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":35,\"sort_order\":125},\"👩‍🔬\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":41,\"sort_order\":134},\"👩‍🚀\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":47,\"sort_order\":149},\"👩‍🚒\":{\"category\":\"People & Body\",\"sheet_x\":18,\"sheet_y\":53,\"sort_order\":152},\"👩‍🦯\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":2,\"sort_order\":223},\"👩‍🦰\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":8,\"sort_order\":62},\"👩‍🦱\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":14,\"sort_order\":64},\"👩‍🦲\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":20,\"sort_order\":68},\"👩‍🦳\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":26,\"sort_order\":66},\"👩‍🦼\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":32,\"sort_order\":226},\"👩‍🦽\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":38,\"sort_order\":229},\"👩‍⚕️\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":44,\"sort_order\":107},\"👩‍⚖️\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":50,\"sort_order\":116},\"👩‍✈️\":{\"category\":\"People & Body\",\"sheet_x\":19,\"sheet_y\":56,\"sort_order\":146},\"👩‍❤️‍👨\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":5,\"sort_order\":302},\"👩‍❤️‍👩\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":6,\"sort_order\":304},\"👩‍❤️‍💋‍👨\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":7,\"sort_order\":298},\"👩‍❤️‍💋‍👩\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":8,\"sort_order\":300},\"👩\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":9,\"sort_order\":61},\"👪\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":15,\"sort_order\":305},\"👫\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":16,\"sort_order\":295},\"👬\":{\"category\":\"People & Body\",\"sheet_x\":20,\"sheet_y\":42,\"sort_order\":296},\"👭\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":11,\"sort_order\":294},\"👮‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":37,\"sort_order\":155},\"👮‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":43,\"sort_order\":154},\"👮\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":49,\"sort_order\":153},\"👯‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":55,\"sort_order\":238},\"👯‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":21,\"sheet_y\":56,\"sort_order\":237},\"👯\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":0,\"sort_order\":236},\"👰\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":1,\"sort_order\":173},\"👱‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":7,\"sort_order\":70},\"👱‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":13,\"sort_order\":71},\"👱\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":19,\"sort_order\":54},\"👲\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":25,\"sort_order\":170},\"👳‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":31,\"sort_order\":169},\"👳‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":37,\"sort_order\":168},\"👳\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":43,\"sort_order\":167},\"👴\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":49,\"sort_order\":73},\"👵\":{\"category\":\"People & Body\",\"sheet_x\":22,\"sheet_y\":55,\"sort_order\":74},\"👶\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":4,\"sort_order\":49},\"👷‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":10,\"sort_order\":164},\"👷‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":16,\"sort_order\":163},\"👷\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":22,\"sort_order\":162},\"👸\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":28,\"sort_order\":166},\"👹\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":34,\"sort_order\":97},\"👺\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":35,\"sort_order\":98},\"👻\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":36,\"sort_order\":99},\"👼\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":37,\"sort_order\":176},\"👽\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":43,\"sort_order\":100},\"👾\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":44,\"sort_order\":101},\"👿\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":45,\"sort_order\":92},\"💀\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":23,\"sheet_y\":46,\"sort_order\":93},\"💁‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":47,\"sort_order\":89},\"💁‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":23,\"sheet_y\":53,\"sort_order\":88},\"💁\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":2,\"sort_order\":87},\"💂‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":8,\"sort_order\":161},\"💂‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":14,\"sort_order\":160},\"💂\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":20,\"sort_order\":159},\"💃\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":26,\"sort_order\":233},\"💄\":{\"category\":\"Objects\",\"sheet_x\":24,\"sheet_y\":32,\"sort_order\":41},\"💅\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":33,\"sort_order\":32},\"💆‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":39,\"sort_order\":208},\"💆‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":45,\"sort_order\":207},\"💆\":{\"category\":\"People & Body\",\"sheet_x\":24,\"sheet_y\":51,\"sort_order\":206},\"💇‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":0,\"sort_order\":211},\"💇‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":6,\"sort_order\":210},\"💇\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":12,\"sort_order\":209},\"💈\":{\"category\":\"Travel & Places\",\"sheet_x\":25,\"sheet_y\":18,\"sort_order\":61},\"💉\":{\"category\":\"Objects\",\"sheet_x\":25,\"sheet_y\":19,\"sort_order\":208},\"💊\":{\"category\":\"Objects\",\"sheet_x\":25,\"sheet_y\":20,\"sort_order\":210},\"💋\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":21,\"sort_order\":115},\"💌\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":22,\"sort_order\":116},\"💍\":{\"category\":\"Objects\",\"sheet_x\":25,\"sheet_y\":23,\"sort_order\":42},\"💎\":{\"category\":\"Objects\",\"sheet_x\":25,\"sheet_y\":24,\"sort_order\":43},\"💏\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":25,\"sort_order\":297},\"💐\":{\"category\":\"Animals & Nature\",\"sheet_x\":25,\"sheet_y\":26,\"sort_order\":106},\"💑\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":27,\"sort_order\":301},\"💒\":{\"category\":\"Travel & Places\",\"sheet_x\":25,\"sheet_y\":28,\"sort_order\":38},\"💓\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":29,\"sort_order\":121},\"💔\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":30,\"sort_order\":126},\"💕\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":31,\"sort_order\":123},\"💖\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":32,\"sort_order\":119},\"💗\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":33,\"sort_order\":120},\"💘\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":34,\"sort_order\":117},\"💙\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":35,\"sort_order\":131},\"💚\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":36,\"sort_order\":130},\"💛\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":37,\"sort_order\":129},\"💜\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":38,\"sort_order\":132},\"💝\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":39,\"sort_order\":118},\"💞\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":40,\"sort_order\":122},\"💟\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":41,\"sort_order\":124},\"💠\":{\"category\":\"Symbols\",\"sheet_x\":25,\"sheet_y\":42,\"sort_order\":214},\"💡\":{\"category\":\"Objects\",\"sheet_x\":25,\"sheet_y\":43,\"sort_order\":100},\"💢\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":44,\"sort_order\":137},\"💣\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":45,\"sort_order\":143},\"💤\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":46,\"sort_order\":149},\"💥\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":47,\"sort_order\":138},\"💦\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":48,\"sort_order\":140},\"💧\":{\"category\":\"Travel & Places\",\"sheet_x\":25,\"sheet_y\":49,\"sort_order\":209},\"💨\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":50,\"sort_order\":141},\"💩\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":25,\"sheet_y\":51,\"sort_order\":95},\"💪\":{\"category\":\"People & Body\",\"sheet_x\":25,\"sheet_y\":52,\"sort_order\":34},\"💫\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":26,\"sheet_y\":1,\"sort_order\":139},\"💬\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":26,\"sheet_y\":2,\"sort_order\":144},\"💭\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":26,\"sheet_y\":3,\"sort_order\":148},\"💮\":{\"category\":\"Animals & Nature\",\"sheet_x\":26,\"sheet_y\":4,\"sort_order\":108},\"💯\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":26,\"sheet_y\":5,\"sort_order\":136},\"💰\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":6,\"sort_order\":121},\"💱\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":7,\"sort_order\":130},\"💲\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":8,\"sort_order\":131},\"💳\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":9,\"sort_order\":127},\"💴\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":10,\"sort_order\":122},\"💵\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":11,\"sort_order\":123},\"💶\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":12,\"sort_order\":124},\"💷\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":13,\"sort_order\":125},\"💸\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":14,\"sort_order\":126},\"💹\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":15,\"sort_order\":129},\"💺\":{\"category\":\"Travel & Places\",\"sheet_x\":26,\"sheet_y\":16,\"sort_order\":123},\"💻\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":17,\"sort_order\":77},\"💼\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":18,\"sort_order\":152},\"💽\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":19,\"sort_order\":83},\"💾\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":20,\"sort_order\":84},\"💿\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":21,\"sort_order\":85},\"📀\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":22,\"sort_order\":86},\"📁\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":23,\"sort_order\":153},\"📂\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":24,\"sort_order\":154},\"📃\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":25,\"sort_order\":113},\"📄\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":26,\"sort_order\":115},\"📅\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":27,\"sort_order\":156},\"📆\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":28,\"sort_order\":157},\"📇\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":29,\"sort_order\":160},\"📈\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":30,\"sort_order\":161},\"📉\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":31,\"sort_order\":162},\"📊\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":32,\"sort_order\":163},\"📋\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":33,\"sort_order\":164},\"📌\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":34,\"sort_order\":165},\"📍\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":35,\"sort_order\":166},\"📎\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":36,\"sort_order\":167},\"📏\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":37,\"sort_order\":169},\"📐\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":38,\"sort_order\":170},\"📑\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":39,\"sort_order\":118},\"📒\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":40,\"sort_order\":112},\"📓\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":41,\"sort_order\":111},\"📔\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":42,\"sort_order\":104},\"📕\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":43,\"sort_order\":105},\"📖\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":44,\"sort_order\":106},\"📗\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":45,\"sort_order\":107},\"📘\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":46,\"sort_order\":108},\"📙\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":47,\"sort_order\":109},\"📚\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":48,\"sort_order\":110},\"📛\":{\"category\":\"Symbols\",\"sheet_x\":26,\"sheet_y\":49,\"sort_order\":104},\"📜\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":50,\"sort_order\":114},\"📝\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":51,\"sort_order\":151},\"📞\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":52,\"sort_order\":72},\"📟\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":53,\"sort_order\":73},\"📠\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":54,\"sort_order\":74},\"📡\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":55,\"sort_order\":207},\"📢\":{\"category\":\"Objects\",\"sheet_x\":26,\"sheet_y\":56,\"sort_order\":48},\"📣\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":0,\"sort_order\":49},\"📤\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":1,\"sort_order\":136},\"📥\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":2,\"sort_order\":137},\"📦\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":3,\"sort_order\":138},\"📧\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":4,\"sort_order\":133},\"📨\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":5,\"sort_order\":134},\"📩\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":6,\"sort_order\":135},\"📪\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":7,\"sort_order\":140},\"📫\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":8,\"sort_order\":139},\"📬\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":9,\"sort_order\":141},\"📭\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":10,\"sort_order\":142},\"📮\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":11,\"sort_order\":143},\"📯\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":12,\"sort_order\":50},\"📰\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":13,\"sort_order\":116},\"📱\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":14,\"sort_order\":69},\"📲\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":15,\"sort_order\":70},\"📳\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":16,\"sort_order\":95},\"📴\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":17,\"sort_order\":96},\"📵\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":18,\"sort_order\":23},\"📶\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":19,\"sort_order\":94},\"📷\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":20,\"sort_order\":93},\"📸\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":21,\"sort_order\":94},\"📹\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":22,\"sort_order\":95},\"📺\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":23,\"sort_order\":92},\"📻\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":24,\"sort_order\":61},\"📼\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":25,\"sort_order\":96},\"📽️\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":26,\"sort_order\":90},\"📿\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":27,\"sort_order\":40},\"🔀\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":28,\"sort_order\":73},\"🔁\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":29,\"sort_order\":74},\"🔂\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":30,\"sort_order\":75},\"🔃\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":31,\"sort_order\":41},\"🔄\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":32,\"sort_order\":42},\"🔅\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":33,\"sort_order\":92},\"🔆\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":34,\"sort_order\":93},\"🔇\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":35,\"sort_order\":44},\"🔈\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":36,\"sort_order\":45},\"🔉\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":37,\"sort_order\":46},\"🔊\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":38,\"sort_order\":47},\"🔋\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":39,\"sort_order\":75},\"🔌\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":40,\"sort_order\":76},\"🔍\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":41,\"sort_order\":97},\"🔎\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":42,\"sort_order\":98},\"🔏\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":43,\"sort_order\":177},\"🔐\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":44,\"sort_order\":178},\"🔑\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":45,\"sort_order\":179},\"🔒\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":46,\"sort_order\":175},\"🔓\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":47,\"sort_order\":176},\"🔔\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":48,\"sort_order\":51},\"🔕\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":49,\"sort_order\":52},\"🔖\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":50,\"sort_order\":119},\"🔗\":{\"category\":\"Objects\",\"sheet_x\":27,\"sheet_y\":51,\"sort_order\":197},\"🔘\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":52,\"sort_order\":215},\"🔙\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":53,\"sort_order\":43},\"🔚\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":54,\"sort_order\":44},\"🔛\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":55,\"sort_order\":45},\"🔜\":{\"category\":\"Symbols\",\"sheet_x\":27,\"sheet_y\":56,\"sort_order\":46},\"🔝\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":0,\"sort_order\":47},\"🔞\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":1,\"sort_order\":24},\"🔟\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":2,\"sort_order\":144},\"🔠\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":3,\"sort_order\":145},\"🔡\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":4,\"sort_order\":146},\"🔢\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":5,\"sort_order\":147},\"🔣\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":6,\"sort_order\":148},\"🔤\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":7,\"sort_order\":149},\"🔥\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":8,\"sort_order\":208},\"🔦\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":9,\"sort_order\":101},\"🔧\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":10,\"sort_order\":191},\"🔨\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":11,\"sort_order\":181},\"🔩\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":12,\"sort_order\":192},\"🔪\":{\"category\":\"Food & Drink\",\"sheet_x\":28,\"sheet_y\":13,\"sort_order\":120},\"🔫\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":14,\"sort_order\":188},\"🔬\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":15,\"sort_order\":205},\"🔭\":{\"category\":\"Objects\",\"sheet_x\":28,\"sheet_y\":16,\"sort_order\":206},\"🔮\":{\"category\":\"Activities\",\"sheet_x\":28,\"sheet_y\":17,\"sort_order\":59},\"🔯\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":18,\"sort_order\":59},\"🔰\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":19,\"sort_order\":105},\"🔱\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":20,\"sort_order\":103},\"🔲\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":21,\"sort_order\":217},\"🔳\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":22,\"sort_order\":216},\"🔴\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":23,\"sort_order\":184},\"🔵\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":24,\"sort_order\":188},\"🔶\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":25,\"sort_order\":208},\"🔷\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":26,\"sort_order\":209},\"🔸\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":27,\"sort_order\":210},\"🔹\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":28,\"sort_order\":211},\"🔺\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":29,\"sort_order\":212},\"🔻\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":30,\"sort_order\":213},\"🔼\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":31,\"sort_order\":83},\"🔽\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":32,\"sort_order\":85},\"🕉️\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":33,\"sort_order\":50},\"🕊️\":{\"category\":\"Animals & Nature\",\"sheet_x\":28,\"sheet_y\":34,\"sort_order\":68},\"🕋\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":35,\"sort_order\":46},\"🕌\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":36,\"sort_order\":42},\"🕍\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":37,\"sort_order\":44},\"🕎\":{\"category\":\"Symbols\",\"sheet_x\":28,\"sheet_y\":38,\"sort_order\":58},\"🕐\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":39,\"sort_order\":142},\"🕑\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":40,\"sort_order\":144},\"🕒\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":41,\"sort_order\":146},\"🕓\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":42,\"sort_order\":148},\"🕔\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":43,\"sort_order\":150},\"🕕\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":44,\"sort_order\":152},\"🕖\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":45,\"sort_order\":154},\"🕗\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":46,\"sort_order\":156},\"🕘\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":47,\"sort_order\":158},\"🕙\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":48,\"sort_order\":160},\"🕚\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":49,\"sort_order\":162},\"🕛\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":50,\"sort_order\":140},\"🕜\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":51,\"sort_order\":143},\"🕝\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":52,\"sort_order\":145},\"🕞\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":53,\"sort_order\":147},\"🕟\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":54,\"sort_order\":149},\"🕠\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":55,\"sort_order\":151},\"🕡\":{\"category\":\"Travel & Places\",\"sheet_x\":28,\"sheet_y\":56,\"sort_order\":153},\"🕢\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":0,\"sort_order\":155},\"🕣\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":1,\"sort_order\":157},\"🕤\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":2,\"sort_order\":159},\"🕥\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":3,\"sort_order\":161},\"🕦\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":4,\"sort_order\":163},\"🕧\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":5,\"sort_order\":141},\"🕯️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":6,\"sort_order\":99},\"🕰️\":{\"category\":\"Travel & Places\",\"sheet_x\":29,\"sheet_y\":7,\"sort_order\":139},\"🕳️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":29,\"sheet_y\":8,\"sort_order\":142},\"🕴️\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":9,\"sort_order\":235},\"🕵️‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":15,\"sort_order\":158},\"🕵️‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":21,\"sort_order\":157},\"🕵️\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":27,\"sort_order\":156},\"🕶️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":33,\"sort_order\":2},\"🕷️\":{\"category\":\"Animals & Nature\",\"sheet_x\":29,\"sheet_y\":34,\"sort_order\":101},\"🕸️\":{\"category\":\"Animals & Nature\",\"sheet_x\":29,\"sheet_y\":35,\"sort_order\":102},\"🕹️\":{\"category\":\"Activities\",\"sheet_x\":29,\"sheet_y\":36,\"sort_order\":62},\"🕺\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":37,\"sort_order\":234},\"🖇️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":43,\"sort_order\":168},\"🖊️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":44,\"sort_order\":148},\"🖋️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":45,\"sort_order\":147},\"🖌️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":46,\"sort_order\":149},\"🖍️\":{\"category\":\"Objects\",\"sheet_x\":29,\"sheet_y\":47,\"sort_order\":150},\"🖐️\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":48,\"sort_order\":3},\"🖕\":{\"category\":\"People & Body\",\"sheet_x\":29,\"sheet_y\":54,\"sort_order\":16},\"🖖\":{\"category\":\"People & Body\",\"sheet_x\":30,\"sheet_y\":3,\"sort_order\":5},\"🖤\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":9,\"sort_order\":134},\"🖥️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":10,\"sort_order\":78},\"🖨️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":11,\"sort_order\":79},\"🖱️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":12,\"sort_order\":81},\"🖲️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":13,\"sort_order\":82},\"🖼️\":{\"category\":\"Activities\",\"sheet_x\":30,\"sheet_y\":14,\"sort_order\":76},\"🗂️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":15,\"sort_order\":155},\"🗃️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":16,\"sort_order\":172},\"🗄️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":17,\"sort_order\":173},\"🗑️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":18,\"sort_order\":174},\"🗒️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":19,\"sort_order\":158},\"🗓️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":20,\"sort_order\":159},\"🗜️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":21,\"sort_order\":194},\"🗝️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":22,\"sort_order\":180},\"🗞️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":23,\"sort_order\":117},\"🗡️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":24,\"sort_order\":186},\"🗣️\":{\"category\":\"People & Body\",\"sheet_x\":30,\"sheet_y\":25,\"sort_order\":331},\"🗨️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":26,\"sort_order\":146},\"🗯️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":27,\"sort_order\":147},\"🗳️\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":28,\"sort_order\":144},\"🗺️\":{\"category\":\"Travel & Places\",\"sheet_x\":30,\"sheet_y\":29,\"sort_order\":5},\"🗻\":{\"category\":\"Travel & Places\",\"sheet_x\":30,\"sheet_y\":30,\"sort_order\":11},\"🗼\":{\"category\":\"Travel & Places\",\"sheet_x\":30,\"sheet_y\":31,\"sort_order\":39},\"🗽\":{\"category\":\"Travel & Places\",\"sheet_x\":30,\"sheet_y\":32,\"sort_order\":40},\"🗾\":{\"category\":\"Travel & Places\",\"sheet_x\":30,\"sheet_y\":33,\"sort_order\":6},\"🗿\":{\"category\":\"Objects\",\"sheet_x\":30,\"sheet_y\":34,\"sort_order\":233},\"😀\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":35,\"sort_order\":1},\"😁\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":36,\"sort_order\":4},\"😂\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":37,\"sort_order\":8},\"😃\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":38,\"sort_order\":2},\"😄\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":39,\"sort_order\":3},\"😅\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":40,\"sort_order\":6},\"😆\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":41,\"sort_order\":5},\"😇\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":42,\"sort_order\":13},\"😈\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":43,\"sort_order\":91},\"😉\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":44,\"sort_order\":11},\"😊\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":45,\"sort_order\":12},\"😋\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":46,\"sort_order\":22},\"😌\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":47,\"sort_order\":42},\"😍\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":48,\"sort_order\":15},\"😎\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":49,\"sort_order\":60},\"😏\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":50,\"sort_order\":37},\"😐\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":51,\"sort_order\":34},\"😑\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":52,\"sort_order\":35},\"😒\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":53,\"sort_order\":38},\"😓\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":54,\"sort_order\":83},\"😔\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":55,\"sort_order\":43},\"😕\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":30,\"sheet_y\":56,\"sort_order\":63},\"😖\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":0,\"sort_order\":80},\"😗\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":1,\"sort_order\":18},\"😘\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":2,\"sort_order\":17},\"😙\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":3,\"sort_order\":21},\"😚\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":4,\"sort_order\":20},\"😛\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":5,\"sort_order\":23},\"😜\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":6,\"sort_order\":24},\"😝\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":7,\"sort_order\":26},\"😞\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":8,\"sort_order\":82},\"😟\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":9,\"sort_order\":64},\"😠\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":10,\"sort_order\":89},\"😡\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":11,\"sort_order\":88},\"😢\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":12,\"sort_order\":77},\"😣\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":13,\"sort_order\":81},\"😤\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":14,\"sort_order\":87},\"😥\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":15,\"sort_order\":76},\"😦\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":16,\"sort_order\":72},\"😧\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":17,\"sort_order\":73},\"😨\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":18,\"sort_order\":74},\"😩\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":19,\"sort_order\":84},\"😪\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":20,\"sort_order\":44},\"😫\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":21,\"sort_order\":85},\"😬\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":22,\"sort_order\":40},\"😭\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":23,\"sort_order\":78},\"😮\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":24,\"sort_order\":67},\"😯\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":25,\"sort_order\":68},\"😰\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":26,\"sort_order\":75},\"😱\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":27,\"sort_order\":79},\"😲\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":28,\"sort_order\":69},\"😳\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":29,\"sort_order\":70},\"😴\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":30,\"sort_order\":46},\"😵\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":31,\"sort_order\":56},\"😶\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":32,\"sort_order\":36},\"😷\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":33,\"sort_order\":47},\"😸\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":34,\"sort_order\":104},\"😹\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":35,\"sort_order\":105},\"😺\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":36,\"sort_order\":103},\"😻\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":37,\"sort_order\":106},\"😼\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":38,\"sort_order\":107},\"😽\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":39,\"sort_order\":108},\"😾\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":40,\"sort_order\":111},\"😿\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":41,\"sort_order\":110},\"🙀\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":42,\"sort_order\":109},\"🙁\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":43,\"sort_order\":65},\"🙂\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":44,\"sort_order\":9},\"🙃\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":45,\"sort_order\":10},\"🙄\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":31,\"sheet_y\":46,\"sort_order\":39},\"🙅‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":31,\"sheet_y\":47,\"sort_order\":83},\"🙅‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":31,\"sheet_y\":53,\"sort_order\":82},\"🙅\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":2,\"sort_order\":81},\"🙆‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":8,\"sort_order\":86},\"🙆‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":14,\"sort_order\":85},\"🙆\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":20,\"sort_order\":84},\"🙇‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":26,\"sort_order\":98},\"🙇‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":32,\"sort_order\":97},\"🙇\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":38,\"sort_order\":96},\"🙈\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":32,\"sheet_y\":44,\"sort_order\":112},\"🙉\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":32,\"sheet_y\":45,\"sort_order\":113},\"🙊\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":32,\"sheet_y\":46,\"sort_order\":114},\"🙋‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":47,\"sort_order\":92},\"🙋‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":32,\"sheet_y\":53,\"sort_order\":91},\"🙋\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":2,\"sort_order\":90},\"🙌\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":8,\"sort_order\":26},\"🙍‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":14,\"sort_order\":77},\"🙍‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":20,\"sort_order\":76},\"🙍\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":26,\"sort_order\":75},\"🙎‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":32,\"sort_order\":80},\"🙎‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":38,\"sort_order\":79},\"🙎\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":44,\"sort_order\":78},\"🙏\":{\"category\":\"People & Body\",\"sheet_x\":33,\"sheet_y\":50,\"sort_order\":30},\"🚀\":{\"category\":\"Travel & Places\",\"sheet_x\":33,\"sheet_y\":56,\"sort_order\":129},\"🚁\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":0,\"sort_order\":124},\"🚂\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":1,\"sort_order\":63},\"🚃\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":2,\"sort_order\":64},\"🚄\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":3,\"sort_order\":65},\"🚅\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":4,\"sort_order\":66},\"🚆\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":5,\"sort_order\":67},\"🚇\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":6,\"sort_order\":68},\"🚈\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":7,\"sort_order\":69},\"🚉\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":8,\"sort_order\":70},\"🚊\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":9,\"sort_order\":71},\"🚋\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":10,\"sort_order\":74},\"🚌\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":11,\"sort_order\":75},\"🚍\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":12,\"sort_order\":76},\"🚎\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":13,\"sort_order\":77},\"🚏\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":14,\"sort_order\":100},\"🚐\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":15,\"sort_order\":78},\"🚑\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":16,\"sort_order\":79},\"🚒\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":17,\"sort_order\":80},\"🚓\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":18,\"sort_order\":81},\"🚔\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":19,\"sort_order\":82},\"🚕\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":20,\"sort_order\":83},\"🚖\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":21,\"sort_order\":84},\"🚗\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":22,\"sort_order\":85},\"🚘\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":23,\"sort_order\":86},\"🚙\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":24,\"sort_order\":87},\"🚚\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":25,\"sort_order\":88},\"🚛\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":26,\"sort_order\":89},\"🚜\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":27,\"sort_order\":90},\"🚝\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":28,\"sort_order\":72},\"🚞\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":29,\"sort_order\":73},\"🚟\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":30,\"sort_order\":125},\"🚠\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":31,\"sort_order\":126},\"🚡\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":32,\"sort_order\":127},\"🚢\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":33,\"sort_order\":117},\"🚣‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":34,\"sheet_y\":34,\"sort_order\":257},\"🚣‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":34,\"sheet_y\":40,\"sort_order\":256},\"🚣\":{\"category\":\"People & Body\",\"sheet_x\":34,\"sheet_y\":46,\"sort_order\":255},\"🚤\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":52,\"sort_order\":113},\"🚥\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":53,\"sort_order\":106},\"🚦\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":54,\"sort_order\":107},\"🚧\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":55,\"sort_order\":109},\"🚨\":{\"category\":\"Travel & Places\",\"sheet_x\":34,\"sheet_y\":56,\"sort_order\":105},\"🚩\":{\"category\":\"Flags\",\"sheet_x\":35,\"sheet_y\":0,\"sort_order\":2},\"🚪\":{\"category\":\"Objects\",\"sheet_x\":35,\"sheet_y\":1,\"sort_order\":213},\"🚫\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":2,\"sort_order\":17},\"🚬\":{\"category\":\"Objects\",\"sheet_x\":35,\"sheet_y\":3,\"sort_order\":230},\"🚭\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":4,\"sort_order\":19},\"🚮\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":5,\"sort_order\":2},\"🚯\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":6,\"sort_order\":20},\"🚰\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":7,\"sort_order\":3},\"🚱\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":8,\"sort_order\":21},\"🚲\":{\"category\":\"Travel & Places\",\"sheet_x\":35,\"sheet_y\":9,\"sort_order\":97},\"🚳\":{\"category\":\"Symbols\",\"sheet_x\":35,\"sheet_y\":10,\"sort_order\":18},\"🚴‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":11,\"sort_order\":269},\"🚴‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":17,\"sort_order\":268},\"🚴\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":23,\"sort_order\":267},\"🚵‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":29,\"sort_order\":272},\"🚵‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":35,\"sort_order\":271},\"🚵\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":41,\"sort_order\":270},\"🚶‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":47,\"sort_order\":214},\"🚶‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":35,\"sheet_y\":53,\"sort_order\":213},\"🚶\":{\"category\":\"People & Body\",\"sheet_x\":36,\"sheet_y\":2,\"sort_order\":212},\"🚷\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":8,\"sort_order\":22},\"🚸\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":9,\"sort_order\":15},\"🚹\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":10,\"sort_order\":5},\"🚺\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":11,\"sort_order\":6},\"🚻\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":12,\"sort_order\":7},\"🚼\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":13,\"sort_order\":8},\"🚽\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":14,\"sort_order\":217},\"🚾\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":15,\"sort_order\":9},\"🚿\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":16,\"sort_order\":218},\"🛀\":{\"category\":\"People & Body\",\"sheet_x\":36,\"sheet_y\":17,\"sort_order\":291},\"🛁\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":23,\"sort_order\":219},\"🛂\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":24,\"sort_order\":10},\"🛃\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":25,\"sort_order\":11},\"🛄\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":26,\"sort_order\":12},\"🛅\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":27,\"sort_order\":13},\"🛋️\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":28,\"sort_order\":215},\"🛌\":{\"category\":\"People & Body\",\"sheet_x\":36,\"sheet_y\":29,\"sort_order\":292},\"🛍️\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":35,\"sort_order\":24},\"🛎️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":36,\"sort_order\":131},\"🛏️\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":37,\"sort_order\":214},\"🛐\":{\"category\":\"Symbols\",\"sheet_x\":36,\"sheet_y\":38,\"sort_order\":48},\"🛑\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":39,\"sort_order\":108},\"🛒\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":40,\"sort_order\":229},\"🛕\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":41,\"sort_order\":43},\"🛠️\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":42,\"sort_order\":185},\"🛡️\":{\"category\":\"Objects\",\"sheet_x\":36,\"sheet_y\":43,\"sort_order\":190},\"🛢️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":44,\"sort_order\":103},\"🛣️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":45,\"sort_order\":101},\"🛤️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":46,\"sort_order\":102},\"🛥️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":47,\"sort_order\":116},\"🛩️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":48,\"sort_order\":119},\"🛫\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":49,\"sort_order\":120},\"🛬\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":50,\"sort_order\":121},\"🛰️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":51,\"sort_order\":128},\"🛳️\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":52,\"sort_order\":114},\"🛴\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":53,\"sort_order\":98},\"🛵\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":54,\"sort_order\":93},\"🛶\":{\"category\":\"Travel & Places\",\"sheet_x\":36,\"sheet_y\":55,\"sort_order\":112},\"🛷\":{\"category\":\"Activities\",\"sheet_x\":36,\"sheet_y\":56,\"sort_order\":53},\"🛸\":{\"category\":\"Travel & Places\",\"sheet_x\":37,\"sheet_y\":0,\"sort_order\":130},\"🛹\":{\"category\":\"Travel & Places\",\"sheet_x\":37,\"sheet_y\":1,\"sort_order\":99},\"🛺\":{\"category\":\"Travel & Places\",\"sheet_x\":37,\"sheet_y\":2,\"sort_order\":96},\"🟠\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":3,\"sort_order\":185},\"🟡\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":4,\"sort_order\":186},\"🟢\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":5,\"sort_order\":187},\"🟣\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":6,\"sort_order\":189},\"🟤\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":7,\"sort_order\":190},\"🟥\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":8,\"sort_order\":193},\"🟦\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":9,\"sort_order\":197},\"🟧\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":10,\"sort_order\":194},\"🟨\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":11,\"sort_order\":195},\"🟩\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":12,\"sort_order\":196},\"🟪\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":13,\"sort_order\":198},\"🟫\":{\"category\":\"Symbols\",\"sheet_x\":37,\"sheet_y\":14,\"sort_order\":199},\"🤍\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":15,\"sort_order\":135},\"🤎\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":16,\"sort_order\":133},\"🤏\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":17,\"sort_order\":7},\"🤐\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":23,\"sort_order\":32},\"🤑\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":24,\"sort_order\":27},\"🤒\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":25,\"sort_order\":48},\"🤓\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":26,\"sort_order\":61},\"🤔\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":27,\"sort_order\":31},\"🤕\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":28,\"sort_order\":49},\"🤖\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":29,\"sort_order\":102},\"🤗\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":37,\"sheet_y\":30,\"sort_order\":28},\"🤘\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":31,\"sort_order\":11},\"🤙\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":37,\"sort_order\":12},\"🤚\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":43,\"sort_order\":2},\"🤛\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":49,\"sort_order\":23},\"🤜\":{\"category\":\"People & Body\",\"sheet_x\":37,\"sheet_y\":55,\"sort_order\":24},\"🤝\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":4,\"sort_order\":29},\"🤞\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":5,\"sort_order\":9},\"🤟\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":11,\"sort_order\":10},\"🤠\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":17,\"sort_order\":58},\"🤡\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":18,\"sort_order\":96},\"🤢\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":19,\"sort_order\":50},\"🤣\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":20,\"sort_order\":7},\"🤤\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":21,\"sort_order\":45},\"🤥\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":22,\"sort_order\":41},\"🤦‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":23,\"sort_order\":101},\"🤦‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":29,\"sort_order\":100},\"🤦\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":35,\"sort_order\":99},\"🤧\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":41,\"sort_order\":52},\"🤨\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":42,\"sort_order\":33},\"🤩\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":43,\"sort_order\":16},\"🤪\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":44,\"sort_order\":25},\"🤫\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":45,\"sort_order\":30},\"🤬\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":46,\"sort_order\":90},\"🤭\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":47,\"sort_order\":29},\"🤮\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":48,\"sort_order\":51},\"🤯\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":38,\"sheet_y\":49,\"sort_order\":57},\"🤰\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":50,\"sort_order\":174},\"🤱\":{\"category\":\"People & Body\",\"sheet_x\":38,\"sheet_y\":56,\"sort_order\":175},\"🤲\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":5,\"sort_order\":28},\"🤳\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":11,\"sort_order\":33},\"🤴\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":17,\"sort_order\":165},\"🤵\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":23,\"sort_order\":172},\"🤶\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":29,\"sort_order\":178},\"🤷‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":35,\"sort_order\":104},\"🤷‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":41,\"sort_order\":103},\"🤷\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":47,\"sort_order\":102},\"🤸‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":39,\"sheet_y\":53,\"sort_order\":275},\"🤸‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":2,\"sort_order\":274},\"🤸\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":8,\"sort_order\":273},\"🤹‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":14,\"sort_order\":287},\"🤹‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":20,\"sort_order\":286},\"🤹\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":26,\"sort_order\":285},\"🤺\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":32,\"sort_order\":245},\"🤼‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":33,\"sort_order\":278},\"🤼‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":34,\"sort_order\":277},\"🤼\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":35,\"sort_order\":276},\"🤽‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":36,\"sort_order\":281},\"🤽‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":42,\"sort_order\":280},\"🤽\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":48,\"sort_order\":279},\"🤾‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":40,\"sheet_y\":54,\"sort_order\":284},\"🤾‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":41,\"sheet_y\":3,\"sort_order\":283},\"🤾\":{\"category\":\"People & Body\",\"sheet_x\":41,\"sheet_y\":9,\"sort_order\":282},\"🤿\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":15,\"sort_order\":50},\"🥀\":{\"category\":\"Animals & Nature\",\"sheet_x\":41,\"sheet_y\":16,\"sort_order\":111},\"🥁\":{\"category\":\"Objects\",\"sheet_x\":41,\"sheet_y\":17,\"sort_order\":68},\"🥂\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":18,\"sort_order\":110},\"🥃\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":19,\"sort_order\":111},\"🥄\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":20,\"sort_order\":119},\"🥅\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":21,\"sort_order\":46},\"🥇\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":22,\"sort_order\":25},\"🥈\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":23,\"sort_order\":26},\"🥉\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":24,\"sort_order\":27},\"🥊\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":25,\"sort_order\":44},\"🥋\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":26,\"sort_order\":45},\"🥌\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":27,\"sort_order\":54},\"🥍\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":28,\"sort_order\":41},\"🥎\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":29,\"sort_order\":30},\"🥏\":{\"category\":\"Activities\",\"sheet_x\":41,\"sheet_y\":30,\"sort_order\":36},\"🥐\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":31,\"sort_order\":33},\"🥑\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":32,\"sort_order\":18},\"🥒\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":33,\"sort_order\":24},\"🥓\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":34,\"sort_order\":43},\"🥔\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":35,\"sort_order\":20},\"🥕\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":36,\"sort_order\":21},\"🥖\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":37,\"sort_order\":34},\"🥗\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":38,\"sort_order\":58},\"🥘\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":39,\"sort_order\":55},\"🥙\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":40,\"sort_order\":51},\"🥚\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":41,\"sort_order\":53},\"🥛\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":42,\"sort_order\":100},\"🥜\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":43,\"sort_order\":30},\"🥝\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":44,\"sort_order\":15},\"🥞\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":45,\"sort_order\":37},\"🥟\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":46,\"sort_order\":77},\"🥠\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":47,\"sort_order\":78},\"🥡\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":48,\"sort_order\":79},\"🥢\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":49,\"sort_order\":116},\"🥣\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":50,\"sort_order\":57},\"🥤\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":51,\"sort_order\":112},\"🥥\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":52,\"sort_order\":17},\"🥦\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":53,\"sort_order\":26},\"🥧\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":54,\"sort_order\":93},\"🥨\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":55,\"sort_order\":35},\"🥩\":{\"category\":\"Food & Drink\",\"sheet_x\":41,\"sheet_y\":56,\"sort_order\":42},\"🥪\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":0,\"sort_order\":48},\"🥫\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":1,\"sort_order\":62},\"🥬\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":2,\"sort_order\":25},\"🥭\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":3,\"sort_order\":8},\"🥮\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":4,\"sort_order\":75},\"🥯\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":5,\"sort_order\":36},\"🥰\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":6,\"sort_order\":14},\"🥱\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":7,\"sort_order\":86},\"🥳\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":8,\"sort_order\":59},\"🥴\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":9,\"sort_order\":55},\"🥵\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":10,\"sort_order\":53},\"🥶\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":11,\"sort_order\":54},\"🥺\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":42,\"sheet_y\":12,\"sort_order\":71},\"🥻\":{\"category\":\"Objects\",\"sheet_x\":42,\"sheet_y\":13,\"sort_order\":15},\"🥼\":{\"category\":\"Objects\",\"sheet_x\":42,\"sheet_y\":14,\"sort_order\":4},\"🥽\":{\"category\":\"Objects\",\"sheet_x\":42,\"sheet_y\":15,\"sort_order\":3},\"🥾\":{\"category\":\"Objects\",\"sheet_x\":42,\"sheet_y\":16,\"sort_order\":28},\"🥿\":{\"category\":\"Objects\",\"sheet_x\":42,\"sheet_y\":17,\"sort_order\":29},\"🦀\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":18,\"sort_order\":80},\"🦁\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":19,\"sort_order\":15},\"🦂\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":20,\"sort_order\":103},\"🦃\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":21,\"sort_order\":60},\"🦄\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":22,\"sort_order\":21},\"🦅\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":23,\"sort_order\":69},\"🦆\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":24,\"sort_order\":70},\"🦇\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":25,\"sort_order\":50},\"🦈\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":26,\"sort_order\":91},\"🦉\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":27,\"sort_order\":72},\"🦊\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":28,\"sort_order\":11},\"🦋\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":29,\"sort_order\":95},\"🦌\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":30,\"sort_order\":23},\"🦍\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":31,\"sort_order\":3},\"🦎\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":32,\"sort_order\":79},\"🦏\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":33,\"sort_order\":40},\"🦐\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":34,\"sort_order\":82},\"🦑\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":35,\"sort_order\":83},\"🦒\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":36,\"sort_order\":38},\"🦓\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":37,\"sort_order\":22},\"🦔\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":38,\"sort_order\":49},\"🦕\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":39,\"sort_order\":83},\"🦖\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":40,\"sort_order\":84},\"🦗\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":41,\"sort_order\":100},\"🦘\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":42,\"sort_order\":57},\"🦙\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":43,\"sort_order\":37},\"🦚\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":44,\"sort_order\":74},\"🦛\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":45,\"sort_order\":41},\"🦜\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":46,\"sort_order\":75},\"🦝\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":47,\"sort_order\":12},\"🦞\":{\"category\":\"Food & Drink\",\"sheet_x\":42,\"sheet_y\":48,\"sort_order\":81},\"🦟\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":49,\"sort_order\":104},\"🦠\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":50,\"sort_order\":105},\"🦡\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":51,\"sort_order\":58},\"🦢\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":52,\"sort_order\":71},\"🦥\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":53,\"sort_order\":54},\"🦦\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":54,\"sort_order\":55},\"🦧\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":55,\"sort_order\":4},\"🦨\":{\"category\":\"Animals & Nature\",\"sheet_x\":42,\"sheet_y\":56,\"sort_order\":56},\"🦩\":{\"category\":\"Animals & Nature\",\"sheet_x\":43,\"sheet_y\":0,\"sort_order\":73},\"🦪\":{\"category\":\"Food & Drink\",\"sheet_x\":43,\"sheet_y\":1,\"sort_order\":84},\"🦮\":{\"category\":\"Animals & Nature\",\"sheet_x\":43,\"sheet_y\":2,\"sort_order\":7},\"🦯\":{\"category\":\"Objects\",\"sheet_x\":43,\"sheet_y\":3,\"sort_order\":196},\"🦴\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":4,\"sort_order\":44},\"🦵\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":5,\"sort_order\":37},\"🦶\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":11,\"sort_order\":38},\"🦷\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":17,\"sort_order\":43},\"🦸‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":18,\"sort_order\":181},\"🦸‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":24,\"sort_order\":180},\"🦸\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":30,\"sort_order\":179},\"🦹‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":36,\"sort_order\":184},\"🦹‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":42,\"sort_order\":183},\"🦹\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":48,\"sort_order\":182},\"🦺\":{\"category\":\"Objects\",\"sheet_x\":43,\"sheet_y\":54,\"sort_order\":5},\"🦻\":{\"category\":\"People & Body\",\"sheet_x\":43,\"sheet_y\":55,\"sort_order\":40},\"🦼\":{\"category\":\"Travel & Places\",\"sheet_x\":44,\"sheet_y\":4,\"sort_order\":95},\"🦽\":{\"category\":\"Travel & Places\",\"sheet_x\":44,\"sheet_y\":5,\"sort_order\":94},\"🦾\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":6,\"sort_order\":35},\"🦿\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":7,\"sort_order\":36},\"🧀\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":8,\"sort_order\":39},\"🧁\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":9,\"sort_order\":92},\"🧂\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":10,\"sort_order\":61},\"🧃\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":11,\"sort_order\":113},\"🧄\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":12,\"sort_order\":27},\"🧅\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":13,\"sort_order\":28},\"🧆\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":14,\"sort_order\":52},\"🧇\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":15,\"sort_order\":38},\"🧈\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":16,\"sort_order\":60},\"🧉\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":17,\"sort_order\":114},\"🧊\":{\"category\":\"Food & Drink\",\"sheet_x\":44,\"sheet_y\":18,\"sort_order\":115},\"🧍‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":19,\"sort_order\":217},\"🧍‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":25,\"sort_order\":216},\"🧍\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":31,\"sort_order\":215},\"🧎‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":37,\"sort_order\":220},\"🧎‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":43,\"sort_order\":219},\"🧎\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":49,\"sort_order\":218},\"🧏‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":44,\"sheet_y\":55,\"sort_order\":95},\"🧏‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":4,\"sort_order\":94},\"🧏\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":10,\"sort_order\":93},\"🧐\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":45,\"sheet_y\":16,\"sort_order\":62},\"🧑‍🌾\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":17,\"sort_order\":117},\"🧑‍🍳\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":23,\"sort_order\":120},\"🧑‍🎓\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":29,\"sort_order\":108},\"🧑‍🎤\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":35,\"sort_order\":138},\"🧑‍🎨\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":41,\"sort_order\":141},\"🧑‍🏫\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":47,\"sort_order\":111},\"🧑‍🏭\":{\"category\":\"People & Body\",\"sheet_x\":45,\"sheet_y\":53,\"sort_order\":126},\"🧑‍💻\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":2,\"sort_order\":135},\"🧑‍💼\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":8,\"sort_order\":129},\"🧑‍🔧\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":14,\"sort_order\":123},\"🧑‍🔬\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":20,\"sort_order\":132},\"🧑‍🚀\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":26,\"sort_order\":147},\"🧑‍🚒\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":32,\"sort_order\":150},\"🧑‍🤝‍🧑\":{\"category\":\"People & Body\",\"sheet_x\":46,\"sheet_y\":38,\"sort_order\":293},\"🧑‍🦯\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":7,\"sort_order\":221},\"🧑‍🦰\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":13,\"sort_order\":63},\"🧑‍🦱\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":19,\"sort_order\":65},\"🧑‍🦲\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":25,\"sort_order\":69},\"🧑‍🦳\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":31,\"sort_order\":67},\"🧑‍🦼\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":37,\"sort_order\":224},\"🧑‍🦽\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":43,\"sort_order\":227},\"🧑‍⚕️\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":49,\"sort_order\":105},\"🧑‍⚖️\":{\"category\":\"People & Body\",\"sheet_x\":47,\"sheet_y\":55,\"sort_order\":114},\"🧑‍✈️\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":4,\"sort_order\":144},\"🧑\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":10,\"sort_order\":53},\"🧒\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":16,\"sort_order\":50},\"🧓\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":22,\"sort_order\":72},\"🧔\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":28,\"sort_order\":56},\"🧕\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":34,\"sort_order\":171},\"🧖‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":40,\"sort_order\":241},\"🧖‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":46,\"sort_order\":240},\"🧖\":{\"category\":\"People & Body\",\"sheet_x\":48,\"sheet_y\":52,\"sort_order\":239},\"🧗‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":1,\"sort_order\":244},\"🧗‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":7,\"sort_order\":243},\"🧗\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":13,\"sort_order\":242},\"🧘‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":19,\"sort_order\":290},\"🧘‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":25,\"sort_order\":289},\"🧘\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":31,\"sort_order\":288},\"🧙‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":37,\"sort_order\":187},\"🧙‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":43,\"sort_order\":186},\"🧙\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":49,\"sort_order\":185},\"🧚‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":49,\"sheet_y\":55,\"sort_order\":190},\"🧚‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":4,\"sort_order\":189},\"🧚\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":10,\"sort_order\":188},\"🧛‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":16,\"sort_order\":193},\"🧛‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":22,\"sort_order\":192},\"🧛\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":28,\"sort_order\":191},\"🧜‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":34,\"sort_order\":196},\"🧜‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":40,\"sort_order\":195},\"🧜\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":46,\"sort_order\":194},\"🧝‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":50,\"sheet_y\":52,\"sort_order\":199},\"🧝‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":1,\"sort_order\":198},\"🧝\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":7,\"sort_order\":197},\"🧞‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":13,\"sort_order\":202},\"🧞‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":14,\"sort_order\":201},\"🧞\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":15,\"sort_order\":200},\"🧟‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":16,\"sort_order\":205},\"🧟‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":17,\"sort_order\":204},\"🧟\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":18,\"sort_order\":203},\"🧠\":{\"category\":\"People & Body\",\"sheet_x\":51,\"sheet_y\":19,\"sort_order\":42},\"🧡\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":51,\"sheet_y\":20,\"sort_order\":128},\"🧢\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":21,\"sort_order\":38},\"🧣\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":22,\"sort_order\":9},\"🧤\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":23,\"sort_order\":10},\"🧥\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":24,\"sort_order\":11},\"🧦\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":25,\"sort_order\":12},\"🧧\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":26,\"sort_order\":16},\"🧨\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":27,\"sort_order\":5},\"🧩\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":28,\"sort_order\":65},\"🧪\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":29,\"sort_order\":202},\"🧫\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":30,\"sort_order\":203},\"🧬\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":31,\"sort_order\":204},\"🧭\":{\"category\":\"Travel & Places\",\"sheet_x\":51,\"sheet_y\":32,\"sort_order\":7},\"🧮\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":33,\"sort_order\":87},\"🧯\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":34,\"sort_order\":228},\"🧰\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":35,\"sort_order\":199},\"🧱\":{\"category\":\"Travel & Places\",\"sheet_x\":51,\"sheet_y\":36,\"sort_order\":20},\"🧲\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":37,\"sort_order\":200},\"🧳\":{\"category\":\"Travel & Places\",\"sheet_x\":51,\"sheet_y\":38,\"sort_order\":132},\"🧴\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":39,\"sort_order\":221},\"🧵\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":40,\"sort_order\":78},\"🧶\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":41,\"sort_order\":79},\"🧷\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":42,\"sort_order\":222},\"🧸\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":43,\"sort_order\":66},\"🧹\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":44,\"sort_order\":223},\"🧺\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":45,\"sort_order\":224},\"🧻\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":46,\"sort_order\":225},\"🧼\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":47,\"sort_order\":226},\"🧽\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":48,\"sort_order\":227},\"🧾\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":49,\"sort_order\":128},\"🧿\":{\"category\":\"Activities\",\"sheet_x\":51,\"sheet_y\":50,\"sort_order\":60},\"🩰\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":51,\"sort_order\":32},\"🩱\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":52,\"sort_order\":16},\"🩲\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":53,\"sort_order\":17},\"🩳\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":54,\"sort_order\":18},\"🩸\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":55,\"sort_order\":209},\"🩹\":{\"category\":\"Objects\",\"sheet_x\":51,\"sheet_y\":56,\"sort_order\":211},\"🩺\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":0,\"sort_order\":212},\"🪀\":{\"category\":\"Activities\",\"sheet_x\":52,\"sheet_y\":1,\"sort_order\":56},\"🪁\":{\"category\":\"Activities\",\"sheet_x\":52,\"sheet_y\":2,\"sort_order\":57},\"🪂\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":3,\"sort_order\":122},\"🪐\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":4,\"sort_order\":180},\"🪑\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":5,\"sort_order\":216},\"🪒\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":6,\"sort_order\":220},\"🪓\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":7,\"sort_order\":182},\"🪔\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":8,\"sort_order\":103},\"🪕\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":9,\"sort_order\":67},\"‼️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":10,\"sort_order\":122},\"⁉️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":11,\"sort_order\":123},\"™️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":12,\"sort_order\":131},\"ℹ️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":13,\"sort_order\":156},\"↔️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":14,\"sort_order\":36},\"↕️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":15,\"sort_order\":35},\"↖️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":16,\"sort_order\":34},\"↗️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":17,\"sort_order\":28},\"↘️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":18,\"sort_order\":30},\"↙️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":19,\"sort_order\":32},\"↩️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":20,\"sort_order\":37},\"↪️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":21,\"sort_order\":38},\"⌚\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":22,\"sort_order\":135},\"⌛\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":23,\"sort_order\":133},\"⌨️\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":24,\"sort_order\":80},\"⏏️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":25,\"sort_order\":90},\"⏩\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":26,\"sort_order\":77},\"⏪\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":27,\"sort_order\":81},\"⏫\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":28,\"sort_order\":84},\"⏬\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":29,\"sort_order\":86},\"⏭️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":30,\"sort_order\":78},\"⏮️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":31,\"sort_order\":82},\"⏯️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":32,\"sort_order\":79},\"⏰\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":33,\"sort_order\":136},\"⏱️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":34,\"sort_order\":137},\"⏲️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":35,\"sort_order\":138},\"⏳\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":36,\"sort_order\":134},\"⏸️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":37,\"sort_order\":87},\"⏹️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":38,\"sort_order\":88},\"⏺️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":39,\"sort_order\":89},\"Ⓜ️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":40,\"sort_order\":158},\"▪️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":41,\"sort_order\":206},\"▫️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":42,\"sort_order\":207},\"▶️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":43,\"sort_order\":76},\"◀️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":44,\"sort_order\":80},\"◻️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":45,\"sort_order\":203},\"◼️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":46,\"sort_order\":202},\"◽\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":47,\"sort_order\":205},\"◾\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":48,\"sort_order\":204},\"☀️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":49,\"sort_order\":177},\"☁️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":50,\"sort_order\":185},\"☂️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":51,\"sort_order\":200},\"☃️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":52,\"sort_order\":205},\"☄️\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":53,\"sort_order\":207},\"☎️\":{\"category\":\"Objects\",\"sheet_x\":52,\"sheet_y\":54,\"sort_order\":71},\"☑️\":{\"category\":\"Symbols\",\"sheet_x\":52,\"sheet_y\":55,\"sort_order\":108},\"☔\":{\"category\":\"Travel & Places\",\"sheet_x\":52,\"sheet_y\":56,\"sort_order\":201},\"☕\":{\"category\":\"Food & Drink\",\"sheet_x\":53,\"sheet_y\":0,\"sort_order\":101},\"☘️\":{\"category\":\"Animals & Nature\",\"sheet_x\":53,\"sheet_y\":1,\"sort_order\":123},\"☝️\":{\"category\":\"People & Body\",\"sheet_x\":53,\"sheet_y\":2,\"sort_order\":18},\"☠️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":53,\"sheet_y\":8,\"sort_order\":94},\"☢️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":9,\"sort_order\":25},\"☣️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":10,\"sort_order\":26},\"☦️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":11,\"sort_order\":55},\"☪️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":12,\"sort_order\":56},\"☮️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":13,\"sort_order\":57},\"☯️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":14,\"sort_order\":53},\"☸️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":15,\"sort_order\":52},\"☹️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":53,\"sheet_y\":16,\"sort_order\":66},\"☺️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":53,\"sheet_y\":17,\"sort_order\":19},\"♈\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":20,\"sort_order\":60},\"♉\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":21,\"sort_order\":61},\"♊\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":22,\"sort_order\":62},\"♋\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":23,\"sort_order\":63},\"♌\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":24,\"sort_order\":64},\"♍\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":25,\"sort_order\":65},\"♎\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":26,\"sort_order\":66},\"♏\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":27,\"sort_order\":67},\"♐\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":28,\"sort_order\":68},\"♑\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":29,\"sort_order\":69},\"♒\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":30,\"sort_order\":70},\"♓\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":31,\"sort_order\":71},\"♟️\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":32,\"sort_order\":71},\"♠️\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":33,\"sort_order\":67},\"♣️\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":34,\"sort_order\":70},\"♥️\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":35,\"sort_order\":68},\"♦️\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":36,\"sort_order\":69},\"♨️\":{\"category\":\"Travel & Places\",\"sheet_x\":53,\"sheet_y\":37,\"sort_order\":57},\"♻️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":38,\"sort_order\":101},\"♾️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":39,\"sort_order\":100},\"♿\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":40,\"sort_order\":4},\"⚒️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":41,\"sort_order\":184},\"⚓\":{\"category\":\"Travel & Places\",\"sheet_x\":53,\"sheet_y\":42,\"sort_order\":110},\"⚔️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":43,\"sort_order\":187},\"⚖️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":45,\"sort_order\":195},\"⚗️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":46,\"sort_order\":201},\"⚙️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":47,\"sort_order\":193},\"⚛️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":48,\"sort_order\":49},\"⚜️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":49,\"sort_order\":102},\"⚠️\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":50,\"sort_order\":14},\"⚡\":{\"category\":\"Travel & Places\",\"sheet_x\":53,\"sheet_y\":51,\"sort_order\":203},\"⚪\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":52,\"sort_order\":192},\"⚫\":{\"category\":\"Symbols\",\"sheet_x\":53,\"sheet_y\":53,\"sort_order\":191},\"⚰️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":54,\"sort_order\":231},\"⚱️\":{\"category\":\"Objects\",\"sheet_x\":53,\"sheet_y\":55,\"sort_order\":232},\"⚽\":{\"category\":\"Activities\",\"sheet_x\":53,\"sheet_y\":56,\"sort_order\":28},\"⚾\":{\"category\":\"Activities\",\"sheet_x\":54,\"sheet_y\":0,\"sort_order\":29},\"⛄\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":1,\"sort_order\":206},\"⛅\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":2,\"sort_order\":186},\"⛈️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":3,\"sort_order\":187},\"⛎\":{\"category\":\"Symbols\",\"sheet_x\":54,\"sheet_y\":4,\"sort_order\":72},\"⛏️\":{\"category\":\"Objects\",\"sheet_x\":54,\"sheet_y\":5,\"sort_order\":183},\"⛑️\":{\"category\":\"Objects\",\"sheet_x\":54,\"sheet_y\":6,\"sort_order\":39},\"⛓️\":{\"category\":\"Objects\",\"sheet_x\":54,\"sheet_y\":7,\"sort_order\":198},\"⛔\":{\"category\":\"Symbols\",\"sheet_x\":54,\"sheet_y\":8,\"sort_order\":16},\"⛩️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":9,\"sort_order\":45},\"⛪\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":10,\"sort_order\":41},\"⛰️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":11,\"sort_order\":9},\"⛱️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":12,\"sort_order\":202},\"⛲\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":13,\"sort_order\":47},\"⛳\":{\"category\":\"Activities\",\"sheet_x\":54,\"sheet_y\":14,\"sort_order\":47},\"⛴️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":15,\"sort_order\":115},\"⛵\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":16,\"sort_order\":111},\"⛷️\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":17,\"sort_order\":247},\"⛸️\":{\"category\":\"Activities\",\"sheet_x\":54,\"sheet_y\":18,\"sort_order\":48},\"⛹️‍♀️\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":19,\"sort_order\":263},\"⛹️‍♂️\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":25,\"sort_order\":262},\"⛹️\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":31,\"sort_order\":261},\"⛺\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":37,\"sort_order\":48},\"⛽\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":38,\"sort_order\":104},\"✂️\":{\"category\":\"Objects\",\"sheet_x\":54,\"sheet_y\":39,\"sort_order\":171},\"✅\":{\"category\":\"Symbols\",\"sheet_x\":54,\"sheet_y\":40,\"sort_order\":107},\"✈️\":{\"category\":\"Travel & Places\",\"sheet_x\":54,\"sheet_y\":41,\"sort_order\":118},\"✉️\":{\"category\":\"Objects\",\"sheet_x\":54,\"sheet_y\":42,\"sort_order\":132},\"✊\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":43,\"sort_order\":21},\"✋\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":49,\"sort_order\":4},\"✌️\":{\"category\":\"People & Body\",\"sheet_x\":54,\"sheet_y\":55,\"sort_order\":8},\"✍️\":{\"category\":\"People & Body\",\"sheet_x\":55,\"sheet_y\":4,\"sort_order\":31},\"✏️\":{\"category\":\"Objects\",\"sheet_x\":55,\"sheet_y\":10,\"sort_order\":145},\"✒️\":{\"category\":\"Objects\",\"sheet_x\":55,\"sheet_y\":11,\"sort_order\":146},\"✔️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":12,\"sort_order\":109},\"✖️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":13,\"sort_order\":110},\"✝️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":14,\"sort_order\":54},\"✡️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":15,\"sort_order\":51},\"✨\":{\"category\":\"Activities\",\"sheet_x\":55,\"sheet_y\":16,\"sort_order\":6},\"✳️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":17,\"sort_order\":119},\"✴️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":18,\"sort_order\":120},\"❄️\":{\"category\":\"Travel & Places\",\"sheet_x\":55,\"sheet_y\":19,\"sort_order\":204},\"❇️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":20,\"sort_order\":121},\"❌\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":21,\"sort_order\":111},\"❎\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":22,\"sort_order\":112},\"❓\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":23,\"sort_order\":124},\"❔\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":24,\"sort_order\":125},\"❕\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":25,\"sort_order\":126},\"❗\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":26,\"sort_order\":127},\"❣️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":55,\"sheet_y\":27,\"sort_order\":125},\"❤️\":{\"category\":\"Smileys & Emotion\",\"sheet_x\":55,\"sheet_y\":28,\"sort_order\":127},\"➕\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":29,\"sort_order\":113},\"➖\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":30,\"sort_order\":114},\"➗\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":31,\"sort_order\":115},\"➡️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":32,\"sort_order\":29},\"➰\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":33,\"sort_order\":116},\"➿\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":34,\"sort_order\":117},\"⤴️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":35,\"sort_order\":39},\"⤵️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":36,\"sort_order\":40},\"⬅️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":37,\"sort_order\":33},\"⬆️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":38,\"sort_order\":27},\"⬇️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":39,\"sort_order\":31},\"⬛\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":40,\"sort_order\":200},\"⬜\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":41,\"sort_order\":201},\"⭐\":{\"category\":\"Travel & Places\",\"sheet_x\":55,\"sheet_y\":42,\"sort_order\":181},\"⭕\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":43,\"sort_order\":106},\"〰️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":44,\"sort_order\":128},\"〽️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":45,\"sort_order\":118},\"㊗️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":46,\"sort_order\":180},\"㊙️\":{\"category\":\"Symbols\",\"sheet_x\":55,\"sheet_y\":47,\"sort_order\":181}}\r\n };\r\n}\r\n\r\nConfig.Countries = [{\"phoneCode\":\"7 840\",\"code\":\"AB\",\"name\":\"Abkhazia\",\"pattern\":\"\",\"emoji\":\"\"},{\"phoneCode\":\"93\",\"code\":\"AF\",\"name\":\"Afghanistan\",\"pattern\":\"93 XXX XXX XXX\",\"emoji\":\"🇦🇫\"},{\"phoneCode\":\"358 18\",\"code\":\"AX\",\"name\":\"Aland Islands\",\"pattern\":\"\",\"emoji\":\"🇦🇽\"},{\"phoneCode\":\"355\",\"code\":\"AL\",\"name\":\"Albania\",\"pattern\":\"355 XX XXX XXXX\",\"emoji\":\"🇦🇱\"},{\"phoneCode\":\"213\",\"code\":\"DZ\",\"name\":\"Algeria\",\"pattern\":\"213 XXX XX XX XX\",\"emoji\":\"🇩🇿\"},{\"phoneCode\":\"1 684\",\"code\":\"AS\",\"name\":\"American Samoa\",\"pattern\":\"1684 XXX XXXX\",\"emoji\":\"🇦🇸\"},{\"phoneCode\":\"376\",\"code\":\"AD\",\"name\":\"Andorra\",\"pattern\":\"376 XX XX XX\",\"emoji\":\"🇦🇩\"},{\"phoneCode\":\"244\",\"code\":\"AO\",\"name\":\"Angola\",\"pattern\":\"244 XXX XXX XXX\",\"emoji\":\"🇦🇴\"},{\"phoneCode\":\"1 264\",\"code\":\"AI\",\"name\":\"Anguilla\",\"pattern\":\"1264 XXX XXXX\",\"emoji\":\"🇦🇮\"},{\"phoneCode\":\"1 268\",\"code\":\"AG\",\"name\":\"Antigua & Barbuda\",\"pattern\":\"1268 XXX XXXX\",\"emoji\":\"🇦🇬\"},{\"phoneCode\":\"54\",\"code\":\"AR\",\"name\":\"Argentina\",\"pattern\":\"\",\"emoji\":\"🇦🇷\"},{\"phoneCode\":\"374\",\"code\":\"AM\",\"name\":\"Armenia\",\"pattern\":\"374 XX XXX XXX\",\"emoji\":\"🇦🇲\"},{\"phoneCode\":\"297\",\"code\":\"AW\",\"name\":\"Aruba\",\"pattern\":\"297 XXX XXXX\",\"emoji\":\"🇦🇼\"},{\"phoneCode\":\"247\",\"code\":\"SH\",\"name\":\"Ascension\",\"pattern\":\"290 XX XXX\",\"emoji\":\"🇸🇭\"},{\"phoneCode\":\"61\",\"code\":\"AU\",\"name\":\"Australia\",\"pattern\":\"61 XXX XXX XXX\",\"emoji\":\"🇦🇺\"},{\"phoneCode\":\"672\",\"code\":\"AU\",\"name\":\"Australian External Territories\",\"pattern\":\"61 XXX XXX XXX\",\"emoji\":\"🇦🇺\"},{\"phoneCode\":\"43\",\"code\":\"AT\",\"name\":\"Austria\",\"pattern\":\"\",\"emoji\":\"🇦🇹\"},{\"phoneCode\":\"994\",\"code\":\"AZ\",\"name\":\"Azerbaijan\",\"pattern\":\"994 XX XXX XX XX\",\"emoji\":\"🇦🇿\"},{\"phoneCode\":\"1 242\",\"code\":\"BS\",\"name\":\"Bahamas\",\"pattern\":\"1242 XXX XXXX\",\"emoji\":\"🇧🇸\"},{\"phoneCode\":\"973\",\"code\":\"BH\",\"name\":\"Bahrain\",\"pattern\":\"973 XXXX XXXX\",\"emoji\":\"🇧🇭\"},{\"phoneCode\":\"880\",\"code\":\"BD\",\"name\":\"Bangladesh\",\"pattern\":\"\",\"emoji\":\"🇧🇩\"},{\"phoneCode\":\"1 246\",\"code\":\"BB\",\"name\":\"Barbados\",\"pattern\":\"1246 XXX XXXX\",\"emoji\":\"🇧🇧\"},{\"phoneCode\":\"1 268\",\"code\":\"AG\",\"name\":\"Barbuda\",\"pattern\":\"1268 XXX XXXX\",\"emoji\":\"🇦🇬\"},{\"phoneCode\":\"375\",\"code\":\"BY\",\"name\":\"Belarus\",\"pattern\":\"375 XX XXX XXXX\",\"emoji\":\"🇧🇾\"},{\"phoneCode\":\"32\",\"code\":\"BE\",\"name\":\"Belgium\",\"pattern\":\"32 XXX XX XX XX\",\"emoji\":\"🇧🇪\"},{\"phoneCode\":\"501\",\"code\":\"BZ\",\"name\":\"Belize\",\"pattern\":\"\",\"emoji\":\"🇧🇿\"},{\"phoneCode\":\"229\",\"code\":\"BJ\",\"name\":\"Benin\",\"pattern\":\"229 XX XXX XXX\",\"emoji\":\"🇧🇯\"},{\"phoneCode\":\"1 441\",\"code\":\"BM\",\"name\":\"Bermuda\",\"pattern\":\"1441 XXX XXXX\",\"emoji\":\"🇧🇲\"},{\"phoneCode\":\"975\",\"code\":\"BT\",\"name\":\"Bhutan\",\"pattern\":\"\",\"emoji\":\"🇧🇹\"},{\"phoneCode\":\"591\",\"code\":\"BO\",\"name\":\"Bolivia\",\"pattern\":\"591 X XXX XXXX\",\"emoji\":\"🇧🇴\"},{\"phoneCode\":\"599 7\",\"code\":\"BQ\",\"name\":\"Caribbean Netherlands\",\"pattern\":\"\",\"emoji\":\"🇧🇶\"},{\"phoneCode\":\"387\",\"code\":\"BA\",\"name\":\"Bosnia & Herzegovina\",\"pattern\":\"\",\"emoji\":\"🇧🇦\"},{\"phoneCode\":\"267\",\"code\":\"BW\",\"name\":\"Botswana\",\"pattern\":\"267 XX XXX XXX\",\"emoji\":\"🇧🇼\"},{\"phoneCode\":\"55\",\"code\":\"BR\",\"name\":\"Brazil\",\"pattern\":\"55 XX XXXXX XXXX\",\"emoji\":\"🇧🇷\"},{\"phoneCode\":\"246\",\"code\":\"IO\",\"name\":\"British Indian Ocean Territory\",\"pattern\":\"246 XXX XXXX\",\"emoji\":\"🇮🇴\"},{\"phoneCode\":\"1 284\",\"code\":\"VG\",\"name\":\"British Virgin Islands\",\"pattern\":\"1284 XXX XXXX\",\"emoji\":\"🇻🇬\"},{\"phoneCode\":\"673\",\"code\":\"BN\",\"name\":\"Brunei\",\"pattern\":\"673 XXX XXXX\",\"emoji\":\"🇧🇳\"},{\"phoneCode\":\"359\",\"code\":\"BG\",\"name\":\"Bulgaria\",\"pattern\":\"\",\"emoji\":\"🇧🇬\"},{\"phoneCode\":\"226\",\"code\":\"BF\",\"name\":\"Burkina Faso\",\"pattern\":\"226 XX XX XX XX\",\"emoji\":\"🇧🇫\"},{\"phoneCode\":\"95\",\"code\":\"MM\",\"name\":\"Myanmar (Burma)\",\"pattern\":\"\",\"emoji\":\"🇲🇲\"},{\"phoneCode\":\"257\",\"code\":\"BI\",\"name\":\"Burundi\",\"pattern\":\"257 XX XX XXXX\",\"emoji\":\"🇧🇮\"},{\"phoneCode\":\"855\",\"code\":\"KH\",\"name\":\"Cambodia\",\"pattern\":\"\",\"emoji\":\"🇰🇭\"},{\"phoneCode\":\"237\",\"code\":\"CM\",\"name\":\"Cameroon\",\"pattern\":\"237 XXXX XXXX\",\"emoji\":\"🇨🇲\"},{\"phoneCode\":\"1\",\"code\":\"CA\",\"name\":\"Canada\",\"pattern\":\"1 XXX XXX XXXX\",\"emoji\":\"🇨🇦\"},{\"phoneCode\":\"238\",\"code\":\"CV\",\"name\":\"Cape Verde\",\"pattern\":\"238 XXX XXXX\",\"emoji\":\"🇨🇻\"},{\"phoneCode\":\"1 345\",\"code\":\"KY\",\"name\":\"Cayman Islands\",\"pattern\":\"1345 XXX XXXX\",\"emoji\":\"🇰🇾\"},{\"phoneCode\":\"236\",\"code\":\"CF\",\"name\":\"Central African Republic\",\"pattern\":\"236 XX XX XX XX\",\"emoji\":\"🇨🇫\"},{\"phoneCode\":\"235\",\"code\":\"TD\",\"name\":\"Chad\",\"pattern\":\"235 XX XX XX XX\",\"emoji\":\"🇹🇩\"},{\"phoneCode\":\"56\",\"code\":\"CL\",\"name\":\"Chile\",\"pattern\":\"56 X XXXX XXXX\",\"emoji\":\"🇨🇱\"},{\"phoneCode\":\"86\",\"code\":\"CN\",\"name\":\"China\",\"pattern\":\"86 XXX XXXX XXXX\",\"emoji\":\"🇨🇳\"},{\"phoneCode\":\"61\",\"code\":\"CX\",\"name\":\"Christmas Island\",\"pattern\":\"\",\"emoji\":\"🇨🇽\"},{\"phoneCode\":\"61\",\"code\":\"CC\",\"name\":\"Cocos (Keeling) Islands\",\"pattern\":\"\",\"emoji\":\"🇨🇨\"},{\"phoneCode\":\"57\",\"code\":\"CO\",\"name\":\"Colombia\",\"pattern\":\"57 XXX XXX XXXX\",\"emoji\":\"🇨🇴\"},{\"phoneCode\":\"269\",\"code\":\"KM\",\"name\":\"Comoros\",\"pattern\":\"269 XXX XXXX\",\"emoji\":\"🇰🇲\"},{\"phoneCode\":\"242\",\"code\":\"CG\",\"name\":\"Congo - Brazzaville\",\"pattern\":\"242 XX XXX XXXX\",\"emoji\":\"🇨🇬\"},{\"phoneCode\":\"243\",\"code\":\"CD\",\"name\":\"Congo - Kinshasa\",\"pattern\":\"243 XX XXX XXXX\",\"emoji\":\"🇨🇩\"},{\"phoneCode\":\"682\",\"code\":\"CK\",\"name\":\"Cook Islands\",\"pattern\":\"\",\"emoji\":\"🇨🇰\"},{\"phoneCode\":\"506\",\"code\":\"CR\",\"name\":\"Costa Rica\",\"pattern\":\"\",\"emoji\":\"🇨🇷\"},{\"phoneCode\":\"225\",\"code\":\"CI\",\"name\":\"Cote d’Ivoire\",\"pattern\":\"225 XX XXX XXX\",\"emoji\":\"🇨🇮\"},{\"phoneCode\":\"385\",\"code\":\"HR\",\"name\":\"Croatia\",\"pattern\":\"\",\"emoji\":\"🇭🇷\"},{\"phoneCode\":\"53\",\"code\":\"CU\",\"name\":\"Cuba\",\"pattern\":\"53 XXXX XXXX\",\"emoji\":\"🇨🇺\"},{\"phoneCode\":\"599 9\",\"code\":\"CW\",\"name\":\"Curacao\",\"pattern\":\"\",\"emoji\":\"🇨🇼\"},{\"phoneCode\":\"357\",\"code\":\"CY\",\"name\":\"Cyprus\",\"pattern\":\"357 XXXX XXXX\",\"emoji\":\"🇨🇾\"},{\"phoneCode\":\"420\",\"code\":\"CZ\",\"name\":\"Czech Republic\",\"pattern\":\"\",\"emoji\":\"🇨🇿\"},{\"phoneCode\":\"45\",\"code\":\"DK\",\"name\":\"Denmark\",\"pattern\":\"45 XXXX XXXX\",\"emoji\":\"🇩🇰\"},{\"phoneCode\":\"246\",\"code\":\"DG\",\"name\":\"Diego Garcia\",\"pattern\":\"\",\"emoji\":\"🇩🇬\"},{\"phoneCode\":\"253\",\"code\":\"DJ\",\"name\":\"Djibouti\",\"pattern\":\"253 XX XX XX XX\",\"emoji\":\"🇩🇯\"},{\"phoneCode\":\"1 767\",\"code\":\"DM\",\"name\":\"Dominica\",\"pattern\":\"1767 XXX XXXX\",\"emoji\":\"🇩🇲\"},{\"phoneCode\":\"1 809 and 1 829\",\"code\":\"DO\",\"name\":\"Dominican Republic\",\"pattern\":\"1 XXX XXX XXXX\",\"emoji\":\"🇩🇴\"},{\"phoneCode\":\"670\",\"code\":\"TL\",\"name\":\"Timor-Leste\",\"pattern\":\"\",\"emoji\":\"🇹🇱\"},{\"phoneCode\":\"593\",\"code\":\"EC\",\"name\":\"Ecuador\",\"pattern\":\"\",\"emoji\":\"🇪🇨\"},{\"phoneCode\":\"20\",\"code\":\"EG\",\"name\":\"Egypt\",\"pattern\":\"20 XX XXX XXXX\",\"emoji\":\"🇪🇬\"},{\"phoneCode\":\"503\",\"code\":\"SV\",\"name\":\"El Salvador\",\"pattern\":\"503 XXXX XXXX\",\"emoji\":\"🇸🇻\"},{\"phoneCode\":\"240\",\"code\":\"GQ\",\"name\":\"Equatorial Guinea\",\"pattern\":\"240 XXX XXX XXX\",\"emoji\":\"🇬🇶\"},{\"phoneCode\":\"291\",\"code\":\"ER\",\"name\":\"Eritrea\",\"pattern\":\"291 X XXX XXX\",\"emoji\":\"🇪🇷\"},{\"phoneCode\":\"372\",\"code\":\"EE\",\"name\":\"Estonia\",\"pattern\":\"\",\"emoji\":\"🇪🇪\"},{\"phoneCode\":\"251\",\"code\":\"ET\",\"name\":\"Ethiopia\",\"pattern\":\"251 XX XXX XXXX\",\"emoji\":\"🇪🇹\"},{\"phoneCode\":\"500\",\"code\":\"FK\",\"name\":\"Falkland Islands\",\"pattern\":\"\",\"emoji\":\"🇫🇰\"},{\"phoneCode\":\"298\",\"code\":\"FO\",\"name\":\"Faroe Islands\",\"pattern\":\"298 XXX XXX\",\"emoji\":\"🇫🇴\"},{\"phoneCode\":\"679\",\"code\":\"FJ\",\"name\":\"Fiji\",\"pattern\":\"\",\"emoji\":\"🇫🇯\"},{\"phoneCode\":\"358\",\"code\":\"FI\",\"name\":\"Finland\",\"pattern\":\"\",\"emoji\":\"🇫🇮\"},{\"phoneCode\":\"33\",\"code\":\"FR\",\"name\":\"France\",\"pattern\":\"33 X XX XX XX XX\",\"emoji\":\"🇫🇷\"},{\"phoneCode\":\"594\",\"code\":\"GF\",\"name\":\"French Guiana\",\"pattern\":\"\",\"emoji\":\"🇬🇫\"},{\"phoneCode\":\"689\",\"code\":\"PF\",\"name\":\"French Polynesia\",\"pattern\":\"\",\"emoji\":\"🇵🇫\"},{\"phoneCode\":\"241\",\"code\":\"GA\",\"name\":\"Gabon\",\"pattern\":\"241 X XX XX XX\",\"emoji\":\"🇬🇦\"},{\"phoneCode\":\"220\",\"code\":\"GM\",\"name\":\"Gambia\",\"pattern\":\"220 XXX XXXX\",\"emoji\":\"🇬🇲\"},{\"phoneCode\":\"995\",\"code\":\"GE\",\"name\":\"Georgia\",\"pattern\":\"\",\"emoji\":\"🇬🇪\"},{\"phoneCode\":\"49\",\"code\":\"DE\",\"name\":\"Germany\",\"pattern\":\"49 XXX XXXXXXXX\",\"emoji\":\"🇩🇪\"},{\"phoneCode\":\"233\",\"code\":\"GH\",\"name\":\"Ghana\",\"pattern\":\"\",\"emoji\":\"🇬🇭\"},{\"phoneCode\":\"350\",\"code\":\"GI\",\"name\":\"Gibraltar\",\"pattern\":\"350 XXXX XXXX\",\"emoji\":\"🇬🇮\"},{\"phoneCode\":\"30\",\"code\":\"GR\",\"name\":\"Greece\",\"pattern\":\"30 XX XXXX XXXX\",\"emoji\":\"🇬🇷\"},{\"phoneCode\":\"299\",\"code\":\"GL\",\"name\":\"Greenland\",\"pattern\":\"299 XXX XXX\",\"emoji\":\"🇬🇱\"},{\"phoneCode\":\"1 473\",\"code\":\"GD\",\"name\":\"Grenada\",\"pattern\":\"1473 XXX XXXX\",\"emoji\":\"🇬🇩\"},{\"phoneCode\":\"590\",\"code\":\"GP\",\"name\":\"Guadeloupe\",\"pattern\":\"\",\"emoji\":\"🇬🇵\"},{\"phoneCode\":\"1 671\",\"code\":\"GU\",\"name\":\"Guam\",\"pattern\":\"1671 XXX XXXX\",\"emoji\":\"🇬🇺\"},{\"phoneCode\":\"502\",\"code\":\"GT\",\"name\":\"Guatemala\",\"pattern\":\"502 X XXX XXXX\",\"emoji\":\"🇬🇹\"},{\"phoneCode\":\"44\",\"code\":\"GG\",\"name\":\"Guernsey\",\"pattern\":\"\",\"emoji\":\"🇬🇬\"},{\"phoneCode\":\"224\",\"code\":\"GN\",\"name\":\"Guinea\",\"pattern\":\"224 XXX XXX XXX\",\"emoji\":\"🇬🇳\"},{\"phoneCode\":\"245\",\"code\":\"GW\",\"name\":\"Guinea-Bissau\",\"pattern\":\"245 XXX XXXX\",\"emoji\":\"🇬🇼\"},{\"phoneCode\":\"592\",\"code\":\"GY\",\"name\":\"Guyana\",\"pattern\":\"\",\"emoji\":\"🇬🇾\"},{\"phoneCode\":\"509\",\"code\":\"HT\",\"name\":\"Haiti\",\"pattern\":\"\",\"emoji\":\"🇭🇹\"},{\"phoneCode\":\"504\",\"code\":\"HN\",\"name\":\"Honduras\",\"pattern\":\"504 XXXX XXXX\",\"emoji\":\"🇭🇳\"},{\"phoneCode\":\"852\",\"code\":\"HK\",\"name\":\"Hong Kong SAR China\",\"pattern\":\"\",\"emoji\":\"🇭🇰\"},{\"phoneCode\":\"36\",\"code\":\"HU\",\"name\":\"Hungary\",\"pattern\":\"36 XX XXX XXXX\",\"emoji\":\"🇭🇺\"},{\"phoneCode\":\"354\",\"code\":\"IS\",\"name\":\"Iceland\",\"pattern\":\"354 XXX XXXX\",\"emoji\":\"🇮🇸\"},{\"phoneCode\":\"91\",\"code\":\"IN\",\"name\":\"India\",\"pattern\":\"91 XXXXX XXXXX\",\"emoji\":\"🇮🇳\"},{\"phoneCode\":\"62\",\"code\":\"ID\",\"name\":\"Indonesia\",\"pattern\":\"\",\"emoji\":\"🇮🇩\"},{\"phoneCode\":\"98\",\"code\":\"IR\",\"name\":\"Iran\",\"pattern\":\"98 XXX XXX XXXX\",\"emoji\":\"🇮🇷\"},{\"phoneCode\":\"964\",\"code\":\"IQ\",\"name\":\"Iraq\",\"pattern\":\"964 XXX XXX XXXX\",\"emoji\":\"🇮🇶\"},{\"phoneCode\":\"353\",\"code\":\"IE\",\"name\":\"Ireland\",\"pattern\":\"353 XX XXX XXXX\",\"emoji\":\"🇮🇪\"},{\"phoneCode\":\"972\",\"code\":\"IL\",\"name\":\"Israel\",\"pattern\":\"972 XX XXX XXXX\",\"emoji\":\"🇮🇱\"},{\"phoneCode\":\"39\",\"code\":\"IT\",\"name\":\"Italy\",\"pattern\":\"39 XXX XXX XXXX\",\"emoji\":\"🇮🇹\"},{\"phoneCode\":\"1 876\",\"code\":\"JM\",\"name\":\"Jamaica\",\"pattern\":\"1876 XXX XXXX\",\"emoji\":\"🇯🇲\"},{\"phoneCode\":\"47 79\",\"code\":\"SJ\",\"name\":\"Svalbard & Jan Mayen\",\"pattern\":\"\",\"emoji\":\"🇸🇯\"},{\"phoneCode\":\"81\",\"code\":\"JP\",\"name\":\"Japan\",\"pattern\":\"81 XX XXXX XXXX\",\"emoji\":\"🇯🇵\"},{\"phoneCode\":\"44\",\"code\":\"JE\",\"name\":\"Jersey\",\"pattern\":\"\",\"emoji\":\"🇯🇪\"},{\"phoneCode\":\"962\",\"code\":\"JO\",\"name\":\"Jordan\",\"pattern\":\"962 X XXXX XXXX\",\"emoji\":\"🇯🇴\"},{\"phoneCode\":\"7 7\",\"code\":\"KZ\",\"name\":\"Kazakhstan\",\"pattern\":\"7 XXX XXX XX XX\",\"emoji\":\"🇰🇿\"},{\"phoneCode\":\"254\",\"code\":\"KE\",\"name\":\"Kenya\",\"pattern\":\"254 XXX XXX XXX\",\"emoji\":\"🇰🇪\"},{\"phoneCode\":\"686\",\"code\":\"KI\",\"name\":\"Kiribati\",\"pattern\":\"\",\"emoji\":\"🇰🇮\"},{\"phoneCode\":\"850\",\"code\":\"KP\",\"name\":\"North Korea\",\"pattern\":\"\",\"emoji\":\"🇰🇵\"},{\"phoneCode\":\"82\",\"code\":\"KR\",\"name\":\"South Korea\",\"pattern\":\"\",\"emoji\":\"🇰🇷\"},{\"phoneCode\":\"965\",\"code\":\"KW\",\"name\":\"Kuwait\",\"pattern\":\"965 XXXX XXXX\",\"emoji\":\"🇰🇼\"},{\"phoneCode\":\"996\",\"code\":\"KG\",\"name\":\"Kyrgyzstan\",\"pattern\":\"\",\"emoji\":\"🇰🇬\"},{\"phoneCode\":\"856\",\"code\":\"LA\",\"name\":\"Laos\",\"pattern\":\"\",\"emoji\":\"🇱🇦\"},{\"phoneCode\":\"371\",\"code\":\"LV\",\"name\":\"Latvia\",\"pattern\":\"371 XXX XXXXX\",\"emoji\":\"🇱🇻\"},{\"phoneCode\":\"961\",\"code\":\"LB\",\"name\":\"Lebanon\",\"pattern\":\"\",\"emoji\":\"🇱🇧\"},{\"phoneCode\":\"266\",\"code\":\"LS\",\"name\":\"Lesotho\",\"pattern\":\"266 XX XXX XXX\",\"emoji\":\"🇱🇸\"},{\"phoneCode\":\"231\",\"code\":\"LR\",\"name\":\"Liberia\",\"pattern\":\"\",\"emoji\":\"🇱🇷\"},{\"phoneCode\":\"218\",\"code\":\"LY\",\"name\":\"Libya\",\"pattern\":\"218 XX XXX XXXX\",\"emoji\":\"🇱🇾\"},{\"phoneCode\":\"423\",\"code\":\"LI\",\"name\":\"Liechtenstein\",\"pattern\":\"\",\"emoji\":\"🇱🇮\"},{\"phoneCode\":\"370\",\"code\":\"LT\",\"name\":\"Lithuania\",\"pattern\":\"370 XXX XXXXX\",\"emoji\":\"🇱🇹\"},{\"phoneCode\":\"352\",\"code\":\"LU\",\"name\":\"Luxembourg\",\"pattern\":\"\",\"emoji\":\"🇱🇺\"},{\"phoneCode\":\"853\",\"code\":\"MO\",\"name\":\"Macau SAR China\",\"pattern\":\"\",\"emoji\":\"🇲🇴\"},{\"phoneCode\":\"389\",\"code\":\"MK\",\"name\":\"Macedonia\",\"pattern\":\"\",\"emoji\":\"🇲🇰\"},{\"phoneCode\":\"261\",\"code\":\"MG\",\"name\":\"Madagascar\",\"pattern\":\"261 XX XX XXX XX\",\"emoji\":\"🇲🇬\"},{\"phoneCode\":\"265\",\"code\":\"MW\",\"name\":\"Malawi\",\"pattern\":\"\",\"emoji\":\"🇲🇼\"},{\"phoneCode\":\"60\",\"code\":\"MM\",\"name\":\"Malaysia\",\"pattern\":\"\",\"emoji\":\"🇲🇲\"},{\"phoneCode\":\"960\",\"code\":\"MV\",\"name\":\"Maldives\",\"pattern\":\"\",\"emoji\":\"🇲🇻\"},{\"phoneCode\":\"223\",\"code\":\"ML\",\"name\":\"Mali\",\"pattern\":\"223 XXXX XXXX\",\"emoji\":\"🇲🇱\"},{\"phoneCode\":\"356\",\"code\":\"MT\",\"name\":\"Malta\",\"pattern\":\"356 XX XX XX XX\",\"emoji\":\"🇲🇹\"},{\"phoneCode\":\"692\",\"code\":\"MH\",\"name\":\"Marshall Islands\",\"pattern\":\"\",\"emoji\":\"🇲🇭\"},{\"phoneCode\":\"596\",\"code\":\"MQ\",\"name\":\"Martinique\",\"pattern\":\"\",\"emoji\":\"🇲🇶\"},{\"phoneCode\":\"222\",\"code\":\"MR\",\"name\":\"Mauritania\",\"pattern\":\"222 XXXX XXXX\",\"emoji\":\"🇲🇷\"},{\"phoneCode\":\"230\",\"code\":\"MU\",\"name\":\"Mauritius\",\"pattern\":\"\",\"emoji\":\"🇲🇺\"},{\"phoneCode\":\"262\",\"code\":\"YT\",\"name\":\"Mayotte\",\"pattern\":\"\",\"emoji\":\"🇾🇹\"},{\"phoneCode\":\"52\",\"code\":\"MX\",\"name\":\"Mexico\",\"pattern\":\"\",\"emoji\":\"🇲🇽\"},{\"phoneCode\":\"691\",\"code\":\"FM\",\"name\":\"Micronesia\",\"pattern\":\"\",\"emoji\":\"🇫🇲\"},{\"phoneCode\":\"373\",\"code\":\"MD\",\"name\":\"Moldova\",\"pattern\":\"373 XX XXX XXX\",\"emoji\":\"🇲🇩\"},{\"phoneCode\":\"377\",\"code\":\"MC\",\"name\":\"Monaco\",\"pattern\":\"377 XXXX XXXX\",\"emoji\":\"🇲🇨\"},{\"phoneCode\":\"976\",\"code\":\"MN\",\"name\":\"Mongolia\",\"pattern\":\"\",\"emoji\":\"🇲🇳\"},{\"phoneCode\":\"382\",\"code\":\"ME\",\"name\":\"Montenegro\",\"pattern\":\"\",\"emoji\":\"🇲🇪\"},{\"phoneCode\":\"1 664\",\"code\":\"MS\",\"name\":\"Montserrat\",\"pattern\":\"1664 XXX XXXX\",\"emoji\":\"🇲🇸\"},{\"phoneCode\":\"212\",\"code\":\"MA\",\"name\":\"Morocco\",\"pattern\":\"212 XX XXX XXXX\",\"emoji\":\"🇲🇦\"},{\"phoneCode\":\"258\",\"code\":\"MZ\",\"name\":\"Mozambique\",\"pattern\":\"258 XX XXX XXXX\",\"emoji\":\"🇲🇿\"},{\"phoneCode\":\"264\",\"code\":\"NA\",\"name\":\"Namibia\",\"pattern\":\"264 XX XXX XXXX\",\"emoji\":\"🇳🇦\"},{\"phoneCode\":\"674\",\"code\":\"NR\",\"name\":\"Nauru\",\"pattern\":\"\",\"emoji\":\"🇳🇷\"},{\"phoneCode\":\"977\",\"code\":\"NP\",\"name\":\"Nepal\",\"pattern\":\"\",\"emoji\":\"🇳🇵\"},{\"phoneCode\":\"31\",\"code\":\"NL\",\"name\":\"Netherlands\",\"pattern\":\"31 X XX XX XX XX\",\"emoji\":\"🇳🇱\"},{\"phoneCode\":\"687\",\"code\":\"NC\",\"name\":\"New Caledonia\",\"pattern\":\"\",\"emoji\":\"🇳🇨\"},{\"phoneCode\":\"64\",\"code\":\"NZ\",\"name\":\"New Zealand\",\"pattern\":\"\",\"emoji\":\"🇳🇿\"},{\"phoneCode\":\"505\",\"code\":\"NI\",\"name\":\"Nicaragua\",\"pattern\":\"505 XXXX XXXX\",\"emoji\":\"🇳🇮\"},{\"phoneCode\":\"227\",\"code\":\"NE\",\"name\":\"Niger\",\"pattern\":\"227 XX XX XX XX\",\"emoji\":\"🇳🇪\"},{\"phoneCode\":\"234\",\"code\":\"NG\",\"name\":\"Nigeria\",\"pattern\":\"\",\"emoji\":\"🇳🇬\"},{\"phoneCode\":\"683\",\"code\":\"NU\",\"name\":\"Niue\",\"pattern\":\"\",\"emoji\":\"🇳🇺\"},{\"phoneCode\":\"672\",\"code\":\"NF\",\"name\":\"Norfolk Island\",\"pattern\":\"\",\"emoji\":\"🇳🇫\"},{\"phoneCode\":\"1 670\",\"code\":\"MP\",\"name\":\"Northern Mariana Islands\",\"pattern\":\"1670 XXX XXXX\",\"emoji\":\"🇲🇵\"},{\"phoneCode\":\"47\",\"code\":\"NO\",\"name\":\"Norway\",\"pattern\":\"47 XXXX XXXX\",\"emoji\":\"🇳🇴\"},{\"phoneCode\":\"968\",\"code\":\"OM\",\"name\":\"Oman\",\"pattern\":\"968 XXXX XXXX\",\"emoji\":\"🇴🇲\"},{\"phoneCode\":\"92\",\"code\":\"PK\",\"name\":\"Pakistan\",\"pattern\":\"92 XXX XXX XXXX\",\"emoji\":\"🇵🇰\"},{\"phoneCode\":\"680\",\"code\":\"PW\",\"name\":\"Palau\",\"pattern\":\"\",\"emoji\":\"🇵🇼\"},{\"phoneCode\":\"970\",\"code\":\"PS\",\"name\":\"Palestinian Territories\",\"pattern\":\"970 XXX XX XXXX\",\"emoji\":\"🇵🇸\"},{\"phoneCode\":\"507\",\"code\":\"PA\",\"name\":\"Panama\",\"pattern\":\"507 XXXX XXXX\",\"emoji\":\"🇵🇦\"},{\"phoneCode\":\"675\",\"code\":\"PG\",\"name\":\"Papua New Guinea\",\"pattern\":\"\",\"emoji\":\"🇵🇬\"},{\"phoneCode\":\"595\",\"code\":\"PY\",\"name\":\"Paraguay\",\"pattern\":\"595 XXX XXX XXX\",\"emoji\":\"🇵🇾\"},{\"phoneCode\":\"51\",\"code\":\"PE\",\"name\":\"Peru\",\"pattern\":\"51 XXX XXX XXX\",\"emoji\":\"🇵🇪\"},{\"phoneCode\":\"63\",\"code\":\"PH\",\"name\":\"Philippines\",\"pattern\":\"63 XXX XXX XXXX\",\"emoji\":\"🇵🇭\"},{\"phoneCode\":\"64\",\"code\":\"PN\",\"name\":\"Pitcairn Islands\",\"pattern\":\"\",\"emoji\":\"🇵🇳\"},{\"phoneCode\":\"48\",\"code\":\"PL\",\"name\":\"Poland\",\"pattern\":\"48 XXX XXX XXX\",\"emoji\":\"🇵🇱\"},{\"phoneCode\":\"351\",\"code\":\"PT\",\"name\":\"Portugal\",\"pattern\":\"351 X XXXX XXXX\",\"emoji\":\"🇵🇹\"},{\"phoneCode\":\"1 787 and 1 939\",\"code\":\"PR\",\"name\":\"Puerto Rico\",\"pattern\":\"1 XXX XXX XXXX\",\"emoji\":\"🇵🇷\"},{\"phoneCode\":\"974\",\"code\":\"QA\",\"name\":\"Qatar\",\"pattern\":\"\",\"emoji\":\"🇶🇦\"},{\"phoneCode\":\"262\",\"code\":\"RE\",\"name\":\"Reunion\",\"pattern\":\"262 XXX XXX XXX\",\"emoji\":\"🇷🇪\"},{\"phoneCode\":\"40\",\"code\":\"RO\",\"name\":\"Romania\",\"pattern\":\"40 XXX XXX XXX\",\"emoji\":\"🇷🇴\"},{\"phoneCode\":\"7\",\"code\":\"RU\",\"name\":\"Russia\",\"pattern\":\"7 XXX XXX XX XX\",\"emoji\":\"🇷🇺\"},{\"phoneCode\":\"250\",\"code\":\"RW\",\"name\":\"Rwanda\",\"pattern\":\"250 XXX XXX XXX\",\"emoji\":\"🇷🇼\"},{\"phoneCode\":\"590\",\"code\":\"BL\",\"name\":\"St. Barthelemy\",\"pattern\":\"\",\"emoji\":\"🇧🇱\"},{\"phoneCode\":\"290\",\"code\":\"SH\",\"name\":\"St. Helena\",\"pattern\":\"290 XX XXX\",\"emoji\":\"🇸🇭\"},{\"phoneCode\":\"1 869\",\"code\":\"KN\",\"name\":\"St. Kitts & Nevis\",\"pattern\":\"1869 XXX XXXX\",\"emoji\":\"🇰🇳\"},{\"phoneCode\":\"1 758\",\"code\":\"LC\",\"name\":\"St. Lucia\",\"pattern\":\"1758 XXX XXXX\",\"emoji\":\"🇱🇨\"},{\"phoneCode\":\"590\",\"code\":\"MF\",\"name\":\"St. Martin (France)\",\"pattern\":\"\",\"emoji\":\"🇲🇫\"},{\"phoneCode\":\"508\",\"code\":\"PM\",\"name\":\"St. Pierre and Miquelon\",\"pattern\":\"\",\"emoji\":\"🇵🇲\"},{\"phoneCode\":\"1 784\",\"code\":\"VC\",\"name\":\"St. Vincent and the Grenadines\",\"pattern\":\"1784 XXX XXXX\",\"emoji\":\"🇻🇨\"},{\"phoneCode\":\"685\",\"code\":\"WS\",\"name\":\"Samoa\",\"pattern\":\"\",\"emoji\":\"🇼🇸\"},{\"phoneCode\":\"378\",\"code\":\"SM\",\"name\":\"San Marino\",\"pattern\":\"378 XXX XXX XXXX\",\"emoji\":\"🇸🇲\"},{\"phoneCode\":\"239\",\"code\":\"ST\",\"name\":\"São Tome & Principe\",\"pattern\":\"239 XX XXXXX\",\"emoji\":\"🇸🇹\"},{\"phoneCode\":\"966\",\"code\":\"SA\",\"name\":\"Saudi Arabia\",\"pattern\":\"\",\"emoji\":\"🇸🇦\"},{\"phoneCode\":\"221\",\"code\":\"SN\",\"name\":\"Senegal\",\"pattern\":\"221 XX XXX XXXX\",\"emoji\":\"🇸🇳\"},{\"phoneCode\":\"381\",\"code\":\"RS\",\"name\":\"Serbia\",\"pattern\":\"381 XX XXX XXXX\",\"emoji\":\"🇷🇸\"},{\"phoneCode\":\"248\",\"code\":\"SC\",\"name\":\"Seychelles\",\"pattern\":\"248 X XX XX XX\",\"emoji\":\"🇸🇨\"},{\"phoneCode\":\"232\",\"code\":\"SL\",\"name\":\"Sierra Leone\",\"pattern\":\"232 XX XXX XXX\",\"emoji\":\"🇸🇱\"},{\"phoneCode\":\"65\",\"code\":\"SG\",\"name\":\"Singapore\",\"pattern\":\"65 XXXX XXXX\",\"emoji\":\"🇸🇬\"},{\"phoneCode\":\"599 3\",\"code\":\"BQ\",\"name\":\"Sint Eustatius\",\"pattern\":\"\",\"emoji\":\"🇧🇶\"},{\"phoneCode\":\"1 721\",\"code\":\"SX\",\"name\":\"Sint Maarten\",\"pattern\":\"1721 XXX XXXX\",\"emoji\":\"🇸🇽\"},{\"phoneCode\":\"421\",\"code\":\"SK\",\"name\":\"Slovakia\",\"pattern\":\"\",\"emoji\":\"🇸🇰\"},{\"phoneCode\":\"386\",\"code\":\"SI\",\"name\":\"Slovenia\",\"pattern\":\"\",\"emoji\":\"🇸🇮\"},{\"phoneCode\":\"677\",\"code\":\"SB\",\"name\":\"Solomon Islands\",\"pattern\":\"\",\"emoji\":\"🇸🇧\"},{\"phoneCode\":\"252\",\"code\":\"SO\",\"name\":\"Somalia\",\"pattern\":\"252 XX XXX XXX\",\"emoji\":\"🇸🇴\"},{\"phoneCode\":\"27\",\"code\":\"ZA\",\"name\":\"South Africa\",\"pattern\":\"27 XX XXX XXXX\",\"emoji\":\"🇿🇦\"},{\"phoneCode\":\"500\",\"code\":\"GS\",\"name\":\"South Georgia & South Sandwich Islands\",\"pattern\":\"\",\"emoji\":\"🇬🇸\"},{\"phoneCode\":\"995 34\",\"code\":\"\",\"name\":\"South Ossetia\",\"pattern\":\"\",\"emoji\":\"\"},{\"phoneCode\":\"211\",\"code\":\"SS\",\"name\":\"South Sudan\",\"pattern\":\"211 XX XXX XXXX\",\"emoji\":\"🇸🇸\"},{\"phoneCode\":\"34\",\"code\":\"ES\",\"name\":\"Spain\",\"pattern\":\"34 XXX XXX XXX\",\"emoji\":\"🇪🇸\"},{\"phoneCode\":\"94\",\"code\":\"LK\",\"name\":\"Sri Lanka\",\"pattern\":\"94 XX XXX XXXX\",\"emoji\":\"🇱🇰\"},{\"phoneCode\":\"249\",\"code\":\"SD\",\"name\":\"Sudan\",\"pattern\":\"249 XX XXX XXXX\",\"emoji\":\"🇸🇩\"},{\"phoneCode\":\"597\",\"code\":\"SR\",\"name\":\"Suriname\",\"pattern\":\"597 XXX XXXX\",\"emoji\":\"🇸🇷\"},{\"phoneCode\":\"47 79\",\"code\":\"SJ\",\"name\":\"Svalbard\",\"pattern\":\"\",\"emoji\":\"🇸🇯\"},{\"phoneCode\":\"268\",\"code\":\"SZ\",\"name\":\"Swaziland\",\"pattern\":\"268 XXXX XXXX\",\"emoji\":\"🇸🇿\"},{\"phoneCode\":\"46\",\"code\":\"SE\",\"name\":\"Sweden\",\"pattern\":\"46 XX XXX XXXX\",\"emoji\":\"🇸🇪\"},{\"phoneCode\":\"41\",\"code\":\"CH\",\"name\":\"Switzerland\",\"pattern\":\"41 XX XXX XXXX\",\"emoji\":\"🇨🇭\"},{\"phoneCode\":\"963\",\"code\":\"SY\",\"name\":\"Syria\",\"pattern\":\"\",\"emoji\":\"🇸🇾\"},{\"phoneCode\":\"886\",\"code\":\"TW\",\"name\":\"Taiwan\",\"pattern\":\"\",\"emoji\":\"🇹🇼\"},{\"phoneCode\":\"992\",\"code\":\"TJ\",\"name\":\"Tajikistan\",\"pattern\":\"\",\"emoji\":\"🇹🇯\"},{\"phoneCode\":\"255\",\"code\":\"TZ\",\"name\":\"Tanzania\",\"pattern\":\"255 XX XXX XXXX\",\"emoji\":\"🇹🇿\"},{\"phoneCode\":\"66\",\"code\":\"TH\",\"name\":\"Thailand\",\"pattern\":\"66 X XXXX XXXX\",\"emoji\":\"🇹🇭\"},{\"phoneCode\":\"228\",\"code\":\"TG\",\"name\":\"Togo\",\"pattern\":\"228 XX XXX XXX\",\"emoji\":\"🇹🇬\"},{\"phoneCode\":\"690\",\"code\":\"TK\",\"name\":\"Tokelau\",\"pattern\":\"\",\"emoji\":\"🇹🇰\"},{\"phoneCode\":\"676\",\"code\":\"TO\",\"name\":\"Tonga\",\"pattern\":\"\",\"emoji\":\"🇹🇴\"},{\"phoneCode\":\"1 868\",\"code\":\"TT\",\"name\":\"Trinidad & Tobago\",\"pattern\":\"1868 XXX XXXX\",\"emoji\":\"🇹🇹\"},{\"phoneCode\":\"216\",\"code\":\"TN\",\"name\":\"Tunisia\",\"pattern\":\"216 XX XXX XXX\",\"emoji\":\"🇹🇳\"},{\"phoneCode\":\"90\",\"code\":\"TR\",\"name\":\"Turkey\",\"pattern\":\"90 XXX XXX XXXX\",\"emoji\":\"🇹🇷\"},{\"phoneCode\":\"993\",\"code\":\"TM\",\"name\":\"Turkmenistan\",\"pattern\":\"993 XX XXXXXX\",\"emoji\":\"🇹🇲\"},{\"phoneCode\":\"1 649\",\"code\":\"TC\",\"name\":\"Turks & Caicos Islands\",\"pattern\":\"1649 XXX XXXX\",\"emoji\":\"🇹🇨\"},{\"phoneCode\":\"688\",\"code\":\"TV\",\"name\":\"Tuvalu\",\"pattern\":\"\",\"emoji\":\"🇹🇻\"},{\"phoneCode\":\"256\",\"code\":\"UG\",\"name\":\"Uganda\",\"pattern\":\"256 XX XXX XXXX\",\"emoji\":\"🇺🇬\"},{\"phoneCode\":\"380\",\"code\":\"UA\",\"name\":\"Ukraine\",\"pattern\":\"380 XX XXX XX XX\",\"emoji\":\"🇺🇦\"},{\"phoneCode\":\"971\",\"code\":\"AE\",\"name\":\"United Arab Emirates\",\"pattern\":\"971 XX XXX XXXX\",\"emoji\":\"🇦🇪\"},{\"phoneCode\":\"44\",\"code\":\"GB\",\"name\":\"United Kingdom\",\"pattern\":\"44 XXXX XXXXXX\",\"emoji\":\"🇬🇧\"},{\"phoneCode\":\"1\",\"code\":\"US\",\"name\":\"United States\",\"pattern\":\"1 XXX XXX XXXX\",\"emoji\":\"🇺🇸\"},{\"phoneCode\":\"598\",\"code\":\"UY\",\"name\":\"Uruguay\",\"pattern\":\"598 XXXX XXXX\",\"emoji\":\"🇺🇾\"},{\"phoneCode\":\"1 340\",\"code\":\"VI\",\"name\":\"U.S. Virgin Islands\",\"pattern\":\"1340 XXX XXXX\",\"emoji\":\"🇻🇮\"},{\"phoneCode\":\"998\",\"code\":\"UZ\",\"name\":\"Uzbekistan\",\"pattern\":\"998 XX XXXXXXX\",\"emoji\":\"🇺🇿\"},{\"phoneCode\":\"678\",\"code\":\"VU\",\"name\":\"Vanuatu\",\"pattern\":\"\",\"emoji\":\"🇻🇺\"},{\"phoneCode\":\"58\",\"code\":\"VE\",\"name\":\"Venezuela\",\"pattern\":\"58 XXX XXX XXXX\",\"emoji\":\"🇻🇪\"},{\"phoneCode\":\"39 06 698\",\"code\":\"VA\",\"name\":\"Vatican City\",\"pattern\":\"\",\"emoji\":\"🇻🇦\"},{\"phoneCode\":\"84\",\"code\":\"VN\",\"name\":\"Vietnam\",\"pattern\":\"\",\"emoji\":\"🇻🇳\"},{\"phoneCode\":\"681\",\"code\":\"WF\",\"name\":\"Wallis & Futuna\",\"pattern\":\"\",\"emoji\":\"🇼🇫\"},{\"phoneCode\":\"967\",\"code\":\"YE\",\"name\":\"Yemen\",\"pattern\":\"967 XXX XXX XXX\",\"emoji\":\"🇾🇪\"},{\"phoneCode\":\"260\",\"code\":\"ZM\",\"name\":\"Zambia\",\"pattern\":\"260 XX XXX XXXX\",\"emoji\":\"🇿🇲\"},{\"phoneCode\":\"255\",\"code\":\"\",\"name\":\"Zanzibar\",\"pattern\":\"\",\"emoji\":\"\"},{\"phoneCode\":\"263\",\"code\":\"ZW\",\"name\":\"Zimbabwe\",\"pattern\":\"263 XX XXX XXXX\",\"emoji\":\"🇿🇼\"}];\r\n\r\nif(Config.Modes.test) {\r\n Config.Countries.push({\r\n name: 'Test Country',\r\n phoneCode: '999 66',\r\n code: 'TC',\r\n emoji: '🤔',\r\n pattern: '999 66 XXX XX'\r\n });\r\n\r\n console.log('Added test country to list!');\r\n}\r\n\r\nConfig.Schema = Config.Schema || {};\r\n\r\nConfig.Schema.MTProto = {\"constructors\":[{\"id\":\"481674261\",\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":\"85337187\",\"predicate\":\"resPQ\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"server_public_key_fingerprints\",\"type\":\"Vector\"}],\"type\":\"ResPQ\"},{\"id\":\"-2083955988\",\"predicate\":\"p_q_inner_data\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"}],\"type\":\"P_Q_inner_data\"},{\"id\":\"1013613780\",\"predicate\":\"p_q_inner_data_temp\",\"params\":[{\"name\":\"pq\",\"type\":\"bytes\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce\",\"type\":\"int256\"},{\"name\":\"expires_in\",\"type\":\"int\"}],\"type\":\"P_Q_inner_data\"},{\"id\":\"2043348061\",\"predicate\":\"server_DH_params_fail\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash\",\"type\":\"int128\"}],\"type\":\"Server_DH_Params\"},{\"id\":\"-790100132\",\"predicate\":\"server_DH_params_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_answer\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":\"-1249309254\",\"predicate\":\"server_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"dh_prime\",\"type\":\"bytes\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"server_time\",\"type\":\"int\"}],\"type\":\"Server_DH_inner_data\"},{\"id\":\"1715713620\",\"predicate\":\"client_DH_inner_data\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"retry_id\",\"type\":\"long\"},{\"name\":\"g_b\",\"type\":\"bytes\"}],\"type\":\"Client_DH_Inner_Data\"},{\"id\":\"1003222836\",\"predicate\":\"dh_gen_ok\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash1\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":\"1188831161\",\"predicate\":\"dh_gen_retry\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash2\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":\"-1499615742\",\"predicate\":\"dh_gen_fail\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"new_nonce_hash3\",\"type\":\"int128\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":\"-212046591\",\"predicate\":\"rpc_result\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"result\",\"type\":\"Object\"}],\"type\":\"RpcResult\"},{\"id\":\"558156313\",\"predicate\":\"rpc_error\",\"params\":[{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"error_message\",\"type\":\"string\"}],\"type\":\"RpcError\"},{\"id\":\"1579864942\",\"predicate\":\"rpc_answer_unknown\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":\"-847714938\",\"predicate\":\"rpc_answer_dropped_running\",\"params\":[],\"type\":\"RpcDropAnswer\"},{\"id\":\"-1539647305\",\"predicate\":\"rpc_answer_dropped\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seq_no\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"}],\"type\":\"RpcDropAnswer\"},{\"id\":\"155834844\",\"predicate\":\"future_salt\",\"params\":[{\"name\":\"valid_since\",\"type\":\"int\"},{\"name\":\"valid_until\",\"type\":\"int\"},{\"name\":\"salt\",\"type\":\"long\"}],\"type\":\"FutureSalt\"},{\"id\":\"-1370486635\",\"predicate\":\"future_salts\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"now\",\"type\":\"int\"},{\"name\":\"salts\",\"type\":\"vector\"}],\"type\":\"FutureSalts\"},{\"id\":\"880243653\",\"predicate\":\"pong\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":\"-501201412\",\"predicate\":\"destroy_session_ok\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":\"1658015945\",\"predicate\":\"destroy_session_none\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":\"-1631450872\",\"predicate\":\"new_session_created\",\"params\":[{\"name\":\"first_msg_id\",\"type\":\"long\"},{\"name\":\"unique_id\",\"type\":\"long\"},{\"name\":\"server_salt\",\"type\":\"long\"}],\"type\":\"NewSession\"},{\"id\":\"1945237724\",\"predicate\":\"msg_container\",\"params\":[{\"name\":\"messages\",\"type\":\"vector<%Message>\"}],\"type\":\"MessageContainer\"},{\"id\":\"1538843921\",\"predicate\":\"message\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"seqno\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"body\",\"type\":\"Object\"}],\"type\":\"Message\"},{\"id\":\"-530561358\",\"predicate\":\"msg_copy\",\"params\":[{\"name\":\"orig_message\",\"type\":\"Message\"}],\"type\":\"MessageCopy\"},{\"id\":\"812830625\",\"predicate\":\"gzip_packed\",\"params\":[{\"name\":\"packed_data\",\"type\":\"bytes\"}],\"type\":\"Object\"},{\"id\":\"1658238041\",\"predicate\":\"msgs_ack\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsAck\"},{\"id\":\"-1477445615\",\"predicate\":\"bad_msg_notification\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"}],\"type\":\"BadMsgNotification\"},{\"id\":\"-307542917\",\"predicate\":\"bad_server_salt\",\"params\":[{\"name\":\"bad_msg_id\",\"type\":\"long\"},{\"name\":\"bad_msg_seqno\",\"type\":\"int\"},{\"name\":\"error_code\",\"type\":\"int\"},{\"name\":\"new_server_salt\",\"type\":\"long\"}],\"type\":\"BadMsgNotification\"},{\"id\":\"2105940488\",\"predicate\":\"msg_resend_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgResendReq\"},{\"id\":\"-630588590\",\"predicate\":\"msgs_state_req\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"}],\"type\":\"MsgsStateReq\"},{\"id\":\"81704317\",\"predicate\":\"msgs_state_info\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsStateInfo\"},{\"id\":\"-1933520591\",\"predicate\":\"msgs_all_info\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"info\",\"type\":\"bytes\"}],\"type\":\"MsgsAllInfo\"},{\"id\":\"661470918\",\"predicate\":\"msg_detailed_info\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":\"-2137147681\",\"predicate\":\"msg_new_detailed_info\",\"params\":[{\"name\":\"answer_msg_id\",\"type\":\"long\"},{\"name\":\"bytes\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"int\"}],\"type\":\"MsgDetailedInfo\"},{\"id\":\"1973679973\",\"predicate\":\"bind_auth_key_inner\",\"params\":[{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"temp_auth_key_id\",\"type\":\"long\"},{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"temp_session_id\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"}],\"type\":\"BindAuthKeyInner\"}],\"methods\":[{\"id\":\"3195965169\",\"method\":\"req_pq_multi\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"}],\"type\":\"ResPQ\"},{\"id\":\"1615239032\",\"method\":\"req_pq\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"}],\"type\":\"ResPQ\"},{\"id\":\"-686627650\",\"method\":\"req_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"q\",\"type\":\"bytes\"},{\"name\":\"public_key_fingerprint\",\"type\":\"long\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Server_DH_Params\"},{\"id\":\"-184262881\",\"method\":\"set_client_DH_params\",\"params\":[{\"name\":\"nonce\",\"type\":\"int128\"},{\"name\":\"server_nonce\",\"type\":\"int128\"},{\"name\":\"encrypted_data\",\"type\":\"bytes\"}],\"type\":\"Set_client_DH_params_answer\"},{\"id\":\"1491380032\",\"method\":\"rpc_drop_answer\",\"params\":[{\"name\":\"req_msg_id\",\"type\":\"long\"}],\"type\":\"RpcDropAnswer\"},{\"id\":\"-1188971260\",\"method\":\"get_future_salts\",\"params\":[{\"name\":\"num\",\"type\":\"int\"}],\"type\":\"FutureSalts\"},{\"id\":\"2059302892\",\"method\":\"ping\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"}],\"type\":\"Pong\"},{\"id\":\"-213746804\",\"method\":\"ping_delay_disconnect\",\"params\":[{\"name\":\"ping_id\",\"type\":\"long\"},{\"name\":\"disconnect_delay\",\"type\":\"int\"}],\"type\":\"Pong\"},{\"id\":\"-414113498\",\"method\":\"destroy_session\",\"params\":[{\"name\":\"session_id\",\"type\":\"long\"}],\"type\":\"DestroySessionRes\"},{\"id\":\"-1835453025\",\"method\":\"http_wait\",\"params\":[{\"name\":\"max_delay\",\"type\":\"int\"},{\"name\":\"wait_after\",\"type\":\"int\"},{\"name\":\"max_wait\",\"type\":\"int\"}],\"type\":\"HttpWait\"}]};\r\n\r\nConfig.Schema.API = {\"constructors\":[{\"id\":\"-1132882121\",\"predicate\":\"boolFalse\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-1720552011\",\"predicate\":\"boolTrue\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"1072550713\",\"predicate\":\"true\",\"params\":[],\"type\":\"True\"},{\"id\":\"481674261\",\"predicate\":\"vector\",\"params\":[],\"type\":\"Vector t\"},{\"id\":\"-994444869\",\"predicate\":\"error\",\"params\":[{\"name\":\"code\",\"type\":\"int\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"Error\"},{\"id\":\"1450380236\",\"predicate\":\"null\",\"params\":[],\"type\":\"Null\"},{\"id\":\"2134579434\",\"predicate\":\"inputPeerEmpty\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":\"2107670217\",\"predicate\":\"inputPeerSelf\",\"params\":[],\"type\":\"InputPeer\"},{\"id\":\"396093539\",\"predicate\":\"inputPeerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"InputPeer\"},{\"id\":\"-1182234929\",\"predicate\":\"inputUserEmpty\",\"params\":[],\"type\":\"InputUser\"},{\"id\":\"-138301121\",\"predicate\":\"inputUserSelf\",\"params\":[],\"type\":\"InputUser\"},{\"id\":\"-208488460\",\"predicate\":\"inputPhoneContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"InputContact\"},{\"id\":\"-181407105\",\"predicate\":\"inputFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"md5_checksum\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":\"-1771768449\",\"predicate\":\"inputMediaEmpty\",\"params\":[],\"type\":\"InputMedia\"},{\"id\":\"505969924\",\"predicate\":\"inputMediaUploadedPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":\"-1279654347\",\"predicate\":\"inputMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"InputPhoto\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":\"-104578748\",\"predicate\":\"inputMediaGeoPoint\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"}],\"type\":\"InputMedia\"},{\"id\":\"-122978821\",\"predicate\":\"inputMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":\"480546647\",\"predicate\":\"inputChatPhotoEmpty\",\"params\":[],\"type\":\"InputChatPhoto\"},{\"id\":\"-1837345356\",\"predicate\":\"inputChatUploadedPhoto\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"}],\"type\":\"InputChatPhoto\"},{\"id\":\"-1991004873\",\"predicate\":\"inputChatPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputChatPhoto\"},{\"id\":\"-457104426\",\"predicate\":\"inputGeoPointEmpty\",\"params\":[],\"type\":\"InputGeoPoint\"},{\"id\":\"-206066487\",\"predicate\":\"inputGeoPoint\",\"params\":[{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"long\",\"type\":\"double\"}],\"type\":\"InputGeoPoint\"},{\"id\":\"483901197\",\"predicate\":\"inputPhotoEmpty\",\"params\":[],\"type\":\"InputPhoto\"},{\"id\":\"1001634122\",\"predicate\":\"inputPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputPhoto\"},{\"id\":\"-539317279\",\"predicate\":\"inputFileLocation\",\"params\":[{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputFileLocation\"},{\"id\":\"-1649296275\",\"predicate\":\"peerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"Peer\"},{\"id\":\"-1160714821\",\"predicate\":\"peerChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Peer\"},{\"id\":\"-1432995067\",\"predicate\":\"storage.fileUnknown\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"1086091090\",\"predicate\":\"storage.filePartial\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"8322574\",\"predicate\":\"storage.fileJpeg\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"-891180321\",\"predicate\":\"storage.fileGif\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"172975040\",\"predicate\":\"storage.filePng\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"-1373745011\",\"predicate\":\"storage.filePdf\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"1384777335\",\"predicate\":\"storage.fileMp3\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"1258941372\",\"predicate\":\"storage.fileMov\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"-1278304028\",\"predicate\":\"storage.fileMp4\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"276907596\",\"predicate\":\"storage.fileWebp\",\"params\":[],\"type\":\"storage.FileType\"},{\"id\":\"537022650\",\"predicate\":\"userEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"User\"},{\"id\":\"1326562017\",\"predicate\":\"userProfilePhotoEmpty\",\"params\":[],\"type\":\"UserProfilePhoto\"},{\"id\":\"-321430132\",\"predicate\":\"userProfilePhoto\",\"params\":[{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"photo_small\",\"type\":\"FileLocation\"},{\"name\":\"photo_big\",\"type\":\"FileLocation\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"UserProfilePhoto\"},{\"id\":\"164646985\",\"predicate\":\"userStatusEmpty\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":\"-306628279\",\"predicate\":\"userStatusOnline\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":\"9203775\",\"predicate\":\"userStatusOffline\",\"params\":[{\"name\":\"was_online\",\"type\":\"int\"}],\"type\":\"UserStatus\"},{\"id\":\"-1683826688\",\"predicate\":\"chatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Chat\"},{\"id\":\"1004149726\",\"predicate\":\"chat\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"kicked\",\"type\":\"flags.1?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"deactivated\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"migrated_to\",\"type\":\"flags.6?InputChannel\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"}],\"type\":\"Chat\"},{\"id\":\"120753115\",\"predicate\":\"chatForbidden\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Chat\"},{\"id\":\"461151667\",\"predicate\":\"chatFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_set_username\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.8?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants\",\"type\":\"ChatParticipants\"},{\"name\":\"chat_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"flags.3?Vector\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"}],\"type\":\"ChatFull\"},{\"id\":\"-925415106\",\"predicate\":\"chatParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"inviter_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":\"-57668565\",\"predicate\":\"chatParticipantsForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"self_participant\",\"type\":\"flags.0?ChatParticipant\"}],\"type\":\"ChatParticipants\"},{\"id\":\"1061556205\",\"predicate\":\"chatParticipants\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"ChatParticipants\"},{\"id\":\"935395612\",\"predicate\":\"chatPhotoEmpty\",\"params\":[],\"type\":\"ChatPhoto\"},{\"id\":\"1197267925\",\"predicate\":\"chatPhoto\",\"params\":[{\"name\":\"photo_small\",\"type\":\"FileLocation\"},{\"name\":\"photo_big\",\"type\":\"FileLocation\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"ChatPhoto\"},{\"id\":\"-2082087340\",\"predicate\":\"messageEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Message\"},{\"id\":\"1160515173\",\"predicate\":\"message\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"from_scheduled\",\"type\":\"flags.18?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"edit_hide\",\"type\":\"flags.21?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?int\"},{\"name\":\"to_id\",\"type\":\"Peer\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?int\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.3?int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.6?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"},{\"name\":\"views\",\"type\":\"flags.10?int\"},{\"name\":\"edit_date\",\"type\":\"flags.15?int\"},{\"name\":\"post_author\",\"type\":\"flags.16?string\"},{\"name\":\"grouped_id\",\"type\":\"flags.17?long\"},{\"name\":\"restriction_reason\",\"type\":\"flags.22?Vector\"}],\"type\":\"Message\"},{\"id\":\"-1642487306\",\"predicate\":\"messageService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"post\",\"type\":\"flags.14?true\"},{\"name\":\"legacy\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"flags.8?int\"},{\"name\":\"to_id\",\"type\":\"Peer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.3?int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"MessageAction\"}],\"type\":\"Message\"},{\"id\":\"1038967584\",\"predicate\":\"messageMediaEmpty\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":\"1766936791\",\"predicate\":\"messageMediaPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":\"1457575028\",\"predicate\":\"messageMediaGeo\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"}],\"type\":\"MessageMedia\"},{\"id\":\"-873313984\",\"predicate\":\"messageMediaContact\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"MessageMedia\"},{\"id\":\"-1618676578\",\"predicate\":\"messageMediaUnsupported\",\"params\":[],\"type\":\"MessageMedia\"},{\"id\":\"-1230047312\",\"predicate\":\"messageActionEmpty\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"-1503425638\",\"predicate\":\"messageActionChatCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":\"-1247687078\",\"predicate\":\"messageActionChatEditTitle\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":\"2144015272\",\"predicate\":\"messageActionChatEditPhoto\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"}],\"type\":\"MessageAction\"},{\"id\":\"-1780220945\",\"predicate\":\"messageActionChatDeletePhoto\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"1217033015\",\"predicate\":\"messageActionChatAddUser\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":\"-1297179892\",\"predicate\":\"messageActionChatDeleteUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":\"739712882\",\"predicate\":\"dialog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"unread_mark\",\"type\":\"flags.3?true\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"unread_mentions_count\",\"type\":\"int\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"},{\"name\":\"draft\",\"type\":\"flags.1?DraftMessage\"},{\"name\":\"folder_id\",\"type\":\"flags.4?int\"}],\"type\":\"Dialog\"},{\"id\":\"590459437\",\"predicate\":\"photoEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Photo\"},{\"id\":\"-797637467\",\"predicate\":\"photo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_stickers\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"sizes\",\"type\":\"Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"Photo\"},{\"id\":\"236446268\",\"predicate\":\"photoSizeEmpty\",\"params\":[{\"name\":\"type\",\"type\":\"string\"}],\"type\":\"PhotoSize\"},{\"id\":\"2009052699\",\"predicate\":\"photoSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"location\",\"type\":\"FileLocation\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"size\",\"type\":\"int\"}],\"type\":\"PhotoSize\"},{\"id\":\"-374917894\",\"predicate\":\"photoCachedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"location\",\"type\":\"FileLocation\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":\"286776671\",\"predicate\":\"geoPointEmpty\",\"params\":[],\"type\":\"GeoPoint\"},{\"id\":\"43446532\",\"predicate\":\"geoPoint\",\"params\":[{\"name\":\"long\",\"type\":\"double\"},{\"name\":\"lat\",\"type\":\"double\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"GeoPoint\"},{\"id\":\"1577067778\",\"predicate\":\"auth.sentCode\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"auth.SentCodeType\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"next_type\",\"type\":\"flags.1?auth.CodeType\"},{\"name\":\"timeout\",\"type\":\"flags.2?int\"}],\"type\":\"auth.SentCode\"},{\"id\":\"-855308010\",\"predicate\":\"auth.authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-543777747\",\"predicate\":\"auth.exportedAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":\"-1195615476\",\"predicate\":\"inputNotifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputNotifyPeer\"},{\"id\":\"423314455\",\"predicate\":\"inputNotifyUsers\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":\"1251338318\",\"predicate\":\"inputNotifyChats\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":\"-1673717362\",\"predicate\":\"inputPeerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"sound\",\"type\":\"flags.3?string\"}],\"type\":\"InputPeerNotifySettings\"},{\"id\":\"-1353671392\",\"predicate\":\"peerNotifySettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"show_previews\",\"type\":\"flags.0?Bool\"},{\"name\":\"silent\",\"type\":\"flags.1?Bool\"},{\"name\":\"mute_until\",\"type\":\"flags.2?int\"},{\"name\":\"sound\",\"type\":\"flags.3?string\"}],\"type\":\"PeerNotifySettings\"},{\"id\":\"-2122045747\",\"predicate\":\"peerSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"report_spam\",\"type\":\"flags.0?true\"},{\"name\":\"add_contact\",\"type\":\"flags.1?true\"},{\"name\":\"block_contact\",\"type\":\"flags.2?true\"},{\"name\":\"share_contact\",\"type\":\"flags.3?true\"},{\"name\":\"need_contacts_exception\",\"type\":\"flags.4?true\"},{\"name\":\"report_geo\",\"type\":\"flags.5?true\"}],\"type\":\"PeerSettings\"},{\"id\":\"-1539849235\",\"predicate\":\"wallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"pattern\",\"type\":\"flags.3?true\"},{\"name\":\"dark\",\"type\":\"flags.4?true\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"Document\"},{\"name\":\"settings\",\"type\":\"flags.2?WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":\"1490799288\",\"predicate\":\"inputReportReasonSpam\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"505595789\",\"predicate\":\"inputReportReasonViolence\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"777640226\",\"predicate\":\"inputReportReasonPornography\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"-1376497949\",\"predicate\":\"inputReportReasonChildAbuse\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"-512463606\",\"predicate\":\"inputReportReasonOther\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"ReportReason\"},{\"id\":\"-302941166\",\"predicate\":\"userFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blocked\",\"type\":\"flags.0?true\"},{\"name\":\"phone_calls_available\",\"type\":\"flags.4?true\"},{\"name\":\"phone_calls_private\",\"type\":\"flags.5?true\"},{\"name\":\"can_pin_message\",\"type\":\"flags.7?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.12?true\"},{\"name\":\"user\",\"type\":\"User\"},{\"name\":\"about\",\"type\":\"flags.1?string\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"},{\"name\":\"profile_photo\",\"type\":\"flags.2?Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"bot_info\",\"type\":\"flags.3?BotInfo\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.6?int\"},{\"name\":\"common_chats_count\",\"type\":\"int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"}],\"type\":\"UserFull\"},{\"id\":\"-116274796\",\"predicate\":\"contact\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"mutual\",\"type\":\"Bool\"}],\"type\":\"Contact\"},{\"id\":\"-805141448\",\"predicate\":\"importedContact\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"client_id\",\"type\":\"long\"}],\"type\":\"ImportedContact\"},{\"id\":\"1444661369\",\"predicate\":\"contactBlocked\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ContactBlocked\"},{\"id\":\"-748155807\",\"predicate\":\"contactStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"ContactStatus\"},{\"id\":\"-1219778094\",\"predicate\":\"contacts.contactsNotModified\",\"params\":[],\"type\":\"contacts.Contacts\"},{\"id\":\"-353862078\",\"predicate\":\"contacts.contacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"},{\"name\":\"saved_count\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Contacts\"},{\"id\":\"2010127419\",\"predicate\":\"contacts.importedContacts\",\"params\":[{\"name\":\"imported\",\"type\":\"Vector\"},{\"name\":\"popular_invites\",\"type\":\"Vector\"},{\"name\":\"retry_contacts\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":\"471043349\",\"predicate\":\"contacts.blocked\",\"params\":[{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":\"-1878523231\",\"predicate\":\"contacts.blockedSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"blocked\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Blocked\"},{\"id\":\"364538944\",\"predicate\":\"messages.dialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":\"1910543603\",\"predicate\":\"messages.dialogsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Dialogs\"},{\"id\":\"-1938715001\",\"predicate\":\"messages.messages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"-923939298\",\"predicate\":\"messages.messagesSlice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"next_rate\",\"type\":\"flags.0?int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"1694474197\",\"predicate\":\"messages.chats\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":\"-438840932\",\"predicate\":\"messages.chatFull\",\"params\":[{\"name\":\"full_chat\",\"type\":\"ChatFull\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.ChatFull\"},{\"id\":\"-1269012015\",\"predicate\":\"messages.affectedHistory\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":\"1474492012\",\"predicate\":\"inputMessagesFilterEmpty\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1777752804\",\"predicate\":\"inputMessagesFilterPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1614803355\",\"predicate\":\"inputMessagesFilterVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"1458172132\",\"predicate\":\"inputMessagesFilterPhotoVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1629621880\",\"predicate\":\"inputMessagesFilterDocument\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"2129714567\",\"predicate\":\"inputMessagesFilterUrl\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-3644025\",\"predicate\":\"inputMessagesFilterGif\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"522914557\",\"predicate\":\"updateNewMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1318109142\",\"predicate\":\"updateMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":\"-1576161051\",\"predicate\":\"updateDeleteMessages\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1548249383\",\"predicate\":\"updateUserTyping\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":\"-1704596961\",\"predicate\":\"updateChatUserTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Update\"},{\"id\":\"125178264\",\"predicate\":\"updateChatParticipants\",\"params\":[{\"name\":\"participants\",\"type\":\"ChatParticipants\"}],\"type\":\"Update\"},{\"id\":\"469489699\",\"predicate\":\"updateUserStatus\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"status\",\"type\":\"UserStatus\"}],\"type\":\"Update\"},{\"id\":\"-1489818765\",\"predicate\":\"updateUserName\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":\"-1791935732\",\"predicate\":\"updateUserPhoto\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"photo\",\"type\":\"UserProfilePhoto\"},{\"name\":\"previous\",\"type\":\"Bool\"}],\"type\":\"Update\"},{\"id\":\"-1519637954\",\"predicate\":\"updates.state\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"}],\"type\":\"updates.State\"},{\"id\":\"1567990072\",\"predicate\":\"updates.differenceEmpty\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":\"16030880\",\"predicate\":\"updates.difference\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":\"-1459938943\",\"predicate\":\"updates.differenceSlice\",\"params\":[{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"new_encrypted_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"intermediate_state\",\"type\":\"updates.State\"}],\"type\":\"updates.Difference\"},{\"id\":\"-484987010\",\"predicate\":\"updatesTooLong\",\"params\":[],\"type\":\"Updates\"},{\"id\":\"-1857044719\",\"predicate\":\"updateShortMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?int\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.3?int\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"}],\"type\":\"Updates\"},{\"id\":\"377562760\",\"predicate\":\"updateShortChatMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"mentioned\",\"type\":\"flags.4?true\"},{\"name\":\"media_unread\",\"type\":\"flags.5?true\"},{\"name\":\"silent\",\"type\":\"flags.13?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"from_id\",\"type\":\"int\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"fwd_from\",\"type\":\"flags.2?MessageFwdHeader\"},{\"name\":\"via_bot_id\",\"type\":\"flags.11?int\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.3?int\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"}],\"type\":\"Updates\"},{\"id\":\"2027216577\",\"predicate\":\"updateShort\",\"params\":[{\"name\":\"update\",\"type\":\"Update\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"1918567619\",\"predicate\":\"updatesCombined\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq_start\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"1957577280\",\"predicate\":\"updates\",\"params\":[{\"name\":\"updates\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"seq\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"-1916114267\",\"predicate\":\"photos.photos\",\"params\":[{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":\"352657236\",\"predicate\":\"photos.photosSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photos\"},{\"id\":\"539045032\",\"predicate\":\"photos.photo\",\"params\":[{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"photos.Photo\"},{\"id\":\"157948117\",\"predicate\":\"upload.file\",\"params\":[{\"name\":\"type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.File\"},{\"id\":\"414687501\",\"predicate\":\"dcOption\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"ipv6\",\"type\":\"flags.0?true\"},{\"name\":\"media_only\",\"type\":\"flags.1?true\"},{\"name\":\"tcpo_only\",\"type\":\"flags.2?true\"},{\"name\":\"cdn\",\"type\":\"flags.3?true\"},{\"name\":\"static\",\"type\":\"flags.4?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"ip_address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"flags.10?bytes\"}],\"type\":\"DcOption\"},{\"id\":\"856375399\",\"predicate\":\"config\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phonecalls_enabled\",\"type\":\"flags.1?true\"},{\"name\":\"default_p2p_contacts\",\"type\":\"flags.3?true\"},{\"name\":\"preload_featured_stickers\",\"type\":\"flags.4?true\"},{\"name\":\"ignore_phone_entities\",\"type\":\"flags.5?true\"},{\"name\":\"revoke_pm_inbox\",\"type\":\"flags.6?true\"},{\"name\":\"blocked_mode\",\"type\":\"flags.8?true\"},{\"name\":\"pfs_enabled\",\"type\":\"flags.13?true\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"test_mode\",\"type\":\"Bool\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"dc_options\",\"type\":\"Vector\"},{\"name\":\"dc_txt_domain_name\",\"type\":\"string\"},{\"name\":\"chat_size_max\",\"type\":\"int\"},{\"name\":\"megagroup_size_max\",\"type\":\"int\"},{\"name\":\"forwarded_count_max\",\"type\":\"int\"},{\"name\":\"online_update_period_ms\",\"type\":\"int\"},{\"name\":\"offline_blur_timeout_ms\",\"type\":\"int\"},{\"name\":\"offline_idle_timeout_ms\",\"type\":\"int\"},{\"name\":\"online_cloud_timeout_ms\",\"type\":\"int\"},{\"name\":\"notify_cloud_delay_ms\",\"type\":\"int\"},{\"name\":\"notify_default_delay_ms\",\"type\":\"int\"},{\"name\":\"push_chat_period_ms\",\"type\":\"int\"},{\"name\":\"push_chat_limit\",\"type\":\"int\"},{\"name\":\"saved_gifs_limit\",\"type\":\"int\"},{\"name\":\"edit_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_time_limit\",\"type\":\"int\"},{\"name\":\"revoke_pm_time_limit\",\"type\":\"int\"},{\"name\":\"rating_e_decay\",\"type\":\"int\"},{\"name\":\"stickers_recent_limit\",\"type\":\"int\"},{\"name\":\"stickers_faved_limit\",\"type\":\"int\"},{\"name\":\"channels_read_media_period\",\"type\":\"int\"},{\"name\":\"tmp_sessions\",\"type\":\"flags.0?int\"},{\"name\":\"pinned_dialogs_count_max\",\"type\":\"int\"},{\"name\":\"pinned_infolder_count_max\",\"type\":\"int\"},{\"name\":\"call_receive_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_ring_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_connect_timeout_ms\",\"type\":\"int\"},{\"name\":\"call_packet_timeout_ms\",\"type\":\"int\"},{\"name\":\"me_url_prefix\",\"type\":\"string\"},{\"name\":\"autoupdate_url_prefix\",\"type\":\"flags.7?string\"},{\"name\":\"gif_search_username\",\"type\":\"flags.9?string\"},{\"name\":\"venue_search_username\",\"type\":\"flags.10?string\"},{\"name\":\"img_search_username\",\"type\":\"flags.11?string\"},{\"name\":\"static_maps_provider\",\"type\":\"flags.12?string\"},{\"name\":\"caption_length_max\",\"type\":\"int\"},{\"name\":\"message_length_max\",\"type\":\"int\"},{\"name\":\"webfile_dc_id\",\"type\":\"int\"},{\"name\":\"suggested_lang_code\",\"type\":\"flags.2?string\"},{\"name\":\"lang_pack_version\",\"type\":\"flags.2?int\"},{\"name\":\"base_lang_pack_version\",\"type\":\"flags.2?int\"}],\"type\":\"Config\"},{\"id\":\"-1910892683\",\"predicate\":\"nearestDc\",\"params\":[{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"this_dc\",\"type\":\"int\"},{\"name\":\"nearest_dc\",\"type\":\"int\"}],\"type\":\"NearestDc\"},{\"id\":\"497489295\",\"predicate\":\"help.appUpdate\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_not_skip\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"url\",\"type\":\"flags.2?string\"}],\"type\":\"help.AppUpdate\"},{\"id\":\"-1000708810\",\"predicate\":\"help.noAppUpdate\",\"params\":[],\"type\":\"help.AppUpdate\"},{\"id\":\"415997816\",\"predicate\":\"help.inviteText\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"help.InviteText\"},{\"id\":\"314359194\",\"predicate\":\"updateNewEncryptedMessage\",\"params\":[{\"name\":\"message\",\"type\":\"EncryptedMessage\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"386986326\",\"predicate\":\"updateEncryptedChatTyping\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1264392051\",\"predicate\":\"updateEncryption\",\"params\":[{\"name\":\"chat\",\"type\":\"EncryptedChat\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"956179895\",\"predicate\":\"updateEncryptedMessagesRead\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1417756512\",\"predicate\":\"encryptedChatEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":\"1006044124\",\"predicate\":\"encryptedChatWaiting\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":\"-931638658\",\"predicate\":\"encryptedChatRequested\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":\"-94974410\",\"predicate\":\"encryptedChat\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":\"332848423\",\"predicate\":\"encryptedChatDiscarded\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"EncryptedChat\"},{\"id\":\"-247351839\",\"predicate\":\"inputEncryptedChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedChat\"},{\"id\":\"-1038136962\",\"predicate\":\"encryptedFileEmpty\",\"params\":[],\"type\":\"EncryptedFile\"},{\"id\":\"1248893260\",\"predicate\":\"encryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"EncryptedFile\"},{\"id\":\"406307684\",\"predicate\":\"inputEncryptedFileEmpty\",\"params\":[],\"type\":\"InputEncryptedFile\"},{\"id\":\"1690108678\",\"predicate\":\"inputEncryptedFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":\"1511503333\",\"predicate\":\"inputEncryptedFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputEncryptedFile\"},{\"id\":\"-182231723\",\"predicate\":\"inputEncryptedFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":\"-317144808\",\"predicate\":\"encryptedMessage\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"EncryptedMessage\"},{\"id\":\"594758406\",\"predicate\":\"encryptedMessageService\",\"params\":[{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"EncryptedMessage\"},{\"id\":\"-1058912715\",\"predicate\":\"messages.dhConfigNotModified\",\"params\":[{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":\"740433629\",\"predicate\":\"messages.dhConfig\",\"params\":[{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random\",\"type\":\"bytes\"}],\"type\":\"messages.DhConfig\"},{\"id\":\"1443858741\",\"predicate\":\"messages.sentEncryptedMessage\",\"params\":[{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":\"-1802240206\",\"predicate\":\"messages.sentEncryptedFile\",\"params\":[{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file\",\"type\":\"EncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":\"-95482955\",\"predicate\":\"inputFileBig\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"InputFile\"},{\"id\":\"767652808\",\"predicate\":\"inputEncryptedFileBigUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"key_fingerprint\",\"type\":\"int\"}],\"type\":\"InputEncryptedFile\"},{\"id\":\"-364179876\",\"predicate\":\"updateChatParticipantAdd\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"inviter_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1851755554\",\"predicate\":\"updateChatParticipantDelete\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1906403213\",\"predicate\":\"updateDcOptions\",\"params\":[{\"name\":\"dc_options\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"1530447553\",\"predicate\":\"inputMediaUploadedDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"nosound_video\",\"type\":\"flags.3?true\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.2?InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"flags.0?Vector\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":\"598418386\",\"predicate\":\"inputMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":\"-1666158377\",\"predicate\":\"messageMediaDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.2?int\"}],\"type\":\"MessageMedia\"},{\"id\":\"1928391342\",\"predicate\":\"inputDocumentEmpty\",\"params\":[],\"type\":\"InputDocument\"},{\"id\":\"448771445\",\"predicate\":\"inputDocument\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"}],\"type\":\"InputDocument\"},{\"id\":\"-1160743548\",\"predicate\":\"inputDocumentFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":\"922273905\",\"predicate\":\"documentEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"Document\"},{\"id\":\"-1683841855\",\"predicate\":\"document\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"thumbs\",\"type\":\"flags.0?Vector\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"Document\"},{\"id\":\"398898678\",\"predicate\":\"help.support\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"user\",\"type\":\"User\"}],\"type\":\"help.Support\"},{\"id\":\"-1613493288\",\"predicate\":\"notifyPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"NotifyPeer\"},{\"id\":\"-1261946036\",\"predicate\":\"notifyUsers\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":\"-1073230141\",\"predicate\":\"notifyChats\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":\"-2131957734\",\"predicate\":\"updateUserBlocked\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"blocked\",\"type\":\"Bool\"}],\"type\":\"Update\"},{\"id\":\"-1094555409\",\"predicate\":\"updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"NotifyPeer\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"}],\"type\":\"Update\"},{\"id\":\"381645902\",\"predicate\":\"sendMessageTypingAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-44119819\",\"predicate\":\"sendMessageCancelAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-1584933265\",\"predicate\":\"sendMessageRecordVideoAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-378127636\",\"predicate\":\"sendMessageUploadVideoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":\"-718310409\",\"predicate\":\"sendMessageRecordAudioAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-212740181\",\"predicate\":\"sendMessageUploadAudioAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":\"-774682074\",\"predicate\":\"sendMessageUploadPhotoAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":\"-1441998364\",\"predicate\":\"sendMessageUploadDocumentAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":\"393186209\",\"predicate\":\"sendMessageGeoLocationAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"1653390447\",\"predicate\":\"sendMessageChooseContactAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-1290580579\",\"predicate\":\"contacts.found\",\"params\":[{\"name\":\"my_results\",\"type\":\"Vector\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.Found\"},{\"id\":\"-337352679\",\"predicate\":\"updateServiceNotification\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"inbox_date\",\"type\":\"flags.1?int\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"media\",\"type\":\"MessageMedia\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"-496024847\",\"predicate\":\"userStatusRecently\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":\"129960444\",\"predicate\":\"userStatusLastWeek\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":\"2011940674\",\"predicate\":\"userStatusLastMonth\",\"params\":[],\"type\":\"UserStatus\"},{\"id\":\"-298113238\",\"predicate\":\"updatePrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"PrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"1335282456\",\"predicate\":\"inputPrivacyKeyStatusTimestamp\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"-1137792208\",\"predicate\":\"privacyKeyStatusTimestamp\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"218751099\",\"predicate\":\"inputPrivacyValueAllowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":\"407582158\",\"predicate\":\"inputPrivacyValueAllowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":\"320652927\",\"predicate\":\"inputPrivacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":\"195371015\",\"predicate\":\"inputPrivacyValueDisallowContacts\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":\"-697604407\",\"predicate\":\"inputPrivacyValueDisallowAll\",\"params\":[],\"type\":\"InputPrivacyRule\"},{\"id\":\"-1877932953\",\"predicate\":\"inputPrivacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":\"-123988\",\"predicate\":\"privacyValueAllowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":\"1698855810\",\"predicate\":\"privacyValueAllowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":\"1297858060\",\"predicate\":\"privacyValueAllowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":\"-125240806\",\"predicate\":\"privacyValueDisallowContacts\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":\"-1955338397\",\"predicate\":\"privacyValueDisallowAll\",\"params\":[],\"type\":\"PrivacyRule\"},{\"id\":\"209668535\",\"predicate\":\"privacyValueDisallowUsers\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":\"1352683077\",\"predicate\":\"account.privacyRules\",\"params\":[{\"name\":\"rules\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":\"-1194283041\",\"predicate\":\"accountDaysTTL\",\"params\":[{\"name\":\"days\",\"type\":\"int\"}],\"type\":\"AccountDaysTTL\"},{\"id\":\"314130811\",\"predicate\":\"updateUserPhone\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":\"1815593308\",\"predicate\":\"documentAttributeImageSize\",\"params\":[{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":\"297109817\",\"predicate\":\"documentAttributeAnimated\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":\"1662637586\",\"predicate\":\"documentAttributeSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"mask\",\"type\":\"flags.1?true\"},{\"name\":\"alt\",\"type\":\"string\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"DocumentAttribute\"},{\"id\":\"250621158\",\"predicate\":\"documentAttributeVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"round_message\",\"type\":\"flags.0?true\"},{\"name\":\"supports_streaming\",\"type\":\"flags.1?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"DocumentAttribute\"},{\"id\":\"-1739392570\",\"predicate\":\"documentAttributeAudio\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"voice\",\"type\":\"flags.10?true\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"performer\",\"type\":\"flags.1?string\"},{\"name\":\"waveform\",\"type\":\"flags.2?bytes\"}],\"type\":\"DocumentAttribute\"},{\"id\":\"358154344\",\"predicate\":\"documentAttributeFilename\",\"params\":[{\"name\":\"file_name\",\"type\":\"string\"}],\"type\":\"DocumentAttribute\"},{\"id\":\"-244016606\",\"predicate\":\"messages.stickersNotModified\",\"params\":[],\"type\":\"messages.Stickers\"},{\"id\":\"-463889475\",\"predicate\":\"messages.stickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.Stickers\"},{\"id\":\"313694676\",\"predicate\":\"stickerPack\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"StickerPack\"},{\"id\":\"-395967805\",\"predicate\":\"messages.allStickersNotModified\",\"params\":[],\"type\":\"messages.AllStickers\"},{\"id\":\"-302170017\",\"predicate\":\"messages.allStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.AllStickers\"},{\"id\":\"-1667805217\",\"predicate\":\"updateReadHistoryInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"791617983\",\"predicate\":\"updateReadHistoryOutbox\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-2066640507\",\"predicate\":\"messages.affectedMessages\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":\"2139689491\",\"predicate\":\"updateWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-350980120\",\"predicate\":\"webPageEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"WebPage\"},{\"id\":\"-981018084\",\"predicate\":\"webPagePending\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":\"-94051982\",\"predicate\":\"webPage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"display_url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"type\",\"type\":\"flags.0?string\"},{\"name\":\"site_name\",\"type\":\"flags.1?string\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"photo\",\"type\":\"flags.4?Photo\"},{\"name\":\"embed_url\",\"type\":\"flags.5?string\"},{\"name\":\"embed_type\",\"type\":\"flags.5?string\"},{\"name\":\"embed_width\",\"type\":\"flags.6?int\"},{\"name\":\"embed_height\",\"type\":\"flags.6?int\"},{\"name\":\"duration\",\"type\":\"flags.7?int\"},{\"name\":\"author\",\"type\":\"flags.8?string\"},{\"name\":\"document\",\"type\":\"flags.9?Document\"},{\"name\":\"documents\",\"type\":\"flags.11?Vector\"},{\"name\":\"cached_page\",\"type\":\"flags.10?Page\"}],\"type\":\"WebPage\"},{\"id\":\"-1557277184\",\"predicate\":\"messageMediaWebPage\",\"params\":[{\"name\":\"webpage\",\"type\":\"WebPage\"}],\"type\":\"MessageMedia\"},{\"id\":\"-1392388579\",\"predicate\":\"authorization\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"current\",\"type\":\"flags.0?true\"},{\"name\":\"official_app\",\"type\":\"flags.1?true\"},{\"name\":\"password_pending\",\"type\":\"flags.2?true\"},{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"app_name\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"country\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"Authorization\"},{\"id\":\"307276766\",\"predicate\":\"account.authorizations\",\"params\":[{\"name\":\"authorizations\",\"type\":\"Vector\"}],\"type\":\"account.Authorizations\"},{\"id\":\"-1390001672\",\"predicate\":\"account.password\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_recovery\",\"type\":\"flags.0?true\"},{\"name\":\"has_secure_values\",\"type\":\"flags.1?true\"},{\"name\":\"has_password\",\"type\":\"flags.2?true\"},{\"name\":\"current_algo\",\"type\":\"flags.2?PasswordKdfAlgo\"},{\"name\":\"srp_B\",\"type\":\"flags.2?bytes\"},{\"name\":\"srp_id\",\"type\":\"flags.2?long\"},{\"name\":\"hint\",\"type\":\"flags.3?string\"},{\"name\":\"email_unconfirmed_pattern\",\"type\":\"flags.4?string\"},{\"name\":\"new_algo\",\"type\":\"PasswordKdfAlgo\"},{\"name\":\"new_secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_random\",\"type\":\"bytes\"}],\"type\":\"account.Password\"},{\"id\":\"-1705233435\",\"predicate\":\"account.passwordSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"email\",\"type\":\"flags.0?string\"},{\"name\":\"secure_settings\",\"type\":\"flags.1?SecureSecretSettings\"}],\"type\":\"account.PasswordSettings\"},{\"id\":\"-1036572727\",\"predicate\":\"account.passwordInputSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"new_algo\",\"type\":\"flags.0?PasswordKdfAlgo\"},{\"name\":\"new_password_hash\",\"type\":\"flags.0?bytes\"},{\"name\":\"hint\",\"type\":\"flags.0?string\"},{\"name\":\"email\",\"type\":\"flags.1?string\"},{\"name\":\"new_secure_settings\",\"type\":\"flags.2?SecureSecretSettings\"}],\"type\":\"account.PasswordInputSettings\"},{\"id\":\"326715557\",\"predicate\":\"auth.passwordRecovery\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"}],\"type\":\"auth.PasswordRecovery\"},{\"id\":\"-1052959727\",\"predicate\":\"inputMediaVenue\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":\"784356159\",\"predicate\":\"messageMediaVenue\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":\"-1551583367\",\"predicate\":\"receivedNotifyMessage\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"flags\",\"type\":\"int\"}],\"type\":\"ReceivedNotifyMessage\"},{\"id\":\"1776236393\",\"predicate\":\"chatInviteEmpty\",\"params\":[],\"type\":\"ExportedChatInvite\"},{\"id\":\"-64092740\",\"predicate\":\"chatInviteExported\",\"params\":[{\"name\":\"link\",\"type\":\"string\"}],\"type\":\"ExportedChatInvite\"},{\"id\":\"1516793212\",\"predicate\":\"chatInviteAlready\",\"params\":[{\"name\":\"chat\",\"type\":\"Chat\"}],\"type\":\"ChatInvite\"},{\"id\":\"-540871282\",\"predicate\":\"chatInvite\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"flags.0?true\"},{\"name\":\"broadcast\",\"type\":\"flags.1?true\"},{\"name\":\"public\",\"type\":\"flags.2?true\"},{\"name\":\"megagroup\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"participants_count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"flags.4?Vector\"}],\"type\":\"ChatInvite\"},{\"id\":\"-123931160\",\"predicate\":\"messageActionChatJoinedByLink\",\"params\":[{\"name\":\"inviter_id\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":\"1757493555\",\"predicate\":\"updateReadMessagesContents\",\"params\":[{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-4838507\",\"predicate\":\"inputStickerSetEmpty\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":\"-1645763991\",\"predicate\":\"inputStickerSetID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputStickerSet\"},{\"id\":\"-2044933984\",\"predicate\":\"inputStickerSetShortName\",\"params\":[{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputStickerSet\"},{\"id\":\"-290164953\",\"predicate\":\"stickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"archived\",\"type\":\"flags.1?true\"},{\"name\":\"official\",\"type\":\"flags.2?true\"},{\"name\":\"masks\",\"type\":\"flags.3?true\"},{\"name\":\"animated\",\"type\":\"flags.5?true\"},{\"name\":\"installed_date\",\"type\":\"flags.0?int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"thumb\",\"type\":\"flags.4?PhotoSize\"},{\"name\":\"thumb_dc_id\",\"type\":\"flags.4?int\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"StickerSet\"},{\"id\":\"-1240849242\",\"predicate\":\"messages.stickerSet\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"-1820043071\",\"predicate\":\"user\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"self\",\"type\":\"flags.10?true\"},{\"name\":\"contact\",\"type\":\"flags.11?true\"},{\"name\":\"mutual_contact\",\"type\":\"flags.12?true\"},{\"name\":\"deleted\",\"type\":\"flags.13?true\"},{\"name\":\"bot\",\"type\":\"flags.14?true\"},{\"name\":\"bot_chat_history\",\"type\":\"flags.15?true\"},{\"name\":\"bot_nochats\",\"type\":\"flags.16?true\"},{\"name\":\"verified\",\"type\":\"flags.17?true\"},{\"name\":\"restricted\",\"type\":\"flags.18?true\"},{\"name\":\"min\",\"type\":\"flags.20?true\"},{\"name\":\"bot_inline_geo\",\"type\":\"flags.21?true\"},{\"name\":\"support\",\"type\":\"flags.23?true\"},{\"name\":\"scam\",\"type\":\"flags.24?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"flags.0?long\"},{\"name\":\"first_name\",\"type\":\"flags.1?string\"},{\"name\":\"last_name\",\"type\":\"flags.2?string\"},{\"name\":\"username\",\"type\":\"flags.3?string\"},{\"name\":\"phone\",\"type\":\"flags.4?string\"},{\"name\":\"photo\",\"type\":\"flags.5?UserProfilePhoto\"},{\"name\":\"status\",\"type\":\"flags.6?UserStatus\"},{\"name\":\"bot_info_version\",\"type\":\"flags.14?int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.18?Vector\"},{\"name\":\"bot_inline_placeholder\",\"type\":\"flags.19?string\"},{\"name\":\"lang_code\",\"type\":\"flags.22?string\"}],\"type\":\"User\"},{\"id\":\"-1032140601\",\"predicate\":\"botCommand\",\"params\":[{\"name\":\"command\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"}],\"type\":\"BotCommand\"},{\"id\":\"-1729618630\",\"predicate\":\"botInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"commands\",\"type\":\"Vector\"}],\"type\":\"BotInfo\"},{\"id\":\"-1560655744\",\"predicate\":\"keyboardButton\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"2002815875\",\"predicate\":\"keyboardButtonRow\",\"params\":[{\"name\":\"buttons\",\"type\":\"Vector\"}],\"type\":\"KeyboardButtonRow\"},{\"id\":\"-1606526075\",\"predicate\":\"replyKeyboardHide\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"}],\"type\":\"ReplyMarkup\"},{\"id\":\"-200242528\",\"predicate\":\"replyKeyboardForceReply\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"}],\"type\":\"ReplyMarkup\"},{\"id\":\"889353612\",\"predicate\":\"replyKeyboardMarkup\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"resize\",\"type\":\"flags.0?true\"},{\"name\":\"single_use\",\"type\":\"flags.1?true\"},{\"name\":\"selective\",\"type\":\"flags.2?true\"},{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"ReplyMarkup\"},{\"id\":\"2072935910\",\"predicate\":\"inputPeerUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":\"-668391402\",\"predicate\":\"inputUser\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputUser\"},{\"id\":\"-1148011883\",\"predicate\":\"messageEntityUnknown\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"-100378723\",\"predicate\":\"messageEntityMention\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1868782349\",\"predicate\":\"messageEntityHashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1827637959\",\"predicate\":\"messageEntityBotCommand\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1859134776\",\"predicate\":\"messageEntityUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1692693954\",\"predicate\":\"messageEntityEmail\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"-1117713463\",\"predicate\":\"messageEntityBold\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"-2106619040\",\"predicate\":\"messageEntityItalic\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"681706865\",\"predicate\":\"messageEntityCode\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1938967520\",\"predicate\":\"messageEntityPre\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":\"1990644519\",\"predicate\":\"messageEntityTextUrl\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"MessageEntity\"},{\"id\":\"301019932\",\"predicate\":\"updateShortSentMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"out\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"media\",\"type\":\"flags.9?MessageMedia\"},{\"name\":\"entities\",\"type\":\"flags.7?Vector\"}],\"type\":\"Updates\"},{\"id\":\"-292807034\",\"predicate\":\"inputChannelEmpty\",\"params\":[],\"type\":\"InputChannel\"},{\"id\":\"-1343524562\",\"predicate\":\"inputChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputChannel\"},{\"id\":\"-1109531342\",\"predicate\":\"peerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"}],\"type\":\"Peer\"},{\"id\":\"548253432\",\"predicate\":\"inputPeerChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPeer\"},{\"id\":\"-753232354\",\"predicate\":\"channel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"left\",\"type\":\"flags.2?true\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"verified\",\"type\":\"flags.7?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"restricted\",\"type\":\"flags.9?true\"},{\"name\":\"signatures\",\"type\":\"flags.11?true\"},{\"name\":\"min\",\"type\":\"flags.12?true\"},{\"name\":\"scam\",\"type\":\"flags.19?true\"},{\"name\":\"has_link\",\"type\":\"flags.20?true\"},{\"name\":\"has_geo\",\"type\":\"flags.21?true\"},{\"name\":\"slowmode_enabled\",\"type\":\"flags.22?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"flags.13?long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"username\",\"type\":\"flags.6?string\"},{\"name\":\"photo\",\"type\":\"ChatPhoto\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"restriction_reason\",\"type\":\"flags.9?Vector\"},{\"name\":\"admin_rights\",\"type\":\"flags.14?ChatAdminRights\"},{\"name\":\"banned_rights\",\"type\":\"flags.15?ChatBannedRights\"},{\"name\":\"default_banned_rights\",\"type\":\"flags.18?ChatBannedRights\"},{\"name\":\"participants_count\",\"type\":\"flags.17?int\"}],\"type\":\"Chat\"},{\"id\":\"681420594\",\"predicate\":\"channelForbidden\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.5?true\"},{\"name\":\"megagroup\",\"type\":\"flags.8?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"until_date\",\"type\":\"flags.16?int\"}],\"type\":\"Chat\"},{\"id\":\"2131196633\",\"predicate\":\"contacts.resolvedPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":\"763976820\",\"predicate\":\"channelFull\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_view_participants\",\"type\":\"flags.3?true\"},{\"name\":\"can_set_username\",\"type\":\"flags.6?true\"},{\"name\":\"can_set_stickers\",\"type\":\"flags.7?true\"},{\"name\":\"hidden_prehistory\",\"type\":\"flags.10?true\"},{\"name\":\"can_view_stats\",\"type\":\"flags.12?true\"},{\"name\":\"can_set_location\",\"type\":\"flags.16?true\"},{\"name\":\"has_scheduled\",\"type\":\"flags.19?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"participants_count\",\"type\":\"flags.0?int\"},{\"name\":\"admins_count\",\"type\":\"flags.1?int\"},{\"name\":\"kicked_count\",\"type\":\"flags.2?int\"},{\"name\":\"banned_count\",\"type\":\"flags.2?int\"},{\"name\":\"online_count\",\"type\":\"flags.13?int\"},{\"name\":\"read_inbox_max_id\",\"type\":\"int\"},{\"name\":\"read_outbox_max_id\",\"type\":\"int\"},{\"name\":\"unread_count\",\"type\":\"int\"},{\"name\":\"chat_photo\",\"type\":\"Photo\"},{\"name\":\"notify_settings\",\"type\":\"PeerNotifySettings\"},{\"name\":\"exported_invite\",\"type\":\"ExportedChatInvite\"},{\"name\":\"bot_info\",\"type\":\"Vector\"},{\"name\":\"migrated_from_chat_id\",\"type\":\"flags.4?int\"},{\"name\":\"migrated_from_max_id\",\"type\":\"flags.4?int\"},{\"name\":\"pinned_msg_id\",\"type\":\"flags.5?int\"},{\"name\":\"stickerset\",\"type\":\"flags.8?StickerSet\"},{\"name\":\"available_min_id\",\"type\":\"flags.9?int\"},{\"name\":\"folder_id\",\"type\":\"flags.11?int\"},{\"name\":\"linked_chat_id\",\"type\":\"flags.14?int\"},{\"name\":\"location\",\"type\":\"flags.15?ChannelLocation\"},{\"name\":\"slowmode_seconds\",\"type\":\"flags.17?int\"},{\"name\":\"slowmode_next_send_date\",\"type\":\"flags.18?int\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"ChatFull\"},{\"id\":\"182649427\",\"predicate\":\"messageRange\",\"params\":[{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"MessageRange\"},{\"id\":\"-1725551049\",\"predicate\":\"messages.channelMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"-1781355374\",\"predicate\":\"messageActionChannelCreate\",\"params\":[{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":\"-352032773\",\"predicate\":\"updateChannelTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"flags.0?int\"}],\"type\":\"Update\"},{\"id\":\"-1227598250\",\"predicate\":\"updateChannel\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1656358105\",\"predicate\":\"updateNewChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"856380452\",\"predicate\":\"updateReadChannelInbox\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"still_unread_count\",\"type\":\"int\"},{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1015733815\",\"predicate\":\"updateDeleteChannelMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1734268085\",\"predicate\":\"updateChannelMessageViews\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"views\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1041346555\",\"predicate\":\"updates.channelDifferenceEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":\"-1531132162\",\"predicate\":\"updates.channelDifferenceTooLong\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"dialog\",\"type\":\"Dialog\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":\"543450958\",\"predicate\":\"updates.channelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"final\",\"type\":\"flags.0?true\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"timeout\",\"type\":\"flags.1?int\"},{\"name\":\"new_messages\",\"type\":\"Vector\"},{\"name\":\"other_updates\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":\"-1798033689\",\"predicate\":\"channelMessagesFilterEmpty\",\"params\":[],\"type\":\"ChannelMessagesFilter\"},{\"id\":\"-847783593\",\"predicate\":\"channelMessagesFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_new_messages\",\"type\":\"flags.1?true\"},{\"name\":\"ranges\",\"type\":\"Vector\"}],\"type\":\"ChannelMessagesFilter\"},{\"id\":\"367766557\",\"predicate\":\"channelParticipant\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":\"-1557620115\",\"predicate\":\"channelParticipantSelf\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"inviter_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChannelParticipant\"},{\"id\":\"-2138237532\",\"predicate\":\"channelParticipantCreator\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"rank\",\"type\":\"flags.0?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":\"-566281095\",\"predicate\":\"channelParticipantsRecent\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"-1268741783\",\"predicate\":\"channelParticipantsAdmins\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"-1548400251\",\"predicate\":\"channelParticipantsKicked\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"-177282392\",\"predicate\":\"channels.channelParticipants\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"participants\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":\"-791039645\",\"predicate\":\"channels.channelParticipant\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":\"-636267638\",\"predicate\":\"chatParticipantCreator\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":\"-489233354\",\"predicate\":\"chatParticipantAdmin\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"inviter_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"ChatParticipant\"},{\"id\":\"-1232070311\",\"predicate\":\"updateChatParticipantAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"is_admin\",\"type\":\"Bool\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1371385889\",\"predicate\":\"messageActionChatMigrateTo\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":\"-1336546578\",\"predicate\":\"messageActionChannelMigrateFrom\",\"params\":[{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":\"-1328445861\",\"predicate\":\"channelParticipantsBots\",\"params\":[],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"2013922064\",\"predicate\":\"help.termsOfService\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"popup\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"DataJSON\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"min_age_confirm\",\"type\":\"flags.1?int\"}],\"type\":\"help.TermsOfService\"},{\"id\":\"1753886890\",\"predicate\":\"updateNewStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"messages.StickerSet\"}],\"type\":\"Update\"},{\"id\":\"196268545\",\"predicate\":\"updateStickerSetsOrder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"1135492588\",\"predicate\":\"updateStickerSets\",\"params\":[],\"type\":\"Update\"},{\"id\":\"372165663\",\"predicate\":\"foundGif\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"thumb_url\",\"type\":\"string\"},{\"name\":\"content_url\",\"type\":\"string\"},{\"name\":\"content_type\",\"type\":\"string\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"FoundGif\"},{\"id\":\"-1670052855\",\"predicate\":\"foundGifCached\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"document\",\"type\":\"Document\"}],\"type\":\"FoundGif\"},{\"id\":\"1212395773\",\"predicate\":\"inputMediaGifExternal\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":\"1158290442\",\"predicate\":\"messages.foundGifs\",\"params\":[{\"name\":\"next_offset\",\"type\":\"int\"},{\"name\":\"results\",\"type\":\"Vector\"}],\"type\":\"messages.FoundGifs\"},{\"id\":\"-402498398\",\"predicate\":\"messages.savedGifsNotModified\",\"params\":[],\"type\":\"messages.SavedGifs\"},{\"id\":\"772213157\",\"predicate\":\"messages.savedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"gifs\",\"type\":\"Vector\"}],\"type\":\"messages.SavedGifs\"},{\"id\":\"-1821035490\",\"predicate\":\"updateSavedGifs\",\"params\":[],\"type\":\"Update\"},{\"id\":\"864077702\",\"predicate\":\"inputBotInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"1036876423\",\"predicate\":\"inputBotInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"-2000710887\",\"predicate\":\"inputBotInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?InputWebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?InputWebDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":\"1984755728\",\"predicate\":\"botInlineMessageMediaAuto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":\"-1937807902\",\"predicate\":\"botInlineMessageText\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":\"295067450\",\"predicate\":\"botInlineResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"url\",\"type\":\"flags.3?string\"},{\"name\":\"thumb\",\"type\":\"flags.4?WebDocument\"},{\"name\":\"content\",\"type\":\"flags.5?WebDocument\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":\"-1803769784\",\"predicate\":\"messages.botResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"next_offset\",\"type\":\"flags.1?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.2?InlineBotSwitchPM\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.BotResults\"},{\"id\":\"1417832080\",\"predicate\":\"updateBotInlineQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":\"239663460\",\"predicate\":\"updateBotInlineSend\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"geo\",\"type\":\"flags.0?GeoPoint\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"msg_id\",\"type\":\"flags.1?InputBotInlineMessageID\"}],\"type\":\"Update\"},{\"id\":\"1358283666\",\"predicate\":\"inputMessagesFilterVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"928101534\",\"predicate\":\"inputMessagesFilterMusic\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1107622874\",\"predicate\":\"inputPrivacyKeyChatInvite\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"1343122938\",\"predicate\":\"privacyKeyChatInvite\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"1571494644\",\"predicate\":\"exportedMessageLink\",\"params\":[{\"name\":\"link\",\"type\":\"string\"},{\"name\":\"html\",\"type\":\"string\"}],\"type\":\"ExportedMessageLink\"},{\"id\":\"-332168592\",\"predicate\":\"messageFwdHeader\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"from_id\",\"type\":\"flags.0?int\"},{\"name\":\"from_name\",\"type\":\"flags.5?string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"flags.1?int\"},{\"name\":\"channel_post\",\"type\":\"flags.2?int\"},{\"name\":\"post_author\",\"type\":\"flags.3?string\"},{\"name\":\"saved_from_peer\",\"type\":\"flags.4?Peer\"},{\"name\":\"saved_from_msg_id\",\"type\":\"flags.4?int\"}],\"type\":\"MessageFwdHeader\"},{\"id\":\"457133559\",\"predicate\":\"updateEditChannelMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1738988427\",\"predicate\":\"updateChannelPinnedMessage\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1799538451\",\"predicate\":\"messageActionPinMessage\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"1923290508\",\"predicate\":\"auth.codeTypeSms\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":\"1948046307\",\"predicate\":\"auth.codeTypeCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":\"577556219\",\"predicate\":\"auth.codeTypeFlashCall\",\"params\":[],\"type\":\"auth.CodeType\"},{\"id\":\"1035688326\",\"predicate\":\"auth.sentCodeTypeApp\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":\"-1073693790\",\"predicate\":\"auth.sentCodeTypeSms\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":\"1398007207\",\"predicate\":\"auth.sentCodeTypeCall\",\"params\":[{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"auth.SentCodeType\"},{\"id\":\"-1425815847\",\"predicate\":\"auth.sentCodeTypeFlashCall\",\"params\":[{\"name\":\"pattern\",\"type\":\"string\"}],\"type\":\"auth.SentCodeType\"},{\"id\":\"629866245\",\"predicate\":\"keyboardButtonUrl\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"1748655686\",\"predicate\":\"keyboardButtonCallback\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"KeyboardButton\"},{\"id\":\"-1318425559\",\"predicate\":\"keyboardButtonRequestPhone\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"-59151553\",\"predicate\":\"keyboardButtonRequestGeoLocation\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"90744648\",\"predicate\":\"keyboardButtonSwitchInline\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"same_peer\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"query\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"1218642516\",\"predicate\":\"replyInlineMarkup\",\"params\":[{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"ReplyMarkup\"},{\"id\":\"911761060\",\"predicate\":\"messages.botCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"has_url\",\"type\":\"flags.3?true\"},{\"name\":\"native_ui\",\"type\":\"flags.4?true\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":\"-415938591\",\"predicate\":\"updateBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":\"649453030\",\"predicate\":\"messages.messageEditData\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"caption\",\"type\":\"flags.0?true\"}],\"type\":\"messages.MessageEditData\"},{\"id\":\"-469536605\",\"predicate\":\"updateEditMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1045340827\",\"predicate\":\"inputBotInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"1098628881\",\"predicate\":\"inputBotInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"-1494368259\",\"predicate\":\"inputBotInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"-1222451611\",\"predicate\":\"botInlineMessageMediaGeo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"period\",\"type\":\"int\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":\"-1970903652\",\"predicate\":\"botInlineMessageMediaVenue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"venue_id\",\"type\":\"string\"},{\"name\":\"venue_type\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":\"416402882\",\"predicate\":\"botInlineMessageMediaContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"vcard\",\"type\":\"string\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"BotInlineMessage\"},{\"id\":\"-1462213465\",\"predicate\":\"inputBotInlineResultPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"InputPhoto\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":\"-459324\",\"predicate\":\"inputBotInlineResultDocument\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"description\",\"type\":\"flags.2?string\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":\"400266251\",\"predicate\":\"botInlineMediaResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?Photo\"},{\"name\":\"document\",\"type\":\"flags.1?Document\"},{\"name\":\"title\",\"type\":\"flags.2?string\"},{\"name\":\"description\",\"type\":\"flags.3?string\"},{\"name\":\"send_message\",\"type\":\"BotInlineMessage\"}],\"type\":\"BotInlineResult\"},{\"id\":\"-1995686519\",\"predicate\":\"inputBotInlineMessageID\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputBotInlineMessageID\"},{\"id\":\"-103646630\",\"predicate\":\"updateInlineBotCallbackQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"msg_id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"chat_instance\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"},{\"name\":\"game_short_name\",\"type\":\"flags.1?string\"}],\"type\":\"Update\"},{\"id\":\"1008755359\",\"predicate\":\"inlineBotSwitchPM\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"InlineBotSwitchPM\"},{\"id\":\"863093588\",\"predicate\":\"messages.peerDialogs\",\"params\":[{\"name\":\"dialogs\",\"type\":\"Vector\"},{\"name\":\"messages\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"state\",\"type\":\"updates.State\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":\"-305282981\",\"predicate\":\"topPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"rating\",\"type\":\"double\"}],\"type\":\"TopPeer\"},{\"id\":\"-1419371685\",\"predicate\":\"topPeerCategoryBotsPM\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"344356834\",\"predicate\":\"topPeerCategoryBotsInline\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"104314861\",\"predicate\":\"topPeerCategoryCorrespondents\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"-1122524854\",\"predicate\":\"topPeerCategoryGroups\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"371037736\",\"predicate\":\"topPeerCategoryChannels\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"-75283823\",\"predicate\":\"topPeerCategoryPeers\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"TopPeerCategoryPeers\"},{\"id\":\"-567906571\",\"predicate\":\"contacts.topPeersNotModified\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":\"1891070632\",\"predicate\":\"contacts.topPeers\",\"params\":[{\"name\":\"categories\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"contacts.TopPeers\"},{\"id\":\"892193368\",\"predicate\":\"messageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"546203849\",\"predicate\":\"inputMessageEntityMentionName\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"MessageEntity\"},{\"id\":\"975236280\",\"predicate\":\"inputMessagesFilterChatPhotos\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"634833351\",\"predicate\":\"updateReadChannelOutbox\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-299124375\",\"predicate\":\"updateDraftMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"draft\",\"type\":\"DraftMessage\"}],\"type\":\"Update\"},{\"id\":\"453805082\",\"predicate\":\"draftMessageEmpty\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"flags.0?int\"}],\"type\":\"DraftMessage\"},{\"id\":\"-40996577\",\"predicate\":\"draftMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"DraftMessage\"},{\"id\":\"-1615153660\",\"predicate\":\"messageActionHistoryClear\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"82699215\",\"predicate\":\"messages.featuredStickersNotModified\",\"params\":[],\"type\":\"messages.FeaturedStickers\"},{\"id\":\"-123893531\",\"predicate\":\"messages.featuredStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"},{\"name\":\"unread\",\"type\":\"Vector\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":\"1461528386\",\"predicate\":\"updateReadFeaturedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":\"186120336\",\"predicate\":\"messages.recentStickersNotModified\",\"params\":[],\"type\":\"messages.RecentStickers\"},{\"id\":\"586395571\",\"predicate\":\"messages.recentStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"},{\"name\":\"dates\",\"type\":\"Vector\"}],\"type\":\"messages.RecentStickers\"},{\"id\":\"-1706939360\",\"predicate\":\"updateRecentStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":\"1338747336\",\"predicate\":\"messages.archivedStickers\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":\"946083368\",\"predicate\":\"messages.stickerSetInstallResultSuccess\",\"params\":[],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":\"904138920\",\"predicate\":\"messages.stickerSetInstallResultArchive\",\"params\":[{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":\"1678812626\",\"predicate\":\"stickerSetCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"cover\",\"type\":\"Document\"}],\"type\":\"StickerSetCovered\"},{\"id\":\"-1574314746\",\"predicate\":\"updateConfig\",\"params\":[],\"type\":\"Update\"},{\"id\":\"861169551\",\"predicate\":\"updatePtsChanged\",\"params\":[],\"type\":\"Update\"},{\"id\":\"-440664550\",\"predicate\":\"inputMediaPhotoExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":\"-78455655\",\"predicate\":\"inputMediaDocumentExternal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"ttl_seconds\",\"type\":\"flags.0?int\"}],\"type\":\"InputMedia\"},{\"id\":\"872932635\",\"predicate\":\"stickerSetMultiCovered\",\"params\":[{\"name\":\"set\",\"type\":\"StickerSet\"},{\"name\":\"covers\",\"type\":\"Vector\"}],\"type\":\"StickerSetCovered\"},{\"id\":\"-1361650766\",\"predicate\":\"maskCoords\",\"params\":[{\"name\":\"n\",\"type\":\"int\"},{\"name\":\"x\",\"type\":\"double\"},{\"name\":\"y\",\"type\":\"double\"},{\"name\":\"zoom\",\"type\":\"double\"}],\"type\":\"MaskCoords\"},{\"id\":\"-1744710921\",\"predicate\":\"documentAttributeHasStickers\",\"params\":[],\"type\":\"DocumentAttribute\"},{\"id\":\"1251549527\",\"predicate\":\"inputStickeredMediaPhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"InputStickeredMedia\"},{\"id\":\"70813275\",\"predicate\":\"inputStickeredMediaDocument\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"}],\"type\":\"InputStickeredMedia\"},{\"id\":\"-1107729093\",\"predicate\":\"game\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"Photo\"},{\"name\":\"document\",\"type\":\"flags.0?Document\"}],\"type\":\"Game\"},{\"id\":\"1336154098\",\"predicate\":\"inputBotInlineResultGame\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"send_message\",\"type\":\"InputBotInlineMessage\"}],\"type\":\"InputBotInlineResult\"},{\"id\":\"1262639204\",\"predicate\":\"inputBotInlineMessageGame\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"}],\"type\":\"InputBotInlineMessage\"},{\"id\":\"-38694904\",\"predicate\":\"messageMediaGame\",\"params\":[{\"name\":\"game\",\"type\":\"Game\"}],\"type\":\"MessageMedia\"},{\"id\":\"-750828557\",\"predicate\":\"inputMediaGame\",\"params\":[{\"name\":\"id\",\"type\":\"InputGame\"}],\"type\":\"InputMedia\"},{\"id\":\"53231223\",\"predicate\":\"inputGameID\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputGame\"},{\"id\":\"-1020139510\",\"predicate\":\"inputGameShortName\",\"params\":[{\"name\":\"bot_id\",\"type\":\"InputUser\"},{\"name\":\"short_name\",\"type\":\"string\"}],\"type\":\"InputGame\"},{\"id\":\"1358175439\",\"predicate\":\"keyboardButtonGame\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"-1834538890\",\"predicate\":\"messageActionGameScore\",\"params\":[{\"name\":\"game_id\",\"type\":\"long\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"MessageAction\"},{\"id\":\"1493171408\",\"predicate\":\"highScore\",\"params\":[{\"name\":\"pos\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"HighScore\"},{\"id\":\"-1707344487\",\"predicate\":\"messages.highScores\",\"params\":[{\"name\":\"scores\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"messages.HighScores\"},{\"id\":\"1258196845\",\"predicate\":\"updates.differenceTooLong\",\"params\":[{\"name\":\"pts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":\"1081547008\",\"predicate\":\"updateChannelWebPage\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"webpage\",\"type\":\"WebPage\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1663561404\",\"predicate\":\"messages.chatsSlice\",\"params\":[{\"name\":\"count\",\"type\":\"int\"},{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":\"-599948721\",\"predicate\":\"textEmpty\",\"params\":[],\"type\":\"RichText\"},{\"id\":\"1950782688\",\"predicate\":\"textPlain\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":\"1730456516\",\"predicate\":\"textBold\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"-653089380\",\"predicate\":\"textItalic\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"-1054465340\",\"predicate\":\"textUnderline\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"-1678197867\",\"predicate\":\"textStrike\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"1816074681\",\"predicate\":\"textFixed\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"1009288385\",\"predicate\":\"textUrl\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"}],\"type\":\"RichText\"},{\"id\":\"-564523562\",\"predicate\":\"textEmail\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":\"2120376535\",\"predicate\":\"textConcat\",\"params\":[{\"name\":\"texts\",\"type\":\"Vector\"}],\"type\":\"RichText\"},{\"id\":\"324435594\",\"predicate\":\"pageBlockUnsupported\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":\"1890305021\",\"predicate\":\"pageBlockTitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-1879401953\",\"predicate\":\"pageBlockSubtitle\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-1162877472\",\"predicate\":\"pageBlockAuthorDate\",\"params\":[{\"name\":\"author\",\"type\":\"RichText\"},{\"name\":\"published_date\",\"type\":\"int\"}],\"type\":\"PageBlock\"},{\"id\":\"-1076861716\",\"predicate\":\"pageBlockHeader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-248793375\",\"predicate\":\"pageBlockSubheader\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"1182402406\",\"predicate\":\"pageBlockParagraph\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-1066346178\",\"predicate\":\"pageBlockPreformatted\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"language\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":\"1216809369\",\"predicate\":\"pageBlockFooter\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-618614392\",\"predicate\":\"pageBlockDivider\",\"params\":[],\"type\":\"PageBlock\"},{\"id\":\"-837994576\",\"predicate\":\"pageBlockAnchor\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"PageBlock\"},{\"id\":\"-454524911\",\"predicate\":\"pageBlockList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":\"641563686\",\"predicate\":\"pageBlockBlockquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"1329878739\",\"predicate\":\"pageBlockPullquote\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"caption\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"391759200\",\"predicate\":\"pageBlockPhoto\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"photo_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"},{\"name\":\"url\",\"type\":\"flags.0?string\"},{\"name\":\"webpage_id\",\"type\":\"flags.0?long\"}],\"type\":\"PageBlock\"},{\"id\":\"2089805750\",\"predicate\":\"pageBlockVideo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autoplay\",\"type\":\"flags.0?true\"},{\"name\":\"loop\",\"type\":\"flags.1?true\"},{\"name\":\"video_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"972174080\",\"predicate\":\"pageBlockCover\",\"params\":[{\"name\":\"cover\",\"type\":\"PageBlock\"}],\"type\":\"PageBlock\"},{\"id\":\"-1468953147\",\"predicate\":\"pageBlockEmbed\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"full_width\",\"type\":\"flags.0?true\"},{\"name\":\"allow_scrolling\",\"type\":\"flags.3?true\"},{\"name\":\"url\",\"type\":\"flags.1?string\"},{\"name\":\"html\",\"type\":\"flags.2?string\"},{\"name\":\"poster_photo_id\",\"type\":\"flags.4?long\"},{\"name\":\"w\",\"type\":\"flags.5?int\"},{\"name\":\"h\",\"type\":\"flags.5?int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"-229005301\",\"predicate\":\"pageBlockEmbedPost\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"author_photo_id\",\"type\":\"long\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"1705048653\",\"predicate\":\"pageBlockCollage\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"52401552\",\"predicate\":\"pageBlockSlideshow\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"-2054908813\",\"predicate\":\"webPageNotModified\",\"params\":[],\"type\":\"WebPage\"},{\"id\":\"-88417185\",\"predicate\":\"inputPrivacyKeyPhoneCall\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"1030105979\",\"predicate\":\"privacyKeyPhoneCall\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"-580219064\",\"predicate\":\"sendMessageGamePlayAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"-2048646399\",\"predicate\":\"phoneCallDiscardReasonMissed\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":\"-527056480\",\"predicate\":\"phoneCallDiscardReasonDisconnect\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":\"1471006352\",\"predicate\":\"phoneCallDiscardReasonHangup\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":\"-84416311\",\"predicate\":\"phoneCallDiscardReasonBusy\",\"params\":[],\"type\":\"PhoneCallDiscardReason\"},{\"id\":\"1852826908\",\"predicate\":\"updateDialogPinned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":\"-99664734\",\"predicate\":\"updatePinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"order\",\"type\":\"flags.0?Vector\"}],\"type\":\"Update\"},{\"id\":\"2104790276\",\"predicate\":\"dataJSON\",\"params\":[{\"name\":\"data\",\"type\":\"string\"}],\"type\":\"DataJSON\"},{\"id\":\"-2095595325\",\"predicate\":\"updateBotWebhookJSON\",\"params\":[{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Update\"},{\"id\":\"-1684914010\",\"predicate\":\"updateBotWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"},{\"name\":\"timeout\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-886477832\",\"predicate\":\"labeledPrice\",\"params\":[{\"name\":\"label\",\"type\":\"string\"},{\"name\":\"amount\",\"type\":\"long\"}],\"type\":\"LabeledPrice\"},{\"id\":\"-1022713000\",\"predicate\":\"invoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"test\",\"type\":\"flags.0?true\"},{\"name\":\"name_requested\",\"type\":\"flags.1?true\"},{\"name\":\"phone_requested\",\"type\":\"flags.2?true\"},{\"name\":\"email_requested\",\"type\":\"flags.3?true\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.4?true\"},{\"name\":\"flexible\",\"type\":\"flags.5?true\"},{\"name\":\"phone_to_provider\",\"type\":\"flags.6?true\"},{\"name\":\"email_to_provider\",\"type\":\"flags.7?true\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"}],\"type\":\"Invoice\"},{\"id\":\"-186607933\",\"predicate\":\"inputMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?InputWebDocument\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"provider\",\"type\":\"string\"},{\"name\":\"provider_data\",\"type\":\"DataJSON\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"InputMedia\"},{\"id\":\"-368917890\",\"predicate\":\"paymentCharge\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"provider_charge_id\",\"type\":\"string\"}],\"type\":\"PaymentCharge\"},{\"id\":\"-1892568281\",\"predicate\":\"messageActionPaymentSentMe\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"charge\",\"type\":\"PaymentCharge\"}],\"type\":\"MessageAction\"},{\"id\":\"-2074799289\",\"predicate\":\"messageMediaInvoice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"shipping_address_requested\",\"type\":\"flags.1?true\"},{\"name\":\"test\",\"type\":\"flags.3?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"description\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.0?WebDocument\"},{\"name\":\"receipt_msg_id\",\"type\":\"flags.2?int\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"MessageMedia\"},{\"id\":\"512535275\",\"predicate\":\"postAddress\",\"params\":[{\"name\":\"street_line1\",\"type\":\"string\"},{\"name\":\"street_line2\",\"type\":\"string\"},{\"name\":\"city\",\"type\":\"string\"},{\"name\":\"state\",\"type\":\"string\"},{\"name\":\"country_iso2\",\"type\":\"string\"},{\"name\":\"post_code\",\"type\":\"string\"}],\"type\":\"PostAddress\"},{\"id\":\"-1868808300\",\"predicate\":\"paymentRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"name\",\"type\":\"flags.0?string\"},{\"name\":\"phone\",\"type\":\"flags.1?string\"},{\"name\":\"email\",\"type\":\"flags.2?string\"},{\"name\":\"shipping_address\",\"type\":\"flags.3?PostAddress\"}],\"type\":\"PaymentRequestedInfo\"},{\"id\":\"-1344716869\",\"predicate\":\"keyboardButtonBuy\",\"params\":[{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"KeyboardButton\"},{\"id\":\"1080663248\",\"predicate\":\"messageActionPaymentSent\",\"params\":[{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"}],\"type\":\"MessageAction\"},{\"id\":\"-842892769\",\"predicate\":\"paymentSavedCredentialsCard\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"PaymentSavedCredentials\"},{\"id\":\"475467473\",\"predicate\":\"webDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":\"-1678949555\",\"predicate\":\"inputWebDocument\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"InputWebDocument\"},{\"id\":\"-1036396922\",\"predicate\":\"inputWebFileLocation\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWebFileLocation\"},{\"id\":\"568808380\",\"predicate\":\"upload.webFile\",\"params\":[{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"file_type\",\"type\":\"storage.FileType\"},{\"name\":\"mtime\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.WebFile\"},{\"id\":\"1062645411\",\"predicate\":\"payments.paymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_save_credentials\",\"type\":\"flags.2?true\"},{\"name\":\"password_missing\",\"type\":\"flags.3?true\"},{\"name\":\"bot_id\",\"type\":\"int\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"provider_id\",\"type\":\"int\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"native_provider\",\"type\":\"flags.4?string\"},{\"name\":\"native_params\",\"type\":\"flags.4?DataJSON\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"saved_credentials\",\"type\":\"flags.1?PaymentSavedCredentials\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentForm\"},{\"id\":\"-784000893\",\"predicate\":\"payments.validatedRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":\"1314881805\",\"predicate\":\"payments.paymentResult\",\"params\":[{\"name\":\"updates\",\"type\":\"Updates\"}],\"type\":\"payments.PaymentResult\"},{\"id\":\"1342771681\",\"predicate\":\"payments.paymentReceipt\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"bot_id\",\"type\":\"int\"},{\"name\":\"invoice\",\"type\":\"Invoice\"},{\"name\":\"provider_id\",\"type\":\"int\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping\",\"type\":\"flags.1?ShippingOption\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"},{\"name\":\"credentials_title\",\"type\":\"string\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":\"-74456004\",\"predicate\":\"payments.savedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"has_saved_credentials\",\"type\":\"flags.1?true\"},{\"name\":\"saved_info\",\"type\":\"flags.0?PaymentRequestedInfo\"}],\"type\":\"payments.SavedInfo\"},{\"id\":\"-1056001329\",\"predicate\":\"inputPaymentCredentialsSaved\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"tmp_password\",\"type\":\"bytes\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":\"873977640\",\"predicate\":\"inputPaymentCredentials\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":\"-614138572\",\"predicate\":\"account.tmpPassword\",\"params\":[{\"name\":\"tmp_password\",\"type\":\"bytes\"},{\"name\":\"valid_until\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":\"-1239335713\",\"predicate\":\"shippingOption\",\"params\":[{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"prices\",\"type\":\"Vector\"}],\"type\":\"ShippingOption\"},{\"id\":\"-523384512\",\"predicate\":\"updateBotShippingQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"shipping_address\",\"type\":\"PostAddress\"}],\"type\":\"Update\"},{\"id\":\"1563376297\",\"predicate\":\"updateBotPrecheckoutQuery\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"payload\",\"type\":\"bytes\"},{\"name\":\"info\",\"type\":\"flags.0?PaymentRequestedInfo\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"currency\",\"type\":\"string\"},{\"name\":\"total_amount\",\"type\":\"long\"}],\"type\":\"Update\"},{\"id\":\"-6249322\",\"predicate\":\"inputStickerSetItem\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"document\",\"type\":\"InputDocument\"},{\"name\":\"emoji\",\"type\":\"string\"},{\"name\":\"mask_coords\",\"type\":\"flags.0?MaskCoords\"}],\"type\":\"InputStickerSetItem\"},{\"id\":\"-1425052898\",\"predicate\":\"updatePhoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"}],\"type\":\"Update\"},{\"id\":\"506920429\",\"predicate\":\"inputPhoneCall\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputPhoneCall\"},{\"id\":\"1399245077\",\"predicate\":\"phoneCallEmpty\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"PhoneCall\"},{\"id\":\"462375633\",\"predicate\":\"phoneCallWaiting\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"receive_date\",\"type\":\"flags.0?int\"}],\"type\":\"PhoneCall\"},{\"id\":\"-2014659757\",\"predicate\":\"phoneCallRequested\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":\"-1719909046\",\"predicate\":\"phoneCallAccepted\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"PhoneCall\"},{\"id\":\"-2025673089\",\"predicate\":\"phoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"p2p_allowed\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_id\",\"type\":\"int\"},{\"name\":\"participant_id\",\"type\":\"int\"},{\"name\":\"g_a_or_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"},{\"name\":\"connections\",\"type\":\"Vector\"},{\"name\":\"start_date\",\"type\":\"int\"}],\"type\":\"PhoneCall\"},{\"id\":\"1355435489\",\"predicate\":\"phoneCallDiscarded\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"need_rating\",\"type\":\"flags.2?true\"},{\"name\":\"need_debug\",\"type\":\"flags.3?true\"},{\"name\":\"video\",\"type\":\"flags.5?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"PhoneCall\"},{\"id\":\"-1655957568\",\"predicate\":\"phoneConnection\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"ipv6\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"},{\"name\":\"peer_tag\",\"type\":\"bytes\"}],\"type\":\"PhoneConnection\"},{\"id\":\"-1564789301\",\"predicate\":\"phoneCallProtocol\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"udp_p2p\",\"type\":\"flags.0?true\"},{\"name\":\"udp_reflector\",\"type\":\"flags.1?true\"},{\"name\":\"min_layer\",\"type\":\"int\"},{\"name\":\"max_layer\",\"type\":\"int\"}],\"type\":\"PhoneCallProtocol\"},{\"id\":\"-326966976\",\"predicate\":\"phone.phoneCall\",\"params\":[{\"name\":\"phone_call\",\"type\":\"PhoneCall\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"phone.PhoneCall\"},{\"id\":\"-2134272152\",\"predicate\":\"inputMessagesFilterPhoneCalls\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"missed\",\"type\":\"flags.0?true\"}],\"type\":\"MessagesFilter\"},{\"id\":\"-2132731265\",\"predicate\":\"messageActionPhoneCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.2?true\"},{\"name\":\"call_id\",\"type\":\"long\"},{\"name\":\"reason\",\"type\":\"flags.0?PhoneCallDiscardReason\"},{\"name\":\"duration\",\"type\":\"flags.1?int\"}],\"type\":\"MessageAction\"},{\"id\":\"2054952868\",\"predicate\":\"inputMessagesFilterRoundVoice\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1253451181\",\"predicate\":\"inputMessagesFilterRoundVideo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-1997373508\",\"predicate\":\"sendMessageRecordRoundAction\",\"params\":[],\"type\":\"SendMessageAction\"},{\"id\":\"608050278\",\"predicate\":\"sendMessageUploadRoundAction\",\"params\":[{\"name\":\"progress\",\"type\":\"int\"}],\"type\":\"SendMessageAction\"},{\"id\":\"-242427324\",\"predicate\":\"upload.fileCdnRedirect\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"encryption_key\",\"type\":\"bytes\"},{\"name\":\"encryption_iv\",\"type\":\"bytes\"},{\"name\":\"file_hashes\",\"type\":\"Vector\"}],\"type\":\"upload.File\"},{\"id\":\"-290921362\",\"predicate\":\"upload.cdnFileReuploadNeeded\",\"params\":[{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":\"-1449145777\",\"predicate\":\"upload.cdnFile\",\"params\":[{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"upload.CdnFile\"},{\"id\":\"-914167110\",\"predicate\":\"cdnPublicKey\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"CdnPublicKey\"},{\"id\":\"1462101002\",\"predicate\":\"cdnConfig\",\"params\":[{\"name\":\"public_keys\",\"type\":\"Vector\"}],\"type\":\"CdnConfig\"},{\"id\":\"-283684427\",\"predicate\":\"pageBlockChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"Chat\"}],\"type\":\"PageBlock\"},{\"id\":\"-892239370\",\"predicate\":\"langPackString\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":\"1816636575\",\"predicate\":\"langPackStringPluralized\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"zero_value\",\"type\":\"flags.0?string\"},{\"name\":\"one_value\",\"type\":\"flags.1?string\"},{\"name\":\"two_value\",\"type\":\"flags.2?string\"},{\"name\":\"few_value\",\"type\":\"flags.3?string\"},{\"name\":\"many_value\",\"type\":\"flags.4?string\"},{\"name\":\"other_value\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":\"695856818\",\"predicate\":\"langPackStringDeleted\",\"params\":[{\"name\":\"key\",\"type\":\"string\"}],\"type\":\"LangPackString\"},{\"id\":\"-209337866\",\"predicate\":\"langPackDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"strings\",\"type\":\"Vector\"}],\"type\":\"LangPackDifference\"},{\"id\":\"-288727837\",\"predicate\":\"langPackLanguage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"official\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.2?true\"},{\"name\":\"beta\",\"type\":\"flags.3?true\"},{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"native_name\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"base_lang_code\",\"type\":\"flags.1?string\"},{\"name\":\"plural_code\",\"type\":\"string\"},{\"name\":\"strings_count\",\"type\":\"int\"},{\"name\":\"translated_count\",\"type\":\"int\"},{\"name\":\"translations_url\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":\"1180041828\",\"predicate\":\"updateLangPackTooLong\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"Update\"},{\"id\":\"1442983757\",\"predicate\":\"updateLangPack\",\"params\":[{\"name\":\"difference\",\"type\":\"LangPackDifference\"}],\"type\":\"Update\"},{\"id\":\"-859915345\",\"predicate\":\"channelParticipantAdmin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"can_edit\",\"type\":\"flags.0?true\"},{\"name\":\"self\",\"type\":\"flags.1?true\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"inviter_id\",\"type\":\"flags.1?int\"},{\"name\":\"promoted_by\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"flags.2?string\"}],\"type\":\"ChannelParticipant\"},{\"id\":\"470789295\",\"predicate\":\"channelParticipantBanned\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"left\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"kicked_by\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelParticipant\"},{\"id\":\"338142689\",\"predicate\":\"channelParticipantsBanned\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"106343499\",\"predicate\":\"channelParticipantsSearch\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"-421545947\",\"predicate\":\"channelAdminLogEventActionChangeTitle\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1427671598\",\"predicate\":\"channelAdminLogEventActionChangeAbout\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1783299128\",\"predicate\":\"channelAdminLogEventActionChangeUsername\",\"params\":[{\"name\":\"prev_value\",\"type\":\"string\"},{\"name\":\"new_value\",\"type\":\"string\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1129042607\",\"predicate\":\"channelAdminLogEventActionChangePhoto\",\"params\":[{\"name\":\"prev_photo\",\"type\":\"Photo\"},{\"name\":\"new_photo\",\"type\":\"Photo\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"460916654\",\"predicate\":\"channelAdminLogEventActionToggleInvites\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"648939889\",\"predicate\":\"channelAdminLogEventActionToggleSignatures\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-370660328\",\"predicate\":\"channelAdminLogEventActionUpdatePinned\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1889215493\",\"predicate\":\"channelAdminLogEventActionEditMessage\",\"params\":[{\"name\":\"prev_message\",\"type\":\"Message\"},{\"name\":\"new_message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1121994683\",\"predicate\":\"channelAdminLogEventActionDeleteMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"405815507\",\"predicate\":\"channelAdminLogEventActionParticipantJoin\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-124291086\",\"predicate\":\"channelAdminLogEventActionParticipantLeave\",\"params\":[],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-484690728\",\"predicate\":\"channelAdminLogEventActionParticipantInvite\",\"params\":[{\"name\":\"participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-422036098\",\"predicate\":\"channelAdminLogEventActionParticipantToggleBan\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-714643696\",\"predicate\":\"channelAdminLogEventActionParticipantToggleAdmin\",\"params\":[{\"name\":\"prev_participant\",\"type\":\"ChannelParticipant\"},{\"name\":\"new_participant\",\"type\":\"ChannelParticipant\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"995769920\",\"predicate\":\"channelAdminLogEvent\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"action\",\"type\":\"ChannelAdminLogEventAction\"}],\"type\":\"ChannelAdminLogEvent\"},{\"id\":\"-309659827\",\"predicate\":\"channels.adminLogResults\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":\"-368018716\",\"predicate\":\"channelAdminLogEventsFilter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"join\",\"type\":\"flags.0?true\"},{\"name\":\"leave\",\"type\":\"flags.1?true\"},{\"name\":\"invite\",\"type\":\"flags.2?true\"},{\"name\":\"ban\",\"type\":\"flags.3?true\"},{\"name\":\"unban\",\"type\":\"flags.4?true\"},{\"name\":\"kick\",\"type\":\"flags.5?true\"},{\"name\":\"unkick\",\"type\":\"flags.6?true\"},{\"name\":\"promote\",\"type\":\"flags.7?true\"},{\"name\":\"demote\",\"type\":\"flags.8?true\"},{\"name\":\"info\",\"type\":\"flags.9?true\"},{\"name\":\"settings\",\"type\":\"flags.10?true\"},{\"name\":\"pinned\",\"type\":\"flags.11?true\"},{\"name\":\"edit\",\"type\":\"flags.12?true\"},{\"name\":\"delete\",\"type\":\"flags.13?true\"}],\"type\":\"ChannelAdminLogEventsFilter\"},{\"id\":\"511092620\",\"predicate\":\"topPeerCategoryPhoneCalls\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"-2143067670\",\"predicate\":\"pageBlockAudio\",\"params\":[{\"name\":\"audio_id\",\"type\":\"long\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"1558266229\",\"predicate\":\"popularContact\",\"params\":[{\"name\":\"client_id\",\"type\":\"long\"},{\"name\":\"importers\",\"type\":\"int\"}],\"type\":\"PopularContact\"},{\"id\":\"1200788123\",\"predicate\":\"messageActionScreenshotTaken\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"-1634752813\",\"predicate\":\"messages.favedStickersNotModified\",\"params\":[],\"type\":\"messages.FavedStickers\"},{\"id\":\"-209768682\",\"predicate\":\"messages.favedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"packs\",\"type\":\"Vector\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.FavedStickers\"},{\"id\":\"-451831443\",\"predicate\":\"updateFavedStickers\",\"params\":[],\"type\":\"Update\"},{\"id\":\"-1987495099\",\"predicate\":\"updateChannelReadMessagesContents\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"-1040652646\",\"predicate\":\"inputMessagesFilterMyMentions\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"1887741886\",\"predicate\":\"updateContactsReset\",\"params\":[],\"type\":\"Update\"},{\"id\":\"-1312568665\",\"predicate\":\"channelAdminLogEventActionChangeStickerSet\",\"params\":[{\"name\":\"prev_stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"new_stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-85549226\",\"predicate\":\"messageActionCustomAction\",\"params\":[{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":\"178373535\",\"predicate\":\"inputPaymentCredentialsApplePay\",\"params\":[{\"name\":\"payment_data\",\"type\":\"DataJSON\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":\"-905587442\",\"predicate\":\"inputPaymentCredentialsAndroidPay\",\"params\":[{\"name\":\"payment_token\",\"type\":\"DataJSON\"},{\"name\":\"google_transaction_id\",\"type\":\"string\"}],\"type\":\"InputPaymentCredentials\"},{\"id\":\"-419271411\",\"predicate\":\"inputMessagesFilterGeo\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"-530392189\",\"predicate\":\"inputMessagesFilterContacts\",\"params\":[],\"type\":\"MessagesFilter\"},{\"id\":\"1893427255\",\"predicate\":\"updateChannelAvailableMessages\",\"params\":[{\"name\":\"channel_id\",\"type\":\"int\"},{\"name\":\"available_min_id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"1599903217\",\"predicate\":\"channelAdminLogEventActionTogglePreHistoryHidden\",\"params\":[{\"name\":\"new_value\",\"type\":\"Bool\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-833715459\",\"predicate\":\"inputMediaGeoLive\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"stopped\",\"type\":\"flags.0?true\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"period\",\"type\":\"flags.1?int\"}],\"type\":\"InputMedia\"},{\"id\":\"2084316681\",\"predicate\":\"messageMediaGeoLive\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"MessageMedia\"},{\"id\":\"1189204285\",\"predicate\":\"recentMeUrlUnknown\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"RecentMeUrl\"},{\"id\":\"-1917045962\",\"predicate\":\"recentMeUrlUser\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"RecentMeUrl\"},{\"id\":\"-1608834311\",\"predicate\":\"recentMeUrlChat\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"RecentMeUrl\"},{\"id\":\"-347535331\",\"predicate\":\"recentMeUrlChatInvite\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"chat_invite\",\"type\":\"ChatInvite\"}],\"type\":\"RecentMeUrl\"},{\"id\":\"-1140172836\",\"predicate\":\"recentMeUrlStickerSet\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"set\",\"type\":\"StickerSetCovered\"}],\"type\":\"RecentMeUrl\"},{\"id\":\"235081943\",\"predicate\":\"help.recentMeUrls\",\"params\":[{\"name\":\"urls\",\"type\":\"Vector\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":\"-266911767\",\"predicate\":\"channels.channelParticipantsNotModified\",\"params\":[],\"type\":\"channels.ChannelParticipants\"},{\"id\":\"1951620897\",\"predicate\":\"messages.messagesNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"482797855\",\"predicate\":\"inputSingleMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.0?Vector\"}],\"type\":\"InputSingleMedia\"},{\"id\":\"-892779534\",\"predicate\":\"webAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"},{\"name\":\"bot_id\",\"type\":\"int\"},{\"name\":\"domain\",\"type\":\"string\"},{\"name\":\"browser\",\"type\":\"string\"},{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"date_created\",\"type\":\"int\"},{\"name\":\"date_active\",\"type\":\"int\"},{\"name\":\"ip\",\"type\":\"string\"},{\"name\":\"region\",\"type\":\"string\"}],\"type\":\"WebAuthorization\"},{\"id\":\"-313079300\",\"predicate\":\"account.webAuthorizations\",\"params\":[{\"name\":\"authorizations\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"account.WebAuthorizations\"},{\"id\":\"-1502174430\",\"predicate\":\"inputMessageID\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":\"-1160215659\",\"predicate\":\"inputMessageReplyTo\",\"params\":[{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"InputMessage\"},{\"id\":\"-2037963464\",\"predicate\":\"inputMessagePinned\",\"params\":[],\"type\":\"InputMessage\"},{\"id\":\"-1687559349\",\"predicate\":\"messageEntityPhone\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1280209983\",\"predicate\":\"messageEntityCashtag\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"-1410748418\",\"predicate\":\"messageActionBotAllowed\",\"params\":[{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"MessageAction\"},{\"id\":\"-55902537\",\"predicate\":\"inputDialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"InputDialogPeer\"},{\"id\":\"-445792507\",\"predicate\":\"dialogPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"}],\"type\":\"DialogPeer\"},{\"id\":\"223655517\",\"predicate\":\"messages.foundStickerSetsNotModified\",\"params\":[],\"type\":\"messages.FoundStickerSets\"},{\"id\":\"1359533640\",\"predicate\":\"messages.foundStickerSets\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"sets\",\"type\":\"Vector\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":\"1648543603\",\"predicate\":\"fileHash\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"FileHash\"},{\"id\":\"-104284986\",\"predicate\":\"webDocumentNoProxy\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"attributes\",\"type\":\"Vector\"}],\"type\":\"WebDocument\"},{\"id\":\"1968737087\",\"predicate\":\"inputClientProxy\",\"params\":[{\"name\":\"address\",\"type\":\"string\"},{\"name\":\"port\",\"type\":\"int\"}],\"type\":\"InputClientProxy\"},{\"id\":\"-526508104\",\"predicate\":\"help.proxyDataEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.ProxyData\"},{\"id\":\"737668643\",\"predicate\":\"help.proxyDataPromo\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"chats\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"help.ProxyData\"},{\"id\":\"-483352705\",\"predicate\":\"help.termsOfServiceUpdateEmpty\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":\"686618977\",\"predicate\":\"help.termsOfServiceUpdate\",\"params\":[{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"terms_of_service\",\"type\":\"help.TermsOfService\"}],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":\"859091184\",\"predicate\":\"inputSecureFileUploaded\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"parts\",\"type\":\"int\"},{\"name\":\"md5_checksum\",\"type\":\"string\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"InputSecureFile\"},{\"id\":\"1399317950\",\"predicate\":\"inputSecureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputSecureFile\"},{\"id\":\"-876089816\",\"predicate\":\"inputSecureFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":\"1679398724\",\"predicate\":\"secureFileEmpty\",\"params\":[],\"type\":\"SecureFile\"},{\"id\":\"-534283678\",\"predicate\":\"secureFile\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"dc_id\",\"type\":\"int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureFile\"},{\"id\":\"-1964327229\",\"predicate\":\"secureData\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureData\"},{\"id\":\"2103482845\",\"predicate\":\"securePlainPhone\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":\"569137759\",\"predicate\":\"securePlainEmail\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"SecurePlainData\"},{\"id\":\"-1658158621\",\"predicate\":\"secureValueTypePersonalDetails\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"1034709504\",\"predicate\":\"secureValueTypePassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"115615172\",\"predicate\":\"secureValueTypeDriverLicense\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1596951477\",\"predicate\":\"secureValueTypeIdentityCard\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1717268701\",\"predicate\":\"secureValueTypeInternalPassport\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-874308058\",\"predicate\":\"secureValueTypeAddress\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-63531698\",\"predicate\":\"secureValueTypeUtilityBill\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1995211763\",\"predicate\":\"secureValueTypeBankStatement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1954007928\",\"predicate\":\"secureValueTypeRentalAgreement\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1713143702\",\"predicate\":\"secureValueTypePassportRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-368907213\",\"predicate\":\"secureValueTypeTemporaryRegistration\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1289704741\",\"predicate\":\"secureValueTypePhone\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"-1908627474\",\"predicate\":\"secureValueTypeEmail\",\"params\":[],\"type\":\"SecureValueType\"},{\"id\":\"411017418\",\"predicate\":\"secureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?SecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?SecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?SecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValue\"},{\"id\":\"-618540889\",\"predicate\":\"inputSecureValue\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data\",\"type\":\"flags.0?SecureData\"},{\"name\":\"front_side\",\"type\":\"flags.1?InputSecureFile\"},{\"name\":\"reverse_side\",\"type\":\"flags.2?InputSecureFile\"},{\"name\":\"selfie\",\"type\":\"flags.3?InputSecureFile\"},{\"name\":\"translation\",\"type\":\"flags.6?Vector\"},{\"name\":\"files\",\"type\":\"flags.4?Vector\"},{\"name\":\"plain_data\",\"type\":\"flags.5?SecurePlainData\"}],\"type\":\"InputSecureValue\"},{\"id\":\"-316748368\",\"predicate\":\"secureValueHash\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"}],\"type\":\"SecureValueHash\"},{\"id\":\"-391902247\",\"predicate\":\"secureValueErrorData\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"data_hash\",\"type\":\"bytes\"},{\"name\":\"field\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"12467706\",\"predicate\":\"secureValueErrorFrontSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"-2037765467\",\"predicate\":\"secureValueErrorReverseSide\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"-449327402\",\"predicate\":\"secureValueErrorSelfie\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"2054162547\",\"predicate\":\"secureValueErrorFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"1717706985\",\"predicate\":\"secureValueErrorFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"871426631\",\"predicate\":\"secureCredentialsEncrypted\",\"params\":[{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"secret\",\"type\":\"bytes\"}],\"type\":\"SecureCredentialsEncrypted\"},{\"id\":\"-1389486888\",\"predicate\":\"account.authorizationForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"required_types\",\"type\":\"Vector\"},{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"errors\",\"type\":\"Vector\"},{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"privacy_policy_url\",\"type\":\"flags.0?string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":\"-2128640689\",\"predicate\":\"account.sentEmailCode\",\"params\":[{\"name\":\"email_pattern\",\"type\":\"string\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"account.SentEmailCode\"},{\"id\":\"455635795\",\"predicate\":\"messageActionSecureValuesSentMe\",\"params\":[{\"name\":\"values\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"MessageAction\"},{\"id\":\"-648257196\",\"predicate\":\"messageActionSecureValuesSent\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"MessageAction\"},{\"id\":\"1722786150\",\"predicate\":\"help.deepLinkInfoEmpty\",\"params\":[],\"type\":\"help.DeepLinkInfo\"},{\"id\":\"1783556146\",\"predicate\":\"help.deepLinkInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"update_app\",\"type\":\"flags.0?true\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.1?Vector\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":\"289586518\",\"predicate\":\"savedPhoneContact\",\"params\":[{\"name\":\"phone\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"SavedContact\"},{\"id\":\"1304052993\",\"predicate\":\"account.takeout\",\"params\":[{\"name\":\"id\",\"type\":\"long\"}],\"type\":\"account.Takeout\"},{\"id\":\"700340377\",\"predicate\":\"inputTakeoutFileLocation\",\"params\":[],\"type\":\"InputFileLocation\"},{\"id\":\"-513517117\",\"predicate\":\"updateDialogUnreadMark\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"DialogPeer\"}],\"type\":\"Update\"},{\"id\":\"-253500010\",\"predicate\":\"messages.dialogsNotModified\",\"params\":[{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.Dialogs\"},{\"id\":\"-1625153079\",\"predicate\":\"inputWebFileGeoPointLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"scale\",\"type\":\"int\"}],\"type\":\"InputWebFileLocation\"},{\"id\":\"-1255369827\",\"predicate\":\"contacts.topPeersDisabled\",\"params\":[],\"type\":\"contacts.TopPeers\"},{\"id\":\"-1685456582\",\"predicate\":\"inputReportReasonCopyright\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"-732254058\",\"predicate\":\"passwordKdfAlgoUnknown\",\"params\":[],\"type\":\"PasswordKdfAlgo\"},{\"id\":\"4883767\",\"predicate\":\"securePasswordKdfAlgoUnknown\",\"params\":[],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":\"-1141711456\",\"predicate\":\"securePasswordKdfAlgoPBKDF2HMACSHA512iter100000\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":\"-2042159726\",\"predicate\":\"securePasswordKdfAlgoSHA512\",\"params\":[{\"name\":\"salt\",\"type\":\"bytes\"}],\"type\":\"SecurePasswordKdfAlgo\"},{\"id\":\"354925740\",\"predicate\":\"secureSecretSettings\",\"params\":[{\"name\":\"secure_algo\",\"type\":\"SecurePasswordKdfAlgo\"},{\"name\":\"secure_secret\",\"type\":\"bytes\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureSecretSettings\"},{\"id\":\"982592842\",\"predicate\":\"passwordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow\",\"params\":[{\"name\":\"salt1\",\"type\":\"bytes\"},{\"name\":\"salt2\",\"type\":\"bytes\"},{\"name\":\"g\",\"type\":\"int\"},{\"name\":\"p\",\"type\":\"bytes\"}],\"type\":\"PasswordKdfAlgo\"},{\"id\":\"-1736378792\",\"predicate\":\"inputCheckPasswordEmpty\",\"params\":[],\"type\":\"InputCheckPasswordSRP\"},{\"id\":\"-763367294\",\"predicate\":\"inputCheckPasswordSRP\",\"params\":[{\"name\":\"srp_id\",\"type\":\"long\"},{\"name\":\"A\",\"type\":\"bytes\"},{\"name\":\"M1\",\"type\":\"bytes\"}],\"type\":\"InputCheckPasswordSRP\"},{\"id\":\"-2036501105\",\"predicate\":\"secureValueError\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"-1592506512\",\"predicate\":\"secureValueErrorTranslationFile\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"bytes\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"878931416\",\"predicate\":\"secureValueErrorTranslationFiles\",\"params\":[{\"name\":\"type\",\"type\":\"SecureValueType\"},{\"name\":\"file_hash\",\"type\":\"Vector\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"SecureValueError\"},{\"id\":\"-2103600678\",\"predicate\":\"secureRequiredType\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"native_names\",\"type\":\"flags.0?true\"},{\"name\":\"selfie_required\",\"type\":\"flags.1?true\"},{\"name\":\"translation_required\",\"type\":\"flags.2?true\"},{\"name\":\"type\",\"type\":\"SecureValueType\"}],\"type\":\"SecureRequiredType\"},{\"id\":\"41187252\",\"predicate\":\"secureRequiredTypeOneOf\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"SecureRequiredType\"},{\"id\":\"-1078332329\",\"predicate\":\"help.passportConfigNotModified\",\"params\":[],\"type\":\"help.PassportConfig\"},{\"id\":\"-1600596305\",\"predicate\":\"help.passportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"countries_langs\",\"type\":\"DataJSON\"}],\"type\":\"help.PassportConfig\"},{\"id\":\"488313413\",\"predicate\":\"inputAppEvent\",\"params\":[{\"name\":\"time\",\"type\":\"double\"},{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"peer\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"JSONValue\"}],\"type\":\"InputAppEvent\"},{\"id\":\"-1059185703\",\"predicate\":\"jsonObjectValue\",\"params\":[{\"name\":\"key\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"JSONValue\"}],\"type\":\"JSONObjectValue\"},{\"id\":\"1064139624\",\"predicate\":\"jsonNull\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":\"-952869270\",\"predicate\":\"jsonBool\",\"params\":[{\"name\":\"value\",\"type\":\"Bool\"}],\"type\":\"JSONValue\"},{\"id\":\"736157604\",\"predicate\":\"jsonNumber\",\"params\":[{\"name\":\"value\",\"type\":\"double\"}],\"type\":\"JSONValue\"},{\"id\":\"-1222740358\",\"predicate\":\"jsonString\",\"params\":[{\"name\":\"value\",\"type\":\"string\"}],\"type\":\"JSONValue\"},{\"id\":\"-146520221\",\"predicate\":\"jsonArray\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":\"-1715350371\",\"predicate\":\"jsonObject\",\"params\":[{\"name\":\"value\",\"type\":\"Vector\"}],\"type\":\"JSONValue\"},{\"id\":\"1279515160\",\"predicate\":\"updateUserPinnedMessage\",\"params\":[{\"name\":\"user_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-519195831\",\"predicate\":\"updateChatPinnedMessage\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-1311015810\",\"predicate\":\"inputNotifyBroadcasts\",\"params\":[],\"type\":\"InputNotifyPeer\"},{\"id\":\"-703403793\",\"predicate\":\"notifyBroadcasts\",\"params\":[],\"type\":\"NotifyPeer\"},{\"id\":\"-311786236\",\"predicate\":\"textSubscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"-939827711\",\"predicate\":\"textSuperscript\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"55281185\",\"predicate\":\"textMarked\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"RichText\"},{\"id\":\"483104362\",\"predicate\":\"textPhone\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":\"136105807\",\"predicate\":\"textImage\",\"params\":[{\"name\":\"document_id\",\"type\":\"long\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"}],\"type\":\"RichText\"},{\"id\":\"504660880\",\"predicate\":\"pageBlockKicker\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"878078826\",\"predicate\":\"pageTableCell\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"header\",\"type\":\"flags.0?true\"},{\"name\":\"align_center\",\"type\":\"flags.3?true\"},{\"name\":\"align_right\",\"type\":\"flags.4?true\"},{\"name\":\"valign_middle\",\"type\":\"flags.5?true\"},{\"name\":\"valign_bottom\",\"type\":\"flags.6?true\"},{\"name\":\"text\",\"type\":\"flags.7?RichText\"},{\"name\":\"colspan\",\"type\":\"flags.1?int\"},{\"name\":\"rowspan\",\"type\":\"flags.2?int\"}],\"type\":\"PageTableCell\"},{\"id\":\"-524237339\",\"predicate\":\"pageTableRow\",\"params\":[{\"name\":\"cells\",\"type\":\"Vector\"}],\"type\":\"PageTableRow\"},{\"id\":\"-1085412734\",\"predicate\":\"pageBlockTable\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bordered\",\"type\":\"flags.0?true\"},{\"name\":\"striped\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"rows\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":\"1869903447\",\"predicate\":\"pageCaption\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"credit\",\"type\":\"RichText\"}],\"type\":\"PageCaption\"},{\"id\":\"-1188055347\",\"predicate\":\"pageListItemText\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListItem\"},{\"id\":\"635466748\",\"predicate\":\"pageListItemBlocks\",\"params\":[{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListItem\"},{\"id\":\"1577484359\",\"predicate\":\"pageListOrderedItemText\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"RichText\"}],\"type\":\"PageListOrderedItem\"},{\"id\":\"-1730311882\",\"predicate\":\"pageListOrderedItemBlocks\",\"params\":[{\"name\":\"num\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"}],\"type\":\"PageListOrderedItem\"},{\"id\":\"-1702174239\",\"predicate\":\"pageBlockOrderedList\",\"params\":[{\"name\":\"items\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":\"1987480557\",\"predicate\":\"pageBlockDetails\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"open\",\"type\":\"flags.0?true\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"RichText\"}],\"type\":\"PageBlock\"},{\"id\":\"-1282352120\",\"predicate\":\"pageRelatedArticle\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"webpage_id\",\"type\":\"long\"},{\"name\":\"title\",\"type\":\"flags.0?string\"},{\"name\":\"description\",\"type\":\"flags.1?string\"},{\"name\":\"photo_id\",\"type\":\"flags.2?long\"},{\"name\":\"author\",\"type\":\"flags.3?string\"},{\"name\":\"published_date\",\"type\":\"flags.4?int\"}],\"type\":\"PageRelatedArticle\"},{\"id\":\"370236054\",\"predicate\":\"pageBlockRelatedArticles\",\"params\":[{\"name\":\"title\",\"type\":\"RichText\"},{\"name\":\"articles\",\"type\":\"Vector\"}],\"type\":\"PageBlock\"},{\"id\":\"-1538310410\",\"predicate\":\"pageBlockMap\",\"params\":[{\"name\":\"geo\",\"type\":\"GeoPoint\"},{\"name\":\"zoom\",\"type\":\"int\"},{\"name\":\"w\",\"type\":\"int\"},{\"name\":\"h\",\"type\":\"int\"},{\"name\":\"caption\",\"type\":\"PageCaption\"}],\"type\":\"PageBlock\"},{\"id\":\"-1366746132\",\"predicate\":\"page\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"part\",\"type\":\"flags.0?true\"},{\"name\":\"rtl\",\"type\":\"flags.1?true\"},{\"name\":\"v2\",\"type\":\"flags.2?true\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"blocks\",\"type\":\"Vector\"},{\"name\":\"photos\",\"type\":\"Vector\"},{\"name\":\"documents\",\"type\":\"Vector\"}],\"type\":\"Page\"},{\"id\":\"-610373422\",\"predicate\":\"inputPrivacyKeyPhoneP2P\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"961092808\",\"predicate\":\"privacyKeyPhoneP2P\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"894777186\",\"predicate\":\"textAnchor\",\"params\":[{\"name\":\"text\",\"type\":\"RichText\"},{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"RichText\"},{\"id\":\"-1945767479\",\"predicate\":\"help.supportName\",\"params\":[{\"name\":\"name\",\"type\":\"string\"}],\"type\":\"help.SupportName\"},{\"id\":\"-206688531\",\"predicate\":\"help.userInfoEmpty\",\"params\":[],\"type\":\"help.UserInfo\"},{\"id\":\"32192344\",\"predicate\":\"help.userInfo\",\"params\":[{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"},{\"name\":\"author\",\"type\":\"string\"},{\"name\":\"date\",\"type\":\"int\"}],\"type\":\"help.UserInfo\"},{\"id\":\"-202219658\",\"predicate\":\"messageActionContactSignUp\",\"params\":[],\"type\":\"MessageAction\"},{\"id\":\"-1398708869\",\"predicate\":\"updateMessagePoll\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"poll_id\",\"type\":\"long\"},{\"name\":\"poll\",\"type\":\"flags.0?Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"Update\"},{\"id\":\"1823064809\",\"predicate\":\"pollAnswer\",\"params\":[{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"option\",\"type\":\"bytes\"}],\"type\":\"PollAnswer\"},{\"id\":\"-716006138\",\"predicate\":\"poll\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"closed\",\"type\":\"flags.0?true\"},{\"name\":\"question\",\"type\":\"string\"},{\"name\":\"answers\",\"type\":\"Vector\"}],\"type\":\"Poll\"},{\"id\":\"997055186\",\"predicate\":\"pollAnswerVoters\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"chosen\",\"type\":\"flags.0?true\"},{\"name\":\"option\",\"type\":\"bytes\"},{\"name\":\"voters\",\"type\":\"int\"}],\"type\":\"PollAnswerVoters\"},{\"id\":\"1465219162\",\"predicate\":\"pollResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"min\",\"type\":\"flags.0?true\"},{\"name\":\"results\",\"type\":\"flags.1?Vector\"},{\"name\":\"total_voters\",\"type\":\"flags.2?int\"}],\"type\":\"PollResults\"},{\"id\":\"112424539\",\"predicate\":\"inputMediaPoll\",\"params\":[{\"name\":\"poll\",\"type\":\"Poll\"}],\"type\":\"InputMedia\"},{\"id\":\"1272375192\",\"predicate\":\"messageMediaPoll\",\"params\":[{\"name\":\"poll\",\"type\":\"Poll\"},{\"name\":\"results\",\"type\":\"PollResults\"}],\"type\":\"MessageMedia\"},{\"id\":\"-264117680\",\"predicate\":\"chatOnlines\",\"params\":[{\"name\":\"onlines\",\"type\":\"int\"}],\"type\":\"ChatOnlines\"},{\"id\":\"1202287072\",\"predicate\":\"statsURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"StatsURL\"},{\"id\":\"-525288402\",\"predicate\":\"photoStrippedSize\",\"params\":[{\"name\":\"type\",\"type\":\"string\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"PhotoSize\"},{\"id\":\"1605510357\",\"predicate\":\"chatAdminRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"change_info\",\"type\":\"flags.0?true\"},{\"name\":\"post_messages\",\"type\":\"flags.1?true\"},{\"name\":\"edit_messages\",\"type\":\"flags.2?true\"},{\"name\":\"delete_messages\",\"type\":\"flags.3?true\"},{\"name\":\"ban_users\",\"type\":\"flags.4?true\"},{\"name\":\"invite_users\",\"type\":\"flags.5?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.7?true\"},{\"name\":\"add_admins\",\"type\":\"flags.9?true\"}],\"type\":\"ChatAdminRights\"},{\"id\":\"-1626209256\",\"predicate\":\"chatBannedRights\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"view_messages\",\"type\":\"flags.0?true\"},{\"name\":\"send_messages\",\"type\":\"flags.1?true\"},{\"name\":\"send_media\",\"type\":\"flags.2?true\"},{\"name\":\"send_stickers\",\"type\":\"flags.3?true\"},{\"name\":\"send_gifs\",\"type\":\"flags.4?true\"},{\"name\":\"send_games\",\"type\":\"flags.5?true\"},{\"name\":\"send_inline\",\"type\":\"flags.6?true\"},{\"name\":\"embed_links\",\"type\":\"flags.7?true\"},{\"name\":\"send_polls\",\"type\":\"flags.8?true\"},{\"name\":\"change_info\",\"type\":\"flags.10?true\"},{\"name\":\"invite_users\",\"type\":\"flags.15?true\"},{\"name\":\"pin_messages\",\"type\":\"flags.17?true\"},{\"name\":\"until_date\",\"type\":\"int\"}],\"type\":\"ChatBannedRights\"},{\"id\":\"1421875280\",\"predicate\":\"updateChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"default_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"version\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"-433014407\",\"predicate\":\"inputWallPaper\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputWallPaper\"},{\"id\":\"1913199744\",\"predicate\":\"inputWallPaperSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputWallPaper\"},{\"id\":\"-1150621555\",\"predicate\":\"channelParticipantsContacts\",\"params\":[{\"name\":\"q\",\"type\":\"string\"}],\"type\":\"ChannelParticipantsFilter\"},{\"id\":\"771095562\",\"predicate\":\"channelAdminLogEventActionDefaultBannedRights\",\"params\":[{\"name\":\"prev_banned_rights\",\"type\":\"ChatBannedRights\"},{\"name\":\"new_banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-1895328189\",\"predicate\":\"channelAdminLogEventActionStopPoll\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"471437699\",\"predicate\":\"account.wallPapersNotModified\",\"params\":[],\"type\":\"account.WallPapers\"},{\"id\":\"1881892265\",\"predicate\":\"account.wallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"wallpapers\",\"type\":\"Vector\"}],\"type\":\"account.WallPapers\"},{\"id\":\"-557924733\",\"predicate\":\"codeSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"allow_flashcall\",\"type\":\"flags.0?true\"},{\"name\":\"current_number\",\"type\":\"flags.1?true\"},{\"name\":\"allow_app_hash\",\"type\":\"flags.4?true\"}],\"type\":\"CodeSettings\"},{\"id\":\"-1590738760\",\"predicate\":\"wallPaperSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"blur\",\"type\":\"flags.1?true\"},{\"name\":\"motion\",\"type\":\"flags.2?true\"},{\"name\":\"background_color\",\"type\":\"flags.0?int\"},{\"name\":\"intensity\",\"type\":\"flags.3?int\"}],\"type\":\"WallPaperSettings\"},{\"id\":\"-767099577\",\"predicate\":\"autoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"disabled\",\"type\":\"flags.0?true\"},{\"name\":\"video_preload_large\",\"type\":\"flags.1?true\"},{\"name\":\"audio_preload_next\",\"type\":\"flags.2?true\"},{\"name\":\"phonecalls_less_data\",\"type\":\"flags.3?true\"},{\"name\":\"photo_size_max\",\"type\":\"int\"},{\"name\":\"video_size_max\",\"type\":\"int\"},{\"name\":\"file_size_max\",\"type\":\"int\"}],\"type\":\"AutoDownloadSettings\"},{\"id\":\"1674235686\",\"predicate\":\"account.autoDownloadSettings\",\"params\":[{\"name\":\"low\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"medium\",\"type\":\"AutoDownloadSettings\"},{\"name\":\"high\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"account.AutoDownloadSettings\"},{\"id\":\"-709641735\",\"predicate\":\"emojiKeyword\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":\"594408994\",\"predicate\":\"emojiKeywordDeleted\",\"params\":[{\"name\":\"keyword\",\"type\":\"string\"},{\"name\":\"emoticons\",\"type\":\"Vector\"}],\"type\":\"EmojiKeyword\"},{\"id\":\"1556570557\",\"predicate\":\"emojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"},{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"keywords\",\"type\":\"Vector\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":\"-1519029347\",\"predicate\":\"emojiURL\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":\"-1275374751\",\"predicate\":\"emojiLanguage\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiLanguage\"},{\"id\":\"-1529000952\",\"predicate\":\"inputPrivacyKeyForwards\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"1777096355\",\"predicate\":\"privacyKeyForwards\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"1461304012\",\"predicate\":\"inputPrivacyKeyProfilePhoto\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"-1777000467\",\"predicate\":\"privacyKeyProfilePhoto\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"-1132476723\",\"predicate\":\"fileLocationToBeDeprecated\",\"params\":[{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"}],\"type\":\"FileLocation\"},{\"id\":\"1075322878\",\"predicate\":\"inputPhotoFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"thumb_size\",\"type\":\"string\"}],\"type\":\"InputFileLocation\"},{\"id\":\"-667654413\",\"predicate\":\"inputPhotoLegacyFileLocation\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"file_reference\",\"type\":\"bytes\"},{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"},{\"name\":\"secret\",\"type\":\"long\"}],\"type\":\"InputFileLocation\"},{\"id\":\"668375447\",\"predicate\":\"inputPeerPhotoFileLocation\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"big\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"}],\"type\":\"InputFileLocation\"},{\"id\":\"230353641\",\"predicate\":\"inputStickerSetThumb\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"volume_id\",\"type\":\"long\"},{\"name\":\"local_id\",\"type\":\"int\"}],\"type\":\"InputFileLocation\"},{\"id\":\"-11252123\",\"predicate\":\"folder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"autofill_new_broadcasts\",\"type\":\"flags.0?true\"},{\"name\":\"autofill_public_groups\",\"type\":\"flags.1?true\"},{\"name\":\"autofill_new_correspondents\",\"type\":\"flags.2?true\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"photo\",\"type\":\"flags.3?ChatPhoto\"}],\"type\":\"Folder\"},{\"id\":\"1908216652\",\"predicate\":\"dialogFolder\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.2?true\"},{\"name\":\"folder\",\"type\":\"Folder\"},{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"top_message\",\"type\":\"int\"},{\"name\":\"unread_muted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_peers_count\",\"type\":\"int\"},{\"name\":\"unread_muted_messages_count\",\"type\":\"int\"},{\"name\":\"unread_unmuted_messages_count\",\"type\":\"int\"}],\"type\":\"Dialog\"},{\"id\":\"1684014375\",\"predicate\":\"inputDialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputDialogPeer\"},{\"id\":\"1363483106\",\"predicate\":\"dialogPeerFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"DialogPeer\"},{\"id\":\"-70073706\",\"predicate\":\"inputFolderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"InputFolderPeer\"},{\"id\":\"-373643672\",\"predicate\":\"folderPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"FolderPeer\"},{\"id\":\"422972864\",\"predicate\":\"updateFolderPeers\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_count\",\"type\":\"int\"}],\"type\":\"Update\"},{\"id\":\"756118935\",\"predicate\":\"inputUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"InputUser\"},{\"id\":\"707290417\",\"predicate\":\"inputChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"int\"}],\"type\":\"InputChannel\"},{\"id\":\"398123750\",\"predicate\":\"inputPeerUserFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"int\"}],\"type\":\"InputPeer\"},{\"id\":\"-1667893317\",\"predicate\":\"inputPeerChannelFromMessage\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"channel_id\",\"type\":\"int\"}],\"type\":\"InputPeer\"},{\"id\":\"55761658\",\"predicate\":\"inputPrivacyKeyPhoneNumber\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"-778378131\",\"predicate\":\"privacyKeyPhoneNumber\",\"params\":[],\"type\":\"PrivacyKey\"},{\"id\":\"-1472172887\",\"predicate\":\"topPeerCategoryForwardUsers\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"-68239120\",\"predicate\":\"topPeerCategoryForwardChats\",\"params\":[],\"type\":\"TopPeerCategory\"},{\"id\":\"-1569748965\",\"predicate\":\"channelAdminLogEventActionChangeLinkedChat\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-398136321\",\"predicate\":\"messages.searchCounter\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"inexact\",\"type\":\"flags.1?true\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"count\",\"type\":\"int\"}],\"type\":\"messages.SearchCounter\"},{\"id\":\"280464681\",\"predicate\":\"keyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"button_id\",\"type\":\"int\"}],\"type\":\"KeyboardButton\"},{\"id\":\"-802258988\",\"predicate\":\"inputKeyboardButtonUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"text\",\"type\":\"string\"},{\"name\":\"fwd_text\",\"type\":\"flags.1?string\"},{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"bot\",\"type\":\"InputUser\"}],\"type\":\"KeyboardButton\"},{\"id\":\"-1831650802\",\"predicate\":\"urlAuthResultRequest\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"request_write_access\",\"type\":\"flags.0?true\"},{\"name\":\"bot\",\"type\":\"User\"},{\"name\":\"domain\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":\"-1886646706\",\"predicate\":\"urlAuthResultAccepted\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"UrlAuthResult\"},{\"id\":\"-1445536993\",\"predicate\":\"urlAuthResultDefault\",\"params\":[],\"type\":\"UrlAuthResult\"},{\"id\":\"1283572154\",\"predicate\":\"inputPrivacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":\"-668769361\",\"predicate\":\"inputPrivacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"InputPrivacyRule\"},{\"id\":\"415136107\",\"predicate\":\"privacyValueAllowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":\"-1397881200\",\"predicate\":\"privacyValueDisallowChatParticipants\",\"params\":[{\"name\":\"chats\",\"type\":\"Vector\"}],\"type\":\"PrivacyRule\"},{\"id\":\"-1672577397\",\"predicate\":\"messageEntityUnderline\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"-1090087980\",\"predicate\":\"messageEntityStrike\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"34469328\",\"predicate\":\"messageEntityBlockquote\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"length\",\"type\":\"int\"}],\"type\":\"MessageEntity\"},{\"id\":\"1786671974\",\"predicate\":\"updatePeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"settings\",\"type\":\"PeerSettings\"}],\"type\":\"Update\"},{\"id\":\"-1078612597\",\"predicate\":\"channelLocationEmpty\",\"params\":[],\"type\":\"ChannelLocation\"},{\"id\":\"547062491\",\"predicate\":\"channelLocation\",\"params\":[{\"name\":\"geo_point\",\"type\":\"GeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"ChannelLocation\"},{\"id\":\"-901375139\",\"predicate\":\"peerLocated\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"expires\",\"type\":\"int\"},{\"name\":\"distance\",\"type\":\"int\"}],\"type\":\"PeerLocated\"},{\"id\":\"-1263546448\",\"predicate\":\"updatePeerLocated\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"241923758\",\"predicate\":\"channelAdminLogEventActionChangeLocation\",\"params\":[{\"name\":\"prev_value\",\"type\":\"ChannelLocation\"},{\"name\":\"new_value\",\"type\":\"ChannelLocation\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"-606798099\",\"predicate\":\"inputReportReasonGeoIrrelevant\",\"params\":[],\"type\":\"ReportReason\"},{\"id\":\"1401984889\",\"predicate\":\"channelAdminLogEventActionToggleSlowMode\",\"params\":[{\"name\":\"prev_value\",\"type\":\"int\"},{\"name\":\"new_value\",\"type\":\"int\"}],\"type\":\"ChannelAdminLogEventAction\"},{\"id\":\"1148485274\",\"predicate\":\"auth.authorizationSignUpRequired\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"terms_of_service\",\"type\":\"flags.0?help.TermsOfService\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-666824391\",\"predicate\":\"payments.paymentVerificationNeeded\",\"params\":[{\"name\":\"url\",\"type\":\"string\"}],\"type\":\"payments.PaymentResult\"},{\"id\":\"42402760\",\"predicate\":\"inputStickerSetAnimatedEmoji\",\"params\":[],\"type\":\"InputStickerSet\"},{\"id\":\"967122427\",\"predicate\":\"updateNewScheduledMessage\",\"params\":[{\"name\":\"message\",\"type\":\"Message\"}],\"type\":\"Update\"},{\"id\":\"-1870238482\",\"predicate\":\"updateDeleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"Peer\"},{\"name\":\"messages\",\"type\":\"Vector\"}],\"type\":\"Update\"},{\"id\":\"-797791052\",\"predicate\":\"restrictionReason\",\"params\":[{\"name\":\"platform\",\"type\":\"string\"},{\"name\":\"reason\",\"type\":\"string\"},{\"name\":\"text\",\"type\":\"string\"}],\"type\":\"RestrictionReason\"},{\"id\":\"1012306921\",\"predicate\":\"inputTheme\",\"params\":[{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"}],\"type\":\"InputTheme\"},{\"id\":\"-175567375\",\"predicate\":\"inputThemeSlug\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"}],\"type\":\"InputTheme\"},{\"id\":\"1211967244\",\"predicate\":\"themeDocumentNotModified\",\"params\":[],\"type\":\"Theme\"},{\"id\":\"-136770336\",\"predicate\":\"theme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"creator\",\"type\":\"flags.0?true\"},{\"name\":\"default\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"long\"},{\"name\":\"access_hash\",\"type\":\"long\"},{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"flags.2?Document\"},{\"name\":\"installs_count\",\"type\":\"int\"}],\"type\":\"Theme\"},{\"id\":\"-199313886\",\"predicate\":\"account.themesNotModified\",\"params\":[],\"type\":\"account.Themes\"},{\"id\":\"2137482273\",\"predicate\":\"account.themes\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"},{\"name\":\"themes\",\"type\":\"Vector\"}],\"type\":\"account.Themes\"},{\"id\":\"-2112423005\",\"predicate\":\"updateTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"Theme\"}],\"type\":\"Update\"},{\"id\":\"-786326563\",\"predicate\":\"inputPrivacyKeyAddedByPhone\",\"params\":[],\"type\":\"InputPrivacyKey\"},{\"id\":\"1124062251\",\"predicate\":\"privacyKeyAddedByPhone\",\"params\":[],\"type\":\"PrivacyKey\"}],\"methods\":[{\"id\":\"-878758099\",\"method\":\"invokeAfterMsg\",\"params\":[{\"name\":\"msg_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"1036301552\",\"method\":\"invokeAfterMsgs\",\"params\":[{\"name\":\"msg_ids\",\"type\":\"Vector\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"-1502141361\",\"method\":\"auth.sendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":\"-2131827673\",\"method\":\"auth.signUp\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-1126886015\",\"method\":\"auth.signIn\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":\"1461180992\",\"method\":\"auth.logOut\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-1616179942\",\"method\":\"auth.resetAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-440401971\",\"method\":\"auth.exportAuthorization\",\"params\":[{\"name\":\"dc_id\",\"type\":\"int\"}],\"type\":\"auth.ExportedAuthorization\"},{\"id\":\"-470837741\",\"method\":\"auth.importAuthorization\",\"params\":[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-841733627\",\"method\":\"auth.bindTempAuthKey\",\"params\":[{\"name\":\"perm_auth_key_id\",\"type\":\"long\"},{\"name\":\"nonce\",\"type\":\"long\"},{\"name\":\"expires_at\",\"type\":\"int\"},{\"name\":\"encrypted_message\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":\"1754754159\",\"method\":\"account.registerDevice\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_muted\",\"type\":\"flags.0?true\"},{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"app_sandbox\",\"type\":\"Bool\"},{\"name\":\"secret\",\"type\":\"bytes\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"813089983\",\"method\":\"account.unregisterDevice\",\"params\":[{\"name\":\"token_type\",\"type\":\"int\"},{\"name\":\"token\",\"type\":\"string\"},{\"name\":\"other_uids\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-2067899501\",\"method\":\"account.updateNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"},{\"name\":\"settings\",\"type\":\"InputPeerNotifySettings\"}],\"type\":\"Bool\"},{\"id\":\"313765169\",\"method\":\"account.getNotifySettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputNotifyPeer\"}],\"type\":\"PeerNotifySettings\"},{\"id\":\"-612493497\",\"method\":\"account.resetNotifySettings\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"2018596725\",\"method\":\"account.updateProfile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"first_name\",\"type\":\"flags.0?string\"},{\"name\":\"last_name\",\"type\":\"flags.1?string\"},{\"name\":\"about\",\"type\":\"flags.2?string\"}],\"type\":\"User\"},{\"id\":\"1713919532\",\"method\":\"account.updateStatus\",\"params\":[{\"name\":\"offline\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"-1430579357\",\"method\":\"account.getWallPapers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"account.WallPapers\"},{\"id\":\"-1374118561\",\"method\":\"account.reportPeer\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reason\",\"type\":\"ReportReason\"}],\"type\":\"Bool\"},{\"id\":\"227648840\",\"method\":\"users.getUsers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-902781519\",\"method\":\"users.getFullUser\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"UserFull\"},{\"id\":\"749357634\",\"method\":\"contacts.getContactIDs\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":\"-995929106\",\"method\":\"contacts.getStatuses\",\"params\":[],\"type\":\"Vector\"},{\"id\":\"-1071414113\",\"method\":\"contacts.getContacts\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"contacts.Contacts\"},{\"id\":\"746589157\",\"method\":\"contacts.importContacts\",\"params\":[{\"name\":\"contacts\",\"type\":\"Vector\"}],\"type\":\"contacts.ImportedContacts\"},{\"id\":\"157945344\",\"method\":\"contacts.deleteContacts\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"269745566\",\"method\":\"contacts.deleteByPhones\",\"params\":[{\"name\":\"phones\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"858475004\",\"method\":\"contacts.block\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"Bool\"},{\"id\":\"-448724803\",\"method\":\"contacts.unblock\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"Bool\"},{\"id\":\"-176409329\",\"method\":\"contacts.getBlocked\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Blocked\"},{\"id\":\"1673946374\",\"method\":\"messages.getMessages\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"-1594999949\",\"method\":\"messages.getDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_pinned\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"flags.1?int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Dialogs\"},{\"id\":\"-591691168\",\"method\":\"messages.getHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"offset_date\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"-2045448344\",\"method\":\"messages.search\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"from_id\",\"type\":\"flags.0?InputUser\"},{\"name\":\"filter\",\"type\":\"MessagesFilter\"},{\"name\":\"min_date\",\"type\":\"int\"},{\"name\":\"max_date\",\"type\":\"int\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"238054714\",\"method\":\"messages.readHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":\"469850889\",\"method\":\"messages.deleteHistory\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"just_clear\",\"type\":\"flags.0?true\"},{\"name\":\"revoke\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":\"-443640366\",\"method\":\"messages.deleteMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"revoke\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":\"94983360\",\"method\":\"messages.receivedMessages\",\"params\":[{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":\"-1551737264\",\"method\":\"messages.setTyping\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"action\",\"type\":\"SendMessageAction\"}],\"type\":\"Bool\"},{\"id\":\"1376532592\",\"method\":\"messages.sendMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"}],\"type\":\"Updates\"},{\"id\":\"881978281\",\"method\":\"messages.sendMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"media\",\"type\":\"InputMedia\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"}],\"type\":\"Updates\"},{\"id\":\"-637606386\",\"method\":\"messages.forwardMessages\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"with_my_score\",\"type\":\"flags.8?true\"},{\"name\":\"grouped\",\"type\":\"flags.9?true\"},{\"name\":\"from_peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"random_id\",\"type\":\"Vector\"},{\"name\":\"to_peer\",\"type\":\"InputPeer\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"}],\"type\":\"Updates\"},{\"id\":\"-820669733\",\"method\":\"messages.reportSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":\"913498268\",\"method\":\"messages.getPeerSettings\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"PeerSettings\"},{\"id\":\"-1115507112\",\"method\":\"messages.report\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"reason\",\"type\":\"ReportReason\"}],\"type\":\"Bool\"},{\"id\":\"1013621127\",\"method\":\"messages.getChats\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":\"998448230\",\"method\":\"messages.getFullChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"messages.ChatFull\"},{\"id\":\"-599447467\",\"method\":\"messages.editChatTitle\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-900957736\",\"method\":\"messages.editChatPhoto\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":\"-106911223\",\"method\":\"messages.addChatUser\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"fwd_limit\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"-530505962\",\"method\":\"messages.deleteChatUser\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":\"164303470\",\"method\":\"messages.createChat\",\"params\":[{\"name\":\"users\",\"type\":\"Vector\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-304838614\",\"method\":\"updates.getState\",\"params\":[],\"type\":\"updates.State\"},{\"id\":\"630429265\",\"method\":\"updates.getDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"pts_total_limit\",\"type\":\"flags.0?int\"},{\"name\":\"date\",\"type\":\"int\"},{\"name\":\"qts\",\"type\":\"int\"}],\"type\":\"updates.Difference\"},{\"id\":\"-256159406\",\"method\":\"photos.updateProfilePhoto\",\"params\":[{\"name\":\"id\",\"type\":\"InputPhoto\"}],\"type\":\"UserProfilePhoto\"},{\"id\":\"1328726168\",\"method\":\"photos.uploadProfilePhoto\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"}],\"type\":\"photos.Photo\"},{\"id\":\"-2016444625\",\"method\":\"photos.deletePhotos\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-1291540959\",\"method\":\"upload.saveFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":\"-1319462148\",\"method\":\"upload.getFile\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"precise\",\"type\":\"flags.0?true\"},{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.File\"},{\"id\":\"-990308245\",\"method\":\"help.getConfig\",\"params\":[],\"type\":\"Config\"},{\"id\":\"531836966\",\"method\":\"help.getNearestDc\",\"params\":[],\"type\":\"NearestDc\"},{\"id\":\"1378703997\",\"method\":\"help.getAppUpdate\",\"params\":[{\"name\":\"source\",\"type\":\"string\"}],\"type\":\"help.AppUpdate\"},{\"id\":\"1295590211\",\"method\":\"help.getInviteText\",\"params\":[],\"type\":\"help.InviteText\"},{\"id\":\"-1848823128\",\"method\":\"photos.getUserPhotos\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"photos.Photos\"},{\"id\":\"651135312\",\"method\":\"messages.getDhConfig\",\"params\":[{\"name\":\"version\",\"type\":\"int\"},{\"name\":\"random_length\",\"type\":\"int\"}],\"type\":\"messages.DhConfig\"},{\"id\":\"-162681021\",\"method\":\"messages.requestEncryption\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a\",\"type\":\"bytes\"}],\"type\":\"EncryptedChat\"},{\"id\":\"1035731989\",\"method\":\"messages.acceptEncryption\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"}],\"type\":\"EncryptedChat\"},{\"id\":\"-304536635\",\"method\":\"messages.discardEncryption\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"2031374829\",\"method\":\"messages.setEncryptedTyping\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"typing\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"2135648522\",\"method\":\"messages.readEncryptedHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"max_date\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"-1451792525\",\"method\":\"messages.sendEncrypted\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":\"-1701831834\",\"method\":\"messages.sendEncryptedFile\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":\"852769188\",\"method\":\"messages.sendEncryptedService\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"bytes\"}],\"type\":\"messages.SentEncryptedMessage\"},{\"id\":\"1436924774\",\"method\":\"messages.receivedQueue\",\"params\":[{\"name\":\"max_qts\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":\"1259113487\",\"method\":\"messages.reportEncryptedSpam\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"}],\"type\":\"Bool\"},{\"id\":\"-562337987\",\"method\":\"upload.saveBigFilePart\",\"params\":[{\"name\":\"file_id\",\"type\":\"long\"},{\"name\":\"file_part\",\"type\":\"int\"},{\"name\":\"file_total_parts\",\"type\":\"int\"},{\"name\":\"bytes\",\"type\":\"bytes\"}],\"type\":\"Bool\"},{\"id\":\"2018609336\",\"method\":\"initConnection\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"device_model\",\"type\":\"string\"},{\"name\":\"system_version\",\"type\":\"string\"},{\"name\":\"app_version\",\"type\":\"string\"},{\"name\":\"system_lang_code\",\"type\":\"string\"},{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"proxy\",\"type\":\"flags.0?InputClientProxy\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"-1663104819\",\"method\":\"help.getSupport\",\"params\":[],\"type\":\"help.Support\"},{\"id\":\"916930423\",\"method\":\"messages.readMessageContents\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":\"655677548\",\"method\":\"account.checkUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"1040964988\",\"method\":\"account.updateUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":\"301470424\",\"method\":\"contacts.search\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"contacts.Found\"},{\"id\":\"-623130288\",\"method\":\"account.getPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"}],\"type\":\"account.PrivacyRules\"},{\"id\":\"-906486552\",\"method\":\"account.setPrivacy\",\"params\":[{\"name\":\"key\",\"type\":\"InputPrivacyKey\"},{\"name\":\"rules\",\"type\":\"Vector\"}],\"type\":\"account.PrivacyRules\"},{\"id\":\"1099779595\",\"method\":\"account.deleteAccount\",\"params\":[{\"name\":\"reason\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"150761757\",\"method\":\"account.getAccountTTL\",\"params\":[],\"type\":\"AccountDaysTTL\"},{\"id\":\"608323678\",\"method\":\"account.setAccountTTL\",\"params\":[{\"name\":\"ttl\",\"type\":\"AccountDaysTTL\"}],\"type\":\"Bool\"},{\"id\":\"-627372787\",\"method\":\"invokeWithLayer\",\"params\":[{\"name\":\"layer\",\"type\":\"int\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"-113456221\",\"method\":\"contacts.resolveUsername\",\"params\":[{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"contacts.ResolvedPeer\"},{\"id\":\"-2108208411\",\"method\":\"account.sendChangePhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":\"1891839707\",\"method\":\"account.changePhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"User\"},{\"id\":\"71126828\",\"method\":\"messages.getStickers\",\"params\":[{\"name\":\"emoticon\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Stickers\"},{\"id\":\"479598769\",\"method\":\"messages.getAllStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.AllStickers\"},{\"id\":\"954152242\",\"method\":\"account.updateDeviceLocked\",\"params\":[{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"1738800940\",\"method\":\"auth.importBotAuthorization\",\"params\":[{\"name\":\"flags\",\"type\":\"int\"},{\"name\":\"api_id\",\"type\":\"int\"},{\"name\":\"api_hash\",\"type\":\"string\"},{\"name\":\"bot_auth_token\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-1956073268\",\"method\":\"messages.getWebPagePreview\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"MessageMedia\"},{\"id\":\"-484392616\",\"method\":\"account.getAuthorizations\",\"params\":[],\"type\":\"account.Authorizations\"},{\"id\":\"-545786948\",\"method\":\"account.resetAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":\"1418342645\",\"method\":\"account.getPassword\",\"params\":[],\"type\":\"account.Password\"},{\"id\":\"-1663767815\",\"method\":\"account.getPasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"account.PasswordSettings\"},{\"id\":\"-1516564433\",\"method\":\"account.updatePasswordSettings\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"new_settings\",\"type\":\"account.PasswordInputSettings\"}],\"type\":\"Bool\"},{\"id\":\"-779399914\",\"method\":\"auth.checkPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-661144474\",\"method\":\"auth.requestPasswordRecovery\",\"params\":[],\"type\":\"auth.PasswordRecovery\"},{\"id\":\"1319464594\",\"method\":\"auth.recoverPassword\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"auth.Authorization\"},{\"id\":\"-1080796745\",\"method\":\"invokeWithoutUpdates\",\"params\":[{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"234312524\",\"method\":\"messages.exportChatInvite\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"ExportedChatInvite\"},{\"id\":\"1051570619\",\"method\":\"messages.checkChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"ChatInvite\"},{\"id\":\"1817183516\",\"method\":\"messages.importChatInvite\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"639215886\",\"method\":\"messages.getStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"-946871200\",\"method\":\"messages.installStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"archived\",\"type\":\"Bool\"}],\"type\":\"messages.StickerSetInstallResult\"},{\"id\":\"-110209570\",\"method\":\"messages.uninstallStickerSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":\"-421563528\",\"method\":\"messages.startBot\",\"params\":[{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"start_param\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-1877938321\",\"method\":\"help.getAppChangelog\",\"params\":[{\"name\":\"prev_app_version\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-993483427\",\"method\":\"messages.getMessagesViews\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"},{\"name\":\"increment\",\"type\":\"Bool\"}],\"type\":\"Vector\"},{\"id\":\"-871347913\",\"method\":\"channels.readHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"-2067661490\",\"method\":\"channels.deleteMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.AffectedMessages\"},{\"id\":\"-787622117\",\"method\":\"channels.deleteUserHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":\"-32999408\",\"method\":\"channels.reportSpam\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-1383294429\",\"method\":\"channels.getMessages\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"306054633\",\"method\":\"channels.getParticipants\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelParticipantsFilter\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"channels.ChannelParticipants\"},{\"id\":\"1416484774\",\"method\":\"channels.getParticipant\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"channels.ChannelParticipant\"},{\"id\":\"176122811\",\"method\":\"channels.getChannels\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":\"141781513\",\"method\":\"channels.getFullChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"messages.ChatFull\"},{\"id\":\"1029681423\",\"method\":\"channels.createChannel\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"broadcast\",\"type\":\"flags.0?true\"},{\"name\":\"megagroup\",\"type\":\"flags.1?true\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"about\",\"type\":\"string\"},{\"name\":\"geo_point\",\"type\":\"flags.2?InputGeoPoint\"},{\"name\":\"address\",\"type\":\"flags.2?string\"}],\"type\":\"Updates\"},{\"id\":\"-751007486\",\"method\":\"channels.editAdmin\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"admin_rights\",\"type\":\"ChatAdminRights\"},{\"name\":\"rank\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"1450044624\",\"method\":\"channels.editTitle\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"title\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-248621111\",\"method\":\"channels.editPhoto\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"photo\",\"type\":\"InputChatPhoto\"}],\"type\":\"Updates\"},{\"id\":\"283557164\",\"method\":\"channels.checkUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"890549214\",\"method\":\"channels.updateUsername\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"username\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"615851205\",\"method\":\"channels.joinChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":\"-130635115\",\"method\":\"channels.leaveChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":\"429865580\",\"method\":\"channels.inviteToChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"users\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"-1072619549\",\"method\":\"channels.deleteChannel\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"}],\"type\":\"Updates\"},{\"id\":\"51854712\",\"method\":\"updates.getChannelDifference\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"filter\",\"type\":\"ChannelMessagesFilter\"},{\"name\":\"pts\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"updates.ChannelDifference\"},{\"id\":\"-1444503762\",\"method\":\"messages.editChatAdmin\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"is_admin\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"363051235\",\"method\":\"messages.migrateChat\",\"params\":[{\"name\":\"chat_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"-1083038300\",\"method\":\"messages.searchGlobal\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"folder_id\",\"type\":\"flags.0?int\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"offset_rate\",\"type\":\"int\"},{\"name\":\"offset_peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"2016638777\",\"method\":\"messages.reorderStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"864953444\",\"method\":\"messages.getDocumentByHash\",\"params\":[{\"name\":\"sha256\",\"type\":\"bytes\"},{\"name\":\"size\",\"type\":\"int\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":\"-1080395925\",\"method\":\"messages.searchGifs\",\"params\":[{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.FoundGifs\"},{\"id\":\"-2084618926\",\"method\":\"messages.getSavedGifs\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.SavedGifs\"},{\"id\":\"846868683\",\"method\":\"messages.saveGif\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"1364105629\",\"method\":\"messages.getInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"bot\",\"type\":\"InputUser\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"geo_point\",\"type\":\"flags.0?InputGeoPoint\"},{\"name\":\"query\",\"type\":\"string\"},{\"name\":\"offset\",\"type\":\"string\"}],\"type\":\"messages.BotResults\"},{\"id\":\"-346119674\",\"method\":\"messages.setInlineBotResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"gallery\",\"type\":\"flags.0?true\"},{\"name\":\"private\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"results\",\"type\":\"Vector\"},{\"name\":\"cache_time\",\"type\":\"int\"},{\"name\":\"next_offset\",\"type\":\"flags.2?string\"},{\"name\":\"switch_pm\",\"type\":\"flags.3?InlineBotSwitchPM\"}],\"type\":\"Bool\"},{\"id\":\"570955184\",\"method\":\"messages.sendInlineBotResult\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"hide_via\",\"type\":\"flags.11?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"random_id\",\"type\":\"long\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"id\",\"type\":\"string\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"}],\"type\":\"Updates\"},{\"id\":\"-826838685\",\"method\":\"channels.exportMessageLink\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"grouped\",\"type\":\"Bool\"}],\"type\":\"ExportedMessageLink\"},{\"id\":\"527021574\",\"method\":\"channels.toggleSignatures\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":\"1056025023\",\"method\":\"auth.resendCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"auth.SentCode\"},{\"id\":\"520357240\",\"method\":\"auth.cancelCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"-39416522\",\"method\":\"messages.getMessageEditData\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"messages.MessageEditData\"},{\"id\":\"1224152952\",\"method\":\"messages.editMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.15?int\"}],\"type\":\"Updates\"},{\"id\":\"-2091549254\",\"method\":\"messages.editInlineBotMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"message\",\"type\":\"flags.11?string\"},{\"name\":\"media\",\"type\":\"flags.14?InputMedia\"},{\"name\":\"reply_markup\",\"type\":\"flags.2?ReplyMarkup\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":\"-2130010132\",\"method\":\"messages.getBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"game\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"data\",\"type\":\"flags.0?bytes\"}],\"type\":\"messages.BotCallbackAnswer\"},{\"id\":\"-712043766\",\"method\":\"messages.setBotCallbackAnswer\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"alert\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"message\",\"type\":\"flags.0?string\"},{\"name\":\"url\",\"type\":\"flags.2?string\"},{\"name\":\"cache_time\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"-728224331\",\"method\":\"contacts.getTopPeers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"correspondents\",\"type\":\"flags.0?true\"},{\"name\":\"bots_pm\",\"type\":\"flags.1?true\"},{\"name\":\"bots_inline\",\"type\":\"flags.2?true\"},{\"name\":\"phone_calls\",\"type\":\"flags.3?true\"},{\"name\":\"forward_users\",\"type\":\"flags.4?true\"},{\"name\":\"forward_chats\",\"type\":\"flags.5?true\"},{\"name\":\"groups\",\"type\":\"flags.10?true\"},{\"name\":\"channels\",\"type\":\"flags.15?true\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"contacts.TopPeers\"},{\"id\":\"451113900\",\"method\":\"contacts.resetTopPeerRating\",\"params\":[{\"name\":\"category\",\"type\":\"TopPeerCategory\"},{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":\"-462373635\",\"method\":\"messages.getPeerDialogs\",\"params\":[{\"name\":\"peers\",\"type\":\"Vector\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":\"-1137057461\",\"method\":\"messages.saveDraft\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"no_webpage\",\"type\":\"flags.1?true\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"flags.3?Vector\"}],\"type\":\"Bool\"},{\"id\":\"1782549861\",\"method\":\"messages.getAllDrafts\",\"params\":[],\"type\":\"Updates\"},{\"id\":\"766298703\",\"method\":\"messages.getFeaturedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.FeaturedStickers\"},{\"id\":\"1527873830\",\"method\":\"messages.readFeaturedStickers\",\"params\":[{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"1587647177\",\"method\":\"messages.getRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.RecentStickers\"},{\"id\":\"958863608\",\"method\":\"messages.saveRecentSticker\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"-1986437075\",\"method\":\"messages.clearRecentStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"attached\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":\"1475442322\",\"method\":\"messages.getArchivedStickers\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"offset_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.ArchivedStickers\"},{\"id\":\"457157256\",\"method\":\"account.sendConfirmPhoneCode\",\"params\":[{\"name\":\"hash\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":\"1596029123\",\"method\":\"account.confirmPhone\",\"params\":[{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"-122669393\",\"method\":\"channels.getAdminedPublicChannels\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"by_location\",\"type\":\"flags.0?true\"},{\"name\":\"check_limit\",\"type\":\"flags.1?true\"}],\"type\":\"messages.Chats\"},{\"id\":\"1706608543\",\"method\":\"messages.getMaskStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.AllStickers\"},{\"id\":\"-866424884\",\"method\":\"messages.getAttachedStickers\",\"params\":[{\"name\":\"media\",\"type\":\"InputStickeredMedia\"}],\"type\":\"Vector\"},{\"id\":\"-1907842680\",\"method\":\"auth.dropTempAuthKeys\",\"params\":[{\"name\":\"except_auth_keys\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-1896289088\",\"method\":\"messages.setGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"363700068\",\"method\":\"messages.setInlineGameScore\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"edit_message\",\"type\":\"flags.0?true\"},{\"name\":\"force\",\"type\":\"flags.1?true\"},{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"score\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"-400399203\",\"method\":\"messages.getGameHighScores\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":\"258170395\",\"method\":\"messages.getInlineGameHighScores\",\"params\":[{\"name\":\"id\",\"type\":\"InputBotInlineMessageID\"},{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"messages.HighScores\"},{\"id\":\"218777796\",\"method\":\"messages.getCommonChats\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":\"-341307408\",\"method\":\"messages.getAllChats\",\"params\":[{\"name\":\"except_ids\",\"type\":\"Vector\"}],\"type\":\"messages.Chats\"},{\"id\":\"-333262899\",\"method\":\"help.setBotUpdatesStatus\",\"params\":[{\"name\":\"pending_updates_count\",\"type\":\"int\"},{\"name\":\"message\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"852135825\",\"method\":\"messages.getWebPage\",\"params\":[{\"name\":\"url\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"WebPage\"},{\"id\":\"-1489903017\",\"method\":\"messages.toggleDialogPin\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"pinned\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":\"991616823\",\"method\":\"messages.reorderPinnedDialogs\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"force\",\"type\":\"flags.0?true\"},{\"name\":\"folder_id\",\"type\":\"int\"},{\"name\":\"order\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-692498958\",\"method\":\"messages.getPinnedDialogs\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"messages.PeerDialogs\"},{\"id\":\"-1440257555\",\"method\":\"bots.sendCustomRequest\",\"params\":[{\"name\":\"custom_method\",\"type\":\"string\"},{\"name\":\"params\",\"type\":\"DataJSON\"}],\"type\":\"DataJSON\"},{\"id\":\"-434028723\",\"method\":\"bots.answerWebhookJSONQuery\",\"params\":[{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"data\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":\"619086221\",\"method\":\"upload.getWebFile\",\"params\":[{\"name\":\"location\",\"type\":\"InputWebFileLocation\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.WebFile\"},{\"id\":\"-1712285883\",\"method\":\"payments.getPaymentForm\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"payments.PaymentForm\"},{\"id\":\"-1601001088\",\"method\":\"payments.getPaymentReceipt\",\"params\":[{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"payments.PaymentReceipt\"},{\"id\":\"1997180532\",\"method\":\"payments.validateRequestedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"save\",\"type\":\"flags.0?true\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"info\",\"type\":\"PaymentRequestedInfo\"}],\"type\":\"payments.ValidatedRequestedInfo\"},{\"id\":\"730364339\",\"method\":\"payments.sendPaymentForm\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"requested_info_id\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_option_id\",\"type\":\"flags.1?string\"},{\"name\":\"credentials\",\"type\":\"InputPaymentCredentials\"}],\"type\":\"payments.PaymentResult\"},{\"id\":\"1151208273\",\"method\":\"account.getTmpPassword\",\"params\":[{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"},{\"name\":\"period\",\"type\":\"int\"}],\"type\":\"account.TmpPassword\"},{\"id\":\"578650699\",\"method\":\"payments.getSavedInfo\",\"params\":[],\"type\":\"payments.SavedInfo\"},{\"id\":\"-667062079\",\"method\":\"payments.clearSavedInfo\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"credentials\",\"type\":\"flags.0?true\"},{\"name\":\"info\",\"type\":\"flags.1?true\"}],\"type\":\"Bool\"},{\"id\":\"-436833542\",\"method\":\"messages.setBotShippingResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"},{\"name\":\"shipping_options\",\"type\":\"flags.1?Vector\"}],\"type\":\"Bool\"},{\"id\":\"163765653\",\"method\":\"messages.setBotPrecheckoutResults\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.1?true\"},{\"name\":\"query_id\",\"type\":\"long\"},{\"name\":\"error\",\"type\":\"flags.0?string\"}],\"type\":\"Bool\"},{\"id\":\"-1680314774\",\"method\":\"stickers.createStickerSet\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"masks\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"short_name\",\"type\":\"string\"},{\"name\":\"stickers\",\"type\":\"Vector\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"-143257775\",\"method\":\"stickers.removeStickerFromSet\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"-4795190\",\"method\":\"stickers.changeStickerPosition\",\"params\":[{\"name\":\"sticker\",\"type\":\"InputDocument\"},{\"name\":\"position\",\"type\":\"int\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"-2041315650\",\"method\":\"stickers.addStickerToSet\",\"params\":[{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"},{\"name\":\"sticker\",\"type\":\"InputStickerSetItem\"}],\"type\":\"messages.StickerSet\"},{\"id\":\"1369162417\",\"method\":\"messages.uploadMedia\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"media\",\"type\":\"InputMedia\"}],\"type\":\"MessageMedia\"},{\"id\":\"1430593449\",\"method\":\"phone.getCallConfig\",\"params\":[],\"type\":\"DataJSON\"},{\"id\":\"1124046573\",\"method\":\"phone.requestCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"random_id\",\"type\":\"int\"},{\"name\":\"g_a_hash\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":\"1003664544\",\"method\":\"phone.acceptCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_b\",\"type\":\"bytes\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":\"788404002\",\"method\":\"phone.confirmCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"g_a\",\"type\":\"bytes\"},{\"name\":\"key_fingerprint\",\"type\":\"long\"},{\"name\":\"protocol\",\"type\":\"PhoneCallProtocol\"}],\"type\":\"phone.PhoneCall\"},{\"id\":\"399855457\",\"method\":\"phone.receivedCall\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"}],\"type\":\"Bool\"},{\"id\":\"-1295269440\",\"method\":\"phone.discardCall\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"video\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"duration\",\"type\":\"int\"},{\"name\":\"reason\",\"type\":\"PhoneCallDiscardReason\"},{\"name\":\"connection_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":\"1508562471\",\"method\":\"phone.setCallRating\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"user_initiative\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"rating\",\"type\":\"int\"},{\"name\":\"comment\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"662363518\",\"method\":\"phone.saveCallDebug\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPhoneCall\"},{\"name\":\"debug\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":\"536919235\",\"method\":\"upload.getCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"upload.CdnFile\"},{\"id\":\"-1691921240\",\"method\":\"upload.reuploadCdnFile\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"request_token\",\"type\":\"bytes\"}],\"type\":\"Vector\"},{\"id\":\"1375900482\",\"method\":\"help.getCdnConfig\",\"params\":[],\"type\":\"CdnConfig\"},{\"id\":\"-219008246\",\"method\":\"langpack.getLangPack\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackDifference\"},{\"id\":\"-269862909\",\"method\":\"langpack.getStrings\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"keys\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-845657435\",\"method\":\"langpack.getDifference\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"LangPackDifference\"},{\"id\":\"1120311183\",\"method\":\"langpack.getLanguages\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"}],\"type\":\"Vector\"},{\"id\":\"1920559378\",\"method\":\"channels.editBanned\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":\"870184064\",\"method\":\"channels.getAdminLog\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"events_filter\",\"type\":\"flags.0?ChannelAdminLogEventsFilter\"},{\"name\":\"admins\",\"type\":\"flags.1?Vector\"},{\"name\":\"max_id\",\"type\":\"long\"},{\"name\":\"min_id\",\"type\":\"long\"},{\"name\":\"limit\",\"type\":\"int\"}],\"type\":\"channels.AdminLogResults\"},{\"id\":\"1302676017\",\"method\":\"upload.getCdnFileHashes\",\"params\":[{\"name\":\"file_token\",\"type\":\"bytes\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":\"-914493408\",\"method\":\"messages.sendScreenshotNotification\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"int\"},{\"name\":\"random_id\",\"type\":\"long\"}],\"type\":\"Updates\"},{\"id\":\"-359881479\",\"method\":\"channels.setStickers\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"stickerset\",\"type\":\"InputStickerSet\"}],\"type\":\"Bool\"},{\"id\":\"567151374\",\"method\":\"messages.getFavedStickers\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.FavedStickers\"},{\"id\":\"-1174420133\",\"method\":\"messages.faveSticker\",\"params\":[{\"name\":\"id\",\"type\":\"InputDocument\"},{\"name\":\"unfave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"-357180360\",\"method\":\"channels.readMessageContents\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-2020263951\",\"method\":\"contacts.resetSaved\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"1180140658\",\"method\":\"messages.getUnreadMentions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"offset_id\",\"type\":\"int\"},{\"name\":\"add_offset\",\"type\":\"int\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"max_id\",\"type\":\"int\"},{\"name\":\"min_id\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"-1355375294\",\"method\":\"channels.deleteHistory\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"max_id\",\"type\":\"int\"}],\"type\":\"Bool\"},{\"id\":\"1036054804\",\"method\":\"help.getRecentMeUrls\",\"params\":[{\"name\":\"referer\",\"type\":\"string\"}],\"type\":\"help.RecentMeUrls\"},{\"id\":\"-356796084\",\"method\":\"channels.togglePreHistoryHidden\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Updates\"},{\"id\":\"251759059\",\"method\":\"messages.readMentions\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"messages.AffectedHistory\"},{\"id\":\"-1144759543\",\"method\":\"messages.getRecentLocations\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"limit\",\"type\":\"int\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"-872345397\",\"method\":\"messages.sendMultiMedia\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.5?true\"},{\"name\":\"background\",\"type\":\"flags.6?true\"},{\"name\":\"clear_draft\",\"type\":\"flags.7?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"reply_to_msg_id\",\"type\":\"flags.0?int\"},{\"name\":\"multi_media\",\"type\":\"Vector\"},{\"name\":\"schedule_date\",\"type\":\"flags.10?int\"}],\"type\":\"Updates\"},{\"id\":\"1347929239\",\"method\":\"messages.uploadEncryptedFile\",\"params\":[{\"name\":\"peer\",\"type\":\"InputEncryptedChat\"},{\"name\":\"file\",\"type\":\"InputEncryptedFile\"}],\"type\":\"EncryptedFile\"},{\"id\":\"405695855\",\"method\":\"account.getWebAuthorizations\",\"params\":[],\"type\":\"account.WebAuthorizations\"},{\"id\":\"755087855\",\"method\":\"account.resetWebAuthorization\",\"params\":[{\"name\":\"hash\",\"type\":\"long\"}],\"type\":\"Bool\"},{\"id\":\"1747789204\",\"method\":\"account.resetWebAuthorizations\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-1028140917\",\"method\":\"messages.searchStickerSets\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"exclude_featured\",\"type\":\"flags.0?true\"},{\"name\":\"q\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.FoundStickerSets\"},{\"id\":\"-956147407\",\"method\":\"upload.getFileHashes\",\"params\":[{\"name\":\"location\",\"type\":\"InputFileLocation\"},{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"Vector\"},{\"id\":\"1031231713\",\"method\":\"help.getProxyData\",\"params\":[],\"type\":\"help.ProxyData\"},{\"id\":\"749019089\",\"method\":\"help.getTermsOfServiceUpdate\",\"params\":[],\"type\":\"help.TermsOfServiceUpdate\"},{\"id\":\"-294455398\",\"method\":\"help.acceptTermsOfService\",\"params\":[{\"name\":\"id\",\"type\":\"DataJSON\"}],\"type\":\"Bool\"},{\"id\":\"-1299661699\",\"method\":\"account.getAllSecureValues\",\"params\":[],\"type\":\"Vector\"},{\"id\":\"1936088002\",\"method\":\"account.getSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-1986010339\",\"method\":\"account.saveSecureValue\",\"params\":[{\"name\":\"value\",\"type\":\"InputSecureValue\"},{\"name\":\"secure_secret_id\",\"type\":\"long\"}],\"type\":\"SecureValue\"},{\"id\":\"-1199522741\",\"method\":\"account.deleteSecureValue\",\"params\":[{\"name\":\"types\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-1865902923\",\"method\":\"users.setSecureValueErrors\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"errors\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-1200903967\",\"method\":\"account.getAuthorizationForm\",\"params\":[{\"name\":\"bot_id\",\"type\":\"int\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"}],\"type\":\"account.AuthorizationForm\"},{\"id\":\"-419267436\",\"method\":\"account.acceptAuthorization\",\"params\":[{\"name\":\"bot_id\",\"type\":\"int\"},{\"name\":\"scope\",\"type\":\"string\"},{\"name\":\"public_key\",\"type\":\"string\"},{\"name\":\"value_hashes\",\"type\":\"Vector\"},{\"name\":\"credentials\",\"type\":\"SecureCredentialsEncrypted\"}],\"type\":\"Bool\"},{\"id\":\"-1516022023\",\"method\":\"account.sendVerifyPhoneCode\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"CodeSettings\"}],\"type\":\"auth.SentCode\"},{\"id\":\"1305716726\",\"method\":\"account.verifyPhone\",\"params\":[{\"name\":\"phone_number\",\"type\":\"string\"},{\"name\":\"phone_code_hash\",\"type\":\"string\"},{\"name\":\"phone_code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"1880182943\",\"method\":\"account.sendVerifyEmailCode\",\"params\":[{\"name\":\"email\",\"type\":\"string\"}],\"type\":\"account.SentEmailCode\"},{\"id\":\"-323339813\",\"method\":\"account.verifyEmail\",\"params\":[{\"name\":\"email\",\"type\":\"string\"},{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"1072547679\",\"method\":\"help.getDeepLinkInfo\",\"params\":[{\"name\":\"path\",\"type\":\"string\"}],\"type\":\"help.DeepLinkInfo\"},{\"id\":\"-2098076769\",\"method\":\"contacts.getSaved\",\"params\":[],\"type\":\"Vector\"},{\"id\":\"-2092831552\",\"method\":\"channels.getLeftChannels\",\"params\":[{\"name\":\"offset\",\"type\":\"int\"}],\"type\":\"messages.Chats\"},{\"id\":\"-262453244\",\"method\":\"account.initTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"contacts\",\"type\":\"flags.0?true\"},{\"name\":\"message_users\",\"type\":\"flags.1?true\"},{\"name\":\"message_chats\",\"type\":\"flags.2?true\"},{\"name\":\"message_megagroups\",\"type\":\"flags.3?true\"},{\"name\":\"message_channels\",\"type\":\"flags.4?true\"},{\"name\":\"files\",\"type\":\"flags.5?true\"},{\"name\":\"file_max_size\",\"type\":\"flags.5?int\"}],\"type\":\"account.Takeout\"},{\"id\":\"489050862\",\"method\":\"account.finishTakeoutSession\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"success\",\"type\":\"flags.0?true\"}],\"type\":\"Bool\"},{\"id\":\"486505992\",\"method\":\"messages.getSplitRanges\",\"params\":[],\"type\":\"Vector\"},{\"id\":\"911373810\",\"method\":\"invokeWithMessagesRange\",\"params\":[{\"name\":\"range\",\"type\":\"MessageRange\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"-1398145746\",\"method\":\"invokeWithTakeout\",\"params\":[{\"name\":\"takeout_id\",\"type\":\"long\"},{\"name\":\"query\",\"type\":\"!X\"}],\"type\":\"X\"},{\"id\":\"-1031349873\",\"method\":\"messages.markDialogUnread\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"unread\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputDialogPeer\"}],\"type\":\"Bool\"},{\"id\":\"585256482\",\"method\":\"messages.getDialogUnreadMarks\",\"params\":[],\"type\":\"Vector\"},{\"id\":\"-2062238246\",\"method\":\"contacts.toggleTopPeers\",\"params\":[{\"name\":\"enabled\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"2119757468\",\"method\":\"messages.clearAllDrafts\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-1735311088\",\"method\":\"help.getAppConfig\",\"params\":[],\"type\":\"JSONValue\"},{\"id\":\"1862465352\",\"method\":\"help.saveAppLog\",\"params\":[{\"name\":\"events\",\"type\":\"Vector\"}],\"type\":\"Bool\"},{\"id\":\"-966677240\",\"method\":\"help.getPassportConfig\",\"params\":[{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"help.PassportConfig\"},{\"id\":\"1784243458\",\"method\":\"langpack.getLanguage\",\"params\":[{\"name\":\"lang_pack\",\"type\":\"string\"},{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"LangPackLanguage\"},{\"id\":\"-760547348\",\"method\":\"messages.updatePinnedMessage\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"silent\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"-1881204448\",\"method\":\"account.confirmPasswordEmail\",\"params\":[{\"name\":\"code\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"2055154197\",\"method\":\"account.resendPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-1043606090\",\"method\":\"account.cancelPasswordEmail\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-748624084\",\"method\":\"help.getSupportName\",\"params\":[],\"type\":\"help.SupportName\"},{\"id\":\"59377875\",\"method\":\"help.getUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"}],\"type\":\"help.UserInfo\"},{\"id\":\"1723407216\",\"method\":\"help.editUserInfo\",\"params\":[{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"message\",\"type\":\"string\"},{\"name\":\"entities\",\"type\":\"Vector\"}],\"type\":\"help.UserInfo\"},{\"id\":\"-1626880216\",\"method\":\"account.getContactSignUpNotification\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"-806076575\",\"method\":\"account.setContactSignUpNotification\",\"params\":[{\"name\":\"silent\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"1398240377\",\"method\":\"account.getNotifyExceptions\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"compare_sound\",\"type\":\"flags.1?true\"},{\"name\":\"peer\",\"type\":\"flags.0?InputNotifyPeer\"}],\"type\":\"Updates\"},{\"id\":\"283795844\",\"method\":\"messages.sendVote\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"options\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"1941660731\",\"method\":\"messages.getPollResults\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"1848369232\",\"method\":\"messages.getOnlines\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"ChatOnlines\"},{\"id\":\"-2127811866\",\"method\":\"messages.getStatsURL\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"params\",\"type\":\"string\"}],\"type\":\"StatsURL\"},{\"id\":\"-554301545\",\"method\":\"messages.editChatAbout\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"about\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"-1517917375\",\"method\":\"messages.editChatDefaultBannedRights\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"banned_rights\",\"type\":\"ChatBannedRights\"}],\"type\":\"Updates\"},{\"id\":\"-57811990\",\"method\":\"account.getWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"}],\"type\":\"WallPaper\"},{\"id\":\"-578472351\",\"method\":\"account.uploadWallPaper\",\"params\":[{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"mime_type\",\"type\":\"string\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"WallPaper\"},{\"id\":\"1817860919\",\"method\":\"account.saveWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"unsave\",\"type\":\"Bool\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":\"-18000023\",\"method\":\"account.installWallPaper\",\"params\":[{\"name\":\"wallpaper\",\"type\":\"InputWallPaper\"},{\"name\":\"settings\",\"type\":\"WallPaperSettings\"}],\"type\":\"Bool\"},{\"id\":\"-1153722364\",\"method\":\"account.resetWallPapers\",\"params\":[],\"type\":\"Bool\"},{\"id\":\"1457130303\",\"method\":\"account.getAutoDownloadSettings\",\"params\":[],\"type\":\"account.AutoDownloadSettings\"},{\"id\":\"1995661875\",\"method\":\"account.saveAutoDownloadSettings\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"low\",\"type\":\"flags.0?true\"},{\"name\":\"high\",\"type\":\"flags.1?true\"},{\"name\":\"settings\",\"type\":\"AutoDownloadSettings\"}],\"type\":\"Bool\"},{\"id\":\"899735650\",\"method\":\"messages.getEmojiKeywords\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":\"352892591\",\"method\":\"messages.getEmojiKeywordsDifference\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"},{\"name\":\"from_version\",\"type\":\"int\"}],\"type\":\"EmojiKeywordsDifference\"},{\"id\":\"1318675378\",\"method\":\"messages.getEmojiKeywordsLanguages\",\"params\":[{\"name\":\"lang_codes\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-709817306\",\"method\":\"messages.getEmojiURL\",\"params\":[{\"name\":\"lang_code\",\"type\":\"string\"}],\"type\":\"EmojiURL\"},{\"id\":\"1749536939\",\"method\":\"folders.editPeerFolders\",\"params\":[{\"name\":\"folder_peers\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"472471681\",\"method\":\"folders.deleteFolder\",\"params\":[{\"name\":\"folder_id\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"1932455680\",\"method\":\"messages.getSearchCounters\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"filters\",\"type\":\"Vector\"}],\"type\":\"Vector\"},{\"id\":\"-170208392\",\"method\":\"channels.getGroupsForDiscussion\",\"params\":[],\"type\":\"messages.Chats\"},{\"id\":\"1079520178\",\"method\":\"channels.setDiscussionGroup\",\"params\":[{\"name\":\"broadcast\",\"type\":\"InputChannel\"},{\"name\":\"group\",\"type\":\"InputChannel\"}],\"type\":\"Bool\"},{\"id\":\"-482388461\",\"method\":\"messages.requestUrlAuth\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"button_id\",\"type\":\"int\"}],\"type\":\"UrlAuthResult\"},{\"id\":\"-148247912\",\"method\":\"messages.acceptUrlAuth\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"write_allowed\",\"type\":\"flags.0?true\"},{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"msg_id\",\"type\":\"int\"},{\"name\":\"button_id\",\"type\":\"int\"}],\"type\":\"UrlAuthResult\"},{\"id\":\"1336717624\",\"method\":\"messages.hidePeerSettingsBar\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"}],\"type\":\"Bool\"},{\"id\":\"-386636848\",\"method\":\"contacts.addContact\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"add_phone_privacy_exception\",\"type\":\"flags.0?true\"},{\"name\":\"id\",\"type\":\"InputUser\"},{\"name\":\"first_name\",\"type\":\"string\"},{\"name\":\"last_name\",\"type\":\"string\"},{\"name\":\"phone\",\"type\":\"string\"}],\"type\":\"Updates\"},{\"id\":\"-130964977\",\"method\":\"contacts.acceptContact\",\"params\":[{\"name\":\"id\",\"type\":\"InputUser\"}],\"type\":\"Updates\"},{\"id\":\"-1892102881\",\"method\":\"channels.editCreator\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"user_id\",\"type\":\"InputUser\"},{\"name\":\"password\",\"type\":\"InputCheckPasswordSRP\"}],\"type\":\"Updates\"},{\"id\":\"171270230\",\"method\":\"contacts.getLocated\",\"params\":[{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"}],\"type\":\"Updates\"},{\"id\":\"1491484525\",\"method\":\"channels.editLocation\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"geo_point\",\"type\":\"InputGeoPoint\"},{\"name\":\"address\",\"type\":\"string\"}],\"type\":\"Bool\"},{\"id\":\"-304832784\",\"method\":\"channels.toggleSlowMode\",\"params\":[{\"name\":\"channel\",\"type\":\"InputChannel\"},{\"name\":\"seconds\",\"type\":\"int\"}],\"type\":\"Updates\"},{\"id\":\"-490575781\",\"method\":\"messages.getScheduledHistory\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"messages.Messages\"},{\"id\":\"-1111817116\",\"method\":\"messages.getScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"messages.Messages\"},{\"id\":\"-1120369398\",\"method\":\"messages.sendScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"1504586518\",\"method\":\"messages.deleteScheduledMessages\",\"params\":[{\"name\":\"peer\",\"type\":\"InputPeer\"},{\"name\":\"id\",\"type\":\"Vector\"}],\"type\":\"Updates\"},{\"id\":\"473805619\",\"method\":\"account.uploadTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"file\",\"type\":\"InputFile\"},{\"name\":\"thumb\",\"type\":\"flags.0?InputFile\"},{\"name\":\"file_name\",\"type\":\"string\"},{\"name\":\"mime_type\",\"type\":\"string\"}],\"type\":\"Document\"},{\"id\":\"729808255\",\"method\":\"account.createTheme\",\"params\":[{\"name\":\"slug\",\"type\":\"string\"},{\"name\":\"title\",\"type\":\"string\"},{\"name\":\"document\",\"type\":\"InputDocument\"}],\"type\":\"Theme\"},{\"id\":\"999203330\",\"method\":\"account.updateTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"slug\",\"type\":\"flags.0?string\"},{\"name\":\"title\",\"type\":\"flags.1?string\"},{\"name\":\"document\",\"type\":\"flags.2?InputDocument\"}],\"type\":\"Theme\"},{\"id\":\"-229175188\",\"method\":\"account.saveTheme\",\"params\":[{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"unsave\",\"type\":\"Bool\"}],\"type\":\"Bool\"},{\"id\":\"2061776695\",\"method\":\"account.installTheme\",\"params\":[{\"name\":\"flags\",\"type\":\"#\"},{\"name\":\"dark\",\"type\":\"flags.0?true\"},{\"name\":\"format\",\"type\":\"flags.1?string\"},{\"name\":\"theme\",\"type\":\"flags.1?InputTheme\"}],\"type\":\"Bool\"},{\"id\":\"-1919060949\",\"method\":\"account.getTheme\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"theme\",\"type\":\"InputTheme\"},{\"name\":\"document_id\",\"type\":\"long\"}],\"type\":\"Theme\"},{\"id\":\"676939512\",\"method\":\"account.getThemes\",\"params\":[{\"name\":\"format\",\"type\":\"string\"},{\"name\":\"hash\",\"type\":\"int\"}],\"type\":\"account.Themes\"}]};\r\n\r\nConfig.Schema.API.layer = 105;\r\n\r\n// From https://github.com/stephenmathieson/node-tlds/blob/master/index.js\r\nConfig.TLD = ['abogado', 'ac', 'academy', 'accountants', 'active', 'actor', 'ad', 'adult', 'ae', 'aero', 'af', 'ag', 'agency', 'ai', 'airforce', 'al', 'allfinanz', 'alsace', 'am', 'amsterdam', 'an', 'android', 'ao', 'apartments', 'aq', 'aquarelle', 'ar', 'archi', 'army', 'arpa', 'as', 'asia', 'associates', 'at', 'attorney', 'au', 'auction', 'audio', 'autos', 'aw', 'ax', 'axa', 'az', 'ba', 'band', 'bank', 'bar', 'barclaycard', 'barclays', 'bargains', 'bayern', 'bb', 'bd', 'be', 'beer', 'berlin', 'best', 'bf', 'bg', 'bh', 'bi', 'bid', 'bike', 'bingo', 'bio', 'biz', 'bj', 'black', 'blackfriday', 'bloomberg', 'blue', 'bm', 'bmw', 'bn', 'bnpparibas', 'bo', 'boo', 'boutique', 'br', 'brussels', 'bs', 'bt', 'budapest', 'build', 'builders', 'business', 'buzz', 'bv', 'bw', 'by', 'bz', 'bzh', 'ca', 'cab', 'cal', 'camera', 'camp', 'cancerresearch', 'canon', 'capetown', 'capital', 'caravan', 'cards', 'care', 'career', 'careers', 'cartier', 'casa', 'cash', 'cat', 'catering', 'cc', 'cd', 'center', 'ceo', 'cern', 'cf', 'cg', 'ch', 'channel', 'chat', 'cheap', 'christmas', 'chrome', 'church', 'ci', 'citic', 'city', 'ck', 'cl', 'claims', 'cleaning', 'click', 'clinic', 'clothing', 'club', 'cm', 'cn', 'co', 'coach', 'codes', 'coffee', 'college', 'cologne', 'com', 'community', 'company', 'computer', 'condos', 'construction', 'consulting', 'contractors', 'cooking', 'cool', 'coop', 'country', 'cr', 'credit', 'creditcard', 'cricket', 'crs', 'cruises', 'cu', 'cuisinella', 'cv', 'cw', 'cx', 'cy', 'cymru', 'cz', 'dabur', 'dad', 'dance', 'dating', 'day', 'dclk', 'de', 'deals', 'degree', 'delivery', 'democrat', 'dental', 'dentist', 'desi', 'design', 'dev', 'diamonds', 'diet', 'digital', 'direct', 'directory', 'discount', 'dj', 'dk', 'dm', 'dnp', 'do', 'docs', 'domains', 'doosan', 'durban', 'dvag', 'dz', 'eat', 'ec', 'edu', 'education', 'ee', 'eg', 'email', 'emerck', 'energy', 'engineer', 'engineering', 'enterprises', 'equipment', 'er', 'es', 'esq', 'estate', 'et', 'eu', 'eurovision', 'eus', 'events', 'everbank', 'exchange', 'expert', 'exposed', 'fail', 'farm', 'fashion', 'feedback', 'fi', 'finance', 'financial', 'firmdale', 'fish', 'fishing', 'fit', 'fitness', 'fj', 'fk', 'flights', 'florist', 'flowers', 'flsmidth', 'fly', 'fm', 'fo', 'foo', 'forsale', 'foundation', 'fr', 'frl', 'frogans', 'fund', 'furniture', 'futbol', 'ga', 'gal', 'gallery', 'garden', 'gb', 'gbiz', 'gd', 'ge', 'gent', 'gf', 'gg', 'ggee', 'gh', 'gi', 'gift', 'gifts', 'gives', 'gl', 'glass', 'gle', 'global', 'globo', 'gm', 'gmail', 'gmo', 'gmx', 'gn', 'goog', 'google', 'gop', 'gov', 'gp', 'gq', 'gr', 'graphics', 'gratis', 'green', 'gripe', 'gs', 'gt', 'gu', 'guide', 'guitars', 'guru', 'gw', 'gy', 'hamburg', 'hangout', 'haus', 'healthcare', 'help', 'here', 'hermes', 'hiphop', 'hiv', 'hk', 'hm', 'hn', 'holdings', 'holiday', 'homes', 'horse', 'host', 'hosting', 'house', 'how', 'hr', 'ht', 'hu', 'ibm', 'id', 'ie', 'ifm', 'il', 'im', 'immo', 'immobilien', 'in', 'industries', 'info', 'ing', 'ink', 'institute', 'insure', 'int', 'international', 'investments', 'io', 'iq', 'ir', 'irish', 'is', 'it', 'iwc', 'jcb', 'je', 'jetzt', 'jm', 'jo', 'jobs', 'joburg', 'jp', 'juegos', 'kaufen', 'kddi', 'ke', 'kg', 'kh', 'ki', 'kim', 'kitchen', 'kiwi', 'km', 'kn', 'koeln', 'kp', 'kr', 'krd', 'kred', 'kw', 'ky', 'kyoto', 'kz', 'la', 'lacaixa', 'land', 'lat', 'latrobe', 'lawyer', 'lb', 'lc', 'lds', 'lease', 'legal', 'lgbt', 'li', 'lidl', 'life', 'lighting', 'limited', 'limo', 'link', 'lk', 'loans', 'london', 'lotte', 'lotto', 'lr', 'ls', 'lt', 'ltda', 'lu', 'luxe', 'luxury', 'lv', 'ly', 'ma', 'madrid', 'maison', 'management', 'mango', 'market', 'marketing', 'marriott', 'mc', 'md', 'me', 'media', 'meet', 'melbourne', 'meme', 'memorial', 'menu', 'mg', 'mh', 'miami', 'mil', 'mini', 'mk', 'ml', 'mm', 'mn', 'mo', 'mobi', 'moda', 'moe', 'monash', 'money', 'mormon', 'mortgage', 'moscow', 'motorcycles', 'mov', 'mp', 'mq', 'mr', 'ms', 'mt', 'mu', 'museum', 'mv', 'mw', 'mx', 'my', 'mz', 'na', 'nagoya', 'name', 'navy', 'nc', 'ne', 'net', 'network', 'neustar', 'new', 'nexus', 'nf', 'ng', 'ngo', 'nhk', 'ni', 'nico', 'ninja', 'nl', 'no', 'np', 'nr', 'nra', 'nrw', 'ntt', 'nu', 'nyc', 'nz', 'okinawa', 'om', 'one', 'ong', 'onl', 'ooo', 'org', 'organic', 'osaka', 'otsuka', 'ovh', 'pa', 'paris', 'partners', 'parts', 'party', 'pe', 'pf', 'pg', 'ph', 'pharmacy', 'photo', 'photography', 'photos', 'physio', 'pics', 'pictures', 'pink', 'pizza', 'pk', 'pl', 'place', 'plumbing', 'pm', 'pn', 'pohl', 'poker', 'porn', 'post', 'pr', 'praxi', 'press', 'pro', 'prod', 'productions', 'prof', 'properties', 'property', 'ps', 'pt', 'pub', 'pw', 'py', 'qa', 'qpon', 'quebec', 're', 'realtor', 'recipes', 'red', 'rehab', 'reise', 'reisen', 'reit', 'ren', 'rentals', 'repair', 'report', 'republican', 'rest', 'restaurant', 'reviews', 'rich', 'rio', 'rip', 'ro', 'rocks', 'rodeo', 'rs', 'rsvp', 'ru', 'ruhr', 'rw', 'ryukyu', 'sa', 'saarland', 'sale', 'samsung', 'sarl', 'saxo', 'sb', 'sc', 'sca', 'scb', 'schmidt', 'schule', 'schwarz', 'science', 'scot', 'sd', 'se', 'services', 'sew', 'sexy', 'sg', 'sh', 'shiksha', 'shoes', 'shriram', 'si', 'singles', 'sj', 'sk', 'sky', 'sl', 'sm', 'sn', 'so', 'social', 'software', 'sohu', 'solar', 'solutions', 'soy', 'space', 'spiegel', 'sr', 'st', 'style', 'su', 'supplies', 'supply', 'support', 'surf', 'surgery', 'suzuki', 'sv', 'sx', 'sy', 'sydney', 'systems', 'sz', 'taipei', 'tatar', 'tattoo', 'tax', 'tc', 'td', 'technology', 'tel', 'temasek', 'tennis', 'tf', 'tg', 'th', 'tienda', 'tips', 'tires', 'tirol', 'tj', 'tk', 'tl', 'tm', 'tn', 'to', 'today', 'tokyo', 'tools', 'top', 'toshiba', 'town', 'toys', 'tp', 'tr', 'trade', 'training', 'travel', 'trust', 'tt', 'tui', 'tv', 'tw', 'tz', 'ua', 'ug', 'uk', 'university', 'uno', 'uol', 'us', 'uy', 'uz', 'va', 'vacations', 'vc', 've', 'vegas', 'ventures', 'versicherung', 'vet', 'vg', 'vi', 'viajes', 'video', 'villas', 'vision', 'vlaanderen', 'vn', 'vodka', 'vote', 'voting', 'voto', 'voyage', 'vu', 'wales', 'wang', 'watch', 'webcam', 'website', 'wed', 'wedding', 'wf', 'whoswho', 'wien', 'wiki', 'williamhill', 'wme', 'work', 'works', 'world', 'ws', 'wtc', 'wtf', '佛山', '集团', '在线', '한국', 'ভারত', '八卦', 'موقع', '公益', '公司', '移动', '我爱你', 'москва', 'қаз', 'онлайн', 'сайт', 'срб', '淡马锡', 'орг', '삼성', 'சிங்கப்பூர்', '商标', '商店', '商城', 'дети', 'мкд', '中文网', '中信', '中国', '中國', '谷歌', 'భారత్', 'ලංකා', 'ભારત', 'भारत', '网店', 'संगठन', '网络', 'укр', '香港', '台湾', '台灣', '手机', 'мон', 'الجزائر', 'عمان', 'ایران', 'امارات', 'بازار', 'الاردن', 'بھارت', 'المغرب', 'السعودية', 'مليسيا', 'شبكة', 'გე', '机构', '组织机构', 'ไทย', 'سورية', 'рус', 'рф', 'تونس', 'みんな', 'グーグル', '世界', 'ਭਾਰਤ', '网址', '游戏', 'vermögensberater', 'vermögensberatung', '企业', 'مصر', 'قطر', '广东', 'இலங்கை', 'இந்தியா', '新加坡', 'فلسطين', '政务', 'xxx', 'xyz', 'yachts', 'yandex', 'ye', 'yoga', 'yokohama', 'youtube', 'yt', 'za', 'zip', 'zm', 'zone', 'zuerich', 'zw'];\r\n\r\n// From https://raw.githubusercontent.com/FGRibreau/latenize/master/latinize_map.js\r\nConfig.LatinizeMap = {'Á': 'A','Ă': 'A','Ắ': 'A','Ặ': 'A','Ằ': 'A','Ẳ': 'A','Ẵ': 'A','Ǎ': 'A','Â': 'A','Ấ': 'A','Ậ': 'A','Ầ': 'A','Ẩ': 'A','Ẫ': 'A','Ä': 'A','Ǟ': 'A','Ȧ': 'A','Ǡ': 'A','Ạ': 'A','Ȁ': 'A','À': 'A','Ả': 'A','Ȃ': 'A','Ā': 'A','Ą': 'A','Å': 'A','Ǻ': 'A','Ḁ': 'A','Ⱥ': 'A','Ã': 'A','Ꜳ': 'AA','Æ': 'AE','Ǽ': 'AE','Ǣ': 'AE','Ꜵ': 'AO','Ꜷ': 'AU','Ꜹ': 'AV','Ꜻ': 'AV','Ꜽ': 'AY','Ḃ': 'B','Ḅ': 'B','Ɓ': 'B','Ḇ': 'B','Ƀ': 'B','Ƃ': 'B','Ć': 'C','Č': 'C','Ç': 'C','Ḉ': 'C','Ĉ': 'C','Ċ': 'C','Ƈ': 'C','Ȼ': 'C','Ď': 'D','Ḑ': 'D','Ḓ': 'D','Ḋ': 'D','Ḍ': 'D','Ɗ': 'D','Ḏ': 'D','Dz': 'D','Dž': 'D','Đ': 'D','Ƌ': 'D','DZ': 'DZ','DŽ': 'DZ','É': 'E','Ĕ': 'E','Ě': 'E','Ȩ': 'E','Ḝ': 'E','Ê': 'E','Ế': 'E','Ệ': 'E','Ề': 'E','Ể': 'E','Ễ': 'E','Ḙ': 'E','Ë': 'E','Ė': 'E','Ẹ': 'E','Ȅ': 'E','È': 'E','Ẻ': 'E','Ȇ': 'E','Ē': 'E','Ḗ': 'E','Ḕ': 'E','Ę': 'E','Ɇ': 'E','Ẽ': 'E','Ḛ': 'E','Ꝫ': 'ET','Ḟ': 'F','Ƒ': 'F','Ǵ': 'G','Ğ': 'G','Ǧ': 'G','Ģ': 'G','Ĝ': 'G','Ġ': 'G','Ɠ': 'G','Ḡ': 'G','Ǥ': 'G','Ḫ': 'H','Ȟ': 'H','Ḩ': 'H','Ĥ': 'H','Ⱨ': 'H','Ḧ': 'H','Ḣ': 'H','Ḥ': 'H','Ħ': 'H','Í': 'I','Ĭ': 'I','Ǐ': 'I','Î': 'I','Ï': 'I','Ḯ': 'I','İ': 'I','Ị': 'I','Ȉ': 'I','Ì': 'I','Ỉ': 'I','Ȋ': 'I','Ī': 'I','Į': 'I','Ɨ': 'I','Ĩ': 'I','Ḭ': 'I','Ꝺ': 'D','Ꝼ': 'F','Ᵹ': 'G','Ꞃ': 'R','Ꞅ': 'S','Ꞇ': 'T','Ꝭ': 'IS','Ĵ': 'J','Ɉ': 'J','Ḱ': 'K','Ǩ': 'K','Ķ': 'K','Ⱪ': 'K','Ꝃ': 'K','Ḳ': 'K','Ƙ': 'K','Ḵ': 'K','Ꝁ': 'K','Ꝅ': 'K','Ĺ': 'L','Ƚ': 'L','Ľ': 'L','Ļ': 'L','Ḽ': 'L','Ḷ': 'L','Ḹ': 'L','Ⱡ': 'L','Ꝉ': 'L','Ḻ': 'L','Ŀ': 'L','Ɫ': 'L','Lj': 'L','Ł': 'L','LJ': 'LJ','Ḿ': 'M','Ṁ': 'M','Ṃ': 'M','Ɱ': 'M','Ń': 'N','Ň': 'N','Ņ': 'N','Ṋ': 'N','Ṅ': 'N','Ṇ': 'N','Ǹ': 'N','Ɲ': 'N','Ṉ': 'N','Ƞ': 'N','Nj': 'N','Ñ': 'N','NJ': 'NJ','Ó': 'O','Ŏ': 'O','Ǒ': 'O','Ô': 'O','Ố': 'O','Ộ': 'O','Ồ': 'O','Ổ': 'O','Ỗ': 'O','Ö': 'O','Ȫ': 'O','Ȯ': 'O','Ȱ': 'O','Ọ': 'O','Ő': 'O','Ȍ': 'O','Ò': 'O','Ỏ': 'O','Ơ': 'O','Ớ': 'O','Ợ': 'O','Ờ': 'O','Ở': 'O','Ỡ': 'O','Ȏ': 'O','Ꝋ': 'O','Ꝍ': 'O','Ō': 'O','Ṓ': 'O','Ṑ': 'O','Ɵ': 'O','Ǫ': 'O','Ǭ': 'O','Ø': 'O','Ǿ': 'O','Õ': 'O','Ṍ': 'O','Ṏ': 'O','Ȭ': 'O','Ƣ': 'OI','Ꝏ': 'OO','Ɛ': 'E','Ɔ': 'O','Ȣ': 'OU','Ṕ': 'P','Ṗ': 'P','Ꝓ': 'P','Ƥ': 'P','Ꝕ': 'P','Ᵽ': 'P','Ꝑ': 'P','Ꝙ': 'Q','Ꝗ': 'Q','Ŕ': 'R','Ř': 'R','Ŗ': 'R','Ṙ': 'R','Ṛ': 'R','Ṝ': 'R','Ȑ': 'R','Ȓ': 'R','Ṟ': 'R','Ɍ': 'R','Ɽ': 'R','Ꜿ': 'C','Ǝ': 'E','Ś': 'S','Ṥ': 'S','Š': 'S','Ṧ': 'S','Ş': 'S','Ŝ': 'S','Ș': 'S','Ṡ': 'S','Ṣ': 'S','Ṩ': 'S','ẞ': 'SS','Ť': 'T','Ţ': 'T','Ṱ': 'T','Ț': 'T','Ⱦ': 'T','Ṫ': 'T','Ṭ': 'T','Ƭ': 'T','Ṯ': 'T','Ʈ': 'T','Ŧ': 'T','Ɐ': 'A','Ꞁ': 'L','Ɯ': 'M','Ʌ': 'V','Ꜩ': 'TZ','Ú': 'U','Ŭ': 'U','Ǔ': 'U','Û': 'U','Ṷ': 'U','Ü': 'U','Ǘ': 'U','Ǚ': 'U','Ǜ': 'U','Ǖ': 'U','Ṳ': 'U','Ụ': 'U','Ű': 'U','Ȕ': 'U','Ù': 'U','Ủ': 'U','Ư': 'U','Ứ': 'U','Ự': 'U','Ừ': 'U','Ử': 'U','Ữ': 'U','Ȗ': 'U','Ū': 'U','Ṻ': 'U','Ų': 'U','Ů': 'U','Ũ': 'U','Ṹ': 'U','Ṵ': 'U','Ꝟ': 'V','Ṿ': 'V','Ʋ': 'V','Ṽ': 'V','Ꝡ': 'VY','Ẃ': 'W','Ŵ': 'W','Ẅ': 'W','Ẇ': 'W','Ẉ': 'W','Ẁ': 'W','Ⱳ': 'W','Ẍ': 'X','Ẋ': 'X','Ý': 'Y','Ŷ': 'Y','Ÿ': 'Y','Ẏ': 'Y','Ỵ': 'Y','Ỳ': 'Y','Ƴ': 'Y','Ỷ': 'Y','Ỿ': 'Y','Ȳ': 'Y','Ɏ': 'Y','Ỹ': 'Y','Ź': 'Z','Ž': 'Z','Ẑ': 'Z','Ⱬ': 'Z','Ż': 'Z','Ẓ': 'Z','Ȥ': 'Z','Ẕ': 'Z','Ƶ': 'Z','IJ': 'IJ','Œ': 'OE','ᴀ': 'A','ᴁ': 'AE','ʙ': 'B','ᴃ': 'B','ᴄ': 'C','ᴅ': 'D','ᴇ': 'E','ꜰ': 'F','ɢ': 'G','ʛ': 'G','ʜ': 'H','ɪ': 'I','ʁ': 'R','ᴊ': 'J','ᴋ': 'K','ʟ': 'L','ᴌ': 'L','ᴍ': 'M','ɴ': 'N','ᴏ': 'O','ɶ': 'OE','ᴐ': 'O','ᴕ': 'OU','ᴘ': 'P','ʀ': 'R','ᴎ': 'N','ᴙ': 'R','ꜱ': 'S','ᴛ': 'T','ⱻ': 'E','ᴚ': 'R','ᴜ': 'U','ᴠ': 'V','ᴡ': 'W','ʏ': 'Y','ᴢ': 'Z','á': 'a','ă': 'a','ắ': 'a','ặ': 'a','ằ': 'a','ẳ': 'a','ẵ': 'a','ǎ': 'a','â': 'a','ấ': 'a','ậ': 'a','ầ': 'a','ẩ': 'a','ẫ': 'a','ä': 'a','ǟ': 'a','ȧ': 'a','ǡ': 'a','ạ': 'a','ȁ': 'a','à': 'a','ả': 'a','ȃ': 'a','ā': 'a','ą': 'a','ᶏ': 'a','ẚ': 'a','å': 'a','ǻ': 'a','ḁ': 'a','ⱥ': 'a','ã': 'a','ꜳ': 'aa','æ': 'ae','ǽ': 'ae','ǣ': 'ae','ꜵ': 'ao','ꜷ': 'au','ꜹ': 'av','ꜻ': 'av','ꜽ': 'ay','ḃ': 'b','ḅ': 'b','ɓ': 'b','ḇ': 'b','ᵬ': 'b','ᶀ': 'b','ƀ': 'b','ƃ': 'b','ɵ': 'o','ć': 'c','č': 'c','ç': 'c','ḉ': 'c','ĉ': 'c','ɕ': 'c','ċ': 'c','ƈ': 'c','ȼ': 'c','ď': 'd','ḑ': 'd','ḓ': 'd','ȡ': 'd','ḋ': 'd','ḍ': 'd','ɗ': 'd','ᶑ': 'd','ḏ': 'd','ᵭ': 'd','ᶁ': 'd','đ': 'd','ɖ': 'd','ƌ': 'd','ı': 'i','ȷ': 'j','ɟ': 'j','ʄ': 'j','dz': 'dz','dž': 'dz','é': 'e','ĕ': 'e','ě': 'e','ȩ': 'e','ḝ': 'e','ê': 'e','ế': 'e','ệ': 'e','ề': 'e','ể': 'e','ễ': 'e','ḙ': 'e','ë': 'e','ė': 'e','ẹ': 'e','ȅ': 'e','è': 'e','ẻ': 'e','ȇ': 'e','ē': 'e','ḗ': 'e','ḕ': 'e','ⱸ': 'e','ę': 'e','ᶒ': 'e','ɇ': 'e','ẽ': 'e','ḛ': 'e','ꝫ': 'et','ḟ': 'f','ƒ': 'f','ᵮ': 'f','ᶂ': 'f','ǵ': 'g','ğ': 'g','ǧ': 'g','ģ': 'g','ĝ': 'g','ġ': 'g','ɠ': 'g','ḡ': 'g','ᶃ': 'g','ǥ': 'g','ḫ': 'h','ȟ': 'h','ḩ': 'h','ĥ': 'h','ⱨ': 'h','ḧ': 'h','ḣ': 'h','ḥ': 'h','ɦ': 'h','ẖ': 'h','ħ': 'h','ƕ': 'hv','í': 'i','ĭ': 'i','ǐ': 'i','î': 'i','ï': 'i','ḯ': 'i','ị': 'i','ȉ': 'i','ì': 'i','ỉ': 'i','ȋ': 'i','ī': 'i','į': 'i','ᶖ': 'i','ɨ': 'i','ĩ': 'i','ḭ': 'i','ꝺ': 'd','ꝼ': 'f','ᵹ': 'g','ꞃ': 'r','ꞅ': 's','ꞇ': 't','ꝭ': 'is','ǰ': 'j','ĵ': 'j','ʝ': 'j','ɉ': 'j','ḱ': 'k','ǩ': 'k','ķ': 'k','ⱪ': 'k','ꝃ': 'k','ḳ': 'k','ƙ': 'k','ḵ': 'k','ᶄ': 'k','ꝁ': 'k','ꝅ': 'k','ĺ': 'l','ƚ': 'l','ɬ': 'l','ľ': 'l','ļ': 'l','ḽ': 'l','ȴ': 'l','ḷ': 'l','ḹ': 'l','ⱡ': 'l','ꝉ': 'l','ḻ': 'l','ŀ': 'l','ɫ': 'l','ᶅ': 'l','ɭ': 'l','ł': 'l','lj': 'lj','ſ': 's','ẜ': 's','ẛ': 's','ẝ': 's','ḿ': 'm','ṁ': 'm','ṃ': 'm','ɱ': 'm','ᵯ': 'm','ᶆ': 'm','ń': 'n','ň': 'n','ņ': 'n','ṋ': 'n','ȵ': 'n','ṅ': 'n','ṇ': 'n','ǹ': 'n','ɲ': 'n','ṉ': 'n','ƞ': 'n','ᵰ': 'n','ᶇ': 'n','ɳ': 'n','ñ': 'n','nj': 'nj','ó': 'o','ŏ': 'o','ǒ': 'o','ô': 'o','ố': 'o','ộ': 'o','ồ': 'o','ổ': 'o','ỗ': 'o','ö': 'o','ȫ': 'o','ȯ': 'o','ȱ': 'o','ọ': 'o','ő': 'o','ȍ': 'o','ò': 'o','ỏ': 'o','ơ': 'o','ớ': 'o','ợ': 'o','ờ': 'o','ở': 'o','ỡ': 'o','ȏ': 'o','ꝋ': 'o','ꝍ': 'o','ⱺ': 'o','ō': 'o','ṓ': 'o','ṑ': 'o','ǫ': 'o','ǭ': 'o','ø': 'o','ǿ': 'o','õ': 'o','ṍ': 'o','ṏ': 'o','ȭ': 'o','ƣ': 'oi','ꝏ': 'oo','ɛ': 'e','ᶓ': 'e','ɔ': 'o','ᶗ': 'o','ȣ': 'ou','ṕ': 'p','ṗ': 'p','ꝓ': 'p','ƥ': 'p','ᵱ': 'p','ᶈ': 'p','ꝕ': 'p','ᵽ': 'p','ꝑ': 'p','ꝙ': 'q','ʠ': 'q','ɋ': 'q','ꝗ': 'q','ŕ': 'r','ř': 'r','ŗ': 'r','ṙ': 'r','ṛ': 'r','ṝ': 'r','ȑ': 'r','ɾ': 'r','ᵳ': 'r','ȓ': 'r','ṟ': 'r','ɼ': 'r','ᵲ': 'r','ᶉ': 'r','ɍ': 'r','ɽ': 'r','ↄ': 'c','ꜿ': 'c','ɘ': 'e','ɿ': 'r','ś': 's','ṥ': 's','š': 's','ṧ': 's','ş': 's','ŝ': 's','ș': 's','ṡ': 's','ṣ': 's','ṩ': 's','ʂ': 's','ᵴ': 's','ᶊ': 's','ȿ': 's','ɡ': 'g','ß': 'ss','ᴑ': 'o','ᴓ': 'o','ᴝ': 'u','ť': 't','ţ': 't','ṱ': 't','ț': 't','ȶ': 't','ẗ': 't','ⱦ': 't','ṫ': 't','ṭ': 't','ƭ': 't','ṯ': 't','ᵵ': 't','ƫ': 't','ʈ': 't','ŧ': 't','ᵺ': 'th','ɐ': 'a','ᴂ': 'ae','ǝ': 'e','ᵷ': 'g','ɥ': 'h','ʮ': 'h','ʯ': 'h','ᴉ': 'i','ʞ': 'k','ꞁ': 'l','ɯ': 'm','ɰ': 'm','ᴔ': 'oe','ɹ': 'r','ɻ': 'r','ɺ': 'r','ⱹ': 'r','ʇ': 't','ʌ': 'v','ʍ': 'w','ʎ': 'y','ꜩ': 'tz','ú': 'u','ŭ': 'u','ǔ': 'u','û': 'u','ṷ': 'u','ü': 'u','ǘ': 'u','ǚ': 'u','ǜ': 'u','ǖ': 'u','ṳ': 'u','ụ': 'u','ű': 'u','ȕ': 'u','ù': 'u','ủ': 'u','ư': 'u','ứ': 'u','ự': 'u','ừ': 'u','ử': 'u','ữ': 'u','ȗ': 'u','ū': 'u','ṻ': 'u','ų': 'u','ᶙ': 'u','ů': 'u','ũ': 'u','ṹ': 'u','ṵ': 'u','ᵫ': 'ue','ꝸ': 'um','ⱴ': 'v','ꝟ': 'v','ṿ': 'v','ʋ': 'v','ᶌ': 'v','ⱱ': 'v','ṽ': 'v','ꝡ': 'vy','ẃ': 'w','ŵ': 'w','ẅ': 'w','ẇ': 'w','ẉ': 'w','ẁ': 'w','ⱳ': 'w','ẘ': 'w','ẍ': 'x','ẋ': 'x','ᶍ': 'x','ý': 'y','ŷ': 'y','ÿ': 'y','ẏ': 'y','ỵ': 'y','ỳ': 'y','ƴ': 'y','ỷ': 'y','ỿ': 'y','ȳ': 'y','ẙ': 'y','ɏ': 'y','ỹ': 'y','ź': 'z','ž': 'z','ẑ': 'z','ʑ': 'z','ⱬ': 'z','ż': 'z','ẓ': 'z','ȥ': 'z','ẕ': 'z','ᵶ': 'z','ᶎ': 'z','ʐ': 'z','ƶ': 'z','ɀ': 'z','ff': 'ff','ffi': 'ffi','ffl': 'ffl','fi': 'fi','fl': 'fl','ij': 'ij','œ': 'oe','st': 'st','ₐ': 'a','ₑ': 'e','ᵢ': 'i','ⱼ': 'j','ₒ': 'o','ᵣ': 'r','ᵤ': 'u','ᵥ': 'v','ₓ': 'x','Ё': 'YO', 'Й': 'I', 'Ц': 'TS', 'У': 'U', 'К': 'K', 'Е': 'E', 'Н': 'N', 'Г': 'G', 'Ш': 'SH', 'Щ': 'SCH', 'З': 'Z', 'Х': 'H', 'Ъ': '', 'ё': 'yo', 'й': 'i', 'ц': 'ts', 'у': 'u', 'к': 'k', 'е': 'e', 'н': 'n', 'г': 'g', 'ш': 'sh', 'щ': 'sch', 'з': 'z', 'х': 'h', 'ъ': '', 'Ф': 'F', 'Ы': 'I', 'В': 'V', 'А': 'A', 'П': 'P', 'Р': 'R', 'О': 'O', 'Л': 'L', 'Д': 'D', 'Ж': 'ZH', 'Э': 'E', 'ф': 'f', 'ы': 'i', 'в': 'v', 'а': 'a', 'п': 'p', 'р': 'r', 'о': 'o', 'л': 'l', 'д': 'd', 'ж': 'zh', 'э': 'e', 'Я': 'Ya', 'Ч': 'CH', 'С': 'S', 'М': 'M', 'И': 'I', 'Т': 'T', 'Ь': '', 'Б': 'B', 'Ю': 'YU', 'я': 'ya', 'ч': 'ch', 'с': 's', 'м': 'm', 'и': 'i', 'т': 't', 'ь': '', 'б': 'b', 'ю': 'yu'}\r\n\r\n// ConfigStorage\r\n//;(function (window) {\r\n var keyPrefix = '';\r\n var noPrefix = false;\r\n var cache = {};\r\n var useCs = !!(window.chrome && chrome.storage && chrome.storage.local);\r\n var useLs = !useCs && !!window.localStorage;\r\n\r\n function storageSetPrefix(newPrefix) {\r\n keyPrefix = newPrefix;\r\n }\r\n\r\n function storageSetNoPrefix() {\r\n noPrefix = true;\r\n }\r\n\r\n function storageGetPrefix() {\r\n if(noPrefix) {\r\n noPrefix = false;\r\n return '';\r\n }\r\n\r\n return keyPrefix;\r\n }\r\n\r\n function storageGetValue(keys, callback) {\r\n var single = false;\r\n if(!Array.isArray(keys)) {\r\n keys = Array.prototype.slice.call(arguments);\r\n callback = keys.pop();\r\n single = keys.length == 1;\r\n }\r\n var result = [],\r\n value;\r\n var allFound = true;\r\n var prefix = storageGetPrefix(),\r\n i, key;\r\n\r\n for(i = 0; i < keys.length; i++) {\r\n key = keys[i] = prefix + keys[i];\r\n if(key.substr(0, 3) != 'xt_' && cache[key] !== undefined) {\r\n result.push(cache[key]);\r\n } else if(useLs) {\r\n try {\r\n value = localStorage.getItem(key);\r\n } catch(e) {\r\n useLs = false;\r\n }\r\n\r\n try {\r\n value = (value === undefined || value === null) ? false : JSON.parse(value);\r\n } catch(e) {\r\n value = false;\r\n }\r\n result.push(cache[key] = value);\r\n } else if(!useCs) {\r\n result.push(cache[key] = false);\r\n } else {\r\n allFound = false;\r\n }\r\n }\r\n\r\n if(allFound) {\r\n return callback(single ? result[0] : result);\r\n }\r\n\r\n chrome.storage.local.get(keys, function(resultObj) {\r\n var value;\r\n result = [];\r\n for(i = 0; i < keys.length; i++) {\r\n key = keys[i];\r\n value = resultObj[key];\r\n value = value === undefined || value === null ? false : JSON.parse(value);\r\n result.push(cache[key] = value);\r\n }\r\n\r\n callback(single ? result[0] : result);\r\n });\r\n }\r\n\r\n function storageSetValue(obj, callback) {\r\n var keyValues = {};\r\n var prefix = storageGetPrefix(),\r\n key, value;\r\n\r\n //console.log('storageSetValue', obj, callback, arguments);\r\n\r\n for(key in obj) {\r\n if(obj.hasOwnProperty(key)) {\r\n value = obj[key];\r\n key = prefix + key;\r\n cache[key] = value;\r\n //value = value instanceof Uint8Array ? Array.from(value) : JSON.stringify(value);\r\n value = JSON.stringify(value);\r\n if(useLs) {\r\n try {\r\n //console.log('setItem', key, value);\r\n localStorage.setItem(key, value);\r\n } catch (e) {\r\n useLs = false;\r\n }\r\n } else {\r\n keyValues[key] = value;\r\n }\r\n }\r\n }\r\n\r\n if(useLs || !useCs) {\r\n if(callback) {\r\n callback();\r\n }\r\n\r\n return;\r\n }\r\n\r\n chrome.storage.local.set(keyValues, callback);\r\n }\r\n\r\n function storageRemoveValue(keys, callback) {\r\n if(!Array.isArray(keys)) {\r\n keys = Array.prototype.slice.call(arguments)\r\n if(typeof keys[keys.length - 1] === 'function') {\r\n callback = keys.pop();\r\n }\r\n }\r\n\r\n var prefix = storageGetPrefix(),\r\n i, key;\r\n\r\n for(i = 0; i < keys.length; i++) {\r\n key = keys[i] = prefix + keys[i];\r\n delete cache[key];\r\n if(useLs) {\r\n try {\r\n localStorage.removeItem(key);\r\n } catch(e) {\r\n useLs = false;\r\n }\r\n }\r\n }\r\n\r\n if(useCs) {\r\n chrome.storage.local.remove(keys, callback);\r\n } else if(callback) {\r\n callback();\r\n }\r\n }\r\n\r\n function storageClear(callback) {\r\n if(useLs) {\r\n try {\r\n localStorage.clear();\r\n } catch (e) {\r\n useLs = false;\r\n }\r\n }\r\n\r\n if(useCs) {\r\n chrome.storage.local.clear(function() {\r\n cache = {};\r\n callback();\r\n })\r\n } else {\r\n cache = {};\r\n callback();\r\n }\r\n }\r\n\r\n \r\n\r\n window.ConfigStorage = {\r\n prefix: storageSetPrefix,\r\n noPrefix: storageSetNoPrefix,\r\n get: storageGetValue,\r\n set: storageSetValue,\r\n remove: storageRemoveValue,\r\n clear: storageClear\r\n };\r\n\r\n //window.Config = Config;\r\n\r\n Config.Storage = window.ConfigStorage;\r\n\r\n module.exports = Config;\r\n//})(this)\r\n" }, { "id": 14, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/scrollable.ts", "name": "./src/components/scrollable.ts", "index": 51, "index2": 49, "size": 10167, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "issuerId": 40, "issuerName": "./src/components/pageSignIn.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 392, "building": 505, "dependencies": 2 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../../components/scrollable", "loc": "33:37-75" }, { "moduleId": 25, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "module": "./src/components/pageIm.ts", "moduleName": "./src/components/pageIm.ts", "type": "cjs require", "userRequest": "./scrollable", "loc": "15:37-60" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "../../components/scrollable", "loc": "17:37-75" }, { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "./scrollable", "loc": "14:37-60" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../../components/scrollable", "loc": "7:37-75" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "./scrollable", "loc": "17:37-60" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../lib/utils\");\nclass Scrollable {\n /* public topObserver: IntersectionObserver;\n public isTopIntersecting: boolean;\n public bottomObserver: IntersectionObserver;\n public isBottomIntersecting: boolean; */\n constructor(el, x = false, y = true) {\n this.el = el;\n this.scrollSize = -1;\n this.size = 0;\n this.thumbSize = 0;\n this.hiddenElements = {\n up: [],\n down: []\n };\n this.paddings = { up: 0, down: 0 };\n this.onAddedBottom = null;\n this.container = document.createElement('div');\n this.container.classList.add('scrollable');\n /* this.bottomObserver = new IntersectionObserver(entries => {\n let entry = entries[0];\n \n this.isBottomIntersecting = entry.intersectionRatio > 0;\n \n // @ts-ignore\n //console.log('bottom instersection:', entry, entry.isVisible, entry.intersectionRatio, entry.isIntersecting);\n console.log('bottom intersection:', this.isBottomIntersecting);\n });\n \n this.topObserver = new IntersectionObserver(entries => {\n let entry = entries[0];\n \n this.isTopIntersecting = entry.intersectionRatio > 0;\n \n // @ts-ignore\n //console.log('top instersection:', entry, entry.isVisible, entry.intersectionRatio, entry.isIntersecting);\n console.log('top intersection:', this.isTopIntersecting);\n }); */\n if (x) {\n this.container.classList.add('scrollable-x');\n this.type = 'width';\n this.side = 'left';\n this.scrollType = 'scrollWidth';\n this.scrollSide = 'scrollLeft';\n this.clientAxis = 'clientX';\n let scrollHorizontally = (e) => {\n e = window.event || e;\n var delta = Math.max(-1, Math.min(1, (e.wheelDelta || -e.detail)));\n this.container.scrollLeft -= (delta * 20);\n e.preventDefault();\n };\n if (this.container.addEventListener) {\n // IE9, Chrome, Safari, Opera\n this.container.addEventListener(\"mousewheel\", scrollHorizontally, false);\n // Firefox\n this.container.addEventListener(\"DOMMouseScroll\", scrollHorizontally, false);\n }\n else {\n // IE 6/7/8\n // @ts-ignore\n this.container.attachEvent(\"onmousewheel\", scrollHorizontally);\n }\n }\n else if (y) {\n this.container.classList.add('scrollable-y');\n this.type = 'height';\n this.side = 'top';\n this.scrollType = 'scrollHeight';\n this.scrollSide = 'scrollTop';\n this.clientAxis = 'clientY';\n }\n else {\n throw new Error('no side for scroll');\n }\n this.thumb = document.createElement('div');\n this.thumb.className = 'scrollbar-thumb';\n // @ts-ignore\n this.thumb.style[this.type] = '30px';\n let onMouseMove = (e) => {\n let rect = this.thumb.getBoundingClientRect();\n let diff;\n // @ts-ignore\n diff = e[this.clientAxis] - rect[this.side];\n // @ts-ignore\n this.container[this.scrollSide] += diff * 0.5;\n console.log('onMouseMove', e, diff);\n utils_1.cancelEvent(e);\n };\n this.thumb.addEventListener('mousedown', () => {\n window.addEventListener('mousemove', onMouseMove);\n window.addEventListener('mouseup', () => {\n window.removeEventListener('mousemove', onMouseMove);\n }, { once: true });\n });\n this.container.addEventListener('mouseover', this.resize.bind(this));\n window.addEventListener('resize', this.resize.bind(this));\n this.paddingTopDiv = document.createElement('div');\n this.paddingTopDiv.classList.add('scroll-padding');\n this.paddingBottomDiv = document.createElement('div');\n this.paddingBottomDiv.classList.add('scroll-padding');\n this.container.addEventListener('scroll', this.onScroll.bind(this));\n //this.container.append(this.paddingTopDiv);\n Array.from(el.children).forEach(c => this.container.append(c));\n //this.container.append(this.paddingBottomDiv);\n el.append(this.container); //container.append(el);\n this.container.parentElement.append(this.thumb);\n this.resize();\n }\n resize() {\n // @ts-ignore\n this.scrollSize = this.container[this.scrollType];\n let rect = this.container.getBoundingClientRect();\n // @ts-ignore\n this.size = rect[this.type];\n if (!this.size || this.size == this.scrollSize) {\n this.thumbSize = 0;\n // @ts-ignore\n this.thumb.style[this.type] = this.thumbSize + 'px';\n return;\n }\n //if(!height) return;\n let divider = this.scrollSize / this.size / 0.5;\n this.thumbSize = this.size / divider;\n if (this.thumbSize < 20)\n this.thumbSize = 20;\n // @ts-ignore\n this.thumb.style[this.type] = this.thumbSize + 'px';\n // @ts-ignore\n //console.log('onresize', thumb.style[type], thumbHeight, height);\n }\n setVirtualContainer(el) {\n this.splitUp = el;\n this.hiddenElements.up.length = this.hiddenElements.down.length = 0;\n this.paddings.up = this.paddings.down = 0;\n if (this.paddingTopDiv.parentElement) {\n this.paddingTopDiv.style.height = '';\n this.paddingBottomDiv.style.height = '';\n }\n //this.topObserver.observe(this.paddingTopDiv);\n //this.bottomObserver.observe(this.paddingBottomDiv);\n if (el) {\n el.parentElement.insertBefore(this.paddingTopDiv, el);\n el.parentNode.insertBefore(this.paddingBottomDiv, el.nextSibling);\n }\n }\n onScroll() {\n // @ts-ignore\n //let st = container[scrollSide];\n if (this.container[this.scrollType] != this.scrollSize || this.thumbSize == 0) {\n this.resize();\n }\n // @ts-ignore\n let value = this.container[this.scrollSide] / (this.scrollSize - this.size) * 100;\n let maxValue = 100 - (this.thumbSize / this.size * 100);\n //console.log('onscroll', container.scrollHeight, thumbHeight, height, value, maxValue);\n // @ts-ignore\n this.thumb.style[this.side] = (value >= maxValue ? maxValue : value) + '%';\n if (!this.splitUp) {\n return;\n }\n let splitUp = this.splitUp;\n let children = Array.from(splitUp.children);\n let firstVisible = -1, lastVisible = -1;\n let length = children.length;\n for (let i = 0; i < length; ++i) {\n let child = children[i];\n if (utils_1.isElementInViewport(child) || utils_1.isScrolledIntoView(child)) {\n if (firstVisible < 0)\n firstVisible = i;\n lastVisible = i;\n }\n }\n //console.log('onscroll', firstVisible, lastVisible);\n if (firstVisible > 0) {\n let sliced = children.slice(0, firstVisible);\n for (let child of sliced) {\n this.paddings.up += child.scrollHeight;\n this.hiddenElements.up.push(child);\n child.parentElement.removeChild(child);\n }\n //console.log('onscroll sliced up', sliced.length);\n //sliced.forEach(child => child.style.display = 'none');\n this.paddingTopDiv.style.height = this.paddings.up + 'px';\n //console.log('onscroll need to add padding: ', paddings.up);\n }\n else if (this.hiddenElements.up.length) {\n //console.log('onscroll up', isElementInViewport(this.paddingTopDiv), isScrolledIntoView(this.paddingTopDiv), this.paddings.up);\n while ((utils_1.isElementInViewport(this.paddingTopDiv) || utils_1.isScrolledIntoView(this.paddingTopDiv)) && this.paddings.up) {\n let child = this.hiddenElements.up.pop();\n splitUp.prepend(child);\n this.paddings.up -= child.scrollHeight;\n this.paddingTopDiv.style.height = this.paddings.up + 'px';\n }\n }\n if (lastVisible < (length - 1)) {\n let sliced = children.slice(lastVisible + 1).reverse();\n for (let child of sliced) {\n this.paddings.down += child.scrollHeight;\n this.hiddenElements.down.unshift(child);\n child.parentElement.removeChild(child);\n }\n //console.log('onscroll sliced down', splitUp, sliced.length, this.paddings.down + 'px');\n this.paddingBottomDiv.style.height = this.paddings.down + 'px';\n //console.log('onscroll need to add padding: ', paddings.up);\n }\n else if (this.hiddenElements.down.length) {\n //console.log('onscroll down', isElementInViewport(this.paddingBottomDiv), \n //isScrolledIntoView(this.paddingBottomDiv), this.paddings.down, this.hiddenElements);\n while ((utils_1.isElementInViewport(this.paddingBottomDiv) || utils_1.isScrolledIntoView(this.paddingBottomDiv)) && this.paddings.down) {\n let child = this.hiddenElements.down.shift();\n if (!child) {\n this.paddings.down = 0;\n this.paddingBottomDiv.style.height = '0px';\n break;\n }\n splitUp.append(child);\n this.paddings.down -= child.scrollHeight;\n this.paddingBottomDiv.style.height = this.paddings.down + 'px';\n }\n if (this.onAddedBottom)\n this.onAddedBottom();\n }\n else {\n this.paddingBottomDiv.style.height = '0px';\n }\n //console.log('onscroll', container, firstVisible, lastVisible, hiddenElements);\n //lastScrollPos = st;\n }\n}\nexports.default = Scrollable;\n" }, { "id": 15, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "name": "./src/lib/appManagers/appMessagesManager.ts", "index": 59, "index2": 75, "size": 136177, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appMessagesManager", "loc": "25:45-76" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "./appMessagesManager", "loc": "18:45-76" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "./appMessagesManager", "loc": "20:45-76" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appMessagesManager", "loc": "9:45-76" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "./appMessagesManager", "loc": "9:45-76" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appMessagesManager", "loc": "13:45-88" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst appMessagesIDsManager_1 = __importDefault(require(\"./appMessagesIDsManager\"));\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst bin_utils_1 = require(\"../bin_utils\");\nconst mtproto_1 = require(\"../mtproto/mtproto\");\nconst apiUpdatesManager_1 = __importDefault(require(\"./apiUpdatesManager\"));\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst serverTimeManager_1 = __importDefault(require(\"../mtproto/serverTimeManager\"));\nconst apiFileManager_1 = __importDefault(require(\"../mtproto/apiFileManager\"));\nconst appDocsManager_1 = __importDefault(require(\"./appDocsManager\"));\nconst appImManager_1 = __importDefault(require(\"./appImManager\"));\nconst preloader_1 = __importDefault(require(\"../../components/preloader\"));\nconst serverTimeManager_2 = __importDefault(require(\"../mtproto/serverTimeManager\"));\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst appWebPagesManager_1 = __importDefault(require(\"./appWebPagesManager\"));\nclass AppMessagesManager {\n constructor() {\n this.messagesStorage = {};\n this.messagesForHistory = {};\n this.messagesForDialogs = {};\n this.historiesStorage = {};\n this.dialogsStorage = { count: null, dialogs: [] };\n this.pendingByRandomID = {};\n this.pendingByMessageID = {};\n this.pendingAfterMsgs = {};\n this.pendingTopMsgs = {};\n this.sendFilePromise = Promise.resolve();\n this.tempID = -1;\n this.tempFinalizeCallbacks = {};\n this.dialogsIndex = utils_1.SearchIndexManager.createIndex();\n this.cachedResults = { query: false };\n this.lastSearchFilter = {};\n this.lastSearchResults = [];\n this.needSingleMessages = [];\n this.fetchSingleMessagesTimeout = 0;\n this.fetchSingleMessagesPromise = null;\n this.incrementedMessageViews = {};\n this.needIncrementMessageViews = [];\n this.incrementMessageViewsTimeout = false;\n this.maxSeenID = 0;\n this.allDialogsLoaded = {};\n this.dialogsOffsetDate = {};\n this.pinnedIndex = 0;\n this.dialogsNum = 0;\n this.migratedFromTo = {};\n this.migratedToFrom = {};\n this.newMessagesHandlePromise = 0;\n this.newMessagesToHandle = {};\n this.newDialogsHandlePromise = 0;\n this.newDialogsToHandle = {};\n //public notificationsHandlePromise = 0;\n //public notificationsToHandle: any = {};\n this.newUpdatesAfterReloadToHandle = {};\n this.fwdMessagesPluralize = utils_1._('conversation_forwarded_X_messages');\n this.gameScorePluralize = utils_1._('conversation_scored_X');\n storage_1.default.get('max_seen_msg').then((maxID) => {\n if (maxID && !appMessagesIDsManager_1.default.getMessageIDInfo(maxID)[1]) {\n this.maxSeenID = maxID;\n }\n });\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n let update = e.detail;\n // if(update._ != 'updateUserStatus') {\n // console.log('on apiUpdate', update)\n // }\n this.handleUpdate(update);\n });\n utils_1.$rootScope.$on('webpage_updated', (e) => {\n let eventData = e.detail;\n eventData.msgs.forEach((msgID) => {\n var historyMessage = this.messagesForHistory[msgID];\n if (historyMessage) {\n historyMessage.media = {\n _: 'messageMediaWebPage',\n webpage: appWebPagesManager_1.default.wrapForHistory(eventData.id)\n };\n utils_1.$rootScope.$broadcast('message_edit', {\n peerID: this.getMessagePeer(historyMessage),\n id: historyMessage.id,\n mid: msgID,\n justMedia: true\n });\n }\n });\n });\n utils_1.$rootScope.$on('draft_updated', (e) => {\n let eventData = e.detail;\n ;\n var peerID = eventData.peerID;\n var draft = eventData.draft;\n var dialog = this.getDialogByPeerID(peerID)[0];\n if (dialog) {\n var topDate;\n if (draft && draft.date) {\n topDate = draft.date;\n }\n else {\n var channelID = appPeersManager_1.default.isChannel(peerID) ? -peerID : 0;\n var topDate = this.getMessage(dialog.top_message).date;\n if (channelID) {\n var channel = appChatsManager_1.default.getChat(channelID);\n if (!topDate || channel.date && channel.date > topDate) {\n topDate = channel.date;\n }\n }\n }\n if (!dialog.pFlags.pinned) {\n dialog.index = this.generateDialogIndex(topDate);\n }\n this.pushDialogToStorage(dialog);\n utils_1.$rootScope.$broadcast('dialog_draft', {\n peerID: peerID,\n draft: draft,\n index: dialog.index\n });\n }\n });\n }\n getInputEntities(entities) {\n var sendEntites = utils_1.copy(entities);\n sendEntites.forEach((entity) => {\n if (entity._ == 'messageEntityMentionName') {\n entity._ = 'inputMessageEntityMentionName';\n entity.user_id = appUsersManager_1.default.getUserInput(entity.user_id);\n }\n });\n return sendEntites;\n }\n editMessage(messageID, text, options = {}) {\n if (typeof (text) !== 'string' || !this.canEditMessage(messageID)) {\n return Promise.reject();\n }\n if (messageID < 0) {\n if (this.tempFinalizeCallbacks[messageID] === undefined) {\n this.tempFinalizeCallbacks[messageID] = {};\n }\n let promise = new Promise((resolve, reject) => {\n this.tempFinalizeCallbacks[messageID].edit = (mid) => {\n console.log('invoke callback', mid);\n this.editMessage(mid, text).then(resolve, reject);\n };\n });\n return promise;\n }\n var entities = [];\n text = richtextprocessor_1.RichTextProcessor.parseMarkdown(text, entities);\n var message = this.getMessage(messageID);\n var peerID = this.getMessagePeer(message);\n var flags = 0;\n let noWebPage = options.noWebPage || false;\n if (noWebPage) {\n flags |= 2;\n }\n if (text) {\n flags |= 8 | 1 << 11;\n }\n /* if(message.media) {\n flags |= 1 << 14;\n } */\n return apiManager_1.default.invokeApi('messages.editMessage', {\n flags: flags,\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n id: appMessagesIDsManager_1.default.getMessageLocalID(messageID),\n message: text,\n media: message.media,\n entities: this.getInputEntities(entities),\n no_webpage: noWebPage,\n }).then((updates) => {\n apiUpdatesManager_1.default.processUpdateMessage(updates);\n }, (error) => {\n if (error && error.type == 'MESSAGE_NOT_MODIFIED') {\n error.handled = true;\n return;\n }\n if (error && error.type == 'MESSAGE_EMPTY') {\n error.handled = true;\n }\n return Promise.reject(error);\n });\n }\n sendText(peerID, text, options = {}) {\n if (typeof (text) != 'string') {\n return;\n }\n peerID = appPeersManager_1.default.getPeerMigratedTo(peerID) || peerID;\n var entities = options.entities || [];\n if (!options.viaBotID) {\n text = richtextprocessor_1.RichTextProcessor.parseMarkdown(text, entities);\n }\n if (!text.length) {\n return;\n }\n var sendEntites = this.getInputEntities(entities);\n var messageID = this.tempID--;\n var randomID = [bin_utils_1.nextRandomInt(0xFFFFFFFF), bin_utils_1.nextRandomInt(0xFFFFFFFF)];\n var randomIDS = bin_utils_1.bigint(randomID[0]).shiftLeft(32).add(bin_utils_1.bigint(randomID[1])).toString();\n var historyStorage = this.historiesStorage[peerID];\n var flags = 0;\n var pFlags = {};\n var replyToMsgID = options.replyToMsgID;\n var isChannel = appPeersManager_1.default.isChannel(peerID);\n var isMegagroup = isChannel && appPeersManager_1.default.isMegagroup(peerID);\n var asChannel = isChannel && !isMegagroup ? true : false;\n var message;\n let noWebPage = options.noWebPage || false;\n if (historyStorage === undefined) {\n historyStorage = this.historiesStorage[peerID] = { count: null, history: [], pending: [] };\n }\n var fromID = appUsersManager_1.default.getSelf().id;\n if (peerID != fromID) {\n flags |= 2;\n pFlags.out = true;\n if (!isChannel && !appUsersManager_1.default.isBot(peerID)) {\n flags |= 1;\n pFlags.unread = true;\n }\n }\n if (replyToMsgID) {\n flags |= 8;\n }\n if (asChannel) {\n fromID = 0;\n pFlags.post = true;\n }\n else {\n flags |= 256;\n }\n message = {\n _: 'message',\n id: messageID,\n from_id: fromID,\n to_id: appPeersManager_1.default.getOutputPeer(peerID),\n flags: flags,\n pFlags: pFlags,\n date: utils_1.tsNow(true) + serverTimeManager_2.default.serverTimeOffset,\n message: text,\n random_id: randomIDS,\n reply_to_msg_id: replyToMsgID,\n via_bot_id: options.viaBotID,\n reply_markup: options.reply_markup,\n entities: entities,\n views: asChannel && 1,\n pending: true\n };\n if (options.webPage) {\n message.media = {\n _: 'messageMediaWebPage',\n webpage: options.webPage\n };\n }\n var toggleError = (on) => {\n var historyMessage = this.messagesForHistory[messageID];\n if (on) {\n message.error = true;\n if (historyMessage) {\n historyMessage.error = true;\n }\n }\n else {\n delete message.error;\n if (historyMessage) {\n delete historyMessage.error;\n }\n }\n utils_1.$rootScope.$broadcast('messages_pending');\n };\n message.send = () => {\n toggleError(false);\n var sentRequestOptions = {};\n if (this.pendingAfterMsgs[peerID]) {\n sentRequestOptions.afterMessageID = this.pendingAfterMsgs[peerID].messageID;\n }\n var flags = 0;\n if (replyToMsgID) {\n flags |= 1;\n }\n if (asChannel) {\n flags |= 16;\n }\n if (options.clearDraft) {\n flags |= 128;\n }\n if (noWebPage) {\n flags |= 2;\n }\n var apiPromise;\n if (options.viaBotID) {\n apiPromise = apiManager_1.default.invokeApi('messages.sendInlineBotResult', {\n flags: flags,\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n random_id: randomID,\n reply_to_msg_id: appMessagesIDsManager_1.default.getMessageLocalID(replyToMsgID),\n query_id: options.queryID,\n id: options.resultID\n }, sentRequestOptions);\n }\n else {\n if (sendEntites.length) {\n flags |= 8;\n }\n apiPromise = apiManager_1.default.invokeApi('messages.sendMessage', {\n flags: flags,\n no_webpage: noWebPage,\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n message: text,\n random_id: randomID,\n reply_to_msg_id: appMessagesIDsManager_1.default.getMessageLocalID(replyToMsgID),\n entities: sendEntites\n }, sentRequestOptions);\n }\n // console.log(flags, entities)\n apiPromise.then((updates) => {\n if (updates._ == 'updateShortSentMessage') {\n message.flags = updates.flags;\n message.date = updates.date;\n message.id = updates.id;\n message.media = updates.media;\n message.entities = updates.entities;\n updates = {\n _: 'updates',\n users: [],\n chats: [],\n seq: 0,\n updates: [{\n _: 'updateMessageID',\n random_id: randomIDS,\n id: updates.id\n }, {\n _: isChannel\n ? 'updateNewChannelMessage'\n : 'updateNewMessage',\n message: message,\n pts: updates.pts,\n pts_count: updates.pts_count\n }]\n };\n }\n else if (updates.updates) {\n updates.updates.forEach((update) => {\n if (update._ == 'updateDraftMessage') {\n update.local = true;\n }\n });\n }\n // Testing bad situations\n // var upd = angular.copy(updates)\n // updates.updates.splice(0, 1)\n apiUpdatesManager_1.default.processUpdateMessage(updates);\n // $timeout(function () {\n // ApiUpdatesManager.processUpdateMessage(upd)\n // }, 5000)\n }, ( /* error: any */) => {\n toggleError(true);\n }).finally(() => {\n if (this.pendingAfterMsgs[peerID] === sentRequestOptions) {\n delete this.pendingAfterMsgs[peerID];\n }\n });\n this.pendingAfterMsgs[peerID] = sentRequestOptions;\n };\n this.saveMessages([message]);\n historyStorage.pending.unshift(messageID);\n utils_1.$rootScope.$broadcast('history_append', { peerID: peerID, messageID: messageID, my: true });\n setTimeout(() => message.send(), 0);\n // setTimeout(function () {\n // message.send()\n // }, 5000)\n /* if(options.clearDraft) { // WARNING\n DraftsManager.clearDraft(peerID)\n } */\n this.pendingByRandomID[randomIDS] = [peerID, messageID];\n }\n sendFile(peerID, file, options = {}) {\n peerID = appPeersManager_1.default.getPeerMigratedTo(peerID) || peerID;\n var messageID = this.tempID--;\n var randomID = [bin_utils_1.nextRandomInt(0xFFFFFFFF), bin_utils_1.nextRandomInt(0xFFFFFFFF)];\n var randomIDS = bin_utils_1.bigint(randomID[0]).shiftLeft(32).add(bin_utils_1.bigint(randomID[1])).toString();\n var historyStorage = this.historiesStorage[peerID];\n var flags = 0;\n var pFlags = {};\n var replyToMsgID = options.replyToMsgID;\n var isChannel = appPeersManager_1.default.isChannel(peerID);\n var isMegagroup = isChannel && appPeersManager_1.default.isMegagroup(peerID);\n var asChannel = isChannel && !isMegagroup ? true : false;\n var attachType, apiFileName;\n let fileType = 'mime_type' in file ? file.mime_type : file.type;\n let fileName = file instanceof File ? file.name : '';\n let isDocument = !(file instanceof File) && !(file instanceof Blob);\n let caption = options.caption || '';\n if (caption) {\n let entities = options.entities || [];\n caption = richtextprocessor_1.RichTextProcessor.parseMarkdown(caption, entities);\n }\n let actionName = '';\n if (!options.isMedia) {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n }\n else if (isDocument) { // maybe it's a sticker\n attachType = 'document';\n apiFileName = '';\n }\n else if (['image/jpeg', 'image/png', 'image/bmp'].indexOf(fileType) >= 0) {\n attachType = 'photo';\n apiFileName = 'photo.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadPhotoAction';\n }\n else if (fileType.substr(0, 6) == 'audio/' || ['video/ogg'].indexOf(fileType) >= 0) {\n attachType = 'audio';\n apiFileName = 'audio.' + (fileType.split('/')[1] == 'ogg' ? 'ogg' : 'mp3');\n actionName = 'sendMessageUploadAudioAction';\n }\n else if (fileType.substr(0, 6) == 'video/') {\n //attachType = 'video';\n //apiFileName = 'video.mp4';\n attachType = 'document'; // last minute fix\n apiFileName = 'video.mp4';\n actionName = 'sendMessageUploadVideoAction';\n }\n else {\n attachType = 'document';\n apiFileName = 'document.' + fileType.split('/')[1];\n actionName = 'sendMessageUploadDocumentAction';\n }\n // console.log(attachType, apiFileName, file.type)\n if (historyStorage === undefined) {\n historyStorage = this.historiesStorage[peerID] = { count: null, history: [], pending: [] };\n }\n var fromID = appUsersManager_1.default.getSelf().id;\n if (peerID != fromID) {\n flags |= 2;\n pFlags.out = true;\n if (!isChannel && !appUsersManager_1.default.isBot(peerID)) {\n flags |= 1;\n pFlags.unread = true;\n }\n }\n if (replyToMsgID) {\n flags |= 8;\n }\n if (asChannel) {\n fromID = 0;\n pFlags.post = true;\n }\n else {\n flags |= 256;\n }\n let preloader = new preloader_1.default(null, true);\n var media = {\n _: 'messageMediaPending',\n type: attachType,\n file_name: fileName || apiFileName,\n size: file.size,\n file: file,\n preloader: preloader,\n w: options.width,\n h: options.height,\n progress: {\n percent: 1,\n total: file.size,\n done: 0,\n cancel: () => { }\n }\n };\n preloader.preloader.onclick = () => {\n console.log('cancelling upload', media);\n appImManager_1.default.setTyping('sendMessageCancelAction');\n media.progress.cancel();\n };\n var message = {\n _: 'message',\n id: messageID,\n from_id: fromID,\n to_id: appPeersManager_1.default.getOutputPeer(peerID),\n flags: flags,\n pFlags: pFlags,\n date: utils_1.tsNow(true) + serverTimeManager_1.default.serverTimeOffset,\n message: caption,\n media: isDocument ? {\n _: 'messageMediaDocument',\n pFlags: {},\n flags: 1,\n document: file\n } : media,\n random_id: randomIDS,\n reply_to_msg_id: replyToMsgID,\n views: asChannel && 1,\n pending: true\n };\n var toggleError = (on) => {\n var historyMessage = this.messagesForHistory[messageID];\n if (on) {\n message.error = true;\n if (historyMessage) {\n historyMessage.error = true;\n }\n }\n else {\n delete message.error;\n if (historyMessage) {\n delete historyMessage.error;\n }\n }\n utils_1.$rootScope.$broadcast('messages_pending');\n };\n var uploaded = false, uploadPromise = null;\n let invoke = (flags, inputMedia) => {\n appImManager_1.default.setTyping('sendMessageCancelAction');\n return apiManager_1.default.invokeApi('messages.sendMedia', {\n flags: flags,\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n media: inputMedia,\n message: caption,\n random_id: randomID,\n reply_to_msg_id: appMessagesIDsManager_1.default.getMessageLocalID(replyToMsgID)\n }).then((updates) => {\n apiUpdatesManager_1.default.processUpdateMessage(updates);\n }, (error) => {\n if (attachType == 'photo' &&\n error.code == 400 &&\n (error.type == 'PHOTO_INVALID_DIMENSIONS' ||\n error.type == 'PHOTO_SAVE_FILE_INVALID')) {\n error.handled = true;\n attachType = 'document';\n message.send();\n return;\n }\n toggleError(true);\n });\n };\n message.send = () => {\n let flags = 0;\n if (replyToMsgID) {\n flags |= 1;\n }\n if (asChannel) {\n flags |= 16;\n }\n if (isDocument) {\n let { id, access_hash, file_reference } = file;\n let inputMedia = {\n _: 'inputMediaDocument',\n flags: 0,\n id: {\n _: 'inputDocument',\n id: id,\n access_hash: access_hash,\n file_reference: file_reference\n }\n };\n invoke(flags, inputMedia);\n }\n else if (file instanceof File || file instanceof Blob) {\n let deferredHelper = {};\n let deferred = new Promise((resolve, reject) => {\n deferredHelper.resolve = resolve;\n deferredHelper.reject = reject;\n });\n Object.assign(deferred, deferredHelper);\n this.sendFilePromise.then(() => {\n if (!uploaded || message.error) {\n uploaded = false;\n uploadPromise = apiFileManager_1.default.uploadFile(file);\n }\n uploadPromise && uploadPromise.then((inputFile) => {\n inputFile.name = apiFileName;\n uploaded = true;\n var inputMedia;\n switch (attachType) {\n case 'photo':\n inputMedia = {\n _: 'inputMediaUploadedPhoto',\n flags: 0,\n file: inputFile\n };\n break;\n case 'document':\n default:\n inputMedia = {\n _: 'inputMediaUploadedDocument',\n file: inputFile,\n mime_type: fileType,\n caption: '',\n attributes: [\n { _: 'documentAttributeFilename', file_name: fileName }\n ]\n };\n }\n invoke(flags, inputMedia);\n }, ( /* error */) => {\n toggleError(true);\n });\n uploadPromise.notify = (progress) => {\n console.log('upload progress', progress);\n media.progress.done = progress.done;\n media.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total));\n appImManager_1.default.setTyping({ _: actionName, progress: media.progress.percent | 0 });\n preloader.setProgress(media.progress.percent); // lol, nice\n utils_1.$rootScope.$broadcast('history_update', { peerID: peerID });\n };\n media.progress.cancel = () => {\n if (!uploaded) {\n deferred.resolve();\n uploadPromise.cancel();\n this.cancelPendingMessage(randomIDS);\n }\n };\n // @ts-ignore\n uploadPromise['finally'](() => {\n deferred.resolve();\n preloader.detach();\n });\n });\n this.sendFilePromise = deferred;\n }\n };\n this.saveMessages([message]);\n historyStorage.pending.unshift(messageID);\n utils_1.$rootScope.$broadcast('history_append', { peerID: peerID, messageID: messageID, my: true });\n setTimeout(message.send.bind(this), 0);\n this.pendingByRandomID[randomIDS] = [peerID, messageID];\n }\n cancelPendingMessage(randomID) {\n var pendingData = this.pendingByRandomID[randomID];\n console.log('cancelPendingMessage', randomID, pendingData);\n if (pendingData) {\n var peerID = pendingData[0];\n var tempID = pendingData[1];\n var historyStorage = this.historiesStorage[peerID];\n var pos = historyStorage.pending.indexOf(tempID);\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updateDeleteMessages',\n messages: [tempID]\n }\n });\n if (pos != -1) {\n historyStorage.pending.splice(pos, 1);\n }\n delete this.messagesForHistory[tempID];\n delete this.messagesStorage[tempID];\n return true;\n }\n return false;\n }\n getConversation(peerID) {\n return __awaiter(this, void 0, void 0, function* () {\n var foundDialog = this.getDialogByPeerID(peerID);\n if (foundDialog.length) {\n return foundDialog[0];\n }\n return {\n peerID: peerID,\n top_message: 0,\n index: this.generateDialogIndex(this.generateDialogPinnedDate()),\n pFlags: {}\n };\n });\n }\n getConversations(query, offsetIndex, limit = 20, folderID = -1) {\n //var curDialogStorage = this.dialogsStorage;\n //var isSearch = typeof(query) == 'string' && query.length;\n let curDialogStorage = this.dialogsStorage.dialogs;\n if (folderID > 0) {\n curDialogStorage = curDialogStorage.filter(d => d.folder_id == folderID);\n }\n else {\n curDialogStorage = curDialogStorage.filter(d => d.folder_id != 1);\n }\n /* if(isSearch) {\n if(!limit || this.cachedResults.query !== query) {\n this.cachedResults.query = query;\n \n var results: any = SearchIndexManager.search(query, this.dialogsIndex);\n \n this.cachedResults.dialogs = [];\n this.dialogsStorage.dialogs.forEach((dialog: any) => {\n if(results[dialog.peerID]) {\n this.cachedResults.dialogs.push(dialog);\n }\n })\n this.cachedResults.count = this.cachedResults.dialogs.length;\n }\n curDialogStorage = this.cachedResults;\n } else { */\n this.cachedResults.query = false;\n //}\n var offset = 0;\n if (offsetIndex > 0) {\n for (; offset < curDialogStorage.length; offset++) {\n if (offsetIndex > curDialogStorage[offset].index) {\n break;\n }\n }\n }\n if ( /* isSearch || */this.allDialogsLoaded[folderID] || curDialogStorage.length >= offset + limit) {\n return Promise.resolve({\n dialogs: curDialogStorage.slice(offset, offset + limit),\n count: curDialogStorage.length\n });\n }\n return this.getTopMessages(limit, folderID).then(count => {\n let curDialogStorage = this.dialogsStorage.dialogs;\n if (folderID > 0) {\n curDialogStorage = curDialogStorage.filter(d => d.folder_id == folderID);\n }\n else {\n curDialogStorage = curDialogStorage.filter(d => d.folder_id != 1);\n }\n offset = 0;\n if (offsetIndex > 0) {\n for (offset = 0; offset < curDialogStorage.length; offset++) {\n if (offsetIndex > curDialogStorage[offset].index) {\n break;\n }\n }\n }\n //console.warn(offset, offset + limit, curDialogStorage.dialogs.length, this.dialogsStorage.dialogs.length);\n return {\n dialogs: curDialogStorage.slice(offset, offset + limit),\n count: count\n };\n });\n }\n getTopMessages(limit, folderID = -1) {\n var dialogs = this.dialogsStorage.dialogs;\n var offsetDate = 0;\n var offsetID = 0;\n var offsetPeerID = 0;\n var offsetIndex = 0;\n var flags = 0;\n if (folderID > 0) {\n dialogs = dialogs.filter(d => d.folder_id == folderID);\n }\n else {\n dialogs = dialogs.filter(d => d.folder_id != 1);\n }\n if (this.dialogsOffsetDate[folderID]) {\n offsetDate = this.dialogsOffsetDate[folderID] + serverTimeManager_2.default.serverTimeOffset;\n offsetIndex = this.dialogsOffsetDate[folderID] * 0x10000;\n flags |= 1;\n }\n if (folderID > 0) {\n flags |= 1;\n flags |= 2;\n }\n let hash = 0;\n return apiManager_1.default.invokeApi('messages.getDialogs', {\n flags: flags,\n folder_id: folderID,\n offset_date: offsetDate,\n offset_id: appMessagesIDsManager_1.default.getMessageLocalID(offsetID),\n offset_peer: appPeersManager_1.default.getInputPeerByID(offsetPeerID),\n limit: limit,\n hash: hash\n }, {\n timeout: 300\n }).then((dialogsResult) => {\n ///////console.log('messages.getDialogs result:', dialogsResult);\n if (!offsetDate) {\n mtproto_1.telegramMeWebService.setAuthorized(true);\n }\n appUsersManager_1.default.saveApiUsers(dialogsResult.users);\n appChatsManager_1.default.saveApiChats(dialogsResult.chats);\n this.saveMessages(dialogsResult.messages);\n var maxSeenIdIncremented = offsetDate ? true : false;\n var hasPrepend = false;\n //dialogsResult.dialogs.reverse();\n let length = dialogsResult.dialogs.length;\n let noIDsDialogs = {};\n for (let i = length - 1; i >= 0; --i) {\n let dialog = dialogsResult.dialogs[i];\n //}\n //dialogsResult.dialogs.forEach((dialog: any) => {\n this.saveConversation(dialog);\n if (offsetIndex && dialog.index > offsetIndex) {\n this.newDialogsToHandle[dialog.peerID] = dialog;\n hasPrepend = true;\n }\n if (!dialog.read_inbox_max_id && !dialog.read_outbox_max_id) {\n noIDsDialogs[dialog.peerID] = dialog;\n }\n if (!maxSeenIdIncremented &&\n !appPeersManager_1.default.isChannel(appPeersManager_1.default.getPeerID(dialog.peer))) {\n this.incrementMaxSeenID(dialog.top_message);\n maxSeenIdIncremented = true;\n }\n }\n //});\n //dialogsResult.dialogs.reverse();\n if (Object.keys(noIDsDialogs).length) {\n //setTimeout(() => { // test bad situation\n this.reloadConversation(Object.keys(noIDsDialogs).map(id => +id)).then(() => {\n utils_1.$rootScope.$broadcast('dialogs_multiupdate', noIDsDialogs);\n for (let peerID in noIDsDialogs) {\n utils_1.$rootScope.$broadcast('dialog_unread', { peerID: +peerID });\n }\n });\n //}, 10e3);\n }\n if (!dialogsResult.dialogs.length ||\n !dialogsResult.count ||\n dialogs.length >= dialogsResult.count) {\n this.allDialogsLoaded[folderID] = true;\n }\n if (hasPrepend && !this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n else {\n utils_1.$rootScope.$broadcast('dialogs_multiupdate', {});\n }\n return dialogsResult.count;\n });\n }\n generateDialogIndex(date) {\n if (date === undefined) {\n date = utils_1.tsNow(true) + serverTimeManager_2.default.serverTimeOffset;\n }\n return (date * 0x10000) + ((++this.dialogsNum) & 0xFFFF);\n }\n pushDialogToStorage(dialog, offsetDate) {\n var dialogs = this.dialogsStorage.dialogs /* .filter(d => d.folder_id == dialog.folder_id) */;\n var pos = this.getDialogByPeerID(dialog.peerID)[1];\n if (pos !== undefined) {\n dialogs.splice(pos, 1);\n }\n if (offsetDate &&\n !dialog.pFlags.pinned &&\n (!this.dialogsOffsetDate[dialog.folder_id] || offsetDate < this.dialogsOffsetDate[dialog.folder_id])) {\n if (pos !== undefined) {\n // So the dialog jumped to the last position\n return false;\n }\n this.dialogsOffsetDate[dialog.folder_id] = offsetDate;\n }\n var index = dialog.index;\n var i;\n var len = dialogs.length;\n if (!len || index < dialogs[len - 1].index) {\n dialogs.push(dialog);\n }\n else if (index >= dialogs[0].index) {\n dialogs.unshift(dialog);\n }\n else {\n for (i = 0; i < len; i++) {\n if (index > dialogs[i].index) {\n dialogs.splice(i, 0, dialog);\n break;\n }\n }\n }\n }\n getMessage(messageID) {\n return this.messagesStorage[messageID] || {\n _: 'messageEmpty',\n deleted: true,\n pFlags: { out: false, unread: false }\n };\n }\n getMessagePeer(message) {\n var toID = message.to_id && appPeersManager_1.default.getPeerID(message.to_id) || 0;\n if (toID < 0) {\n return toID;\n }\n else if (message.pFlags && message.pFlags.out || message.flags & 2) {\n return toID;\n }\n return message.from_id;\n }\n getDialogByPeerID(peerID) {\n let length = this.dialogsStorage.dialogs.length;\n for (var i = 0; i < length; i++) {\n if (this.dialogsStorage.dialogs[i].peerID == peerID) {\n return [this.dialogsStorage.dialogs[i], i];\n }\n }\n return [];\n }\n reloadConversation(peerID) {\n let peers = [].concat(peerID).map(peerID => appPeersManager_1.default.getInputPeerByID(peerID));\n console.log('will reloadConversation', peerID);\n return apiManager_1.default.invokeApi('messages.getPeerDialogs', {\n peers: peers\n }).then(this.applyConversations.bind(this));\n }\n saveMessages(apiMessages, options = {}) {\n apiMessages.forEach((apiMessage) => {\n if (apiMessage.pFlags === undefined) {\n apiMessage.pFlags = {};\n }\n if (!apiMessage.pFlags.out) {\n apiMessage.pFlags.out = false;\n }\n if (!apiMessage.pFlags.unread) {\n apiMessage.pFlags.unread = false;\n }\n if (apiMessage._ == 'messageEmpty') {\n return;\n }\n var peerID = this.getMessagePeer(apiMessage);\n var isChannel = apiMessage.to_id._ == 'peerChannel';\n var channelID = isChannel ? -peerID : 0;\n var isBroadcast = isChannel && appChatsManager_1.default.isBroadcast(channelID);\n var mid = appMessagesIDsManager_1.default.getFullMessageID(apiMessage.id, channelID);\n apiMessage.mid = mid;\n var dialog = this.getDialogByPeerID(peerID)[0];\n if (dialog && mid > 0) {\n let dialogKey = apiMessage.pFlags.out\n ? 'read_outbox_max_id'\n : 'read_inbox_max_id';\n apiMessage.pFlags.unread = mid > dialog[dialogKey];\n }\n else if (options.isNew) {\n apiMessage.pFlags.unread = true;\n }\n // console.log(dT(), 'msg unread', mid, apiMessage.pFlags.out, dialog && dialog[apiMessage.pFlags.out ? 'read_outbox_max_id' : 'read_inbox_max_id'])\n if (apiMessage.reply_to_msg_id) {\n apiMessage.reply_to_mid = appMessagesIDsManager_1.default.getFullMessageID(apiMessage.reply_to_msg_id, channelID);\n }\n apiMessage.date -= serverTimeManager_2.default.serverTimeOffset;\n apiMessage.peerID = peerID;\n apiMessage.fromID = apiMessage.pFlags.post ? peerID : apiMessage.from_id;\n var fwdHeader = apiMessage.fwd_from;\n if (fwdHeader) {\n if (peerID == appUsersManager_1.default.getSelf().id) {\n if (fwdHeader.saved_from_peer && fwdHeader.saved_from_msg_id) {\n var savedFromPeerID = appPeersManager_1.default.getPeerID(fwdHeader.saved_from_peer);\n var savedFromMid = appMessagesIDsManager_1.default.getFullMessageID(fwdHeader.saved_from_msg_id, appPeersManager_1.default.isChannel(savedFromPeerID) ? -savedFromPeerID : 0);\n apiMessage.savedFrom = savedFromPeerID + '_' + savedFromMid;\n }\n apiMessage.fromID = fwdHeader.channel_id ? -fwdHeader.channel_id : fwdHeader.from_id;\n }\n else {\n apiMessage.fwdPostID = fwdHeader.channel_post;\n }\n apiMessage.fwdFromID = fwdHeader.channel_id ? -fwdHeader.channel_id : fwdHeader.from_id;\n fwdHeader.date -= serverTimeManager_2.default.serverTimeOffset;\n }\n if (apiMessage.via_bot_id > 0) {\n apiMessage.viaBotID = apiMessage.via_bot_id;\n }\n var mediaContext = {\n user_id: apiMessage.fromID,\n date: apiMessage.date\n };\n if (apiMessage.media) {\n switch (apiMessage.media._) {\n case 'messageMediaEmpty':\n delete apiMessage.media;\n break;\n case 'messageMediaPhoto':\n if (apiMessage.media.ttl_seconds) {\n apiMessage.media = { _: 'messageMediaUnsupportedWeb' };\n }\n else {\n appPhotosManager_1.default.savePhoto(apiMessage.media.photo, mediaContext);\n }\n break;\n case 'messageMediaDocument':\n if (apiMessage.media.ttl_seconds) {\n apiMessage.media = { _: 'messageMediaUnsupportedWeb' };\n }\n else {\n appDocsManager_1.default.saveDoc(apiMessage.media.document, mediaContext);\n }\n break;\n case 'messageMediaWebPage':\n /* if(apiMessage.media.webpage.document) {\n appDocsManager.saveDoc(apiMessage.media.webpage.document, mediaContext);\n } */\n appWebPagesManager_1.default.saveWebPage(apiMessage.media.webpage, apiMessage.mid, mediaContext);\n break;\n /*case 'messageMediaGame':\n AppGamesManager.saveGame(apiMessage.media.game, apiMessage.mid, mediaContext);\n apiMessage.media.handleMessage = true;\n break; */\n case 'messageMediaInvoice':\n apiMessage.media = { _: 'messageMediaUnsupportedWeb' };\n break;\n case 'messageMediaGeoLive':\n apiMessage.media._ = 'messageMediaGeo';\n break;\n }\n }\n if (apiMessage.action) {\n var migrateFrom;\n var migrateTo;\n switch (apiMessage.action._) {\n case 'messageActionChatEditPhoto':\n appPhotosManager_1.default.savePhoto(apiMessage.action.photo, mediaContext);\n if (isBroadcast) {\n apiMessage.action._ = 'messageActionChannelEditPhoto';\n }\n break;\n case 'messageActionChatEditTitle':\n if (isBroadcast) {\n apiMessage.action._ = 'messageActionChannelEditTitle';\n }\n break;\n case 'messageActionChatDeletePhoto':\n if (isBroadcast) {\n apiMessage.action._ = 'messageActionChannelDeletePhoto';\n }\n break;\n case 'messageActionChatAddUser':\n if (apiMessage.action.users.length == 1) {\n apiMessage.action.user_id = apiMessage.action.users[0];\n if (apiMessage.fromID == apiMessage.action.user_id) {\n if (isChannel) {\n apiMessage.action._ = 'messageActionChatJoined';\n }\n else {\n apiMessage.action._ = 'messageActionChatReturn';\n }\n }\n }\n else if (apiMessage.action.users.length > 1) {\n apiMessage.action._ = 'messageActionChatAddUsers';\n }\n break;\n case 'messageActionChatDeleteUser':\n if (apiMessage.fromID == apiMessage.action.user_id) {\n apiMessage.action._ = 'messageActionChatLeave';\n }\n break;\n case 'messageActionChannelMigrateFrom':\n migrateFrom = -apiMessage.action.chat_id;\n migrateTo = -channelID;\n break;\n case 'messageActionChatMigrateTo':\n migrateFrom = -channelID;\n migrateTo = -apiMessage.action.channel_id;\n break;\n case 'messageActionHistoryClear':\n apiMessage.deleted = true;\n apiMessage.clear_history = true;\n apiMessage.pFlags.out = false;\n apiMessage.pFlags.unread = false;\n break;\n case 'messageActionPhoneCall':\n delete apiMessage.fromID;\n apiMessage.action.type =\n (apiMessage.pFlags.out ? 'out_' : 'in_') +\n (apiMessage.action.reason._ == 'phoneCallDiscardReasonMissed' ||\n apiMessage.action.reason._ == 'phoneCallDiscardReasonBusy'\n ? 'missed'\n : 'ok');\n break;\n }\n if (migrateFrom &&\n migrateTo &&\n !this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo]) {\n this.migrateChecks(migrateFrom, migrateTo);\n }\n }\n if (apiMessage.message && apiMessage.message.length) {\n var myEntities = richtextprocessor_1.RichTextProcessor.parseEntities(apiMessage.message);\n var apiEntities = apiMessage.entities || [];\n apiMessage.totalEntities = richtextprocessor_1.RichTextProcessor.mergeEntities(myEntities, apiEntities, !apiMessage.pending);\n }\n apiMessage.canBeEdited = this.canMessageBeEdited(apiMessage);\n if (!options.isEdited) {\n this.messagesStorage[mid] = apiMessage;\n }\n });\n }\n migrateChecks(migrateFrom, migrateTo) {\n if (!this.migratedFromTo[migrateFrom] &&\n !this.migratedToFrom[migrateTo] &&\n appChatsManager_1.default.hasChat(-migrateTo)) {\n var fromChat = appChatsManager_1.default.getChat(-migrateFrom);\n if (fromChat &&\n fromChat.migrated_to &&\n fromChat.migrated_to.channel_id == -migrateTo) {\n this.migratedFromTo[migrateFrom] = migrateTo;\n this.migratedToFrom[migrateTo] = migrateFrom;\n setTimeout(() => {\n var foundDialog = this.getDialogByPeerID(migrateFrom);\n if (foundDialog.length) {\n this.dialogsStorage.dialogs.splice(foundDialog[1], 1);\n utils_1.$rootScope.$broadcast('dialog_drop', { peerID: migrateFrom });\n }\n utils_1.$rootScope.$broadcast('dialog_migrate', { migrateFrom: migrateFrom, migrateTo: migrateTo });\n }, 100);\n }\n }\n }\n canMessageBeEdited(message) {\n var goodMedias = [\n 'messageMediaPhoto',\n 'messageMediaDocument',\n 'messageMediaWebPage',\n 'messageMediaPending'\n ];\n if (message._ != 'message' ||\n message.deleted ||\n message.fwd_from ||\n message.via_bot_id ||\n message.media && goodMedias.indexOf(message.media._) == -1 ||\n message.fromID && appUsersManager_1.default.isBot(message.fromID)) {\n return false;\n }\n if (message.media &&\n message.media._ == 'messageMediaDocument' &&\n message.media.document.sticker) {\n return false;\n }\n return true;\n }\n canEditMessage(messageID) {\n if (!this.messagesStorage[messageID]) {\n return false;\n }\n var message = this.messagesStorage[messageID];\n if (!message ||\n !message.canBeEdited) {\n return false;\n }\n if (this.getMessagePeer(message) == appUsersManager_1.default.getSelf().id) {\n return true;\n }\n if (message.date < utils_1.tsNow(true) - 2 * 86400 ||\n !message.pFlags.out) {\n return false;\n }\n return true;\n }\n applyConversations(dialogsResult) {\n appUsersManager_1.default.saveApiUsers(dialogsResult.users);\n appChatsManager_1.default.saveApiChats(dialogsResult.chats);\n this.saveMessages(dialogsResult.messages);\n //console.log('applyConversation', dialogsResult);\n var updatedDialogs = {};\n var hasUpdated = false;\n dialogsResult.dialogs.forEach((dialog) => {\n var peerID = appPeersManager_1.default.getPeerID(dialog.peer);\n var topMessage = dialog.top_message;\n var topPendingMesage = this.pendingTopMsgs[peerID];\n if (topPendingMesage) {\n if (!topMessage || this.getMessage(topPendingMesage).date > this.getMessage(topMessage).date) {\n dialog.top_message = topMessage = topPendingMesage;\n }\n }\n if (topMessage) {\n let wasDialogBefore = this.getDialogByPeerID(peerID)[0];\n // here need to just replace, not FULL replace dialog! WARNING\n if (wasDialogBefore && wasDialogBefore.pFlags && wasDialogBefore.pFlags.pinned) {\n if (!dialog.pFlags)\n dialog.pFlags = {};\n dialog.pFlags.pinned = true;\n dialog.pinnedIndex = wasDialogBefore.pinnedIndex;\n }\n this.saveConversation(dialog);\n if (wasDialogBefore) {\n this.clearDialogCache(topMessage);\n utils_1.$rootScope.$broadcast('dialog_top', dialog);\n }\n else {\n updatedDialogs[peerID] = dialog;\n hasUpdated = true;\n }\n }\n else {\n var foundDialog = this.getDialogByPeerID(peerID);\n if (foundDialog.length) {\n this.dialogsStorage.dialogs.splice(foundDialog[1], 1);\n utils_1.$rootScope.$broadcast('dialog_drop', { peerID: peerID });\n }\n }\n if (this.newUpdatesAfterReloadToHandle[peerID] !== undefined) {\n for (let i in this.newUpdatesAfterReloadToHandle[peerID]) {\n let update = this.newUpdatesAfterReloadToHandle[peerID][i];\n this.handleUpdate(update);\n }\n delete this.newUpdatesAfterReloadToHandle[peerID];\n }\n });\n if (hasUpdated) {\n utils_1.$rootScope.$broadcast('dialogs_multiupdate', updatedDialogs);\n }\n }\n clearDialogCache(msgID) {\n delete this.messagesForDialogs[msgID];\n }\n saveConversation(dialog) {\n var peerID = appPeersManager_1.default.getPeerID(dialog.peer);\n if (!peerID) {\n return false;\n }\n var channelID = appPeersManager_1.default.isChannel(peerID) ? -peerID : 0;\n var peerText = appPeersManager_1.default.getPeerSearchText(peerID);\n utils_1.SearchIndexManager.indexObject(peerID, peerText, this.dialogsIndex);\n //var isMegagroup = AppPeersManager.isMegagroup(channelID);\n if (dialog.top_message) {\n var mid = appMessagesIDsManager_1.default.getFullMessageID(dialog.top_message, channelID);\n var message = this.getMessage(mid);\n }\n else {\n var mid = this.tempID--;\n var message = {\n _: 'message',\n id: mid,\n mid: mid,\n from_id: appUsersManager_1.default.getSelf().id,\n to_id: appPeersManager_1.default.getOutputPeer(peerID),\n deleted: true,\n flags: 0,\n pFlags: { unread: false, out: true },\n date: 0,\n message: ''\n };\n this.saveMessages([message]);\n }\n var offsetDate = message.date;\n if (!channelID && peerID < 0) {\n var chat = appChatsManager_1.default.getChat(-peerID);\n if (chat && chat.migrated_to && chat.pFlags.deactivated) {\n var migratedToPeer = appPeersManager_1.default.getPeerID(chat.migrated_to);\n this.migratedFromTo[peerID] = migratedToPeer;\n this.migratedToFrom[migratedToPeer] = peerID;\n return;\n }\n }\n dialog.top_message = mid;\n dialog.read_inbox_max_id = appMessagesIDsManager_1.default.getFullMessageID(dialog.read_inbox_max_id, channelID);\n dialog.read_outbox_max_id = appMessagesIDsManager_1.default.getFullMessageID(dialog.read_outbox_max_id, channelID);\n var topDate = message.date;\n if (channelID) {\n var channel = appChatsManager_1.default.getChat(channelID);\n if (!topDate || channel.date && channel.date > topDate) {\n topDate = channel.date;\n }\n }\n var savedDraft = {}; // DraftsManager.saveDraft(peerID, dialog.draft); // warning\n if (savedDraft && savedDraft.date > topDate) {\n topDate = savedDraft.date;\n }\n if (dialog.pFlags.pinned) {\n topDate = this.generateDialogPinnedDate(dialog);\n //console.log('topDate', peerID, topDate);\n }\n dialog.index = this.generateDialogIndex(topDate);\n dialog.peerID = peerID;\n if (!dialog.folder_id)\n dialog.folder_id = 0;\n this.pushDialogToStorage(dialog, offsetDate);\n // Because we saved message without dialog present\n var unreadKey = message.pFlags.out ? 'read_outbox_max_id' : 'read_inbox_max_id';\n if (message.mid > 0) {\n if (message.mid > dialog[unreadKey])\n message.pFlags.unread = true;\n else\n message.pFlags.unread = false;\n }\n if (this.historiesStorage[peerID] === undefined && !message.deleted) {\n var historyStorage = { count: null, history: [], pending: [] };\n historyStorage[mid > 0 ? 'history' : 'pending'].push(mid);\n if (mid < 0 && message.pFlags.unread) {\n dialog.unread_count++;\n }\n this.historiesStorage[peerID] = historyStorage;\n if (this.mergeReplyKeyboard(historyStorage, message)) {\n utils_1.$rootScope.$broadcast('history_reply_markup', { peerID: peerID });\n }\n }\n //NotificationsManager.savePeerSettings(peerID, dialog.notify_settings); // warning\n /* if(dialog.pts || dialog.pFlags.pts) {\n console.warn('dialog pts!', dialog, dialog.pts);\n } */\n if (channelID && dialog.pts) {\n apiUpdatesManager_1.default.addChannelState(channelID, dialog.pts);\n }\n /*if(Config.Modes.packed && !channelID && dialog.unread_count > 0 &&\n this.maxSeenID && dialog.top_message > this.maxSeenID &&\n message.pFlags.unread && !message.pFlags.out) {\n var notifyPeer = message.flags & 16 ? message.from_id : peerID\n NotificationsManager.getPeerMuted(notifyPeer).then((muted: any) => {\n if(!muted) {\n this.notifyAboutMessage(message);\n }\n });\n }*/ // WARNING\n }\n /*public handleNotifications() {\n clearTimeout(this.notificationsHandlePromise);\n this.notificationsHandlePromise = 0;\n \n var timeout = $rootScope.idle.isIDLE /* && StatusManager.isOtherDeviceActive() * ? 30000 : 1000;\n Object.keys(this.notificationsToHandle).forEach((key: any) => {\n let notifyPeerToHandle = this.notificationsToHandle[key];\n notifyPeerToHandle.isMutedPromise.then((muted: boolean) => {\n var topMessage = notifyPeerToHandle.top_message\n if(muted ||\n !topMessage.pFlags.unread) {\n return;\n }\n \n setTimeout(() => {\n if(topMessage.pFlags.unread) {\n this.notifyAboutMessage(topMessage, {\n fwd_count: notifyPeerToHandle.fwd_count\n });\n }\n }, timeout);\n });\n });\n \n this.notificationsToHandle = {};\n }*/\n /*public notifyAboutMessage(message: any, options: any = {}) {\n var peerID = this.getMessagePeer(message);\n var peerString: string;\n var notification: any = {};\n var notificationMessage = '',\n notificationPhoto;\n \n var notifySettings: any = {}; //NotificationsManager.getNotifySettings(); // warning\n \n if(message.fwdFromID && options.fwd_count) {\n notificationMessage = options.fwd_count;// this.fwdMessagesPluralize(options.fwd_count); // warning\n } else if(message.message) {\n if(notifySettings.nopreview) {\n notificationMessage = 'conversation_message_sent';\n } else {\n notificationMessage = RichTextProcessor.wrapPlainText(message.message);\n }\n } else if(message.media) {\n var captionEmoji = '';\n switch (message.media._) {\n case 'messageMediaPhoto':\n notificationMessage = _('conversation_media_photo_raw');\n captionEmoji = 'рџ–ј';\n break\n case 'messageMediaDocument':\n switch (message.media.document.type) {\n case 'gif':\n notificationMessage = _('conversation_media_gif_raw');\n captionEmoji = 'рџЋ¬'\n break\n case 'sticker':\n notificationMessage = _('conversation_media_sticker');\n var stickerEmoji = message.media.document.stickerEmojiRaw;\n if(stickerEmoji !== undefined) {\n notificationMessage = RichTextProcessor.wrapPlainText(stickerEmoji) + ' ' + notificationMessage;\n }\n break;\n case 'video':\n notificationMessage = _('conversation_media_video_raw');\n captionEmoji = 'рџ“№';\n break;\n case 'round':\n notificationMessage = _('conversation_media_round_raw');\n captionEmoji = 'рџ“№';\n break;\n case 'voice':\n case 'audio':\n notificationMessage = _('conversation_media_audio_raw');\n break;\n default:\n if(message.media.document.file_name) {\n notificationMessage = RichTextProcessor.wrapPlainText('рџ“Ћ ' + message.media.document.file_name);\n } else {\n notificationMessage = _('conversation_media_document_raw');\n captionEmoji = 'рџ“Ћ';\n }\n break;\n }\n break;\n \n case 'messageMediaGeo':\n case 'messageMediaVenue':\n notificationMessage = _('conversation_media_location_raw');\n captionEmoji = 'рџ“Ќ';\n break;\n case 'messageMediaContact':\n notificationMessage = _('conversation_media_contact_raw');\n break;\n case 'messageMediaGame':\n notificationMessage = RichTextProcessor.wrapPlainText('рџЋ® ' + message.media.game.title);\n break;\n case 'messageMediaUnsupported':\n notificationMessage = _('conversation_media_unsupported_raw');\n break;\n default:\n notificationMessage = _('conversation_media_attachment_raw');\n break;\n }\n \n if(captionEmoji != '' &&\n message.media.caption) {\n notificationMessage = RichTextProcessor.wrapPlainText(captionEmoji + ' ' + message.media.caption);\n }\n } else if(message._ == 'messageService') {\n switch(message.action._) {\n case 'messageActionChatCreate':\n notificationMessage = _('conversation_group_created_raw');\n break\n case 'messageActionChatEditTitle':\n notificationMessage = _('conversation_group_renamed_raw');\n break\n case 'messageActionChatEditPhoto':\n notificationMessage = _('conversation_group_photo_updated_raw');\n break\n case 'messageActionChatDeletePhoto':\n notificationMessage = _('conversation_group_photo_removed_raw');\n break\n case 'messageActionChatAddUser':\n case 'messageActionChatAddUsers':\n notificationMessage = _('conversation_invited_user_message_raw');\n break\n case 'messageActionChatReturn':\n notificationMessage = _('conversation_returned_to_group_raw');\n break\n case 'messageActionChatJoined':\n notificationMessage = _('conversation_joined_group_raw');\n break\n case 'messageActionChatDeleteUser':\n notificationMessage = _('conversation_kicked_user_message_raw');\n break\n case 'messageActionChatLeave':\n notificationMessage = _('conversation_left_group_raw');\n break\n case 'messageActionChatJoinedByLink':\n notificationMessage = _('conversation_joined_by_link_raw');\n break\n case 'messageActionChannelCreate':\n notificationMessage = _('conversation_created_channel_raw');\n break\n case 'messageActionChannelEditTitle':\n notificationMessage = _('conversation_changed_channel_name_raw');\n break\n case 'messageActionChannelEditPhoto':\n notificationMessage = _('conversation_changed_channel_photo_raw')\n break\n case 'messageActionChannelDeletePhoto':\n notificationMessage = _('conversation_removed_channel_photo_raw')\n break\n case 'messageActionPinMessage':\n notificationMessage = _('conversation_pinned_message_raw')\n break\n case 'messageActionGameScore':\n notificationMessage = message.action.score;//this.gameScorePluralize(message.action.score); // warning\n break\n \n case 'messageActionPhoneCall':\n switch(message.action.type) {\n case 'out_missed':\n notificationMessage = _('message_service_phonecall_canceled_raw')\n break\n case 'in_missed':\n notificationMessage = _('message_service_phonecall_missed_raw')\n break\n case 'out_ok':\n notificationMessage = _('message_service_phonecall_outgoing_raw')\n break\n case 'in_ok':\n notificationMessage = _('message_service_phonecall_incoming_raw')\n break\n }\n break\n }\n }\n \n if(peerID > 0) {\n var fromUser = appUsersManager.getUser(message.from_id);\n var fromPhoto = appUsersManager.getUserPhoto(message.from_id);\n \n notification.title = (fromUser.first_name || '') +\n (fromUser.first_name && fromUser.last_name ? ' ' : '') +\n (fromUser.last_name || '')\n if(!notification.title) {\n notification.title = fromUser.phone || _('conversation_unknown_user_raw')\n }\n \n notificationPhoto = fromPhoto\n \n peerString = appUsersManager.getUserString(peerID)\n } else {\n notification.title = appChatsManager.getChat(-peerID).title || _('conversation_unknown_chat_raw')\n \n if(message.from_id > 0) {\n var fromUser = appUsersManager.getUser(message.from_id)\n notification.title = (fromUser.first_name || fromUser.last_name || _('conversation_unknown_user_raw')) +\n ' @ ' +\n notification.title\n }\n \n notificationPhoto = appChatsManager.getChatPhoto(-peerID)\n \n peerString = appChatsManager.getChatString(-peerID)\n }\n \n notification.title = RichTextProcessor.wrapPlainText(notification.title)\n \n notification.onclick = function () {\n $rootScope.$broadcast('history_focus', {\n peerString: peerString,\n messageID: message.flags & 16 ? message.mid : 0\n })\n }\n \n notification.message = notificationMessage\n notification.key = 'msg' + message.mid\n notification.tag = peerString\n notification.silent = message.pFlags.silent || false\n \n if(notificationPhoto.location && !notificationPhoto.location.empty) {\n apiFileManager.downloadSmallFile(notificationPhoto.location/* , notificationPhoto.size *)\n .then((blob) => {\n if(message.pFlags.unread) {\n notification.image = blob\n // NotificationsManager.notify(notification) // warning\n }\n })\n } else {\n // NotificationsManager.notify(notification) // warning\n }\n }*/\n mergeReplyKeyboard(historyStorage, message) {\n // console.log('merge', message.mid, message.reply_markup, historyStorage.reply_markup)\n if (!message.reply_markup &&\n !message.pFlags.out &&\n !message.action) {\n return false;\n }\n if (message.reply_markup &&\n message.reply_markup._ == 'replyInlineMarkup') {\n return false;\n }\n var messageReplyMarkup = message.reply_markup;\n var lastReplyMarkup = historyStorage.reply_markup;\n if (messageReplyMarkup) {\n if (lastReplyMarkup && lastReplyMarkup.mid >= message.mid) {\n return false;\n }\n if (messageReplyMarkup.pFlags.selective &&\n !(message.flags & 16)) {\n return false;\n }\n if (historyStorage.maxOutID &&\n message.mid < historyStorage.maxOutID &&\n messageReplyMarkup.pFlags.single_use) {\n messageReplyMarkup.pFlags.hidden = true;\n }\n messageReplyMarkup = Object.assign({\n mid: message.mid\n }, messageReplyMarkup);\n if (messageReplyMarkup._ != 'replyKeyboardHide') {\n messageReplyMarkup.fromID = message.from_id;\n }\n historyStorage.reply_markup = messageReplyMarkup;\n // console.log('set', historyStorage.reply_markup)\n return true;\n }\n if (message.pFlags.out) {\n if (lastReplyMarkup) {\n if (lastReplyMarkup.pFlags.single_use &&\n !lastReplyMarkup.pFlags.hidden &&\n (message.mid > lastReplyMarkup.mid || message.mid < 0) &&\n message.message) {\n lastReplyMarkup.pFlags.hidden = true;\n // console.log('set', historyStorage.reply_markup)\n return true;\n }\n }\n else if (!historyStorage.maxOutID ||\n message.mid > historyStorage.maxOutID) {\n historyStorage.maxOutID = message.mid;\n }\n }\n if (message.action &&\n message.action._ == 'messageActionChatDeleteUser' &&\n (lastReplyMarkup\n ? message.action.user_id == lastReplyMarkup.fromID\n : appUsersManager_1.default.isBot(message.action.user_id))) {\n historyStorage.reply_markup = {\n _: 'replyKeyboardHide',\n mid: message.mid,\n flags: 0,\n pFlags: {}\n };\n // console.log('set', historyStorage.reply_markup)\n return true;\n }\n return false;\n }\n getSearch(peerID = 0, query = '', inputFilter = { _: 'inputMessagesFilterEmpty' }, maxID, limit, offsetRate = 0) {\n //peerID = peerID ? parseInt(peerID) : 0;\n var foundMsgs = [];\n var useSearchCache = !query;\n var newSearchFilter = { peer: peerID, filter: inputFilter };\n var sameSearchCache = useSearchCache\n && utils_1.deepEqual(this.lastSearchFilter, newSearchFilter); //angular.equals(this.lastSearchFilter, newSearchFilter);\n if (useSearchCache && !sameSearchCache) {\n // console.warn(dT(), 'new search filter', lastSearchFilter, newSearchFilter)\n this.lastSearchFilter = newSearchFilter;\n this.lastSearchResults = [];\n }\n //console.log(dT(), 'search', useSearchCache, sameSearchCache, this.lastSearchResults, maxID);\n if (peerID && !maxID && !query) {\n var historyStorage = this.historiesStorage[peerID];\n if (historyStorage !== undefined && historyStorage.history.length) {\n var neededContents = {}, neededDocType;\n var neededLimit = limit || 20;\n var message;\n switch (inputFilter._) {\n case 'inputMessagesFilterPhotos':\n neededContents['messageMediaPhoto'] = true;\n break;\n case 'inputMessagesFilterPhotoVideo':\n neededContents['messageMediaPhoto'] = true;\n neededContents['messageMediaDocument'] = true;\n neededDocType = 'video';\n break;\n case 'inputMessagesFilterVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocType = 'video';\n break;\n case 'inputMessagesFilterDocument':\n neededContents['messageMediaDocument'] = true;\n neededDocType = false;\n break;\n case 'inputMessagesFilterVoice':\n neededContents['messageMediaDocument'] = true;\n neededDocType = 'voice';\n break;\n case 'inputMessagesFilterRoundVideo':\n neededContents['messageMediaDocument'] = true;\n neededDocType = 'round';\n break;\n case 'inputMessagesFilterMusic':\n neededContents['messageMediaDocument'] = true;\n neededDocType = 'audio';\n break;\n case 'inputMessagesFilterUrl':\n neededContents['url'] = true;\n break;\n case 'inputMessagesFilterMyMentions':\n neededContents['mentioned'] = true;\n break;\n default:\n return Promise.resolve({\n count: 0,\n next_rate: 0,\n history: []\n });\n }\n for (let i = 0; i < historyStorage.history.length; i++) {\n message = this.messagesStorage[historyStorage.history[i]];\n if (message.media && neededContents[message.media._]) {\n if (neededDocType !== undefined &&\n message.media._ == 'messageMediaDocument' &&\n message.media.document.type != neededDocType) {\n continue;\n }\n foundMsgs.push(message.mid);\n if (foundMsgs.length >= neededLimit) {\n break;\n }\n }\n }\n }\n // console.warn(dT(), 'before append', foundMsgs)\n if (foundMsgs.length < neededLimit && this.lastSearchResults.length && sameSearchCache) {\n var minID = foundMsgs.length ? foundMsgs[foundMsgs.length - 1] : false;\n for (let i = 0; i < this.lastSearchResults.length; i++) {\n if (minID === false || this.lastSearchResults[i] < minID) {\n foundMsgs.push(this.lastSearchResults[i]);\n if (foundMsgs.length >= neededLimit) {\n break;\n }\n }\n }\n }\n // console.warn(dT(), 'after append', foundMsgs)\n }\n if (foundMsgs.length || limit == 1000) {\n if (useSearchCache) {\n this.lastSearchResults = utils_1.listMergeSorted(this.lastSearchResults, foundMsgs);\n }\n return Promise.resolve({\n count: 0,\n next_rate: 0,\n history: foundMsgs\n });\n }\n var apiPromise;\n if (peerID || !query) {\n apiPromise = apiManager_1.default.invokeApi('messages.search', {\n flags: 0,\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n q: query || '',\n filter: inputFilter || { _: 'inputMessagesFilterEmpty' },\n min_date: 0,\n max_date: 0,\n limit: limit || 20,\n offset_id: appMessagesIDsManager_1.default.getMessageLocalID(maxID) || 0,\n add_offset: 0,\n max_id: 0,\n min_id: 0\n }, {\n timeout: 300,\n noErrorBox: true\n });\n }\n else {\n var offsetDate = 0;\n var offsetPeerID = 0;\n var offsetID = 0;\n var offsetMessage = maxID && this.getMessage(maxID);\n if (offsetMessage && offsetMessage.date) {\n offsetDate = offsetMessage.date + serverTimeManager_1.default.serverTimeOffset;\n offsetID = offsetMessage.id;\n offsetPeerID = this.getMessagePeer(offsetMessage);\n }\n apiPromise = apiManager_1.default.invokeApi('messages.searchGlobal', {\n q: query,\n offset_rate: offsetRate,\n offset_peer: appPeersManager_1.default.getInputPeerByID(offsetPeerID),\n offset_id: appMessagesIDsManager_1.default.getMessageLocalID(offsetID),\n limit: limit || 20\n }, {\n timeout: 300,\n noErrorBox: true\n });\n }\n return apiPromise.then((searchResult) => {\n appUsersManager_1.default.saveApiUsers(searchResult.users);\n appChatsManager_1.default.saveApiChats(searchResult.chats);\n this.saveMessages(searchResult.messages);\n ///////////console.log('messages.search result:', searchResult);\n var foundCount = searchResult.count || searchResult.messages.length;\n foundMsgs = [];\n searchResult.messages.forEach((message) => {\n var peerID = this.getMessagePeer(message);\n if (peerID < 0) {\n var chat = appChatsManager_1.default.getChat(-peerID);\n if (chat.migrated_to) {\n this.migrateChecks(peerID, -chat.migrated_to.channel_id);\n }\n }\n foundMsgs.push(message.mid);\n });\n if (useSearchCache &&\n (!maxID || sameSearchCache && this.lastSearchResults.indexOf(maxID) >= 0)) {\n this.lastSearchResults = utils_1.listMergeSorted(this.lastSearchResults, foundMsgs);\n }\n // console.log(dT(), 'after API', foundMsgs, lastSearchResults)\n return {\n count: foundCount,\n next_rate: searchResult.next_rate,\n history: foundMsgs\n };\n }, (error) => {\n if (error.code == 400) {\n error.handled = true;\n }\n return Promise.reject(error);\n });\n }\n generateDialogPinnedDate(dialog) {\n let pinnedIndex;\n if (dialog) {\n if (dialog.pinnedIndex) {\n pinnedIndex = dialog.pinnedIndex;\n }\n else {\n dialog.pinnedIndex = pinnedIndex = this.pinnedIndex++;\n }\n }\n else {\n pinnedIndex = this.pinnedIndex++;\n }\n return 0x7fffff00 + (pinnedIndex & 0xff);\n }\n handleNewMessages() {\n clearTimeout(this.newMessagesHandlePromise);\n this.newMessagesHandlePromise = 0;\n utils_1.$rootScope.$broadcast('history_multiappend', this.newMessagesToHandle);\n this.newMessagesToHandle = {};\n }\n handleNewDialogs() {\n clearTimeout(this.newDialogsHandlePromise);\n this.newDialogsHandlePromise = 0;\n var newMaxSeenID = 0;\n Object.keys(this.newDialogsToHandle).forEach((peerID) => {\n let dialog = this.newDialogsToHandle[peerID];\n if (dialog.reload) {\n this.reloadConversation(+peerID);\n delete this.newDialogsToHandle[peerID];\n }\n else {\n this.pushDialogToStorage(dialog);\n if (!appPeersManager_1.default.isChannel(+peerID)) {\n newMaxSeenID = Math.max(newMaxSeenID, dialog.top_message || 0);\n }\n }\n });\n if (newMaxSeenID != 0) {\n this.incrementMaxSeenID(newMaxSeenID);\n }\n utils_1.$rootScope.$broadcast('dialogs_multiupdate', this.newDialogsToHandle);\n this.newDialogsToHandle = {};\n }\n readHistory(peerID, maxID = 0, minID = 0) {\n // console.trace('start read')\n var isChannel = appPeersManager_1.default.isChannel(peerID);\n var historyStorage = this.historiesStorage[peerID];\n var foundDialog = this.getDialogByPeerID(peerID)[0];\n if (!foundDialog || !foundDialog.unread_count) {\n if (!historyStorage || !historyStorage.history.length) {\n return Promise.resolve(false);\n }\n let messageID, message;\n let foundUnread = false;\n for (let i = historyStorage.history.length; i >= 0; i--) {\n messageID = historyStorage.history[i];\n message = this.messagesStorage[messageID];\n if (message && !message.pFlags.out && message.pFlags.unread) {\n foundUnread = true;\n break;\n }\n }\n if (!foundUnread) {\n return Promise.resolve(false);\n }\n }\n if (historyStorage.readPromise) {\n return historyStorage.readPromise;\n }\n var apiPromise;\n if (isChannel) {\n apiPromise = apiManager_1.default.invokeApi('channels.readHistory', {\n channel: appChatsManager_1.default.getChannelInput(-peerID),\n max_id: maxID\n });\n }\n else {\n apiPromise = apiManager_1.default.invokeApi('messages.readHistory', {\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n max_id: maxID\n }).then((affectedMessages) => {\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n }\n });\n });\n }\n historyStorage.readPromise = apiPromise.then(() => {\n if (foundDialog) {\n // console.log('done read history', peerID)\n let index = -1;\n if (maxID != 0 && historyStorage && historyStorage.history.length) {\n index = historyStorage.history.findIndex((mid) => mid == maxID);\n }\n foundDialog.unread_count = index == -1 ? 0 : index;\n ////////console.log('readHistory set unread_count to:', foundDialog.unread_count, foundDialog);\n utils_1.$rootScope.$broadcast('dialog_unread', { peerID: peerID, count: foundDialog.unread_count });\n utils_1.$rootScope.$broadcast('messages_read');\n if (historyStorage && historyStorage.history.length) {\n ////////console.warn('readPromise:', index, historyStorage.history[index != -1 ? index : 0]);\n foundDialog.read_inbox_max_id = historyStorage.history[index != -1 ? index : 0];\n }\n return true;\n }\n return false;\n /* if(foundDialog) {\n // console.log('done read history', peerID)\n foundDialog.unread_count = 0\n $rootScope.$broadcast('dialog_unread', {peerID: peerID, count: 0})\n $rootScope.$broadcast('messages_read')\n if(historyStorage && historyStorage.history.length) {\n foundDialog.read_inbox_max_id = historyStorage.history[0]\n }\n } */\n }).finally(() => {\n delete historyStorage.readPromise;\n });\n if (historyStorage && historyStorage.history.length) {\n let messageID;\n let message, i;\n for (i = 0; i < historyStorage.history.length; i++) {\n messageID = historyStorage.history[i];\n message = this.messagesStorage[messageID];\n if (message && !message.pFlags.out) {\n message.pFlags.unread = false;\n if (this.messagesForHistory[messageID]) {\n this.messagesForHistory[messageID].pFlags.unread = false;\n }\n if (this.messagesForDialogs[messageID]) {\n this.messagesForDialogs[messageID].pFlags.unread = false;\n }\n //NotificationsManager.cancel('msg' + messageID); // warning\n }\n if (messageID == minID)\n break;\n }\n }\n // NotificationsManager.soundReset(AppPeersManager.getPeerString(peerID)) // warning\n return historyStorage.readPromise;\n }\n readMessages(messageIDs) {\n var splitted = appMessagesIDsManager_1.default.splitMessageIDsByChannels(messageIDs);\n Object.keys(splitted.msgIDs).forEach((channelID) => {\n channelID = +channelID;\n let msgIDs = splitted.msgIDs[channelID];\n if (channelID > 0) {\n apiManager_1.default.invokeApi('channels.readMessageContents', {\n channel: appChatsManager_1.default.getChannelInput(channelID),\n id: msgIDs\n }).then(() => {\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updateChannelReadMessagesContents',\n channel_id: channelID,\n messages: msgIDs\n }\n });\n });\n }\n else {\n apiManager_1.default.invokeApi('messages.readMessageContents', {\n id: msgIDs\n }).then((affectedMessages) => {\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updateReadMessagesContents',\n messages: msgIDs,\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n }\n });\n });\n }\n });\n }\n handleUpdate(update) {\n //console.log('AMM: handleUpdate:', update._);\n switch (update._) {\n case 'updateMessageID': {\n var randomID = update.random_id;\n var pendingData = this.pendingByRandomID[randomID];\n if (pendingData) {\n var peerID = pendingData[0];\n var tempID = pendingData[1];\n var channelID = appPeersManager_1.default.isChannel(peerID) ? -peerID : 0;\n var mid = appMessagesIDsManager_1.default.getFullMessageID(update.id, channelID);\n var message = this.messagesStorage[mid];\n if (message) {\n var historyStorage = this.historiesStorage[peerID];\n var pos = historyStorage.pending.indexOf(tempID);\n if (pos != -1) {\n historyStorage.pending.splice(pos, 1);\n }\n delete this.messagesForHistory[tempID];\n delete this.messagesStorage[tempID];\n var msgs = {};\n msgs[tempID] = true;\n //$rootScope.$broadcast('history_delete', {peerID: peerID, msgs: msgs}); // commented 11.02.2020\n this.finalizePendingMessageCallbacks(tempID, mid);\n }\n else {\n this.pendingByMessageID[mid] = randomID;\n }\n }\n break;\n }\n case 'updateNewMessage':\n case 'updateNewChannelMessage': {\n var message = update.message;\n var peerID = this.getMessagePeer(message);\n var historyStorage = this.historiesStorage[peerID];\n var foundDialog = this.getDialogByPeerID(peerID);\n if (!foundDialog.length) {\n this.newDialogsToHandle[peerID] = { reload: true };\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n if (this.newUpdatesAfterReloadToHandle[peerID] === undefined) {\n this.newUpdatesAfterReloadToHandle[peerID] = [];\n }\n this.newUpdatesAfterReloadToHandle[peerID].push(update);\n break;\n }\n if (update._ == 'updateNewChannelMessage') {\n var chat = appChatsManager_1.default.getChat(-peerID);\n if (chat.pFlags && (chat.pFlags.left || chat.pFlags.kicked)) {\n break;\n }\n }\n this.saveMessages([message], { isNew: true });\n // console.warn(dT(), 'message unread', message.mid, message.pFlags.unread)\n if (historyStorage === undefined) {\n historyStorage = this.historiesStorage[peerID] = {\n count: null,\n history: [],\n pending: []\n };\n }\n var history = message.mid > 0 ? historyStorage.history : historyStorage.pending;\n if (history.indexOf(message.mid) != -1) {\n return false;\n }\n var topMsgID = history[0];\n history.unshift(message.mid);\n if (message.mid > 0 && message.mid < topMsgID) {\n history.sort((a, b) => {\n return b - a;\n });\n }\n if (message.mid > 0 &&\n historyStorage.count !== null) {\n historyStorage.count++;\n }\n if (this.mergeReplyKeyboard(historyStorage, message)) {\n utils_1.$rootScope.$broadcast('history_reply_markup', { peerID: peerID });\n }\n if (!message.pFlags.out && message.from_id) {\n appUsersManager_1.default.forceUserOnline(message.from_id);\n }\n var randomID = this.pendingByMessageID[message.mid], pendingMessage;\n if (randomID) {\n if (pendingMessage = this.finalizePendingMessage(randomID, message)) {\n utils_1.$rootScope.$broadcast('history_update', { peerID: peerID, mid: message.mid });\n }\n delete this.pendingByMessageID[message.mid];\n }\n if (!pendingMessage) {\n if (this.newMessagesToHandle[peerID] === undefined) {\n this.newMessagesToHandle[peerID] = [];\n }\n this.newMessagesToHandle[peerID].push(message.mid);\n if (!this.newMessagesHandlePromise) {\n this.newMessagesHandlePromise = window.setTimeout(this.handleNewMessages.bind(this), 0);\n }\n }\n var inboxUnread = !message.pFlags.out && message.pFlags.unread;\n var dialog = foundDialog[0];\n dialog.top_message = message.mid;\n if (inboxUnread) {\n dialog.unread_count++;\n }\n if (!dialog.pFlags.pinned || !dialog.index) {\n dialog.index = this.generateDialogIndex(message.date);\n }\n this.newDialogsToHandle[peerID] = dialog;\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n /*if(inboxUnread &&\n ($rootScope.selectedPeerID != peerID || $rootScope.idle.isIDLE)) {\n var notifyPeer = message.flags & 16 ? message.from_id : peerID;\n var notifyPeerToHandle = this.notificationsToHandle[notifyPeer];\n if(notifyPeerToHandle === undefined) {\n notifyPeerToHandle = this.notificationsToHandle[notifyPeer] = {\n isMutedPromise: Promise.resolve()/* NotificationsManager.getPeerMuted(notifyPeer), // WARNING\n fwd_count: 0,\n from_id: 0\n };\n }\n \n if(notifyPeerToHandle.from_id != message.from_id) {\n notifyPeerToHandle.from_id = message.from_id;\n notifyPeerToHandle.fwd_count = 0;\n }\n if(message.fwdFromID) {\n notifyPeerToHandle.fwd_count++;\n }\n \n notifyPeerToHandle.top_message = message;\n \n if(!this.notificationsHandlePromise) {\n this.notificationsHandlePromise = window.setTimeout(this.handleNotifications.bind(this), 1000);\n }\n } */\n break;\n }\n case 'updateDialogPinned': {\n var peerID = appPeersManager_1.default.getPeerID(update.peer);\n var foundDialog = this.getDialogByPeerID(peerID);\n if (!foundDialog.length || !update.pFlags.pinned) {\n this.newDialogsToHandle[peerID] = { reload: true };\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n break;\n }\n var dialog = foundDialog[0];\n dialog.index = this.generateDialogIndex(this.generateDialogPinnedDate(dialog));\n dialog.pFlags.pinned = true;\n break;\n }\n case 'updatePinnedDialogs': {\n var newPinned = {};\n if (!update.order) {\n apiManager_1.default.invokeApi('messages.getPinnedDialogs', {}).then((dialogsResult) => {\n dialogsResult.dialogs.reverse();\n this.applyConversations(dialogsResult);\n dialogsResult.dialogs.forEach((dialog) => {\n newPinned[dialog.peerID] = true;\n });\n this.dialogsStorage.dialogs.forEach((dialog) => {\n var peerID = dialog.peerID;\n if (dialog.pFlags.pinned && !newPinned[peerID]) {\n this.newDialogsToHandle[peerID] = { reload: true };\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n }\n });\n });\n break;\n }\n update.order.reverse();\n update.order.forEach((peer) => {\n var peerID = appPeersManager_1.default.getPeerID(peer);\n newPinned[peerID] = true;\n var foundDialog = this.getDialogByPeerID(peerID);\n if (!foundDialog.length) {\n this.newDialogsToHandle[peerID] = { reload: true };\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n return;\n }\n var dialog = foundDialog[0];\n dialog.index = this.generateDialogIndex(this.generateDialogPinnedDate(dialog));\n dialog.pFlags.pinned = true;\n this.newDialogsToHandle[peerID] = dialog;\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n });\n this.dialogsStorage.dialogs.forEach((dialog) => {\n var peerID = dialog.peerID;\n if (dialog.pFlags.pinned && !newPinned[peerID]) {\n this.newDialogsToHandle[peerID] = { reload: true };\n if (!this.newDialogsHandlePromise) {\n this.newDialogsHandlePromise = window.setTimeout(this.handleNewDialogs.bind(this), 0);\n }\n }\n });\n break;\n }\n case 'updateEditMessage':\n case 'updateEditChannelMessage': {\n var message = update.message;\n var peerID = this.getMessagePeer(message);\n var channelID = message.to_id._ == 'peerChannel' ? -peerID : 0;\n var mid = appMessagesIDsManager_1.default.getFullMessageID(message.id, channelID);\n if (this.messagesStorage[mid] === undefined) {\n break;\n }\n // console.trace(dT(), 'edit message', message)\n this.saveMessages([message], { isEdited: true });\n utils_1.safeReplaceObject(this.messagesStorage[mid], message);\n var wasForHistory = this.messagesForHistory[mid];\n if (wasForHistory !== undefined) {\n delete this.messagesForHistory[mid];\n var newForHistory = this.wrapForHistory(mid);\n utils_1.safeReplaceObject(wasForHistory, newForHistory);\n this.messagesForHistory[mid] = wasForHistory;\n }\n var dialog = this.getDialogByPeerID(peerID)[0];\n var isTopMessage = dialog && dialog.top_message == mid;\n if (message.clear_history) { // that's will never happen\n if (isTopMessage) {\n utils_1.$rootScope.$broadcast('dialog_flush', { peerID: peerID });\n }\n else {\n var msgs = {};\n msgs[mid] = true;\n /////////$rootScope.$broadcast('history_delete', {peerID: peerID, msgs: msgs}); // commented 11.02.2020\n }\n }\n else {\n utils_1.$rootScope.$broadcast('message_edit', {\n peerID: peerID,\n id: message.id,\n mid: mid,\n justMedia: false\n });\n if (isTopMessage) {\n var updatedDialogs = {};\n updatedDialogs[peerID] = dialog;\n utils_1.$rootScope.$broadcast('dialogs_multiupdate', updatedDialogs);\n }\n }\n break;\n }\n case 'updateReadHistoryInbox':\n case 'updateReadHistoryOutbox':\n case 'updateReadChannelInbox':\n case 'updateReadChannelOutbox': {\n var isOut = update._ == 'updateReadHistoryOutbox' || update._ == 'updateReadChannelOutbox';\n var channelID = update.channel_id;\n var maxID = appMessagesIDsManager_1.default.getFullMessageID(update.max_id, channelID);\n var peerID = channelID ? -channelID : appPeersManager_1.default.getPeerID(update.peer);\n var foundDialog = this.getDialogByPeerID(peerID);\n var history = (this.historiesStorage[peerID] || {}).history || [];\n var newUnreadCount = 0;\n var length = history.length;\n var foundAffected = false;\n var messageID, message;\n var i;\n //console.warn(dT(), 'read', peerID, isOut ? 'out' : 'in', maxID)\n if (peerID > 0 && isOut) {\n appUsersManager_1.default.forceUserOnline(peerID);\n }\n for (i = 0; i < length; i++) {\n messageID = history[i];\n if (messageID > maxID) {\n continue;\n }\n message = this.messagesStorage[messageID];\n if (message.pFlags.out != isOut) {\n continue;\n }\n if (!message.pFlags.unread) {\n break;\n }\n // console.warn('read', messageID, message.pFlags.unread, message)\n if (message && message.pFlags.unread) {\n message.pFlags.unread = false;\n if (this.messagesForHistory[messageID]) {\n this.messagesForHistory[messageID].pFlags.unread = false;\n if (!foundAffected) {\n foundAffected = true;\n }\n }\n if (this.messagesForDialogs[messageID]) {\n this.messagesForDialogs[messageID].pFlags.unread = false;\n }\n if (!message.pFlags.out) {\n if (foundDialog[0]) {\n newUnreadCount = --foundDialog[0].unread_count;\n }\n //NotificationsManager.cancel('msg' + messageID); // warning\n }\n }\n }\n if (foundDialog[0]) {\n if (!isOut && newUnreadCount && foundDialog[0].top_message <= maxID) {\n newUnreadCount = foundDialog[0].unread_count = 0;\n }\n let dialogKey = isOut ? 'read_outbox_max_id' : 'read_inbox_max_id';\n foundDialog[0][dialogKey] = maxID;\n }\n // need be commented for read out messages\n //if(newUnreadCount != 0 || !isOut) { // fix 16.11.2019 (maybe not)\n //////////console.warn(dT(), 'cnt', peerID, newUnreadCount, isOut, foundDialog, update, foundAffected);\n utils_1.$rootScope.$broadcast('dialog_unread', { peerID: peerID, count: newUnreadCount });\n //}\n if (foundAffected) {\n utils_1.$rootScope.$broadcast('messages_read');\n }\n break;\n }\n case 'updateChannelReadMessagesContents': {\n var channelID = update.channel_id;\n var newMessages = [];\n update.messages.forEach((msgID) => {\n newMessages.push(appMessagesIDsManager_1.default.getFullMessageID(msgID, channelID));\n });\n update.messages = newMessages;\n }\n case 'updateReadMessagesContents': {\n var messages = update.messages;\n var len = messages.length;\n var i;\n var messageID, message;\n var historyMessage;\n for (i = 0; i < len; i++) {\n messageID = messages[i];\n if (message = this.messagesStorage[messageID]) {\n delete message.pFlags.media_unread;\n }\n if (historyMessage = this.messagesForHistory[messageID]) {\n delete historyMessage.pFlags.media_unread;\n }\n }\n break;\n }\n case 'updateChannelAvailableMessages': {\n var channelID = update.channel_id;\n var messages = [];\n var peerID = -channelID;\n var history = (this.historiesStorage[peerID] || {}).history || [];\n if (history.length) {\n history.forEach((msgID) => {\n if (!update.available_min_id ||\n appMessagesIDsManager_1.default.getMessageLocalID(msgID) <= update.available_min_id) {\n messages.push(msgID);\n }\n });\n }\n update.messages = messages;\n }\n case 'updateDeleteMessages':\n case 'updateDeleteChannelMessages': {\n var historiesUpdated = {};\n var channelID = update.channel_id;\n var messageID;\n var message, i;\n var peerID, foundDialog;\n let history;\n var peerMessagesToHandle;\n var peerMessagesHandlePos;\n for (i = 0; i < update.messages.length; i++) {\n messageID = appMessagesIDsManager_1.default.getFullMessageID(update.messages[i], channelID);\n message = this.messagesStorage[messageID];\n if (message) {\n peerID = this.getMessagePeer(message);\n history = historiesUpdated[peerID] || (historiesUpdated[peerID] = { count: 0, unread: 0, msgs: {} });\n if (!message.pFlags.out && message.pFlags.unread) {\n history.unread++;\n // NotificationsManager.cancel('msg' + messageID); // warning\n }\n history.count++;\n history.msgs[messageID] = true;\n if (this.messagesForHistory[messageID]) {\n this.messagesForHistory[messageID].deleted = true;\n delete this.messagesForHistory[messageID];\n }\n if (this.messagesForDialogs[messageID]) {\n this.messagesForDialogs[messageID].deleted = true;\n delete this.messagesForDialogs[messageID];\n }\n message.deleted = true;\n this.messagesStorage[messageID] = {\n deleted: true,\n id: messageID,\n from_id: message.from_id,\n to_id: message.to_id,\n flags: message.flags,\n pFlags: message.pFlags,\n date: message.date\n };\n peerMessagesToHandle = this.newMessagesToHandle[peerID];\n if (peerMessagesToHandle && peerMessagesToHandle.length) {\n peerMessagesHandlePos = peerMessagesToHandle.indexOf(messageID);\n if (peerMessagesHandlePos != -1) {\n peerMessagesToHandle.splice(peerMessagesHandlePos);\n }\n }\n }\n }\n Object.keys(historiesUpdated).forEach((peerID) => {\n let updatedData = historiesUpdated[peerID];\n var historyStorage = this.historiesStorage[peerID];\n if (historyStorage !== undefined) {\n var newHistory = [];\n var newPending = [];\n for (var i = 0; i < historyStorage.history.length; i++) {\n if (!updatedData.msgs[historyStorage.history[i]]) {\n newHistory.push(historyStorage.history[i]);\n }\n }\n historyStorage.history = newHistory;\n if (updatedData.count &&\n historyStorage.count !== null &&\n historyStorage.count > 0) {\n historyStorage.count -= updatedData.count;\n if (historyStorage.count < 0) {\n historyStorage.count = 0;\n }\n }\n for (var i = 0; i < historyStorage.pending.length; i++) {\n if (!updatedData.msgs[historyStorage.pending[i]]) {\n newPending.push(historyStorage.pending[i]);\n }\n }\n historyStorage.pending = newPending;\n utils_1.$rootScope.$broadcast('history_delete', { peerID: peerID, msgs: updatedData.msgs });\n }\n var foundDialog = this.getDialogByPeerID(+peerID)[0];\n if (foundDialog) {\n if (updatedData.unread) {\n foundDialog.unread_count -= updatedData.unread;\n utils_1.$rootScope.$broadcast('dialog_unread', {\n peerID: peerID,\n count: foundDialog.unread_count\n });\n }\n if (updatedData.msgs[foundDialog.top_message]) {\n this.reloadConversation(+peerID);\n }\n }\n });\n break;\n }\n case 'updateChannel': {\n var channelID = update.channel_id;\n var peerID = -channelID;\n var channel = appChatsManager_1.default.getChat(channelID);\n var needDialog = channel._ == 'channel' && (!channel.pFlags.left && !channel.pFlags.kicked);\n var foundDialog = this.getDialogByPeerID(peerID);\n var hasDialog = foundDialog.length > 0;\n var canViewHistory = channel._ == 'channel' && (channel.username || !channel.pFlags.left && !channel.pFlags.kicked) && true || false;\n var hasHistory = this.historiesStorage[peerID] !== undefined;\n if (canViewHistory != hasHistory) {\n delete this.historiesStorage[peerID];\n utils_1.$rootScope.$broadcast('history_forbidden', peerID);\n }\n if (hasDialog != needDialog) {\n if (needDialog) {\n this.reloadConversation(-channelID);\n }\n else {\n if (foundDialog[0]) {\n this.dialogsStorage.dialogs.splice(foundDialog[1], 1);\n utils_1.$rootScope.$broadcast('dialog_drop', { peerID: peerID });\n }\n }\n }\n break;\n }\n case 'updateChannelReload': {\n var channelID = update.channel_id;\n var peerID = -channelID;\n var foundDialog = this.getDialogByPeerID(peerID);\n if (foundDialog[0]) {\n this.dialogsStorage.dialogs.splice(foundDialog[1], 1);\n }\n delete this.historiesStorage[peerID];\n this.reloadConversation(-channelID).then(() => {\n utils_1.$rootScope.$broadcast('history_reload', peerID);\n });\n break;\n }\n case 'updateChannelMessageViews': {\n var views = update.views;\n var mid = appMessagesIDsManager_1.default.getFullMessageID(update.id, update.channel_id);\n var message = this.getMessage(mid);\n if (message && message.views && message.views < views) {\n message.views = views;\n utils_1.$rootScope.$broadcast('message_views', {\n mid: mid,\n views: views\n });\n }\n break;\n }\n case 'updateServiceNotification': {\n // update.inbox_date = tsNow(true)\n // update.pFlags = {popup: true}\n var fromID = 777000;\n var peerID = fromID;\n var messageID = this.tempID--;\n var message = {\n _: 'message',\n id: messageID,\n from_id: fromID,\n to_id: appPeersManager_1.default.getOutputPeer(peerID),\n flags: 0,\n pFlags: { unread: true },\n date: (update.inbox_date || utils_1.tsNow(true)) + serverTimeManager_2.default.serverTimeOffset,\n message: update.message,\n media: update.media,\n entities: update.entities\n };\n if (!appUsersManager_1.default.hasUser(fromID)) {\n appUsersManager_1.default.saveApiUsers([{\n _: 'user',\n id: fromID,\n pFlags: { verified: true },\n access_hash: 0,\n first_name: 'Telegram',\n phone: '42777'\n }]);\n }\n this.saveMessages([message]);\n if (update.inbox_date) {\n this.pendingTopMsgs[peerID] = messageID;\n this.handleUpdate({\n _: 'updateNewMessage',\n message: message\n });\n }\n if (update.pFlags.popup && update.message) {\n var historyMessage = this.wrapForHistory(messageID);\n //ErrorService.show({error: {code: 400, type: 'UPDATE_SERVICE_NOTIFICATION'}, historyMessage: historyMessage}); // warning\n }\n break;\n }\n }\n }\n wrapForHistory(msgID) {\n if (this.messagesForHistory[msgID] !== undefined) {\n return this.messagesForHistory[msgID];\n }\n var message = utils_1.copy(this.messagesStorage[msgID]) || { id: msgID };\n if (message.media && message.media.progress !== undefined) {\n message.media.progress = this.messagesStorage[msgID].media.progress;\n }\n var fromUser = message.from_id && appUsersManager_1.default.getUser(message.from_id);\n var fromBot = fromUser && fromUser.pFlags.bot && fromUser.username || false;\n var withBot = (fromBot ||\n message.to_id && (message.to_id.chat_id ||\n message.to_id.user_id && appUsersManager_1.default.isBot(message.to_id.user_id)));\n if (message.media) {\n if (message.media.caption &&\n message.media.caption.length) {\n message.media.rCaption = richtextprocessor_1.RichTextProcessor.wrapRichText(message.media.caption, {\n noCommands: !withBot,\n fromBot: fromBot\n });\n }\n switch (message.media._) {\n case 'messageMediaPhoto':\n message.media.photo = appPhotosManager_1.default.wrapForHistory(message.media.photo.id);\n break;\n /* case 'messageMediaDocument':\n message.media.document = appDocsManager.wrapForHistory(message.media.document.id)\n break */\n case 'messageMediaGeo':\n var mapUrl = 'https://maps.google.com/?q=' + message.media.geo['lat'] + ',' + message.media.geo['long'];\n message.media.mapUrl = mapUrl; //$sce.trustAsResourceUrl(mapUrl) // warning\n break;\n case 'messageMediaVenue':\n var mapUrl;\n if (message.media.provider == 'foursquare' &&\n message.media.venue_id) {\n mapUrl = 'https://foursquare.com/v/' + encodeURIComponent(message.media.venue_id);\n }\n else {\n mapUrl = 'https://maps.google.com/?q=' + message.media.geo['lat'] + ',' + message.media.geo['long'];\n }\n message.media.mapUrl = mapUrl; //$sce.trustAsResourceUrl(mapUrl) // warning\n break;\n case 'messageMediaContact':\n message.media.rFullName = richtextprocessor_1.RichTextProcessor.wrapRichText(message.media.first_name + ' ' + (message.media.last_name || ''), { noLinks: true, noLinebreaks: true });\n break;\n case 'messageMediaWebPage':\n if (!message.media.webpage ||\n message.media.webpage._ == 'webPageEmpty') {\n delete message.media;\n break;\n }\n message.media.webpage = appWebPagesManager_1.default.wrapForHistory(message.media.webpage.id);\n break;\n /*case 'messageMediaGame':\n message.media.game = AppGamesManager.wrapForHistory(message.media.game.id)\n break */\n }\n }\n else if (message.action) {\n switch (message.action._) {\n case 'messageActionChatEditPhoto':\n case 'messageActionChannelEditPhoto':\n message.action.photo = appPhotosManager_1.default.wrapForHistory(message.action.photo.id);\n break;\n case 'messageActionChatCreate':\n case 'messageActionChatEditTitle':\n case 'messageActionChannelCreate':\n case 'messageActionChannelEditTitle':\n message.action.rTitle = richtextprocessor_1.RichTextProcessor.wrapRichText(message.action.title, { noLinebreaks: true }) || 'chat_title_deleted';\n break;\n case 'messageActionBotIntro':\n message.action.rDescription = richtextprocessor_1.RichTextProcessor.wrapRichText(message.action.description, {\n noCommands: !withBot,\n fromBot: fromBot\n });\n break;\n }\n }\n return this.messagesForHistory[msgID] = message;\n }\n finalizePendingMessage(randomID, finalMessage) {\n var pendingData = this.pendingByRandomID[randomID];\n // console.log('pdata', randomID, pendingData)\n if (pendingData) {\n var peerID = pendingData[0];\n var tempID = pendingData[1];\n var historyStorage = this.historiesStorage[peerID], message, historyMessage;\n // console.log('pending', randomID, historyStorage.pending)\n var pos = historyStorage.pending.indexOf(tempID);\n if (pos != -1) {\n historyStorage.pending.splice(pos, 1);\n }\n if (message = this.messagesStorage[tempID]) {\n delete message.pending;\n delete message.error;\n delete message.random_id;\n delete message.send;\n }\n if (historyMessage = this.messagesForHistory[tempID]) {\n this.messagesForHistory[finalMessage.mid] = Object.assign(historyMessage, this.wrapForHistory(finalMessage.mid));\n delete historyMessage.pending;\n delete historyMessage.error;\n delete historyMessage.random_id;\n delete historyMessage.send;\n utils_1.$rootScope.$broadcast('messages_pending');\n }\n delete this.messagesForHistory[tempID];\n delete this.messagesStorage[tempID];\n this.finalizePendingMessageCallbacks(tempID, finalMessage.mid);\n return message;\n }\n return false;\n }\n /* public finalizePendingMessageCallbacks(tempID: number, mid: number) {\n $rootScope.$broadcast('message_sent', {tempID, mid});\n } */\n finalizePendingMessageCallbacks(tempID, mid) {\n var callbacks = this.tempFinalizeCallbacks[tempID];\n console.warn(utils_1.dT(), callbacks, tempID);\n if (callbacks !== undefined) {\n callbacks.forEach((callback) => {\n callback(mid);\n });\n delete this.tempFinalizeCallbacks[tempID];\n }\n utils_1.$rootScope.$broadcast('message_sent', { tempID, mid });\n }\n incrementMaxSeenID(maxID) {\n if (!maxID || !(!this.maxSeenID || maxID > this.maxSeenID)) {\n return false;\n }\n storage_1.default.set({\n max_seen_msg: maxID\n });\n apiManager_1.default.invokeApi('messages.receivedMessages', {\n max_id: maxID\n });\n }\n getHistory(peerID, maxID = 0, limit = 0, backLimit, prerendered) {\n if (this.migratedFromTo[peerID]) {\n peerID = this.migratedFromTo[peerID];\n }\n var historyStorage = this.historiesStorage[peerID];\n var offset = 0;\n var offsetNotFound = false;\n var unreadOffset = 0;\n var unreadSkip = false;\n prerendered = prerendered ? Math.min(50, prerendered) : 0;\n if (historyStorage === undefined) {\n historyStorage = this.historiesStorage[peerID] = { count: null, history: [], pending: [] };\n }\n if (maxID < 0) {\n maxID = 0;\n }\n var isMigrated = false;\n var reqPeerID = peerID;\n if (this.migratedToFrom[peerID]) {\n isMigrated = true;\n if (maxID && maxID < appMessagesIDsManager_1.default.fullMsgIDModulus) {\n reqPeerID = this.migratedToFrom[peerID];\n }\n }\n if (!limit && !maxID) {\n var foundDialog = this.getDialogByPeerID(peerID)[0];\n if (foundDialog && foundDialog.unread_count > 1) {\n var unreadCount = foundDialog.unread_count;\n if (unreadSkip = (unreadCount > 50)) {\n if (foundDialog.read_inbox_max_id) {\n maxID = foundDialog.read_inbox_max_id;\n backLimit = 16;\n unreadOffset = 16;\n limit = 4;\n }\n else {\n limit = 20;\n unreadOffset = 16;\n offset = unreadCount - unreadOffset;\n }\n }\n else {\n limit = Math.max(10, prerendered, unreadCount + 2);\n unreadOffset = unreadCount;\n }\n }\n else if ('Mobile' in Config) {\n limit = 20;\n }\n }\n if (maxID > 0) {\n offsetNotFound = true;\n for (offset = 0; offset < historyStorage.history.length; offset++) {\n if (maxID > historyStorage.history[offset]) {\n offsetNotFound = false;\n break;\n }\n }\n }\n if (!offsetNotFound && (historyStorage.count !== null && historyStorage.history.length == historyStorage.count ||\n historyStorage.history.length >= offset + (limit || 1))) {\n if (backLimit) {\n backLimit = Math.min(offset, backLimit);\n offset = Math.max(0, offset - backLimit);\n limit += backLimit;\n }\n else {\n limit = limit || (offset ? 20 : (prerendered || 5));\n }\n var history = historyStorage.history.slice(offset, offset + limit);\n if (!maxID && historyStorage.pending.length) {\n history = historyStorage.pending.slice().concat(history);\n }\n return this.wrapHistoryResult(peerID, {\n count: historyStorage.count,\n history: history,\n unreadOffset: unreadOffset,\n unreadSkip: unreadSkip\n });\n }\n if (!backLimit && !limit) {\n limit = prerendered || 20;\n }\n if (offsetNotFound) {\n offset = 0;\n }\n if ((backLimit || unreadSkip || maxID) && historyStorage.history.indexOf(maxID) == -1) {\n if (backLimit) {\n offset = -backLimit;\n limit += backLimit;\n }\n return this.requestHistory(reqPeerID, maxID, limit, offset).then((historyResult) => {\n historyStorage.count = historyResult.count || historyResult.messages.length;\n if (isMigrated) {\n historyStorage.count++;\n }\n var history = [];\n historyResult.messages.forEach((message) => {\n history.push(message.mid);\n });\n if (!maxID && historyStorage.pending.length) {\n history = historyStorage.pending.slice().concat(history);\n }\n return this.wrapHistoryResult(peerID, {\n count: historyStorage.count,\n history: history,\n unreadOffset: unreadOffset,\n unreadSkip: unreadSkip\n });\n });\n }\n return this.fillHistoryStorage(peerID, maxID, limit, historyStorage).then(() => {\n offset = 0;\n if (maxID > 0) {\n for (offset = 0; offset < historyStorage.history.length; offset++) {\n if (maxID > historyStorage.history[offset]) {\n break;\n }\n }\n }\n var history = historyStorage.history.slice(offset, offset + limit);\n if (!maxID && historyStorage.pending.length) {\n history = historyStorage.pending.slice().concat(history);\n }\n return this.wrapHistoryResult(peerID, {\n count: historyStorage.count,\n history: history,\n unreadOffset: unreadOffset,\n unreadSkip: unreadSkip\n });\n });\n }\n fillHistoryStorage(peerID, maxID, fullLimit, historyStorage) {\n // console.log('fill history storage', peerID, maxID, fullLimit, angular.copy(historyStorage))\n var offset = (this.migratedFromTo[peerID] && !maxID) ? 1 : 0;\n return this.requestHistory(peerID, maxID, fullLimit, offset).then((historyResult) => {\n historyStorage.count = historyResult.count || historyResult.messages.length;\n var offset = 0;\n if (!maxID && historyResult.messages.length) {\n maxID = historyResult.messages[0].mid + 1;\n }\n if (maxID > 0) {\n for (offset = 0; offset < historyStorage.history.length; offset++) {\n if (maxID > historyStorage.history[offset]) {\n break;\n }\n }\n }\n var wasTotalCount = historyStorage.history.length;\n historyStorage.history.splice(offset, historyStorage.history.length - offset);\n historyResult.messages.forEach((message) => {\n if (this.mergeReplyKeyboard(historyStorage, message)) {\n utils_1.$rootScope.$broadcast('history_reply_markup', { peerID: peerID });\n }\n historyStorage.history.push(message.mid);\n });\n var totalCount = historyStorage.history.length;\n fullLimit -= (totalCount - wasTotalCount);\n var migratedNextPeer = this.migratedFromTo[peerID];\n var migratedPrevPeer = this.migratedToFrom[peerID];\n var isMigrated = migratedNextPeer !== undefined || migratedPrevPeer !== undefined;\n if (isMigrated) {\n historyStorage.count = Math.max(historyStorage.count, totalCount) + 1;\n }\n if (fullLimit > 0) {\n maxID = historyStorage.history[totalCount - 1];\n if (isMigrated) {\n if (!historyResult.messages.length) {\n if (migratedPrevPeer) {\n maxID = 0;\n peerID = migratedPrevPeer;\n }\n else {\n historyStorage.count = totalCount;\n return true;\n }\n }\n return this.fillHistoryStorage(peerID, maxID, fullLimit, historyStorage);\n }\n else if (totalCount < historyStorage.count) {\n return this.fillHistoryStorage(peerID, maxID, fullLimit, historyStorage);\n }\n }\n return true;\n });\n }\n wrapHistoryResult(peerID, result) {\n var unreadOffset = result.unreadOffset;\n if (unreadOffset) {\n var i;\n var message;\n for (i = result.history.length - 1; i >= 0; i--) {\n message = this.messagesStorage[result.history[i]];\n if (message && !message.pFlags.out && message.pFlags.unread) {\n result.unreadOffset = i + 1;\n break;\n }\n }\n }\n return Promise.resolve(result);\n }\n requestHistory(peerID, maxID, limit, offset = 0) {\n var isChannel = appPeersManager_1.default.isChannel(peerID);\n //console.trace('requestHistory', peerID, maxID, limit, offset);\n return apiManager_1.default.invokeApi('messages.getHistory', {\n peer: appPeersManager_1.default.getInputPeerByID(peerID),\n offset_id: maxID ? appMessagesIDsManager_1.default.getMessageLocalID(maxID) : 0,\n offset_date: 0,\n add_offset: offset || 0,\n limit: limit || 0,\n max_id: 0,\n min_id: 0,\n hash: 0\n }, {\n timeout: 300,\n noErrorBox: true\n }).then((historyResult) => {\n ///console.log('requestHistory result:', historyResult);\n appUsersManager_1.default.saveApiUsers(historyResult.users);\n appChatsManager_1.default.saveApiChats(historyResult.chats);\n this.saveMessages(historyResult.messages);\n if (isChannel) {\n apiUpdatesManager_1.default.addChannelState(-peerID, historyResult.pts);\n }\n var length = historyResult.messages.length;\n if (length && historyResult.messages[length - 1].deleted) {\n historyResult.messages.splice(length - 1, 1);\n length--;\n historyResult.count--;\n }\n // don't need the intro now\n /* if(peerID < 0 || !appUsersManager.isBot(peerID) || (length == limit && limit < historyResult.count)) {\n return historyResult;\n } */\n return historyResult;\n /* return appProfileManager.getProfile(peerID).then((userFull: any) => {\n var description = userFull.bot_info && userFull.bot_info.description;\n if(description) {\n var messageID = this.tempID--;\n var message = {\n _: 'messageService',\n id: messageID,\n from_id: peerID,\n to_id: AppPeersManager.getOutputPeer(peerID),\n flags: 0,\n pFlags: {},\n date: tsNow(true) + serverTimeManager.serverTimeOffset,\n action: {\n _: 'messageActionBotIntro',\n description: description\n }\n }\n \n this.saveMessages([message]);\n historyResult.messages.push(message);\n if(historyResult.count) {\n historyResult.count++;\n }\n }\n \n return historyResult;\n }); */\n }, (error) => {\n switch (error.type) {\n case 'CHANNEL_PRIVATE':\n var channel = appChatsManager_1.default.getChat(-peerID);\n channel = { _: 'channelForbidden', access_hash: channel.access_hash, title: channel.title };\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: -peerID\n }],\n chats: [channel],\n users: []\n });\n break;\n }\n return Promise.reject(error);\n });\n }\n /* public wrapForDialog(msgID: number, dialog?: any) {\n var useCache = msgID && dialog !== undefined;\n var unreadCount = dialog && dialog.unread_count;\n \n if(useCache && this.messagesForDialogs[msgID] !== undefined) {\n delete this.messagesForDialogs[msgID].typing;\n this.messagesForDialogs[msgID].unreadCount = unreadCount;\n return this.messagesForDialogs[msgID];\n }\n \n var message = copy(this.messagesStorage[msgID]);\n \n if(!message || !message.to_id) {\n if(dialog && dialog.peerID) {\n message = {\n _: 'message',\n to_id: AppPeersManager.getOutputPeer(dialog.peerID),\n deleted: true,\n date: tsNow(true),\n pFlags: {out: true}\n }\n } else {\n return message;\n }\n }\n \n message.peerID = this.getMessagePeer(message);\n message.peerData = AppPeersManager.getPeer(message.peerID);\n message.peerString = AppPeersManager.getPeerString(message.peerID);\n message.unreadCount = unreadCount;\n message.index = dialog && dialog.index || (message.date * 0x10000);\n message.pinned = dialog && dialog.pFlags.pinned || false;\n \n if(message._ == 'messageService' && message.action.user_id) {\n message.action.user = appUsersManager.getUser(message.action.user_id);\n }\n \n if(message.message && message.message.length) {\n message.richMessage = RichTextProcessor.wrapRichText(message.message.substr(0, 128), {noLinks: true, noLinebreaks: true});\n }\n \n message.dateText = message.date; //dateOrTimeFilter(message.date); // warning\n \n if(useCache) {\n message.draft = '';//DraftsManager.getServerDraft(message.peerID); // warning\n this.messagesForDialogs[msgID] = message;\n }\n \n return message;\n } */\n fetchSingleMessages() {\n if (this.fetchSingleMessagesPromise) {\n return this.fetchSingleMessagesPromise;\n }\n var mids = this.needSingleMessages.slice();\n this.needSingleMessages.length = 0;\n var splitted = appMessagesIDsManager_1.default.splitMessageIDsByChannels(mids);\n let promises = [];\n Object.keys(splitted.msgIDs).forEach((channelID) => {\n channelID = +channelID;\n let msgIDs = splitted.msgIDs[channelID].map((msgID) => {\n return {\n _: 'inputMessageID',\n id: msgID\n };\n });\n var promise;\n if (channelID > 0) {\n promise = apiManager_1.default.invokeApi('channels.getMessages', {\n channel: appChatsManager_1.default.getChannelInput(channelID),\n id: msgIDs\n });\n }\n else {\n promise = apiManager_1.default.invokeApi('messages.getMessages', {\n id: msgIDs\n });\n }\n promises.push(promise.then((getMessagesResult) => {\n appUsersManager_1.default.saveApiUsers(getMessagesResult.users);\n appChatsManager_1.default.saveApiChats(getMessagesResult.chats);\n this.saveMessages(getMessagesResult.messages);\n utils_1.$rootScope.$broadcast('messages_downloaded', splitted.mids[+channelID]);\n }));\n });\n return this.fetchSingleMessagesPromise = Promise.all(promises).then(() => {\n this.fetchSingleMessagesTimeout = 0;\n this.fetchSingleMessagesPromise = null;\n if (this.needSingleMessages.length)\n this.fetchSingleMessages();\n }).catch(() => {\n this.fetchSingleMessagesTimeout = 0;\n this.fetchSingleMessagesPromise = null;\n if (this.needSingleMessages.length)\n this.fetchSingleMessages();\n });\n }\n wrapSingleMessage(msgID) {\n if (this.messagesStorage[msgID]) {\n //let ret = this.wrapForDialog(msgID); // hm\n utils_1.$rootScope.$broadcast('messages_downloaded', [msgID]);\n //return ret;\n return { mid: msgID, loading: false };\n }\n if (this.needSingleMessages.indexOf(msgID) == -1) {\n this.needSingleMessages.push(msgID);\n if (this.fetchSingleMessagesTimeout == 0) {\n this.fetchSingleMessagesTimeout = window.setTimeout(this.fetchSingleMessages.bind(this), 25);\n }\n return { mid: msgID, loading: true };\n }\n return { mid: msgID, loading: false };\n }\n}\nexports.AppMessagesManager = AppMessagesManager;\nexports.default = new AppMessagesManager();\n" }, { "id": 16, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "name": "./src/lib/mtproto/mtproto.ts", "index": 29, "index2": 44, "size": 3515, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "./mtproto", "loc": "25:18-38" }, { "moduleId": 8, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/polyfill.ts", "module": "./src/lib/polyfill.ts", "moduleName": "./src/lib/polyfill.ts", "type": "cjs require", "userRequest": "./mtproto/mtproto", "loc": "4:18-46" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../mtproto/mtproto", "loc": "21:18-47" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "./mtproto", "loc": "24:18-38" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "./mtproto", "loc": "24:18-38" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst Config = __importStar(require(\"../config\"));\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst utils_1 = require(\"../utils\");\nconst passwordManager_1 = __importDefault(require(\"./passwordManager\"));\nconst dcConfigurator_1 = __importDefault(require(\"./dcConfigurator\"));\nconst rsaKeysManager_1 = __importDefault(require(\"./rsaKeysManager\"));\nconst timeManager_1 = __importDefault(require(\"./timeManager\"));\nconst serverTimeManager_1 = __importDefault(require(\"./serverTimeManager\"));\nconst authorizer_1 = __importDefault(require(\"./authorizer\"));\nconst networkerFactory_1 = __importDefault(require(\"./networkerFactory\"));\nconst apiManager_1 = __importDefault(require(\"./apiManager\"));\nconst apiFileManager_1 = __importDefault(require(\"./apiFileManager\"));\nclass TelegramMeWebService {\n constructor() {\n this.disabled = Config.Modes.test ||\n Config.App.domains.indexOf(location.hostname) == -1 ||\n location.protocol != 'http:' && location.protocol != 'https:' ||\n location.protocol == 'https:' && location.hostname != 'web.telegram.org';\n }\n setAuthorized(canRedirect) {\n if (this.disabled) {\n return false;\n }\n storage_1.default.get('tgme_sync').then((curValue) => {\n var ts = utils_1.tsNow(true);\n if (canRedirect &&\n curValue &&\n curValue.canRedirect == canRedirect &&\n curValue.ts + 86400 > ts) {\n return false;\n }\n storage_1.default.set({ tgme_sync: { canRedirect: canRedirect, ts: ts } });\n var urls = [\n '//telegram.me/_websync_?authed=' + (canRedirect ? '1' : '0'),\n '//t.me/_websync_?authed=' + (canRedirect ? '1' : '0')\n ];\n urls.forEach(url => {\n let script = document.createElement('script');\n script.onload = script.onerror = function () {\n script.remove();\n };\n script.src = url;\n document.body.appendChild(script);\n });\n });\n }\n}\nexports.TelegramMeWebService = TelegramMeWebService;\nexports.telegramMeWebService = new TelegramMeWebService();\n// @ts-ignore\nconst jsbn_1 = require(\"jsbn\");\nvar MTProto;\n(function (MTProto) {\n //$($window).on('click keydown', rng_seed_time); // WARNING!\n MTProto.secureRandom = new jsbn_1.SecureRandom();\n MTProto.passwordManager = passwordManager_1.default;\n MTProto.dcConfigurator = dcConfigurator_1.default;\n MTProto.rsaKeysManager = rsaKeysManager_1.default;\n MTProto.timeManager = timeManager_1.default;\n MTProto.authorizer = authorizer_1.default;\n MTProto.networkerFactory = networkerFactory_1.default;\n MTProto.apiManager = apiManager_1.default;\n MTProto.apiFileManager = apiFileManager_1.default;\n MTProto.serverTimeManager = serverTimeManager_1.default;\n})(MTProto = exports.MTProto || (exports.MTProto = {}));\n//(window as any).MTProto = MTProto;\n" }, { "id": 17, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesIDsManager.ts", "name": "./src/lib/appManagers/appMessagesIDsManager.ts", "index": 60, "index2": 53, "size": 2045, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appMessagesIDsManager", "loc": "16:48-82" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appMessagesIDsManager", "loc": "39:48-82" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "./appMessagesIDsManager", "loc": "21:48-82" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./appMessagesIDsManager", "loc": "7:48-82" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appMessagesIDsManager", "loc": "9:48-94" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass AppMessagesIDsManager {\n constructor() {\n this.channelLocals = {};\n this.channelsByLocals = {};\n this.channelCurLocal = 0;\n this.fullMsgIDModulus = 4294967296;\n }\n getFullMessageID(msgID, channelID) {\n if (!channelID || msgID <= 0) {\n return msgID;\n }\n msgID = this.getMessageLocalID(msgID);\n var localStart = this.channelLocals[channelID];\n if (!localStart) {\n localStart = (++this.channelCurLocal) * this.fullMsgIDModulus;\n this.channelsByLocals[localStart] = channelID;\n this.channelLocals[channelID] = localStart;\n }\n return localStart + msgID;\n }\n getMessageIDInfo(fullMsgID) {\n if (fullMsgID < this.fullMsgIDModulus) {\n return [fullMsgID, 0];\n }\n var msgID = fullMsgID % this.fullMsgIDModulus;\n var channelID = this.channelsByLocals[fullMsgID - msgID];\n return [msgID, channelID];\n }\n getMessageLocalID(fullMsgID) {\n if (!fullMsgID) {\n return 0;\n }\n return fullMsgID % this.fullMsgIDModulus;\n }\n splitMessageIDsByChannels(mids) {\n var msgIDsByChannels = {};\n var midsByChannels = {};\n var i;\n var mid, msgChannel;\n var channelID;\n for (i = 0; i < mids.length; i++) {\n mid = mids[i];\n msgChannel = this.getMessageIDInfo(mid);\n channelID = msgChannel[1];\n if (msgIDsByChannels[channelID] === undefined) {\n msgIDsByChannels[channelID] = [];\n midsByChannels[channelID] = [];\n }\n msgIDsByChannels[channelID].push(msgChannel[0]);\n midsByChannels[channelID].push(mid);\n }\n return {\n msgIDs: msgIDsByChannels,\n mids: midsByChannels\n };\n }\n}\nexports.AppMessagesIDsManager = AppMessagesIDsManager;\nexports.default = new AppMessagesIDsManager();\n" }, { "id": 18, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDocsManager.ts", "name": "./src/lib/appManagers/appDocsManager.ts", "index": 66, "index2": 59, "size": 10109, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appDocsManager", "loc": "28:41-68" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appDocsManager", "loc": "19:41-85" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "./appDocsManager", "loc": "15:41-68" }, { "moduleId": 49, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebPagesManager.ts", "module": "./src/lib/appManagers/appWebPagesManager.ts", "moduleName": "./src/lib/appManagers/appWebPagesManager.ts", "type": "cjs require", "userRequest": "./appDocsManager", "loc": "8:41-68" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appDocsManager", "loc": "18:41-80" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiFileManager_1 = __importDefault(require(\"../mtproto/apiFileManager\"));\nconst filemanager_1 = __importDefault(require(\"../filemanager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\n//import { MTDocument } from '../../components/misc';\nclass AppDocsManager {\n constructor() {\n this.docs = {};\n }\n saveDoc(apiDoc, context) {\n this.docs[apiDoc.id] = apiDoc;\n if (context) {\n Object.assign(apiDoc, context);\n }\n if (apiDoc.thumb && apiDoc.thumb._ == 'photoCachedSize') {\n apiFileManager_1.default.saveSmallFile(apiDoc.thumb.location, apiDoc.thumb.bytes);\n // Memory\n apiDoc.thumb.size = apiDoc.thumb.bytes.length;\n delete apiDoc.thumb.bytes;\n apiDoc.thumb._ = 'photoSize';\n }\n if (apiDoc.thumb && apiDoc.thumb._ == 'photoSizeEmpty') {\n delete apiDoc.thumb;\n }\n apiDoc.attributes.forEach((attribute) => {\n switch (attribute._) {\n case 'documentAttributeFilename':\n apiDoc.file_name = richtextprocessor_1.RichTextProcessor.wrapPlainText(attribute.file_name);\n break;\n case 'documentAttributeAudio':\n apiDoc.duration = attribute.duration;\n apiDoc.audioTitle = attribute.title;\n apiDoc.audioPerformer = attribute.performer;\n apiDoc.type = attribute.pFlags.voice ? 'voice' : 'audio';\n break;\n case 'documentAttributeVideo':\n apiDoc.duration = attribute.duration;\n apiDoc.w = attribute.w;\n apiDoc.h = attribute.h;\n if (apiDoc.thumbs && attribute.pFlags.round_message) {\n apiDoc.type = 'round';\n }\n else if (apiDoc.thumbs) {\n apiDoc.type = 'video';\n }\n break;\n case 'documentAttributeSticker':\n apiDoc.sticker = true;\n if (attribute.alt !== undefined) {\n apiDoc.stickerEmojiRaw = attribute.alt;\n apiDoc.stickerEmoji = richtextprocessor_1.RichTextProcessor.wrapRichText(apiDoc.stickerEmojiRaw, { noLinks: true, noLinebreaks: true });\n }\n if (attribute.stickerset) {\n if (attribute.stickerset._ == 'inputStickerSetEmpty') {\n delete attribute.stickerset;\n }\n else if (attribute.stickerset._ == 'inputStickerSetID') {\n apiDoc.stickerSetInput = attribute.stickerset;\n }\n }\n if (apiDoc.thumbs && apiDoc.mime_type == 'image/webp') {\n apiDoc.type = 'sticker';\n }\n else if (apiDoc.mime_type == 'application/x-tgsticker') {\n apiDoc.type = 'sticker';\n apiDoc.animated = true;\n }\n break;\n case 'documentAttributeImageSize':\n apiDoc.w = attribute.w;\n apiDoc.h = attribute.h;\n break;\n case 'documentAttributeAnimated':\n if ((apiDoc.mime_type == 'image/gif' || apiDoc.mime_type == 'video/mp4') && apiDoc.thumbs) {\n apiDoc.type = 'gif';\n }\n apiDoc.animated = true;\n break;\n }\n });\n if (!apiDoc.mime_type) {\n switch (apiDoc.type) {\n case 'gif':\n apiDoc.mime_type = 'video/mp4';\n break;\n case 'video':\n case 'round':\n apiDoc.mime_type = 'video/mp4';\n break;\n case 'sticker':\n apiDoc.mime_type = 'image/webp';\n break;\n case 'audio':\n apiDoc.mime_type = 'audio/mpeg';\n break;\n case 'voice':\n apiDoc.mime_type = 'audio/ogg';\n break;\n default:\n apiDoc.mime_type = 'application/octet-stream';\n break;\n }\n }\n if (!apiDoc.file_name) {\n apiDoc.file_name = '';\n }\n if (apiDoc._ == 'documentEmpty') {\n apiDoc.size = 0;\n }\n }\n getDoc(docID) {\n return this.docs[docID] || { _: 'documentEmpty' };\n }\n hasDoc(docID) {\n return this.docs[docID] !== undefined;\n }\n getFileName(doc) {\n if (doc.file_name) {\n return doc.file_name;\n }\n var fileExt = '.' + doc.mime_type.split('/')[1];\n if (fileExt == '.octet-stream') {\n fileExt = '';\n }\n return 't_' + (doc.type || 'file') + doc.id + fileExt;\n }\n updateDocDownloaded(docID) {\n var doc = this.docs[docID];\n var inputFileLocation = {\n _: 'inputDocumentFileLocation',\n id: docID,\n access_hash: doc.access_hash,\n version: doc.version,\n file_name: this.getFileName(doc)\n };\n if (doc.downloaded === undefined) {\n apiFileManager_1.default.getDownloadedFile(inputFileLocation, doc.size).then(() => {\n doc.downloaded = true;\n }, () => {\n doc.downloaded = false;\n });\n }\n }\n downloadDoc(docID, toFileEntry) {\n let doc;\n if (typeof (docID) === 'string') {\n doc = this.docs[docID];\n }\n else {\n doc = docID;\n }\n var inputFileLocation = {\n _: 'inputDocumentFileLocation',\n id: doc.id,\n access_hash: doc.access_hash,\n file_reference: doc.file_reference,\n thumb_size: '',\n version: doc.version,\n file_name: this.getFileName(doc)\n };\n if (doc._ == 'documentEmpty') {\n return Promise.reject();\n }\n if (doc.downloaded && !toFileEntry) {\n var cachedBlob = apiFileManager_1.default.getCachedFile(inputFileLocation);\n if (cachedBlob) {\n return Promise.resolve(cachedBlob);\n }\n }\n //historyDoc.progress = {enabled: !historyDoc.downloaded, percent: 1, total: doc.size};\n // нет смысла делать объект с выполняющимися промисами, нижняя строка и так вернёт загружающийся\n var downloadPromise = apiFileManager_1.default.downloadFile(doc.dc_id, inputFileLocation, doc.size, {\n mimeType: doc.mime_type || 'application/octet-stream',\n toFileEntry: toFileEntry\n });\n downloadPromise.then((blob) => {\n if (blob) {\n doc.downloaded = true;\n /* FileManager.getFileCorrectUrl(blob, doc.mime_type).then((url) => {\n doc.url = url;\n }); */\n }\n /* doc.progress.percent = 100;\n setTimeout(() => {\n delete doc.progress;\n }, 0); */\n // console.log('file save done')\n return blob;\n }, (e) => {\n console.log('document download failed', e);\n //historyDoc.progress.enabled = false;\n });\n /* downloadPromise.notify = (progress) => {\n console.log('dl progress', progress);\n historyDoc.progress.enabled = true;\n historyDoc.progress.done = progress.done;\n historyDoc.progress.percent = Math.max(1, Math.floor(100 * progress.done / progress.total));\n $rootScope.$broadcast('history_update');\n }; */\n //historyDoc.progress.cancel = downloadPromise.cancel;\n //console.log('return downloadPromise:', downloadPromise);\n return downloadPromise;\n }\n saveDocFile(docID) {\n return __awaiter(this, void 0, void 0, function* () {\n var doc = this.docs[docID];\n var fileName = this.getFileName(doc);\n var ext = (fileName.split('.', 2) || [])[1] || '';\n try {\n let writer = filemanager_1.default.chooseSaveFile(fileName, ext, doc.mime_type, doc.size);\n yield writer.ready;\n let promise = this.downloadDoc(docID, writer);\n promise.then(() => {\n writer.close();\n console.log('saved doc', doc);\n });\n //console.log('got promise from downloadDoc', promise);\n return { promise };\n }\n catch (err) {\n let promise = this.downloadDoc(docID);\n promise.then((blob) => {\n filemanager_1.default.download(blob, doc.mime_type, fileName);\n });\n return { promise };\n }\n });\n }\n}\nexports.default = new AppDocsManager();\n" }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "index": 67, "index2": 74, "size": 97445, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appImManager", "loc": "29:39-64" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "./appImManager", "loc": "22:39-64" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "./appImManager", "loc": "18:39-64" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appImManager", "loc": "16:39-64" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appImManager", "loc": "15:39-76" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst utils_1 = require(\"../utils\");\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst appMessagesManager_1 = __importDefault(require(\"./appMessagesManager\"));\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst appProfileManager_1 = __importDefault(require(\"./appProfileManager\"));\n//import { ProgressivePreloader, wrapDocument, wrapSticker, wrapVideo, wrapPhoto, openBtnMenu, LazyLoadQueue } from \"../../components/misc\";\nconst appDialogsManager_1 = __importDefault(require(\"./appDialogsManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst appSidebarRight_1 = __importDefault(require(\"./appSidebarRight\"));\nconst scrollable_1 = __importDefault(require(\"../../components/scrollable\"));\nconst polyfill_1 = require(\"../polyfill\");\nconst lottieLoader_1 = __importDefault(require(\"../lottieLoader\"));\nconst appMediaViewer_1 = __importDefault(require(\"./appMediaViewer\"));\nconst appSidebarLeft_1 = __importDefault(require(\"./appSidebarLeft\"));\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nconst appMessagesIDsManager_1 = __importDefault(require(\"./appMessagesIDsManager\"));\nconst apiUpdatesManager_1 = __importDefault(require(\"./apiUpdatesManager\"));\nconst emoticonsDropdown_1 = __importStar(require(\"../../components/emoticonsDropdown\"));\nconst wrappers_1 = require(\"../../components/wrappers\");\nconst preloader_1 = __importDefault(require(\"../../components/preloader\"));\nconst misc_1 = require(\"../../components/misc\");\nconst appWebPagesManager_1 = __importDefault(require(\"./appWebPagesManager\"));\nconsole.log('appImManager included!');\nlet testScroll = false;\nclass ScrollPosition {\n constructor(node) {\n this.node = node;\n this.previousScrollHeightMinusTop = 0;\n this.readyFor = 'up';\n this.container = node.parentElement;\n }\n /* public restore() {\n if(!this.scroll) return;\n //console.log('restore', this.readyFor, this.previousScrollHeightMinusTop);\n \n //if(this.readyFor === 'up') {\n this.scroll.update(true);\n \n //console.log('restore 2', this.node.scrollHeight, (this.node.scrollHeight\n //- this.previousScrollHeightMinusTop) + 'px')\n \n this.scroll.scroll({y: (this.node.scrollHeight\n - this.previousScrollHeightMinusTop) + 'px'});\n //}\n \n // 'down' doesn't need to be special cased unless the\n // content was flowing upwards, which would only happen\n // if the container is position: absolute, bottom: 0 for\n // a Facebook messages effect\n }\n \n public prepareFor(direction: string) {\n if(!this.scroll) return;\n \n this.readyFor = direction || 'up';\n \n this.scroll.update(true);\n let pos = this.scroll.scroll();\n this.previousScrollHeightMinusTop = this.node.scrollHeight\n - pos.position.y;\n } */\n restore() {\n //console.log('scrollPosition restore 2', this.node.scrollHeight, (this.node.scrollHeight\n //- this.previousScrollHeightMinusTop) + 'px', this.container);\n if (this.readyFor === 'up' || appImManager.scroll.parentElement.classList.contains('scrolled-down')) {\n this.container.scrollTop = this.node.scrollHeight\n - this.previousScrollHeightMinusTop;\n }\n // 'down' doesn't need to be special cased unless the\n // content was flowing upwards, which would only happen\n // if the container is position: absolute, bottom: 0 for\n // a Facebook messages effect\n }\n prepareFor(direction) {\n this.readyFor = direction || 'up';\n this.previousScrollHeightMinusTop = this.node.scrollHeight\n - this.container.scrollTop;\n //console.log('scrollPosition prepareFor', direction, this.node.scrollHeight, this.previousScrollHeightMinusTop + 'px')\n }\n}\nclass ChatInput {\n constructor() {\n this.pageEl = document.querySelector('.page-chats');\n this.messageInput = document.getElementById('input-message') /* HTMLInputElement */;\n this.fileInput = document.getElementById('input-file');\n this.inputMessageContainer = document.getElementsByClassName('input-message-container')[0];\n this.inputScroll = new scrollable_1.default(this.inputMessageContainer);\n this.btnSend = document.getElementById('btn-send');\n this.emoticonsDropdown = null;\n this.emoticonsTimeout = 0;\n this.emoticonsLazyLoadQueue = null;\n this.lastUrl = '';\n this.lastTimeType = 0;\n this.attachMenu = {};\n this.attachMediaPopUp = {};\n this.replyElements = {};\n this.willSendWebPage = null;\n this.replyToMsgID = 0;\n this.editMsgID = 0;\n this.noWebPage = false;\n this.toggleEmoticons = this.pageEl.querySelector('.toggle-emoticons');\n this.attachMenu.container = document.getElementById('attach-file');\n this.attachMenu.media = this.attachMenu.container.querySelector('.menu-media');\n this.attachMenu.document = this.attachMenu.container.querySelector('.menu-document');\n this.attachMenu.poll = this.attachMenu.container.querySelector('.menu-poll');\n this.attachMediaPopUp.container = this.pageEl.querySelector('.popup-send-photo');\n this.attachMediaPopUp.titleEl = this.attachMediaPopUp.container.querySelector('.popup-title');\n this.attachMediaPopUp.sendBtn = this.attachMediaPopUp.container.querySelector('.btn-primary');\n this.attachMediaPopUp.mediaContainer = this.attachMediaPopUp.container.querySelector('.popup-photo');\n this.attachMediaPopUp.captionInput = this.attachMediaPopUp.container.querySelector('input');\n this.replyElements.container = this.pageEl.querySelector('.reply-wrapper');\n this.replyElements.cancelBtn = this.replyElements.container.querySelector('.reply-cancel');\n this.replyElements.titleEl = this.replyElements.container.querySelector('.reply-title');\n this.replyElements.subtitleEl = this.replyElements.container.querySelector('.reply-subtitle');\n this.messageInput.addEventListener('keydown', (e) => {\n if (e.key == 'Enter') {\n /* if(e.ctrlKey || e.metaKey) {\n this.messageInput.innerHTML += '
';\n placeCaretAtEnd(this.message)\n return;\n } */\n if (e.shiftKey || e.ctrlKey || e.metaKey) {\n return;\n }\n this.sendMessage();\n }\n });\n this.messageInput.addEventListener('input', (e) => {\n //console.log('messageInput input', this.messageInput.innerText, this.serializeNodes(Array.from(this.messageInput.childNodes)));\n let value = this.messageInput.innerText;\n let entities = richtextprocessor_1.RichTextProcessor.parseEntities(value);\n //console.log('messageInput entities', entities);\n let entityUrl = entities.find(e => e._ == 'messageEntityUrl');\n if (entityUrl) { // need to get webpage\n let url = value.slice(entityUrl.offset, entityUrl.offset + entityUrl.length);\n //console.log('messageInput url:', url);\n if (this.lastUrl != url) {\n this.lastUrl = url;\n this.willSendWebPage = null;\n apiManager_1.default.invokeApi('messages.getWebPage', {\n url: url,\n hash: 0\n }).then((webpage) => {\n appWebPagesManager_1.default.saveWebPage(webpage);\n if (this.lastUrl != url)\n return;\n console.log('got webpage: ', webpage);\n this.setTopInfo(webpage.site_name || webpage.title, webpage.description || webpage.url);\n this.replyToMsgID = 0;\n this.noWebPage = false;\n this.willSendWebPage = webpage;\n });\n }\n }\n if (!value.trim() && !this.serializeNodes(Array.from(this.messageInput.childNodes)).trim()) {\n this.messageInput.innerHTML = '';\n this.btnSend.classList.remove('tgico-send');\n this.btnSend.classList.add('tgico-microphone2');\n appImManager.setTyping('sendMessageCancelAction');\n }\n else if (!this.btnSend.classList.contains('tgico-send')) {\n this.btnSend.classList.add('tgico-send');\n this.btnSend.classList.remove('tgico-microphone2');\n let time = Date.now();\n if (time - this.lastTimeType >= 6000) {\n this.lastTimeType = time;\n appImManager.setTyping('sendMessageTypingAction');\n }\n }\n });\n if (!richtextprocessor_1.RichTextProcessor.emojiSupported) {\n this.messageInput.addEventListener('copy', (e) => {\n const selection = document.getSelection();\n let range = selection.getRangeAt(0);\n let ancestorContainer = range.commonAncestorContainer;\n let str = '';\n let selectedNodes = Array.from(ancestorContainer.childNodes).slice(range.startOffset, range.endOffset);\n if (selectedNodes.length) {\n str = this.serializeNodes(selectedNodes);\n }\n else {\n str = selection.toString();\n }\n //console.log('messageInput copy', str, ancestorContainer.childNodes, range);\n //let str = getRichValueWithCaret(this.messageInput);\n //console.log('messageInput childNode copy:', str);\n // @ts-ignore\n event.clipboardData.setData('text/plain', str);\n event.preventDefault();\n });\n }\n this.messageInput.addEventListener('paste', (e) => {\n //console.log('messageInput paste');\n e.preventDefault();\n // @ts-ignore\n let text = (e.originalEvent || e).clipboardData.getData('text/plain');\n // console.log('messageInput paste', text);\n text = richtextprocessor_1.RichTextProcessor.wrapEmojiText(text);\n // console.log('messageInput paste after', text);\n // @ts-ignore\n //let html = (e.originalEvent || e).clipboardData.getData('text/html');\n // @ts-ignore\n //console.log('paste text', text, );\n window.document.execCommand('insertHTML', false, text);\n });\n let attachFile = (file) => {\n console.log('selected file:', file, typeof (file));\n willAttachFile = file;\n this.fileInput.value = '';\n this.attachMediaPopUp.captionInput.value = '';\n this.attachMediaPopUp.mediaContainer.innerHTML = '';\n this.attachMediaPopUp.mediaContainer.style.width = '';\n this.attachMediaPopUp.mediaContainer.style.height = '';\n this.attachMediaPopUp.mediaContainer.classList.remove('is-document');\n if (file.type.indexOf('video/') === 0) {\n willAttach = 'document';\n }\n else if (file.type.indexOf('image/') === -1 && willAttach == 'media') {\n willAttach = 'document';\n }\n switch (willAttach) {\n case 'media': {\n let img = new Image();\n img.src = URL.createObjectURL(file);\n img.onload = () => {\n willAttachWidth = img.naturalWidth;\n willAttachHeight = img.naturalHeight;\n let { w, h } = utils_1.calcImageInBox(willAttachWidth, willAttachHeight, 378, 256);\n this.attachMediaPopUp.mediaContainer.style.width = w + 'px';\n this.attachMediaPopUp.mediaContainer.style.height = h + 'px';\n this.attachMediaPopUp.mediaContainer.append(img);\n };\n this.attachMediaPopUp.titleEl.innerText = 'Send Photo';\n this.attachMediaPopUp.container.classList.add('active');\n break;\n }\n case 'document': {\n let docDiv = wrappers_1.wrapDocument({\n file: file,\n file_name: file.name || '',\n size: file.size,\n type: ['image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/bmp'].indexOf(file.type) !== -1 ? 'photo' : 'doc'\n }, false, true);\n this.attachMediaPopUp.titleEl.innerText = 'Send File';\n this.attachMediaPopUp.mediaContainer.append(docDiv);\n this.attachMediaPopUp.mediaContainer.classList.add('is-document');\n this.attachMediaPopUp.container.classList.add('active');\n break;\n }\n }\n };\n let willAttach = '';\n let willAttachFile = null;\n let willAttachWidth = 0, willAttachHeight = 0;\n this.fileInput.addEventListener('change', (e) => {\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n attachFile(file);\n }, false);\n this.attachMenu.media.addEventListener('click', () => {\n willAttach = 'media';\n this.fileInput.click();\n });\n this.attachMenu.document.addEventListener('click', () => {\n willAttach = 'document';\n this.fileInput.click();\n });\n document.addEventListener('paste', (event) => {\n if (!appImManager.peerID || this.attachMediaPopUp.container.classList.contains('active')) {\n return;\n }\n //console.log('document paste');\n // @ts-ignore\n var items = (event.clipboardData || event.originalEvent.clipboardData).items;\n //console.log('item', event.clipboardData.getData());\n for (let i = 0; i < items.length; ++i) {\n if (items[i].kind == 'file') {\n event.preventDefault();\n event.cancelBubble = true;\n event.stopPropagation();\n let file = items[i].getAsFile();\n //console.log(items[i], file);\n if (!file)\n continue;\n willAttach = file.type.indexOf('image/') === 0 ? 'media' : \"document\";\n attachFile(file);\n }\n }\n }, true);\n this.attachMediaPopUp.sendBtn.addEventListener('click', () => {\n this.attachMediaPopUp.container.classList.remove('active');\n let caption = this.attachMediaPopUp.captionInput.value;\n appMessagesManager_1.default.sendFile(appImManager.peerID, willAttachFile, {\n isMedia: true,\n caption,\n width: willAttachWidth,\n height: willAttachHeight\n });\n appImManager.scroll.scrollTop = appImManager.scroll.scrollHeight;\n let dialog = appMessagesManager_1.default.getDialogByPeerID(appImManager.peerID)[0];\n if (dialog && dialog.top_message) {\n appMessagesManager_1.default.readHistory(appImManager.peerID, dialog.top_message); // lol\n }\n });\n this.btnSend.addEventListener('click', () => {\n if (this.btnSend.classList.contains('tgico-send')) {\n this.sendMessage();\n }\n });\n this.toggleEmoticons.onmouseover = (e) => {\n clearTimeout(this.emoticonsTimeout);\n this.emoticonsTimeout = setTimeout(() => {\n if (!this.emoticonsDropdown) {\n let res = emoticonsDropdown_1.default(this.pageEl, appImManager, appMessagesManager_1.default, this.messageInput, this.toggleEmoticons, this.btnSend);\n this.emoticonsDropdown = res.dropdown;\n this.emoticonsLazyLoadQueue = res.lazyLoadQueue;\n this.toggleEmoticons.onmouseout = this.emoticonsDropdown.onmouseout = (e) => {\n clearTimeout(this.emoticonsTimeout);\n this.emoticonsTimeout = setTimeout(() => {\n this.emoticonsDropdown.classList.remove('active');\n this.toggleEmoticons.classList.remove('active');\n lottieLoader_1.default.checkAnimations(true, emoticonsDropdown_1.EMOTICONSSTICKERGROUP);\n }, 200);\n };\n this.emoticonsDropdown.onmouseover = (e) => {\n clearTimeout(this.emoticonsTimeout);\n };\n }\n else {\n this.emoticonsDropdown.classList.add('active');\n this.emoticonsLazyLoadQueue.check();\n }\n this.toggleEmoticons.classList.add('active');\n lottieLoader_1.default.checkAnimations(false, emoticonsDropdown_1.EMOTICONSSTICKERGROUP);\n }, 0 /* 200 */);\n };\n this.replyElements.cancelBtn.addEventListener('click', () => {\n this.replyElements.container.classList.remove('active');\n this.replyToMsgID = 0;\n if (this.editMsgID) {\n if (this.willSendWebPage) {\n let message = appMessagesManager_1.default.getMessage(this.editMsgID);\n this.setTopInfo('Editing', message.message);\n }\n else {\n this.editMsgID = 0;\n this.messageInput.innerHTML = '';\n this.btnSend.classList.remove('tgico-send');\n this.btnSend.classList.add('tgico-microphone2');\n }\n }\n this.noWebPage = true;\n this.willSendWebPage = null;\n });\n }\n serializeNodes(nodes) {\n return nodes.reduce((str, child) => {\n //console.log('childNode', str, child, typeof(child), typeof(child) === 'string', child.innerText);\n if (typeof (child) === 'object' && child.textContent)\n return str += child.textContent;\n if (child.innerText)\n return str += child.innerText;\n if (child.tagName == 'IMG' && child.classList && child.classList.contains('emoji'))\n return str += child.getAttribute('alt');\n return str;\n }, '');\n }\n ;\n sendMessage() {\n //let str = this.serializeNodes(Array.from(this.messageInput.childNodes));\n let str = utils_1.getRichValue(this.messageInput);\n //console.log('childnode str after:', str/* , getRichValue(this.messageInput) */);\n //return;\n this.lastUrl = '';\n if (this.editMsgID) {\n appMessagesManager_1.default.editMessage(this.editMsgID, str, {\n noWebPage: this.noWebPage\n });\n }\n else {\n appMessagesManager_1.default.sendText(appImManager.peerID, str, {\n replyToMsgID: this.replyToMsgID == 0 ? undefined : this.replyToMsgID,\n noWebPage: this.noWebPage,\n webPage: this.willSendWebPage\n });\n appImManager.scroll.scrollTop = appImManager.scroll.scrollHeight;\n }\n let dialog = appMessagesManager_1.default.getDialogByPeerID(appImManager.peerID)[0];\n if (dialog && dialog.top_message) {\n appMessagesManager_1.default.readHistory(appImManager.peerID, dialog.top_message); // lol\n }\n this.editMsgID = 0;\n this.replyToMsgID = 0;\n this.noWebPage = false;\n this.replyElements.container.classList.remove('active');\n this.willSendWebPage = null;\n this.messageInput.innerText = '';\n this.btnSend.classList.remove('tgico-send');\n this.btnSend.classList.add('tgico-microphone2');\n }\n ;\n setTopInfo(title, subtitle, input, media) {\n //appImManager.scrollPosition.prepareFor('down');\n if (this.replyElements.container.lastElementChild.tagName == 'DIV') {\n this.replyElements.container.lastElementChild.remove();\n this.replyElements.container.append(wrappers_1.wrapReply(title, subtitle, media));\n }\n //this.replyElements.titleEl.innerHTML = title ? RichTextProcessor.wrapEmojiText(title) : '';\n //this.replyElements.subtitleEl.innerHTML = subtitle ? RichTextProcessor.wrapEmojiText(subtitle) : '';\n this.replyElements.container.classList.add('active');\n if (input !== undefined) {\n this.messageInput.innerHTML = input ? richtextprocessor_1.RichTextProcessor.wrapRichText(input) : '';\n this.btnSend.classList.remove('tgico-microphone2');\n this.btnSend.classList.add('tgico-send');\n }\n //appImManager.scrollPosition.restore();\n }\n}\nclass AppImManager {\n constructor() {\n this.pageEl = document.querySelector('.page-chats');\n this.btnMute = this.pageEl.querySelector('.tool-mute');\n this.btnMenuMute = this.pageEl.querySelector('.menu-mute');\n this.avatarEl = document.getElementById('im-avatar');\n this.titleEl = document.getElementById('im-title');\n this.subtitleEl = document.getElementById('im-subtitle');\n this.chatInner = document.getElementById('bubbles-inner');\n this.searchBtn = this.pageEl.querySelector('.chat-search-button');\n this.goDownBtn = this.pageEl.querySelector('#bubbles-go-down');\n this.getHistoryTimeout = 0;\n this.chatInputC = null;\n this.myID = 0;\n this.peerID = 0;\n this.muted = false;\n this.bubbles = {};\n this.dateMessages = {};\n this.unreaded = [];\n this.unreadOut = [];\n this.needUpdate = []; // if need wrapSingleMessage\n this.offline = false;\n this.updateStatusInterval = 0;\n this.pinnedMsgID = 0;\n this.pinnedMessageContainer = this.pageEl.querySelector('.pinned-message');\n this.pinnedMessageContent = this.pinnedMessageContainer.querySelector('.pinned-message-subtitle');\n this.firstTopMsgID = 0;\n this.loadMediaQueue = [];\n this.loadMediaQueuePromise = null;\n this.loadingMedia = 0;\n this.scroll = null;\n this.scrollPosition = null;\n this.preloader = null;\n this.typingTimeouts = {};\n this.typingUsers = {}; // to peerID\n this.topbar = null;\n this.chatInput = null;\n this.contextMenu = document.getElementById('bubble-contextmenu');\n this.contextMenuPin = this.contextMenu.querySelector('.menu-pin');\n this.contextMenuEdit = this.contextMenu.querySelector('.menu-edit');\n this.popupDeleteMessage = {};\n this.setPeerPromise = null;\n this.log = polyfill_1.logger('IM');\n this.chatInputC = new ChatInput();\n this.preloader = new preloader_1.default(null, false);\n this.popupDeleteMessage.popupEl = this.pageEl.querySelector('.popup-delete-message');\n this.popupDeleteMessage.deleteBothBtn = this.popupDeleteMessage.popupEl.querySelector('.popup-delete-both');\n this.popupDeleteMessage.deleteMeBtn = this.popupDeleteMessage.popupEl.querySelector('.popup-delete-me');\n this.popupDeleteMessage.cancelBtn = this.popupDeleteMessage.popupEl.querySelector('.popup-close');\n apiManager_1.default.getUserID().then((id) => {\n this.myID = id;\n });\n this.topbar = document.getElementById('topbar');\n this.chatInput = document.getElementById('chat-input');\n utils_1.$rootScope.$on('user_auth', (e) => {\n let userAuth = e.detail;\n this.myID = userAuth ? userAuth.id : 0;\n });\n utils_1.$rootScope.$on('history_append', (e) => {\n let details = e.detail;\n this.renderMessagesByIDs([details.messageID]);\n });\n utils_1.$rootScope.$on('history_update', (e) => {\n let details = e.detail;\n if (details.mid && details.peerID == this.peerID) {\n let mid = details.mid;\n let bubble = this.bubbles[mid];\n if (!bubble)\n return;\n let message = appMessagesManager_1.default.getMessage(mid);\n //this.log('history_update', this.bubbles[mid], mid, message);\n this.renderMessage(message, false, false, bubble);\n this.deleteEmptySideDivs();\n }\n });\n utils_1.$rootScope.$on('history_multiappend', (e) => {\n let msgIDsByPeer = e.detail;\n if (!(this.peerID in msgIDsByPeer))\n return;\n let msgIDs = msgIDsByPeer[this.peerID];\n this.renderMessagesByIDs(msgIDs);\n appDialogsManager_1.default.sortDom();\n });\n utils_1.$rootScope.$on('history_delete', (e) => {\n let detail = e.detail;\n this.deleteMessagesByIDs(Object.keys(detail.msgs).map(s => +s));\n setTimeout(() => {\n this.deleteEmptySideDivs();\n }, 0);\n });\n // Calls when message successfully sent and we have an ID\n utils_1.$rootScope.$on('message_sent', (e) => {\n let { tempID, mid } = e.detail;\n ////this.log('message_sent', e.detail);\n let bubble = this.bubbles[tempID];\n if (bubble) {\n this.bubbles[mid] = bubble;\n /////this.log('message_sent', bubble);\n let media = bubble.querySelector('img, video');\n if (media) {\n media.setAttribute('message-id', mid);\n }\n bubble.classList.remove('is-sending');\n bubble.classList.add('is-sent');\n delete this.bubbles[tempID];\n }\n else {\n this.log.warn('message_sent there is no bubble', e.detail);\n }\n let length = this.unreadOut.length;\n for (let i = 0; i < length; i++) {\n if (this.unreadOut[i] == tempID) {\n this.unreadOut[i] = mid;\n }\n }\n });\n utils_1.$rootScope.$on('message_edit', (e) => {\n let { peerID, mid, id, justMedia } = e.detail;\n if (peerID != this.peerID)\n return;\n let bubble = this.bubbles[mid];\n if (!bubble)\n return;\n let message = appMessagesManager_1.default.getMessage(mid);\n this.renderMessage(message, false, false, bubble, false);\n });\n utils_1.$rootScope.$on('messages_downloaded', (e) => {\n let mids = e.detail;\n mids.forEach(mid => {\n if (this.pinnedMsgID == mid) {\n let message = appMessagesManager_1.default.getMessage(mid);\n /////this.log('setting pinned message', message);\n this.pinnedMessageContainer.dataset.mid = '' + mid;\n this.pinnedMessageContainer.style.display = '';\n this.pinnedMessageContent.innerHTML = richtextprocessor_1.RichTextProcessor.wrapEmojiText(message.message);\n }\n let length = this.needUpdate.length;\n for (let i = length - 1; i >= 0; --i) {\n if (this.needUpdate[i].replyMid == mid) {\n let { mid, replyMid } = this.needUpdate.splice(i, 1)[0];\n //this.log('messages_downloaded', mid, replyMid, i, this.needUpdate, this.needUpdate.length, mids, this.bubbles[mid]);\n let bubble = this.bubbles[mid];\n if (!bubble)\n return;\n let message = appMessagesManager_1.default.getMessage(mid);\n let repliedMessage = appMessagesManager_1.default.getMessage(replyMid);\n if (repliedMessage.deleted) { // чтобы не пыталось бесконечно загрузить удалённое сообщение\n delete message.reply_to_mid; // WARNING!\n }\n this.renderMessage(message, false, false, bubble, false);\n }\n }\n });\n });\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n let update = e.detail;\n this.handleUpdate(update);\n });\n window.addEventListener('blur', () => {\n lottieLoader_1.default.checkAnimations(true);\n this.offline = true;\n this.updateStatus();\n clearInterval(this.updateStatusInterval);\n window.addEventListener('focus', () => {\n lottieLoader_1.default.checkAnimations(false);\n this.offline = false;\n this.updateStatus();\n this.updateStatusInterval = window.setInterval(() => this.updateStatus(), 50e3);\n }, { once: true });\n });\n this.pageEl.querySelector('.person').addEventListener('click', (e) => {\n appSidebarRight_1.default.toggleSidebar(true);\n });\n this.chatInner.addEventListener('click', (e) => {\n let target = e.target;\n let bubble = null;\n try {\n bubble = utils_1.findUpClassName(e.target, 'bubble');\n }\n catch (err) { }\n if (!bubble)\n return;\n if (['IMG', 'VIDEO', 'SVG', 'DIV'].indexOf(target.tagName) === -1)\n target = utils_1.findUpTag(target, 'DIV');\n /* if(target.tagName == 'VIDEO' && bubble.classList.contains('round')) {\n let video = target as HTMLVideoElement;\n video.currentTime = 0;\n if(video.paused) {\n video.play();\n video.volume = 1;\n } else {\n video.pause();\n video.volume = 0;\n }\n return;\n } */\n if (target.tagName == 'DIV') {\n if (target.classList.contains('forward')) {\n let savedFrom = bubble.dataset.savedFrom;\n let splitted = savedFrom.split('_');\n let peerID = +splitted[0];\n let msgID = +splitted[1];\n ////this.log('savedFrom', peerID, msgID);\n this.setPeer(peerID, msgID, true);\n return;\n }\n else if (target.classList.contains('user-avatar') || target.classList.contains('name')) {\n let peerID = +target.dataset.peerID;\n if (!isNaN(peerID)) {\n this.setPeer(peerID);\n }\n return;\n }\n let isReplyClick = false;\n try {\n isReplyClick = !!utils_1.findUpClassName(e.target, 'reply');\n }\n catch (err) { }\n if (isReplyClick && bubble.classList.contains('is-reply') /* || bubble.classList.contains('forwarded') */) {\n let originalMessageID = +bubble.getAttribute('data-original-mid');\n this.setPeer(this.peerID, originalMessageID);\n }\n }\n else if (bubble.classList.contains('round')) {\n }\n else if (target.tagName == 'IMG' && target.parentElement.classList.contains('user-avatar')) {\n let peerID = +target.parentElement.dataset.peerID;\n if (!isNaN(peerID)) {\n this.setPeer(peerID);\n }\n }\n else if ((target.tagName == 'IMG' && !target.classList.contains('emoji')) || target.tagName == 'VIDEO') {\n let messageID = +target.getAttribute('message-id');\n let message = appMessagesManager_1.default.getMessage(messageID);\n if (!message) {\n this.log.warn('no message by messageID:', messageID);\n return;\n }\n let ids = Object.keys(this.bubbles).map(k => +k).filter(id => {\n let message = appMessagesManager_1.default.getMessage(id);\n return message.media && (message.media.photo\n || (message.media.document && (message.media.document.type == 'video' || message.media.document.type == 'gif'))\n || (message.media.webpage && (message.media.webpage.document || message.media.webpage.photo)));\n }).sort();\n let idx = ids.findIndex(i => i == messageID);\n let prev = ids[idx + 1] || null;\n let next = ids[idx - 1] || null;\n let prevTarget = this.bubbles[prev] ? this.bubbles[prev].querySelector('img, video') : null;\n let nextTarget = this.bubbles[next] ? this.bubbles[next].querySelector('img, video') : null;\n /////this.log('ids', ids, idx, this.bubbles[prev], this.bubbles[next]);\n appMediaViewer_1.default.openMedia(message, target, nextTarget, prevTarget);\n //appMediaViewer.openMedia(message, target as HTMLImageElement);\n }\n //console.log('chatInner click', e);\n });\n this.searchBtn.addEventListener('click', (e) => {\n if (this.peerID) {\n appSidebarLeft_1.default.beginSearch(this.peerID);\n }\n });\n this.pinnedMessageContainer.addEventListener('click', (e) => {\n e.preventDefault();\n e.cancelBubble = true;\n let mid = +this.pinnedMessageContainer.getAttribute('data-mid');\n this.setPeer(this.peerID, mid);\n });\n this.btnMenuMute.addEventListener('click', () => this.mutePeer());\n this.btnMute.addEventListener('click', () => this.mutePeer());\n let onKeyDown = (e) => {\n let target = e.target;\n //if(target.tagName == 'INPUT') return;\n //this.log('onkeydown', e);\n if (this.chatInputC.attachMediaPopUp.container.classList.contains('active')) {\n if (target.tagName != 'INPUT') {\n this.chatInputC.attachMediaPopUp.captionInput.focus();\n }\n if (e.key == 'Enter') {\n this.chatInputC.attachMediaPopUp.sendBtn.click();\n }\n else if (e.key == 'Escape') {\n this.chatInputC.attachMediaPopUp.container.classList.remove('active');\n }\n return;\n }\n if (e.key == 'Meta' || e.key == 'Control') {\n return;\n }\n else if (e.key == 'c' && (e.ctrlKey || e.metaKey) && target.tagName != 'INPUT') {\n return;\n }\n if (e.target != this.chatInputC.messageInput && target.tagName != 'INPUT') {\n this.chatInputC.messageInput.focus();\n utils_1.placeCaretAtEnd(this.chatInputC.messageInput);\n }\n };\n document.body.addEventListener('keydown', onKeyDown);\n /* this.chatInner.addEventListener('mouseover', () => {\n document.body.addEventListener('keydown', onKeyDown);\n \n this.log('mouseover');\n \n this.chatInner.addEventListener('mouseout', () => {\n document.body.removeEventListener('keydown', onKeyDown);\n }, {once: true});\n }); */\n this.chatInner.addEventListener('contextmenu', e => {\n let bubble = null;\n try {\n bubble = utils_1.findUpClassName(e.target, 'bubble');\n }\n catch (e) { }\n if (bubble) {\n e.preventDefault();\n e.cancelBubble = true;\n let msgID = 0;\n for (let id in this.bubbles) {\n if (this.bubbles[id] === bubble) {\n msgID = +id;\n break;\n }\n }\n if (!msgID)\n return;\n if (this.myID == this.peerID ||\n (this.peerID < 0 && !appPeersManager_1.default.isChannel(this.peerID) && !appPeersManager_1.default.isMegagroup(this.peerID))) {\n this.contextMenuPin.style.display = '';\n }\n else\n this.contextMenuPin.style.display = 'none';\n this.contextMenuMsgID = msgID;\n let side = bubble.parentElement.classList.contains('in') ? 'left' : 'right';\n this.contextMenuEdit.style.display = side == 'right' ? '' : 'none';\n this.contextMenu.classList.remove('bottom-left', 'bottom-right');\n this.contextMenu.classList.add(side == 'left' ? 'bottom-right' : 'bottom-left');\n let { clientX, clientY } = e;\n this.contextMenu.style.left = (side == 'right' ? clientX - this.contextMenu.scrollWidth : clientX) + 'px';\n if ((clientY + this.contextMenu.scrollHeight) > window.innerHeight) {\n this.contextMenu.style.top = (window.innerHeight - this.contextMenu.scrollHeight) + 'px';\n }\n else {\n this.contextMenu.style.top = clientY + 'px';\n }\n //this.contextMenu.classList.add('active');\n misc_1.openBtnMenu(this.contextMenu);\n /////this.log('contextmenu', e, bubble, msgID, side);\n }\n });\n this.contextMenu.querySelector('.menu-copy').addEventListener('click', () => {\n let message = appMessagesManager_1.default.getMessage(this.contextMenuMsgID);\n let str = message ? message.message : '';\n var textArea = document.createElement(\"textarea\");\n textArea.value = str;\n textArea.style.position = \"fixed\"; //avoid scrolling to bottom\n document.body.appendChild(textArea);\n textArea.focus();\n textArea.select();\n try {\n document.execCommand('copy');\n }\n catch (err) {\n console.error('Oops, unable to copy', err);\n }\n document.body.removeChild(textArea);\n });\n this.contextMenu.querySelector('.menu-delete').addEventListener('click', () => {\n if (this.peerID == this.myID) {\n this.popupDeleteMessage.deleteBothBtn.style.display = 'none';\n this.popupDeleteMessage.deleteMeBtn.innerText = 'DELETE';\n }\n else {\n this.popupDeleteMessage.deleteBothBtn.style.display = '';\n this.popupDeleteMessage.deleteMeBtn.innerText = 'DELETE JUST FOR ME';\n if (this.peerID > 0) {\n let title = appPeersManager_1.default.getPeerTitle(this.peerID);\n this.popupDeleteMessage.deleteBothBtn.innerHTML = 'DELETE FOR ME AND ' + title;\n }\n else {\n this.popupDeleteMessage.deleteBothBtn.innerText = 'DELETE FOR ALL';\n }\n }\n this.popupDeleteMessage.popupEl.classList.add('active');\n });\n this.contextMenu.querySelector('.menu-reply').addEventListener('click', () => {\n let message = appMessagesManager_1.default.getMessage(this.contextMenuMsgID);\n this.chatInputC.setTopInfo(appPeersManager_1.default.getPeerTitle(message.fromID, true), message.message, undefined, message.media);\n this.chatInputC.replyToMsgID = this.contextMenuMsgID;\n this.chatInputC.editMsgID = 0;\n });\n this.contextMenuEdit.addEventListener('click', () => {\n let message = appMessagesManager_1.default.getMessage(this.contextMenuMsgID);\n this.chatInputC.setTopInfo('Editing', message.message, message.message, message.media);\n this.chatInputC.replyToMsgID = 0;\n this.chatInputC.editMsgID = this.contextMenuMsgID;\n });\n this.contextMenuPin.addEventListener('click', () => {\n apiManager_1.default.invokeApi('messages.updatePinnedMessage', {\n flags: 0,\n peer: appPeersManager_1.default.getInputPeerByID(this.peerID),\n id: this.contextMenuMsgID\n }).then(updates => {\n /////this.log('pinned updates:', updates);\n apiUpdatesManager_1.default.processUpdateMessage(updates);\n });\n });\n this.popupDeleteMessage.deleteBothBtn.addEventListener('click', () => {\n this.deleteMessages(true);\n this.popupDeleteMessage.cancelBtn.click();\n });\n this.popupDeleteMessage.deleteMeBtn.addEventListener('click', () => {\n this.deleteMessages(false);\n this.popupDeleteMessage.cancelBtn.click();\n });\n this.goDownBtn.addEventListener('click', () => {\n let dialog = appMessagesManager_1.default.getDialogByPeerID(this.peerID)[0];\n if (dialog) {\n this.setPeer(this.peerID, dialog.top_message);\n }\n else {\n this.scroll.scrollTop = this.scroll.scrollHeight;\n }\n });\n this.updateStatusInterval = window.setInterval(() => this.updateStatus(), 50e3);\n this.updateStatus();\n setInterval(() => this.setPeerStatus(), 60e3);\n this.loadMediaQueueProcess();\n }\n deleteMessages(revoke = false) {\n let flags = revoke ? 1 : 0;\n let ids = [this.contextMenuMsgID];\n apiManager_1.default.invokeApi('messages.deleteMessages', {\n flags: flags,\n revoke: revoke,\n id: ids\n }).then((affectedMessages) => {\n /////this.log('deleted messages:', affectedMessages);\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updatePts',\n pts: affectedMessages.pts,\n pts_count: affectedMessages.pts_count\n }\n });\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updateDeleteMessages',\n messages: ids\n }\n });\n });\n }\n deleteEmptySideDivs() {\n let nodes = Array.from(this.chatInner.childNodes);\n nodes.filter((node) => {\n let childElementCount = node.childElementCount;\n if (!childElementCount) {\n node.remove();\n return false;\n }\n else if (childElementCount == 1) {\n let child = node.firstElementChild;\n if (child.classList.contains('service')) {\n node.remove();\n return false;\n }\n }\n return true;\n }).forEach(node => {\n let nextNode = node.nextElementSibling;\n if (nextNode && node.className == nextNode.className) {\n Array.from(node.childNodes).reverse().forEach(div => {\n nextNode.prepend(div);\n });\n node.remove();\n }\n });\n }\n loadMediaQueuePush(cb) {\n this.loadMediaQueue.push(cb);\n this.loadMediaQueueProcess();\n }\n loadMediaQueueProcessOld() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.loadMediaQueuePromise /* || 1 == 1 */)\n return this.loadMediaQueuePromise;\n let woo = this.loadMediaQueue.splice(-5, 5).reverse().map(f => f());\n if (woo.length) {\n ///this.log('Will load more media:', woo.length);\n woo.forEach((promise) => __awaiter(this, void 0, void 0, function* () {\n try {\n yield promise;\n }\n catch (err) {\n this.log.error('loadMediaQueue error:', err);\n }\n this.loadingMedia--;\n }));\n try {\n this.loadMediaQueuePromise = Promise.all(woo);\n yield this.loadMediaQueuePromise;\n }\n catch (err) {\n this.log.error('loadMediaQueue error:', err);\n }\n }\n this.loadMediaQueuePromise = null;\n if (this.loadMediaQueue.length)\n return this.loadMediaQueueProcess();\n return this.loadMediaQueuePromise;\n });\n }\n loadMediaQueueProcess() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.loadingMedia >= 5)\n return;\n let item = this.loadMediaQueue.pop();\n if (item) {\n this.loadingMedia++;\n let peerID = this.peerID;\n let promise = item();\n try {\n yield promise;\n }\n catch (err) {\n this.log.error('loadMediaQueue error:', err);\n }\n if (peerID == this.peerID) {\n this.loadingMedia--;\n }\n }\n if (this.loadMediaQueue.length)\n return this.loadMediaQueueProcess();\n });\n }\n updateStatus() {\n if (!this.myID)\n return Promise.resolve();\n appUsersManager_1.default.setUserStatus(this.myID, this.offline);\n return apiManager_1.default.invokeApi('account.updateStatus', {\n offline: this.offline\n }, { noErrorBox: true });\n }\n onScroll() {\n let length = this.unreaded.length;\n let readed = [];\n for (let i = length - 1; i >= 0; --i) {\n let msgID = this.unreaded[i];\n let bubble = this.bubbles[msgID];\n if (utils_1.isElementInViewport(bubble)) {\n readed.push(msgID);\n this.unreaded.splice(i, 1);\n }\n }\n lottieLoader_1.default.checkAnimations();\n if (readed.length) {\n let max = Math.max(...readed);\n let min = Math.min(...readed);\n if (this.peerID < 0) {\n max = appMessagesIDsManager_1.default.getMessageIDInfo(max)[0];\n min = appMessagesIDsManager_1.default.getMessageIDInfo(min)[0];\n }\n //appMessagesManager.readMessages(readed);\n appMessagesManager_1.default.readHistory(this.peerID, max, min).catch((err) => {\n this.log.error('readHistory err:', err);\n appMessagesManager_1.default.readHistory(this.peerID, max, min);\n });\n }\n if (this.scroll.scrollHeight - (this.scroll.scrollTop + this.scroll.offsetHeight) == 0 /* <= 5 */) {\n this.scroll.parentElement.classList.add('scrolled-down');\n }\n else if (this.scroll.parentElement.classList.contains('scrolled-down')) {\n this.scroll.parentElement.classList.remove('scrolled-down');\n }\n // load more history\n if (!this.getHistoryPromise && !this.getHistoryTimeout && !testScroll) {\n this.getHistoryTimeout = setTimeout(() => {\n let history = Object.keys(this.bubbles).map(id => +id).sort();\n /* let history = appMessagesManager.historiesStorage[this.peerID].history;\n let length = history.length; */\n // filter negative ids\n let lastBadIndex = -1;\n for (let i = 0; i < history.length; ++i) {\n if (history[i] <= 0)\n lastBadIndex = i;\n else\n break;\n }\n if (lastBadIndex != -1) {\n history = history.slice(lastBadIndex + 1);\n }\n this.getHistoryTimeout = 0;\n let willLoad = false;\n if (!this.scrolledAll) {\n let length = history.length < 10 ? history.length : 10;\n for (let i = 0; i < length; ++i) {\n let msgID = history[i];\n let bubble = this.bubbles[msgID];\n if (!bubble) {\n this.log.error('no bubble by msgID:', msgID);\n continue;\n }\n if (utils_1.isElementInViewport(bubble)) {\n willLoad = true;\n ////this.log('Will load more (up) history by id:', history[0], 'maxID:', history[history.length - 1], history, bubble);\n /* false && */ !testScroll && this.getHistory(history[0], true).then(() => {\n this.onScroll();\n }).catch(err => {\n this.log.warn('Could not load more history, err:', err);\n });\n break;\n }\n }\n }\n if (this.scrolledAllDown)\n return;\n let dialog = appMessagesManager_1.default.getDialogByPeerID(this.peerID)[0];\n /* if(!dialog) {\n this.log.warn('no dialog for load history');\n return;\n } */\n // if scroll down after search\n if (!willLoad && (!dialog || history.indexOf(dialog.top_message) === -1)) {\n let lastMsgIDs = history.slice(-10);\n for (let msgID of lastMsgIDs) {\n let bubble = this.bubbles[msgID];\n if (utils_1.isElementInViewport(bubble)) {\n willLoad = true;\n ////this.log('Will load more (down) history by maxID:', lastMsgIDs[lastMsgIDs.length - 1], lastMsgIDs, bubble);\n /* false && */ !testScroll && this.getHistory(lastMsgIDs[lastMsgIDs.length - 1], false, true).then(() => {\n this.onScroll();\n }).catch(err => {\n this.log.warn('Could not load more history, err:', err);\n });\n break;\n }\n }\n }\n }, 0);\n }\n }\n setScroll(scroll) {\n this.scroll = scroll;\n this.scrollPosition = new ScrollPosition(this.chatInner);\n this.scroll.addEventListener('scroll', this.onScroll.bind(this));\n this.scroll.parentElement.classList.add('scrolled-down');\n }\n setPeerStatus() {\n if (!this.myID)\n return;\n // set subtitle\n this.subtitleEl.innerText = appSidebarRight_1.default.profileElements.subtitle.innerText = '';\n this.subtitleEl.classList.remove('online');\n appSidebarRight_1.default.profileElements.subtitle.classList.remove('online');\n if (this.peerID < 0) { // not human\n let chat = appPeersManager_1.default.getPeer(this.peerID);\n let isChannel = appPeersManager_1.default.isChannel(this.peerID) && !appPeersManager_1.default.isMegagroup(this.peerID);\n ///////this.log('setPeerStatus', chat);\n Promise.all([\n appPeersManager_1.default.isMegagroup(this.peerID) ? apiManager_1.default.invokeApi('messages.getOnlines', {\n peer: appPeersManager_1.default.getInputPeerByID(this.peerID)\n }) : Promise.resolve(),\n // will redirect if wrong\n appProfileManager_1.default.getChatFull(chat.id)\n ]).then(results => {\n let [chatOnlines, chatInfo] = results;\n let onlines = chatOnlines ? chatOnlines.onlines : 1;\n ///////////this.log('chatInfo res:', chatInfo);\n if (chatInfo.pinned_msg_id) { // request pinned message\n this.pinnedMsgID = chatInfo.pinned_msg_id;\n appMessagesManager_1.default.wrapSingleMessage(chatInfo.pinned_msg_id);\n }\n let participants_count = chatInfo.participants_count || chatInfo.participants.participants.length;\n let subtitle = utils_1.numberWithCommas(participants_count) + ' ' + (isChannel ? 'subscribers' : 'members');\n if (onlines > 1) {\n subtitle += ', ' + utils_1.numberWithCommas(onlines) + ' online';\n }\n this.subtitleEl.innerText = appSidebarRight_1.default.profileElements.subtitle.innerText = subtitle;\n });\n }\n else if (!appUsersManager_1.default.isBot(this.peerID)) { // user\n let user = appUsersManager_1.default.getUser(this.peerID);\n //this.subtitleEl.classList.remove('online');\n if (user && user.status && this.myID != this.peerID) {\n let subtitle = '';\n switch (user.status._) {\n case 'userStatusRecently':\n subtitle += 'last seen recently';\n break;\n case 'userStatusOffline':\n subtitle = 'last seen ';\n let date = user.status.was_online;\n let now = Date.now() / 1000;\n if ((now - date) < 60) {\n subtitle += ' just now';\n }\n else if ((now - date) < 3600) {\n subtitle += ((now - date) / 60 | 0) + ' minutes ago';\n }\n else if (now - date < 86400) {\n subtitle += ((now - date) / 3600 | 0) + ' hours ago';\n }\n else {\n let d = new Date(date * 1000);\n subtitle += ('0' + d.getDate()).slice(-2) + '.' + ('0' + (d.getMonth() + 1)).slice(-2) + ' at ' +\n ('0' + d.getHours()).slice(-2) + ':' + ('0' + d.getMinutes()).slice(-2);\n }\n break;\n case 'userStatusOnline':\n this.subtitleEl.classList.add('online');\n appSidebarRight_1.default.profileElements.subtitle.classList.add('online');\n subtitle = 'online';\n break;\n }\n appSidebarRight_1.default.profileElements.subtitle.innerText = subtitle;\n if (this.typingUsers[this.peerID] == this.peerID) {\n this.subtitleEl.innerText = 'typing...';\n this.subtitleEl.classList.add('online');\n }\n else\n this.subtitleEl.innerText = subtitle;\n }\n }\n }\n cleanup() {\n this.peerID = utils_1.$rootScope.selectedPeerID = 0;\n this.scrolledAll = false;\n this.scrolledAllDown = false;\n this.muted = false;\n if (this.lastContainerDiv)\n this.lastContainerDiv.remove();\n if (this.firstContainerDiv)\n this.firstContainerDiv.remove();\n this.lastContainerDiv = undefined;\n this.firstContainerDiv = undefined;\n for (let i in this.bubbles) {\n let bubble = this.bubbles[i];\n bubble.remove();\n }\n this.bubbles = {};\n this.dateMessages = {};\n this.unreaded = [];\n this.unreadOut = [];\n this.loadMediaQueue = [];\n this.loadingMedia = 0;\n this.needUpdate.length = 0;\n lottieLoader_1.default.checkAnimations(false, 'chat', true);\n // clear input \n this.chatInputC.messageInput.innerHTML = '';\n this.chatInputC.replyElements.cancelBtn.click();\n // clear messages\n this.chatInner.innerHTML = '';\n //appSidebarRight.minMediaID = {};\n }\n setPeer(peerID, lastMsgID = 0, forwarding = false) {\n if (peerID == 0) {\n appSidebarRight_1.default.toggleSidebar(false);\n this.topbar.style.display = this.chatInput.style.display = this.goDownBtn.style.display = 'none';\n this.cleanup();\n return Promise.resolve(false);\n }\n let samePeer = this.peerID == peerID;\n if (this.setPeerPromise && samePeer)\n return this.setPeerPromise;\n if (lastMsgID) {\n appMessagesManager_1.default.readHistory(peerID, lastMsgID); // lol\n }\n if (samePeer) {\n if (!testScroll && !lastMsgID) {\n return Promise.resolve(true);\n }\n if (this.bubbles[lastMsgID]) {\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n if (dialog && lastMsgID == dialog.top_message) {\n this.scroll.scrollTop = this.scroll.scrollHeight;\n }\n else {\n this.bubbles[lastMsgID].scrollIntoView();\n }\n return Promise.resolve(true);\n }\n }\n // clear \n this.cleanup();\n // set new\n this.peerID = utils_1.$rootScope.selectedPeerID = peerID;\n // no dialog\n /* if(!appMessagesManager.getDialogByPeerID(this.peerID).length) {\n this.log.error('No dialog by peerID:', this.peerID);\n return Promise.reject();\n } */\n this.pinnedMessageContainer.style.display = 'none';\n this.preloader.attach(this.chatInner);\n let dialog = appMessagesManager_1.default.getDialogByPeerID(this.peerID)[0] || null;\n //////this.log('setPeer peerID:', this.peerID, dialog, lastMsgID);\n appDialogsManager_1.default.loadDialogPhoto(this.avatarEl, this.peerID);\n appDialogsManager_1.default.loadDialogPhoto(appSidebarRight_1.default.profileElements.avatar, this.peerID);\n if (!samePeer && appDialogsManager_1.default.lastActiveListElement) {\n appDialogsManager_1.default.lastActiveListElement.classList.remove('active');\n }\n this.firstTopMsgID = dialog ? dialog.top_message : 0;\n /* let dom = appDialogsManager.getDialogDom(this.peerID);\n if(!dom) {\n this.log.warn('No rendered dialog by peerID:', this.peerID);\n appDialogsManager.addDialog(dialog);\n dom = appDialogsManager.getDialogDom(this.peerID);\n }\n // warning need check\n dom.listEl.classList.add('active'); */\n this.setPeerStatus();\n //this.titleEl.innerHTML = appSidebarRight.profileElements.name.innerHTML = dom.titleSpan.innerHTML;\n this.titleEl.innerHTML = appSidebarRight_1.default.profileElements.name.innerHTML = appPeersManager_1.default.getPeerTitle(this.peerID);\n this.topbar.style.display = this.goDownBtn.style.display = '';\n appSidebarRight_1.default.toggleSidebar(true);\n this.chatInput.style.display = appPeersManager_1.default.isChannel(peerID) && !appPeersManager_1.default.isMegagroup(peerID) ? 'none' : '';\n if (appPeersManager_1.default.isAnyGroup(peerID)) {\n this.chatInner.classList.add('is-chat');\n }\n else {\n this.chatInner.classList.remove('is-chat');\n }\n return this.setPeerPromise = Promise.all([\n this.getHistory(forwarding ? lastMsgID + 1 : lastMsgID).then(() => {\n ////this.log('setPeer removing preloader');\n if (lastMsgID) {\n if (!forwarding) {\n let message = appMessagesManager_1.default.getMessage(lastMsgID);\n //////this.log('setPeer render last message:', message, lastMsgID);\n this.renderMessage(message);\n }\n if (!dialog || lastMsgID != dialog.top_message) {\n let bubble = this.bubbles[lastMsgID];\n if (bubble)\n this.bubbles[lastMsgID].scrollIntoView();\n else\n this.log.warn('no bubble by lastMsgID:', lastMsgID);\n }\n else {\n this.scroll.scrollTop = this.scroll.scrollHeight;\n }\n }\n else if (dialog && dialog.top_message) { // add last message, bc in getHistory will load < max_id\n this.renderMessage(appMessagesManager_1.default.getMessage(dialog.top_message));\n }\n if (this.scroll) {\n this.onScroll();\n }\n this.preloader.detach();\n //setTimeout(() => {\n //appSidebarRight.fillProfileElements();\n appSidebarRight_1.default.loadSidebarMedia();\n //}, 500);\n return true;\n }) /* .catch(err => {\n this.log.error(err);\n }) */,\n appSidebarRight_1.default.fillProfileElements()\n ]).then(() => {\n if (this.peerID == peerID) {\n this.setPeerPromise = null;\n }\n return true;\n }).catch(err => {\n if (this.peerID == peerID) {\n this.setPeerPromise = null;\n }\n this.log.error('setPeer promises error:', err);\n return false;\n });\n }\n setTyping(action) {\n if (!this.peerID)\n return Promise.resolve(false);\n if (typeof (action) == 'string') {\n action = { _: action };\n }\n let input = appPeersManager_1.default.getInputPeerByID(this.peerID);\n return apiManager_1.default.invokeApi('messages.setTyping', {\n peer: input,\n action: action\n });\n }\n updateUnreadByDialog(dialog) {\n let maxID = this.peerID == this.myID ? dialog.read_inbox_max_id : dialog.read_outbox_max_id;\n ///////this.log('updateUnreadByDialog', maxID, dialog, this.unreadOut);\n let length = this.unreadOut.length;\n for (let i = length - 1; i >= 0; --i) {\n let msgID = this.unreadOut[i];\n if (msgID > 0 && msgID <= maxID) {\n let bubble = this.bubbles[msgID];\n bubble.classList.remove('is-sent');\n bubble.classList.add('is-read');\n this.unreadOut.splice(i, 1);\n }\n }\n }\n deleteMessagesByIDs(msgIDs) {\n msgIDs.forEach(id => {\n if (this.firstTopMsgID == id) {\n let dialog = appMessagesManager_1.default.getDialogByPeerID(this.peerID)[0];\n if (dialog) {\n ///////this.log('setting firstTopMsgID after delete:', id, dialog.top_message, dialog);\n this.firstTopMsgID = dialog.top_message;\n }\n }\n if (!(id in this.bubbles))\n return;\n let bubble = this.bubbles[id];\n let parent = bubble.parentNode;\n delete this.bubbles[id];\n bubble.remove();\n if (!parent.childNodes.length) {\n parent.remove();\n }\n });\n lottieLoader_1.default.checkAnimations();\n }\n renderMessagesByIDs(msgIDs) {\n if (!this.bubbles[this.firstTopMsgID] && Object.keys(this.bubbles).length) { // seems search active\n //////this.log('seems search is active, skipping render:', msgIDs);\n return;\n }\n msgIDs.forEach((msgID) => {\n let message = appMessagesManager_1.default.getMessage(msgID);\n /////////this.log('got new message to append:', message);\n //this.unreaded.push(msgID);\n this.renderMessage(message);\n });\n }\n renderMessage(message, reverse = false, multipleRender, bubble = null, updatePosition = true) {\n /////this.log('message to render:', message);\n if (message.deleted)\n return;\n let peerID = this.peerID;\n let our = message.fromID == this.myID;\n let messageDiv = document.createElement('div');\n messageDiv.classList.add('message');\n //messageDiv.innerText = message.message;\n if (!multipleRender) {\n this.scrollPosition.prepareFor(reverse ? 'up' : 'down'); // лагает из-за этого\n }\n // bubble\n if (!bubble) {\n bubble = document.createElement('div');\n bubble.classList.add('bubble');\n this.bubbles[+message.mid] = bubble;\n }\n else {\n bubble.className = 'bubble';\n bubble.innerHTML = '';\n }\n // time section\n let date = new Date(message.date * 1000);\n let time = ('0' + date.getHours()).slice(-2) +\n ':' + ('0' + date.getMinutes()).slice(-2);\n if (message.views) {\n bubble.classList.add('channel-post');\n time = utils_1.formatNumber(message.views, 1) + ' ' + time;\n }\n if (message.edit_date) {\n bubble.classList.add('is-edited');\n time = 'edited ' + time;\n }\n let timeSpan = document.createElement('span');\n timeSpan.classList.add('time');\n let timeInner = document.createElement('div');\n timeInner.classList.add('inner', 'tgico');\n timeInner.innerHTML = time;\n let richText = richtextprocessor_1.RichTextProcessor.wrapRichText(message.message, {\n entities: message.totalEntities\n });\n if (message.totalEntities) {\n let emojiEntities = message.totalEntities.filter((e) => e._ == 'messageEntityEmoji');\n let strLength = message.message.length;\n let emojiStrLength = emojiEntities.reduce((acc, curr) => acc + curr.length, 0);\n if (emojiStrLength == strLength && emojiEntities.length <= 3) {\n let attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment');\n attachmentDiv.innerHTML = richText;\n messageDiv.classList.add('message-empty');\n bubble.classList.add('emoji-' + emojiEntities.length + 'x', 'emoji-big');\n bubble.append(attachmentDiv);\n }\n else {\n messageDiv.innerHTML = richText;\n }\n /* if(strLength == emojiStrLength) {\n messageDiv.classList.add('emoji-only');\n messageDiv.classList.add('message-empty');\n } */\n }\n else {\n messageDiv.innerHTML = richText;\n }\n //messageDiv.innerHTML = 'samsung samsung samsung';\n timeSpan.appendChild(timeInner);\n messageDiv.append(timeSpan);\n bubble.prepend(messageDiv);\n //bubble.prepend(timeSpan, messageDiv); // that's bad\n if (our) {\n if (message.pFlags.unread || message.mid < 0)\n this.unreadOut.push(message.mid); // message.mid < 0 added 11.02.2020\n let status = '';\n if (message.mid < 0)\n status = 'is-sending';\n else\n status = message.pFlags.unread ? 'is-sent' : 'is-read';\n bubble.classList.add(status);\n }\n else {\n //this.log('not our message', message, message.pFlags.unread);\n if (message.pFlags.unread)\n this.unreaded.push(message.mid);\n }\n // media\n if (message.media) {\n let attachmentDiv = document.createElement('div');\n attachmentDiv.classList.add('attachment');\n if (!message.message) {\n messageDiv.classList.add('message-empty');\n }\n let processingWebPage = false;\n switch (message.media._) {\n case 'messageMediaPending': {\n let pending = message.media;\n let preloader = pending.preloader;\n switch (pending.type) {\n case 'photo': {\n if (pending.size < 5e6) {\n let img = new Image();\n img.src = URL.createObjectURL(pending.file);\n let { w, h } = utils_1.calcImageInBox(pending.w, pending.h, 380, 380);\n attachmentDiv.style.width = w + 'px';\n attachmentDiv.style.height = h + 'px';\n attachmentDiv.append(img);\n preloader.attach(attachmentDiv, false);\n bubble.classList.add('hide-name', 'photo');\n break;\n }\n }\n case 'audio':\n case 'document': {\n let docDiv = wrappers_1.wrapDocument(pending, false, true);\n let icoDiv = docDiv.querySelector('.document-ico');\n preloader.attach(icoDiv, false);\n messageDiv.classList.remove('message-empty');\n messageDiv.append(docDiv);\n processingWebPage = true;\n break;\n }\n }\n break;\n }\n case 'messageMediaPhoto': {\n let photo = message.media.photo;\n ////////this.log('messageMediaPhoto', photo);\n bubble.classList.add('hide-name', 'photo');\n wrappers_1.wrapPhoto.call(this, photo, message, attachmentDiv);\n break;\n }\n case 'messageMediaWebPage': {\n processingWebPage = true;\n let webpage = message.media.webpage;\n ////////this.log('messageMediaWebPage', webpage);\n if (webpage._ == 'webPageEmpty') {\n break;\n }\n bubble.classList.add('webpage');\n let box = document.createElement('div');\n box.classList.add('box', 'web');\n let quote = document.createElement('div');\n quote.classList.add('quote');\n let nameEl = document.createElement('a');\n nameEl.classList.add('name');\n let titleDiv = document.createElement('div');\n titleDiv.classList.add('title');\n let textDiv = document.createElement('div');\n textDiv.classList.add('text');\n let preview = null;\n if (webpage.photo || webpage.document) {\n preview = document.createElement('div');\n preview.classList.add('preview');\n }\n let doc = null;\n if (webpage.document) {\n doc = webpage.document;\n if (doc.type == 'gif' || doc.type == 'video') {\n //if(doc.size <= 20e6) {\n bubble.classList.add('video');\n wrappers_1.wrapVideo.call(this, doc, preview, message);\n //}\n }\n else {\n doc = null;\n }\n }\n if (webpage.photo && !doc) {\n bubble.classList.add('photo');\n //appPhotosManager.savePhoto(webpage.photo); // hot-fix because no webpage manager\n wrappers_1.wrapPhoto.call(this, webpage.photo, message, preview);\n }\n if (preview) {\n quote.append(preview);\n }\n nameEl.setAttribute('target', '_blank');\n nameEl.href = webpage.url || '#';\n nameEl.innerHTML = webpage.site_name ? richtextprocessor_1.RichTextProcessor.wrapEmojiText(webpage.site_name) : '';\n if (webpage.description) {\n textDiv.innerHTML = richtextprocessor_1.RichTextProcessor.wrapRichText(webpage.description);\n }\n if (webpage.title) {\n titleDiv.innerHTML = richtextprocessor_1.RichTextProcessor.wrapRichText(webpage.title);\n }\n quote.append(nameEl, titleDiv, textDiv);\n box.append(quote);\n //bubble.prepend(box);\n bubble.prepend(timeSpan, box);\n //this.log('night running', bubble.scrollHeight);\n break;\n }\n case 'messageMediaDocument': {\n let doc = message.media.document;\n /* if(document.size > 1e6) { // 1mb\n break;\n } */\n ////////this.log('messageMediaDocument', doc);\n if (doc.sticker && doc.size <= 1e6) {\n bubble.classList.add('sticker');\n if (doc.animated) {\n bubble.classList.add('sticker-animated');\n }\n appPhotosManager_1.default.setAttachmentSize(doc, attachmentDiv, undefined, undefined, true);\n let preloader = new preloader_1.default(attachmentDiv, false);\n bubble.style.height = attachmentDiv.style.height;\n bubble.style.width = attachmentDiv.style.width;\n //appPhotosManager.setAttachmentSize(doc, bubble);\n let load = () => wrappers_1.wrapSticker(doc, attachmentDiv, () => {\n if (this.peerID != peerID) {\n this.log.warn('peer changed, canceling sticker attach');\n return false;\n }\n return true;\n }, null, 'chat', false, !!message.pending || !multipleRender).then(() => {\n preloader.detach();\n /* attachmentDiv.style.width = '';\n attachmentDiv.style.height = ''; */\n });\n this.loadMediaQueuePush(load);\n break;\n }\n else if (doc.mime_type == 'video/mp4' && doc.size <= 20e6) {\n ////////this.log('never get free 2', doc);\n if (doc.type == 'round') {\n bubble.classList.add('round');\n }\n bubble.classList.add('video');\n wrappers_1.wrapVideo.call(this, doc, attachmentDiv, message, true, null, false, doc.type == 'round');\n break;\n }\n else {\n let docDiv = wrappers_1.wrapDocument(doc);\n messageDiv.classList.remove('message-empty');\n messageDiv.append(docDiv);\n processingWebPage = true;\n break;\n }\n }\n default:\n messageDiv.classList.remove('message-empty');\n messageDiv.innerHTML = 'unrecognized media type: ' + message.media._;\n messageDiv.append(timeSpan);\n this.log.warn('unrecognized media type:', message.media._, message);\n break;\n }\n if (!processingWebPage) {\n bubble.append(attachmentDiv);\n }\n }\n if ((this.peerID < 0 && !our) || message.fwd_from || message.reply_to_mid) { // chat\n let title = appPeersManager_1.default.getPeerTitle(message.fwdFromID || message.fromID);\n let isHidden = message.fwd_from && !message.fwd_from.from_id && !message.fwd_from.channel_id;\n if (isHidden) {\n ///////this.log('message to render hidden', message);\n title = message.fwd_from.from_name;\n bubble.classList.add('hidden-profile');\n }\n //this.log(title);\n if (message.fwdFromID || message.fwd_from) {\n bubble.classList.add('forwarded');\n if (message.savedFrom) {\n let fwd = document.createElement('div');\n fwd.classList.add('forward' /* , 'tgico-forward' */);\n fwd.innerHTML = `\n \n \n \n \n \n `;\n bubble.append(fwd);\n bubble.dataset.savedFrom = message.savedFrom;\n }\n if (!bubble.classList.contains('sticker')) {\n let nameDiv = document.createElement('div');\n nameDiv.classList.add('name');\n nameDiv.innerHTML = 'Forwarded from ' + title;\n nameDiv.dataset.peerID = message.fwdFromID;\n //nameDiv.style.color = appPeersManager.getPeerColorByID(message.fromID, false);\n bubble.append(nameDiv);\n }\n }\n else {\n if (message.reply_to_mid) {\n let originalMessage = appMessagesManager_1.default.getMessage(message.reply_to_mid);\n let originalPeerTitle = appPeersManager_1.default.getPeerTitle(originalMessage.fromID, true) || '';\n /////////this.log('message to render reply', originalMessage, originalPeerTitle, bubble, message);\n // need to download separately\n if (originalMessage._ == 'messageEmpty') {\n //////////this.log('message to render reply empty, need download', message, message.reply_to_mid);\n appMessagesManager_1.default.wrapSingleMessage(message.reply_to_mid);\n this.needUpdate.push({ replyMid: message.reply_to_mid, mid: message.mid });\n originalPeerTitle = 'Loading...';\n }\n if (originalMessage.mid) {\n bubble.setAttribute('data-original-mid', originalMessage.mid);\n }\n else {\n bubble.setAttribute('data-original-mid', message.reply_to_mid);\n }\n bubble.append(wrappers_1.wrapReply(originalPeerTitle, originalMessage.message || '', originalMessage.media));\n bubble.classList.add('is-reply');\n }\n if (!bubble.classList.contains('sticker') && (peerID < 0 && peerID != message.fromID)) {\n let nameDiv = document.createElement('div');\n nameDiv.classList.add('name');\n nameDiv.innerHTML = title;\n nameDiv.style.color = appPeersManager_1.default.getPeerColorByID(message.fromID, false);\n nameDiv.dataset.peerID = message.fromID;\n bubble.append(nameDiv);\n }\n else /* if(!message.reply_to_mid) */ {\n bubble.classList.add('hide-name');\n }\n //bubble.prepend(avatarDiv);\n /* if(messageDiv.nextElementSibling) {\n bubble.insertBefore(avatarDiv, messageDiv.nextElementSibling);\n } else { */\n //}\n }\n if (!our && this.peerID < 0 &&\n (!appPeersManager_1.default.isChannel(this.peerID) || appPeersManager_1.default.isMegagroup(this.peerID))) {\n let avatarDiv = document.createElement('div');\n avatarDiv.classList.add('user-avatar');\n /////////this.log('exec loadDialogPhoto', message);\n if (message.fromID) { // if no - user hidden\n appDialogsManager_1.default.loadDialogPhoto(avatarDiv, message.fromID);\n }\n else if (!title && message.fwd_from && message.fwd_from.from_name) {\n title = message.fwd_from.from_name;\n appDialogsManager_1.default.loadDialogPhoto(avatarDiv, title);\n }\n avatarDiv.dataset.peerID = message.fromID;\n bubble.append(avatarDiv);\n }\n }\n else {\n bubble.classList.add('hide-name');\n }\n if (message._ == 'messageService') {\n bubble.className = 'service';\n let action = message.action;\n let title = appPeersManager_1.default.getPeerTitle(message.fromID);\n let name = document.createElement('div');\n name.classList.add('name');\n name.dataset.peerID = message.fromID;\n name.innerHTML = title;\n let _ = action._;\n if (_ == \"messageActionPhoneCall\") {\n _ += '.' + action.type;\n }\n // @ts-ignore\n let str = (name.innerText ? name.outerHTML + ' ' : '') + utils_1.langPack[_];\n bubble.innerHTML = `
${str}
`;\n }\n if (updatePosition) {\n let type = our ? 'out' : 'in';\n let containerDiv = reverse ? this.firstContainerDiv : this.lastContainerDiv;\n if (!containerDiv || !containerDiv.classList.contains(type)) {\n /* if(containerDiv) {\n if(reverse) this.chatInner.prepend(containerDiv);\n else this.chatInner.append(containerDiv);\n } */\n containerDiv = document.createElement('div');\n containerDiv.classList.add(type);\n if (!this.firstContainerDiv)\n this.firstContainerDiv = containerDiv;\n if (reverse)\n this.firstContainerDiv = containerDiv;\n else\n this.lastContainerDiv = containerDiv;\n }\n if (reverse) {\n /* if(!multipleRender) {\n this.scrollPosition.prepareFor('up'); // лагает из-за этого\n } */\n containerDiv.prepend(bubble);\n this.chatInner.prepend(containerDiv);\n }\n else {\n /* if(!multipleRender) {\n this.scrollPosition.prepareFor('down'); // лагает из-за этого\n } */\n containerDiv.append(bubble);\n this.chatInner.append(containerDiv);\n }\n let justDate = new Date(date.getFullYear(), date.getMonth(), date.getDate());\n let dateTimestamp = justDate.getTime();\n if (!(dateTimestamp in this.dateMessages)) {\n let str = '';\n let today = new Date();\n today.setHours(0);\n today.setMinutes(0);\n today.setSeconds(0);\n if (today < date) {\n str = 'Today';\n }\n else {\n const months = ['January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December'];\n str = justDate.getFullYear() == new Date().getFullYear() ?\n months[justDate.getMonth()] + ' ' + justDate.getDate() :\n justDate.toISOString().split('T')[0].split('-').reverse().join('.');\n }\n let div = document.createElement('div');\n div.classList.add('service');\n div.innerHTML = `
${str}
`;\n ////////this.log('need to render date message', dateTimestamp, str);\n this.dateMessages[dateTimestamp] = {\n div,\n firstTimestamp: date.getTime()\n };\n //this.chatInner.insertBefore(div, containerDiv);\n containerDiv.insertBefore(div, bubble);\n }\n else {\n let dateMessage = this.dateMessages[dateTimestamp];\n if (dateMessage.firstTimestamp > date.getTime()) {\n //this.chatInner.insertBefore(dateMessage.div, containerDiv);\n containerDiv.insertBefore(dateMessage.div, bubble);\n }\n }\n }\n /* if(bubble.classList.contains('webpage')) {\n this.log('night running', bubble, bubble.scrollHeight);\n } */\n //return //this.scrollPosition.restore();\n if (!multipleRender) {\n this.scrollPosition.restore(); // лагает из-за этого\n }\n //this.log('history msg', message);\n }\n // reverse means scroll up\n getHistory(maxID = 0, reverse = false, isBackLimit = false) {\n let peerID = this.peerID;\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n if (!maxID && dialog && dialog.top_message) {\n maxID = dialog.top_message /* + 1 */;\n }\n let loadCount = Object.keys(this.bubbles).length > 0 ?\n 20 :\n (this.chatInner.parentElement.parentElement.scrollHeight) / 30 * 1.25 | 0;\n if (testScroll) {\n loadCount = 1;\n //if(Object.keys(this.bubbles).length > 0)\n return Promise.resolve(true);\n }\n //console.time('render getHistory');\n //console.time('render history total');\n let backLimit = 0;\n if (isBackLimit) {\n backLimit = loadCount;\n loadCount = 0;\n maxID += 1;\n }\n return this.getHistoryPromise = appMessagesManager_1.default.getHistory(this.peerID, maxID, loadCount, backLimit)\n .then((result) => {\n ///////this.log('getHistory result by maxID:', maxID, reverse, isBackLimit, result);\n //console.timeEnd('render getHistory');\n if (this.peerID != peerID) {\n this.log.warn('peer changed');\n //console.timeEnd('render history total');\n return Promise.reject();\n }\n if (!result || !result.history) {\n //console.timeEnd('render history total');\n return true;\n }\n // commented bot getProfile in getHistory!\n if (!result.history /* .filter((id: number) => id > 0) */.length) {\n if (!isBackLimit) {\n this.scrolledAll = true;\n }\n else {\n this.scrolledAllDown = true;\n }\n }\n //this.chatInner.innerHTML = '';\n let history = result.history.slice();\n if (reverse)\n history.reverse();\n //console.time('render history');\n if (!isBackLimit) {\n this.scrollPosition.prepareFor(reverse ? 'up' : 'down');\n }\n let length = history.length;\n for (let i = length - 1; i >= 0; --i) {\n let msgID = history[i];\n let message = appMessagesManager_1.default.getMessage(msgID);\n this.renderMessage(message, reverse, true);\n }\n if (!isBackLimit) {\n this.scrollPosition.restore();\n }\n //console.timeEnd('render history');\n this.getHistoryPromise = undefined;\n //console.timeEnd('render history total');\n return true;\n });\n }\n setMutedState(muted = false) {\n appSidebarRight_1.default.profileElements.notificationsCheckbox.checked = !muted;\n appSidebarRight_1.default.profileElements.notificationsStatus.innerText = muted ? 'Disabled' : 'Enabled';\n let peerID = this.peerID;\n this.muted = muted;\n if (peerID < 0) { // not human\n let isChannel = appPeersManager_1.default.isChannel(peerID) && !appPeersManager_1.default.isMegagroup(peerID);\n if (isChannel) {\n this.btnMute.classList.remove('tgico-mute', 'tgico-unmute');\n this.btnMute.classList.add(muted ? 'tgico-unmute' : 'tgico-mute');\n this.btnMute.style.display = '';\n }\n else {\n this.btnMute.style.display = 'none';\n }\n }\n else {\n this.btnMute.style.display = 'none';\n }\n this.btnMenuMute.classList.remove('tgico-mute', 'tgico-unmute');\n this.btnMenuMute.classList.add(muted ? 'tgico-unmute' : 'tgico-mute');\n let rp = this.btnMenuMute.firstElementChild;\n this.btnMenuMute.innerText = muted ? 'Unmute' : 'Mute';\n this.btnMenuMute.appendChild(rp);\n }\n mutePeer() {\n let inputPeer = appPeersManager_1.default.getInputPeerByID(this.peerID);\n let inputNotifyPeer = {\n _: 'inputNotifyPeer',\n peer: inputPeer\n };\n let settings = {\n _: 'inputPeerNotifySettings',\n flags: 0,\n mute_until: 0\n };\n if (!this.muted) {\n settings.flags |= 1 << 2;\n settings.mute_until = 2147483646;\n }\n else {\n settings.flags |= 2;\n }\n apiManager_1.default.invokeApi('account.updateNotifySettings', {\n peer: inputNotifyPeer,\n settings: settings\n }).then(res => {\n this.handleUpdate({ _: 'updateNotifySettings', peer: inputNotifyPeer, notify_settings: settings });\n });\n /* return apiManager.invokeApi('account.getNotifySettings', {\n peer: inputNotifyPeer\n }).then((settings: any) => {\n settings.flags |= 2 << 1;\n settings.mute_until = 2000000000; // 2147483646\n \n return apiManager.invokeApi('account.updateNotifySettings', {\n peer: inputNotifyPeer,\n settings: Object.assign(settings, {\n _: 'inputPeerNotifySettings'\n })\n }).then(res => {\n this.log('mute result:', res);\n });\n }); */\n }\n handleUpdate(update) {\n switch (update._) {\n case 'updateUserTyping':\n case 'updateChatUserTyping':\n if (this.myID == update.user_id) {\n return;\n }\n var peerID = update._ == 'updateUserTyping' ? update.user_id : -update.chat_id;\n this.typingUsers[update.user_id] = peerID;\n if (!appUsersManager_1.default.hasUser(update.user_id)) {\n if (update.chat_id &&\n appChatsManager_1.default.hasChat(update.chat_id) &&\n !appChatsManager_1.default.isChannel(update.chat_id)) {\n appProfileManager_1.default.getChatFull(update.chat_id);\n }\n //return;\n }\n appUsersManager_1.default.forceUserOnline(update.user_id);\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n let currentPeer = this.peerID == peerID;\n if (this.typingTimeouts[peerID])\n clearTimeout(this.typingTimeouts[peerID]);\n else if (dialog) {\n appDialogsManager_1.default.setTyping(dialog, appUsersManager_1.default.getUser(update.user_id));\n if (currentPeer) { // user\n this.setPeerStatus();\n }\n }\n this.typingTimeouts[peerID] = setTimeout(() => {\n this.typingTimeouts[peerID] = 0;\n delete this.typingUsers[update.user_id];\n if (dialog) {\n appDialogsManager_1.default.unsetTyping(dialog);\n }\n // лень просчитывать случаи\n this.setPeerStatus();\n }, 6000);\n break;\n case 'updateNotifySettings': {\n let { peer, notify_settings } = update;\n // peer was NotifyPeer\n peer = peer.peer;\n let peerID = appPeersManager_1.default.getPeerID(peer);\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n if (dialog) {\n dialog.notify_settings = notify_settings;\n }\n if (peerID == this.peerID) {\n let muted = notify_settings.mute_until ? new Date(notify_settings.mute_until * 1000) > new Date() : false;\n this.setMutedState(muted);\n }\n /////this.log('updateNotifySettings', peerID, notify_settings);\n break;\n }\n case 'updateChatPinnedMessage':\n case 'updateUserPinnedMessage': {\n let { id } = update;\n /////this.log('updateUserPinnedMessage', update);\n this.pinnedMsgID = id;\n // hz nado li tut appMessagesIDsManager.getFullMessageID(update.max_id, channelID);\n let peerID = update.user_id || -update.chat_id || -update.channel_id;\n if (peerID == this.peerID) {\n appMessagesManager_1.default.wrapSingleMessage(id);\n }\n break;\n }\n }\n }\n}\nexports.AppImManager = AppImManager;\nconst appImManager = new AppImManager();\nexports.default = appImManager;\n" }, { "id": 20, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/lottieLoader.ts", "name": "./src/lib/lottieLoader.ts", "index": 74, "index2": 64, "size": 5314, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "issuerId": 77, "issuerName": "./src/components/pageAuthCode.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 278, "building": 994, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../lottieLoader", "loc": "35:39-65" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/lottieLoader", "loc": "17:39-69" }, { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "../lib/lottieLoader", "loc": "20:39-69" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/lottieLoader", "loc": "16:39-69" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "../lib/lottieLoader", "loc": "18:39-69" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//import LottiePlayer, { AnimationConfigWithPath, AnimationConfigWithData, AnimationItem } from \"lottie-web\";\n// @ts-ignore\nconst lottie_canvas_min_js_1 = __importDefault(require(\"lottie-web/build/player/lottie_canvas.min.js\"));\n//import LottiePlayer, { AnimationConfigWithPath, AnimationConfigWithData, AnimationItem } from \"lottie-web/build/player/lottie_light.min.js\";\nconst utils_1 = require(\"./utils\");\nclass LottieLoader {\n constructor() {\n this.lottie = null;\n this.animations = {};\n this.debug = false;\n }\n checkAnimations(blurred, group, destroy = false) {\n let groups = group ? [group] : Object.keys(this.animations);\n if (group && !this.animations[group]) {\n console.warn('no animation group:', group);\n this.animations[group] = [];\n //return;\n }\n for (let group of groups) {\n let animations = this.animations[group];\n let length = animations.length;\n for (let i = length - 1; i >= 0; --i) {\n let { animation, container, paused, autoplay, canvas } = animations[i];\n if (canvas && utils_1.isElementInViewport(container)) {\n let c = container.firstElementChild;\n if (!c.height && !c.width) {\n //console.log('lottie need resize');\n animation.resize();\n }\n }\n if (destroy && !utils_1.isInDOM(container)) {\n this.debug && console.log('destroy animation');\n animation.destroy();\n animations.splice(i, 1);\n continue;\n }\n if (!autoplay)\n continue;\n if (!utils_1.isElementInViewport(container) || blurred) {\n if (!paused) {\n this.debug && console.log('pause animation', utils_1.isElementInViewport(container), container);\n animation.pause();\n animations[i].paused = true;\n }\n }\n else if (paused) {\n this.debug && console.log('play animation', container);\n animation.play();\n animations[i].paused = false;\n }\n }\n }\n }\n loadAnimation(params, group = '') {\n return __awaiter(this, void 0, void 0, function* () {\n /* if(!this.lottie) {\n this.lottie = (await import(\n 'lottie-web')).default;\n this.lottie.setQuality('low');\n } */\n //params.autoplay = false;\n params.renderer = 'canvas';\n params.rendererSettings = {\n //context: canvasContext, // the canvas context\n //preserveAspectRatio: 'xMinYMin slice', // Supports the same options as the svg element's preserveAspectRatio property\n clearCanvas: true,\n progressiveLoad: true,\n hideOnTransparent: true,\n };\n if (!this.lottie) {\n this.lottie = lottie_canvas_min_js_1.default;\n //this.lottie.setQuality('low');\n this.lottie.setQuality(10);\n }\n let animation = this.lottie.loadAnimation(params);\n if (!this.animations[group])\n this.animations[group] = [];\n this.animations[group].push({\n animation,\n container: params.container,\n paused: !params.autoplay,\n autoplay: params.autoplay,\n canvas: params.renderer == 'canvas'\n });\n if (params.autoplay) {\n this.checkAnimations();\n }\n return animation;\n });\n }\n getAnimation(el, group = '') {\n let groups = group ? [group] : Object.keys(this.animations);\n //console.log('getAnimation', groups, this.animations);\n for (let group of groups) {\n let animations = this.animations[group];\n let animation = animations.find(a => a.container === el);\n if (animation)\n return animation.animation;\n }\n return null;\n }\n}\nconst lottieLoader = new LottieLoader();\n//(window as any).LottieLoader = lottieLoader;\nexports.default = lottieLoader;\n" }, { "id": 21, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networkerFactory.ts", "name": "./src/lib/mtproto/networkerFactory.ts", "index": 27, "index2": 46, "size": 1145, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "./networkerFactory", "loc": "24:43-72" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./networkerFactory", "loc": "22:43-72" }, { "moduleId": 27, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "module": "./src/lib/appManagers/apiUpdatesManager.ts", "moduleName": "./src/lib/appManagers/apiUpdatesManager.ts", "type": "cjs require", "userRequest": "../mtproto/networkerFactory", "loc": "7:43-81" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "./networkerFactory", "loc": "30:43-72" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst networker_1 = require(\"./networker\");\nclass NetworkerFactory {\n constructor() {\n this.updatesProcessor = null;\n this.offlineInited = false;\n this.akStopped = false;\n /* $rootScope.retryOnline = function() {\n $(document.body).trigger('online');\n } */\n }\n startAll() {\n if (this.akStopped) {\n this.akStopped = false;\n if (this.updatesProcessor) {\n this.updatesProcessor({\n _: 'new_session_created'\n }, true);\n }\n }\n }\n stopAll() {\n this.akStopped = true;\n }\n setUpdatesProcessor(callback) {\n this.updatesProcessor = callback;\n }\n getNetworker(dcID, authKey, authKeyID, serverSalt, options) {\n //console.log(dT(), 'NetworkerFactory: creating new instance of MTPNetworker:', dcID, options);\n return new networker_1.MTPNetworker(dcID, authKey, authKeyID, serverSalt, options);\n }\n}\nexports.NetworkerFactory = NetworkerFactory;\nexports.default = new NetworkerFactory();\n" }, { "id": 22, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "name": "./src/lib/mtproto/dcConfigurator.ts", "index": 34, "index2": 33, "size": 2930, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "./dcConfigurator", "loc": "29:41-68" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./dcConfigurator", "loc": "17:41-68" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "./dcConfigurator", "loc": "16:41-68" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "./dcConfigurator", "loc": "31:41-68" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst websocket_1 = __importDefault(require(\"./transports/websocket\"));\nconst http_1 = __importDefault(require(\"./transports/http\"));\nclass DcConfigurator {\n constructor() {\n this.sslSubdomains = ['pluto', 'venus', 'aurora', 'vesta', 'flora'];\n this.dcOptions = Config.Modes.test\n ? [\n { id: 1, host: '149.154.175.10', port: 80 },\n { id: 2, host: '149.154.167.40', port: 80 },\n { id: 3, host: '149.154.175.117', port: 80 }\n ]\n : [\n { id: 1, host: '149.154.175.50', port: 80 },\n { id: 2, host: '149.154.167.50', port: 80 },\n { id: 3, host: '149.154.175.100', port: 80 },\n { id: 4, host: '149.154.167.91', port: 80 },\n { id: 5, host: '149.154.171.5', port: 80 }\n ];\n this.chosenServers = {\n websocket: {},\n https: {},\n http: {}\n };\n this.chosenUploadServers = {\n websocket: {},\n https: {},\n http: {}\n };\n }\n chooseServer(dcID, upload, transport = 'websocket') {\n let servers = upload && (transport != 'websocket' || Config.Modes.multipleConnections)\n ? this.chosenUploadServers[transport]\n : this.chosenServers[transport];\n if (!(dcID in servers)) {\n let chosenServer = '';\n if (transport == 'websocket') {\n let subdomain = this.sslSubdomains[dcID - 1];\n let path = Config.Modes.test ? 'apiws_test' : 'apiws';\n chosenServer = 'wss://' + subdomain + '.web.telegram.org/' + path;\n return servers[dcID] = new websocket_1.default(dcID, chosenServer);\n }\n if (Config.Modes.ssl || !Config.Modes.http || transport == 'https') {\n let subdomain = this.sslSubdomains[dcID - 1] + (upload ? '-1' : '');\n let path = Config.Modes.test ? 'apiw_test1' : 'apiw1';\n chosenServer = 'https://' + subdomain + '.web.telegram.org/' + path;\n return servers[dcID] = new http_1.default(dcID, chosenServer);\n }\n for (let dcOption of this.dcOptions) {\n if (dcOption.id == dcID) {\n chosenServer = 'http://' + dcOption.host + (dcOption.port != 80 ? ':' + dcOption.port : '') + '/apiw1';\n return servers[dcID] = new http_1.default(dcID, chosenServer);\n }\n }\n console.error('No chosenServer!', dcID);\n return null;\n }\n return servers[dcID];\n }\n}\nexports.DcConfigurator = DcConfigurator;\nexports.default = new DcConfigurator();\n" }, { "id": 23, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/serverTimeManager.ts", "name": "./src/lib/mtproto/serverTimeManager.ts", "index": 44, "index2": 37, "size": 1250, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "issuerId": 4, "issuerName": "./src/lib/appManagers/appUsersManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 4, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "name": "./src/lib/appManagers/appUsersManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 974, "building": 125, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 4, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appUsersManager.ts", "module": "./src/lib/appManagers/appUsersManager.ts", "moduleName": "./src/lib/appManagers/appUsersManager.ts", "type": "cjs require", "userRequest": "../mtproto/serverTimeManager", "loc": "10:44-83" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../mtproto/serverTimeManager", "loc": "26:44-83" }, { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../mtproto/serverTimeManager", "loc": "31:44-83" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./serverTimeManager", "loc": "20:44-74" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst utils_1 = require(\"../utils\");\nclass ServerTimeManager {\n constructor() {\n this.timestampNow = utils_1.tsNow(true);\n this.midnightNoOffset = this.timestampNow - (this.timestampNow % 86400);\n this.midnightOffseted = new Date();\n this.midnightOffset = this.midnightNoOffset - (Math.floor(+this.midnightOffseted / 1000));\n this.serverTimeOffset = 0;\n this.timeParams = {\n midnightOffset: this.midnightOffset,\n serverTimeOffset: this.serverTimeOffset\n };\n this.midnightOffseted.setHours(0);\n this.midnightOffseted.setMinutes(0);\n this.midnightOffseted.setSeconds(0);\n storage_1.default.get('server_time_offset').then((to) => {\n if (to) {\n this.serverTimeOffset = to;\n this.timeParams.serverTimeOffset = to;\n }\n });\n }\n}\nexports.ServerTimeManager = ServerTimeManager;\nexports.default = new ServerTimeManager();\n" }, { "id": 24, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/filemanager.ts", "name": "./src/lib/filemanager.ts", "index": 48, "index2": 41, "size": 10347, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "issuerId": 11, "issuerName": "./src/lib/appManagers/appPhotosManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 11, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "name": "./src/lib/appManagers/appPhotosManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 862, "building": 151, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 9, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "module": "./src/lib/mtproto/apiFileManager.ts", "moduleName": "./src/lib/mtproto/apiFileManager.ts", "type": "cjs require", "userRequest": "../filemanager", "loc": "17:38-63" }, { "moduleId": 11, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appPhotosManager.ts", "module": "./src/lib/appManagers/appPhotosManager.ts", "moduleName": "./src/lib/appManagers/appPhotosManager.ts", "type": "cjs require", "userRequest": "../filemanager", "loc": "17:38-63" }, { "moduleId": 18, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDocsManager.ts", "module": "./src/lib/appManagers/appDocsManager.ts", "moduleName": "./src/lib/appManagers/appDocsManager.ts", "type": "cjs require", "userRequest": "../filemanager", "loc": "16:38-63" }, { "moduleId": 74, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/idb.ts", "module": "./src/lib/idb.ts", "moduleName": "./src/lib/idb.ts", "type": "cjs require", "userRequest": "./filemanager", "loc": "7:38-62" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"./bin_utils\");\nrequire(\"web-streams-polyfill/ponyfill\");\n// @ts-ignore\nconst streamsaver_1 = __importDefault(require(\"streamsaver\"));\nif (window.location.href.indexOf('localhost') === -1) {\n streamsaver_1.default.mitm = 'mitm.html';\n}\nclass FileManager {\n constructor() {\n this.isSafari = 'safari' in window;\n this.safariVersion = parseFloat(this.isSafari && (navigator.userAgent.match(/Version\\/(\\d+\\.\\d+).* Safari/) || [])[1]);\n this.safariWithDownload = this.isSafari && this.safariVersion >= 11.0;\n this.buggyUnknownBlob = this.isSafari && !this.safariWithDownload;\n this.blobSupported = true;\n try {\n bin_utils_1.blobConstruct([], '');\n }\n catch (e) {\n this.blobSupported = false;\n }\n }\n isAvailable() {\n return this.blobSupported;\n }\n /* public copy(fromFileEntry: any, toFileEntry: any) {\n return this.getFileWriter(toFileEntry).then((fileWriter) => {\n return this.write(fileWriter, fromFileEntry).then(() => {\n return fileWriter;\n }, (error: any) => {\n try {\n // @ts-ignore\n fileWriter.truncate(0);\n } catch (e) {}\n \n return Promise.reject(error);\n });\n });\n } */\n copy(fromFileEntry, toFileEntry) {\n return this.write(toFileEntry, fromFileEntry).then(() => {\n console.log('copy success');\n return toFileEntry;\n }, (error) => {\n console.error('copy error 1:', error);\n try {\n toFileEntry.truncate(0);\n }\n catch (e) {\n console.error('copy error', e);\n }\n return Promise.reject(error);\n });\n }\n /* public write(fileWriter: any, bytes: any) {\n return new Promise((resolve, reject) => {\n fileWriter.onwriteend = function(e: any) {\n resolve();\n };\n fileWriter.onerror = function(e: any) {\n reject(e);\n };\n \n if(bytes.file) {\n bytes.file((file: any) => {\n fileWriter.write(file);\n }, reject);\n } else if(bytes instanceof Blob) { // is file bytes\n fileWriter.write(bytes);\n } else {\n try {\n var blob = blobConstruct([bytesToArrayBuffer(bytes)]);\n fileWriter.write(blob);\n } catch(e) {\n reject(e);\n }\n }\n });\n } */\n write(fileWriter, bytes) {\n if (bytes.file) {\n return bytes.file((file) => {\n return fileWriter.write(file);\n });\n }\n else if (bytes instanceof Blob) { // is file bytes\n return new Promise((resolve, reject) => {\n let fileReader = new FileReader();\n fileReader.onload = function (event) {\n let arrayBuffer = event.target.result;\n let arr = new Uint8Array(arrayBuffer);\n fileWriter.write(arr).then(resolve, reject);\n };\n fileReader.readAsArrayBuffer(bytes);\n });\n }\n else {\n //var blob = blobConstruct([bytesToArrayBuffer(bytes)]);\n //return fileWriter.write(blob);\n return fileWriter.write(bytes);\n }\n }\n chooseSaveFile(fileName, ext, mimeType, size) {\n let fileStream = streamsaver_1.default.createWriteStream(fileName, {\n size: size,\n writableStrategy: undefined,\n readableStrategy: undefined\n });\n let writer = fileStream.getWriter();\n return writer;\n }\n getFakeFileWriter(mimeType, saveFileCallback) {\n var blobParts = [];\n var fakeFileWriter = {\n write: (blob) => __awaiter(this, void 0, void 0, function* () {\n if (!this.blobSupported) {\n throw false;\n }\n blobParts.push(blob);\n }),\n truncate: () => {\n blobParts = [];\n },\n finalize: () => {\n var blob = bin_utils_1.blobConstruct(blobParts, mimeType);\n if (saveFileCallback) {\n saveFileCallback(blob);\n }\n return blob;\n }\n };\n return fakeFileWriter;\n }\n getUrl(fileData, mimeType) {\n var safeMimeType = bin_utils_1.blobSafeMimeType(mimeType);\n // console.log(dT(), 'get url', fileData, mimeType, fileData.toURL !== undefined, fileData instanceof Blob)\n if (fileData.toURL !== undefined) {\n return fileData.toURL(safeMimeType);\n }\n if (fileData instanceof Blob) {\n return URL.createObjectURL(fileData);\n }\n return 'data:' + safeMimeType + ';base64,' + bin_utils_1.bytesToBase64(fileData);\n }\n getByteArray(fileData) {\n if (fileData instanceof Blob) {\n return new Promise((resolve, reject) => {\n try {\n var reader = new FileReader();\n reader.onloadend = (e) => {\n // @ts-ignore\n resolve(new Uint8Array(e.target.result));\n };\n reader.onerror = (e) => {\n reject(e);\n };\n reader.readAsArrayBuffer(fileData);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n else if (fileData.file) {\n return new Promise((resolve, reject) => {\n fileData.file((blob) => {\n this.getByteArray(blob).then(resolve, reject);\n }, reject);\n });\n }\n return Promise.resolve(fileData);\n //return $q.when(fileData);\n }\n getDataUrl(blob) {\n return new Promise((resolve, reject) => {\n try {\n var reader = new FileReader();\n reader.onloadend = () => {\n resolve(reader.result);\n };\n reader.readAsDataURL(blob);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n getFileCorrectUrl(blob, mimeType) {\n if (this.buggyUnknownBlob && blob instanceof Blob) {\n // @ts-ignore\n mimeType = blob.type || blob.mimeType || mimeType || '';\n if (!mimeType.match(/image\\/(jpeg|gif|png|bmp)|video\\/quicktime/)) {\n return this.getDataUrl(blob);\n }\n }\n return Promise.resolve(this.getUrl(blob, mimeType));\n }\n // downloadFile\n download(blob, mimeType, fileName) {\n if (window.navigator && navigator.msSaveBlob !== undefined) {\n window.navigator.msSaveBlob(blob, fileName);\n return false;\n }\n if (window.navigator && 'getDeviceStorage' in navigator) {\n var storageName = 'sdcard';\n var subdir = 'telegram/';\n switch (mimeType.split('/')[0]) {\n case 'video':\n storageName = 'videos';\n break;\n case 'audio':\n storageName = 'music';\n break;\n case 'image':\n storageName = 'pictures';\n break;\n }\n // @ts-ignore\n var deviceStorage = navigator.getDeviceStorage(storageName);\n var request = deviceStorage.addNamed(blob, subdir + fileName);\n request.onsuccess = function () {\n console.log('Device storage save result', this.result);\n };\n request.onerror = () => { };\n return;\n }\n var popup;\n if (this.isSafari && !this.safariWithDownload) {\n popup = window.open();\n }\n this.getFileCorrectUrl(blob, mimeType).then((url) => {\n if (popup) {\n try {\n // @ts-ignore\n popup.location.href = url;\n return;\n }\n catch (e) { }\n }\n var anchor = document.createElementNS('http://www.w3.org/1999/xhtml', 'a');\n anchor.href = url;\n if (!this.safariWithDownload) {\n anchor.target = '_blank';\n }\n anchor.download = fileName;\n if (anchor.dataset) {\n anchor.dataset.downloadurl = ['video/quicktime', fileName, url].join(':');\n }\n anchor.style.position = 'absolute';\n anchor.style.top = '1px';\n anchor.style.left = '1px';\n document.body.append(anchor);\n try {\n var clickEvent = document.createEvent('MouseEvents');\n clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n anchor.dispatchEvent(clickEvent);\n }\n catch (e) {\n console.error('Download click error', e);\n try {\n anchor.click();\n }\n catch (e) {\n window.open(url, '_blank');\n }\n }\n setTimeout(() => {\n anchor.remove();\n }, 100);\n });\n }\n}\nexports.default = new FileManager();\n" }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "index": 56, "index2": 78, "size": 6938, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./components/pageIm", "loc": "74:57-87" }, { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "./pageIm", "loc": "17:33-52" }, { "moduleId": 78, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "module": "./src/components/pageSignUp.ts", "moduleName": "./src/components/pageSignUp.ts", "type": "cjs require", "userRequest": "./pageIm", "loc": "10:33-52" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "./pageIm", "loc": "15:33-52" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//import { appImManager, appMessagesManager, appDialogsManager, apiUpdatesManager, appUsersManager } from \"../lib/services\";\nconst misc_1 = require(\"./misc\");\nconst scrollable_1 = __importDefault(require(\"./scrollable\"));\nconst StackBlur_1 = require(\"../lib/StackBlur\");\nconst appSidebarLeft_1 = __importDefault(require(\"../lib/appManagers/appSidebarLeft\"));\n/* (window as any).libraryLoaded = function(lol: any) {\n // @ts-ignore\n console.log('libraryLoaded', lol, this, window.webpMachine);\n} */\nexports.default = () => Promise.resolve().then(() => __importStar(require('../lib/services'))).then(services => {\n //console.log('included services', services);\n let { appImManager, appMessagesManager, appDialogsManager, apiUpdatesManager, appUsersManager } = services;\n //export default () => {\n let pageEl = document.body.getElementsByClassName('page-chats')[0];\n pageEl.style.display = '';\n let chatScroll = new scrollable_1.default(document.getElementById('bubbles')).container;\n apiUpdatesManager.attach();\n // @ts-ignore\n document.addEventListener('user_update', (e) => {\n let userID = e.detail;\n let user = appUsersManager.getUser(userID);\n let dialog = appMessagesManager.getDialogByPeerID(user.id)[0];\n //console.log('updating user:', user, dialog);\n if (dialog && !appUsersManager.isBot(dialog.peerID) && dialog.peerID != appImManager.myID) {\n let online = user.status._ == 'userStatusOnline';\n let dom = appDialogsManager.getDialogDom(dialog.peerID);\n if (dom) {\n if (online) {\n dom.avatarDiv.classList.add('is-online');\n }\n else {\n dom.avatarDiv.classList.remove('is-online');\n }\n }\n }\n if (appImManager.peerID == user.id) {\n appImManager.setPeerStatus();\n }\n });\n // @ts-ignore\n document.addEventListener('dialog_top', (e) => {\n let dialog = e.detail;\n appDialogsManager.setLastMessage(dialog);\n appDialogsManager.sortDom();\n });\n // @ts-ignore\n document.addEventListener('dialogs_multiupdate', (e) => {\n let dialogs = e.detail;\n let performed = 0;\n for (let id in dialogs) {\n let dialog = dialogs[id];\n /////console.log('updating dialog:', dialog);\n ++performed;\n if (!(dialog.peerID in appDialogsManager.doms)) {\n appDialogsManager.addDialog(dialog);\n continue;\n }\n appDialogsManager.setLastMessage(dialog);\n }\n if (performed) {\n /////////console.log('will sortDom');\n appDialogsManager.sortDom();\n appDialogsManager.sortDom(true);\n }\n });\n // @ts-ignore\n document.addEventListener('dialog_unread', (e) => {\n let info = e.detail;\n let dialog = appMessagesManager.getDialogByPeerID(info.peerID)[0];\n if (dialog) {\n appDialogsManager.setUnreadMessages(dialog);\n if (dialog.peerID == appImManager.peerID) {\n appImManager.updateUnreadByDialog(dialog);\n }\n }\n });\n /*\n loadDialogs().then(result => {\n //appImManager.setScroll(chatScroll);\n });\n return;\n */\n /* function placeCaretAfterNode(node: HTMLElement) {\n if (typeof window.getSelection != \"undefined\") {\n var range = document.createRange();\n range.setStartAfter(node);\n range.collapse(true);\n var selection = window.getSelection();\n selection.removeAllRanges();\n selection.addRange(range);\n }\n }\n \n messageInput.onclick = (e) => {\n let target = e.target as HTMLElement;\n if(target.classList.contains('emoji-inner')) {\n placeCaretAfterNode(target.parentElement);\n } else if(target.classList.contains('emoji-sizer')) {\n placeCaretAfterNode(target);\n }\n console.log('lol', target);\n }; */\n /* window.addEventListener('click', function(this, e) {\n // @ts-ignore\n let isInput = e.target.tagName == 'INPUT';\n if(!isInput && !window.getSelection().toString()) {\n console.log('click');\n messageInput.focus();\n }\n }); */\n fetch('assets/img/camomile.jpg')\n .then(res => res.blob())\n .then(blob => {\n let img = new Image();\n let url = URL.createObjectURL(blob);\n img.src = url;\n img.onload = () => {\n let id = 'chat-background-canvas';\n var canvas = document.getElementById(id);\n URL.revokeObjectURL(url);\n StackBlur_1.stackBlurImage(img, id, 15, 0);\n canvas.toBlob(blob => {\n //let dataUrl = canvas.toDataURL('image/jpeg', 1);\n let dataUrl = URL.createObjectURL(blob);\n [/* '.chat-background', '#chat-closed' */ '.chat-container'].forEach(selector => {\n let bg = document.querySelector(selector);\n bg.style.backgroundImage = 'url(' + dataUrl + ')';\n });\n }, 'image/jpeg', 1);\n };\n });\n /* toggleEmoticons.onclick = (e) => {\n if(!emoticonsDropdown) {\n emoticonsDropdown = initEmoticonsDropdown(pageEl, appImManager,\n appMessagesManager, messageInput, toggleEmoticons);\n } else {\n emoticonsDropdown.classList.toggle('active');\n }\n \n toggleEmoticons.classList.toggle('active');\n }; */\n Array.from(document.getElementsByClassName('btn-menu-toggle')).forEach((el) => {\n el.addEventListener('click', (e) => {\n console.log('click pageIm');\n if (!el.classList.contains('btn-menu-toggle'))\n return false;\n //window.removeEventListener('mousemove', onMouseMove);\n let openedMenu = el.querySelector('.btn-menu');\n e.cancelBubble = true;\n if (el.classList.contains('menu-open')) {\n el.classList.remove('menu-open');\n openedMenu.classList.remove('active');\n }\n else {\n misc_1.openBtnMenu(openedMenu);\n }\n });\n });\n appSidebarLeft_1.default.loadDialogs().then(result => {\n appSidebarLeft_1.default.onChatsScroll();\n appImManager.setScroll(chatScroll);\n appSidebarLeft_1.default.loadDialogs(true);\n });\n});\n" }, { "id": 26, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "name": "./src/lib/appManagers/appSidebarLeft.ts", "index": 58, "index2": 77, "size": 18861, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "issuerId": 25, "issuerName": "./src/components/pageIm.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 323, "building": 561, "dependencies": 110 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appSidebarLeft", "loc": "37:41-68" }, { "moduleId": 25, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "module": "./src/components/pageIm.ts", "moduleName": "./src/components/pageIm.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appSidebarLeft", "loc": "17:41-85" }, { "moduleId": 28, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "module": "./src/lib/appManagers/appDialogsManager.ts", "moduleName": "./src/lib/appManagers/appDialogsManager.ts", "type": "cjs require", "userRequest": "./appSidebarLeft", "loc": "24:41-68" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appSidebarLeft", "loc": "20:41-80" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst polyfill_1 = require(\"../polyfill\");\nconst misc_1 = require(\"../../components/misc\");\nconst scrollable_1 = __importDefault(require(\"../../components/scrollable\"));\nconst appMessagesManager_1 = __importDefault(require(\"./appMessagesManager\"));\nconst appDialogsManager_1 = __importDefault(require(\"./appDialogsManager\"));\nconst utils_1 = require(\"../utils\");\nconst appMessagesIDsManager_1 = __importDefault(require(\"./appMessagesIDsManager\"));\nconst appImManager_1 = __importDefault(require(\"./appImManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst services_1 = require(\"../services\");\nclass SearchGroup {\n constructor(name, type) {\n this.name = name;\n this.type = type;\n this.list = document.createElement('ul');\n this.container = document.createElement('div');\n this.nameEl = document.createElement('div');\n this.nameEl.classList.add('search-group__name');\n this.nameEl.innerText = name;\n this.container.classList.add('search-group');\n this.container.append(this.nameEl, this.list);\n this.container.style.display = 'none';\n appDialogsManager_1.default.setListClickListener(this.list);\n }\n clear() {\n this.container.style.display = 'none';\n this.list.innerHTML = '';\n }\n setActive() {\n this.container.style.display = '';\n }\n}\nclass AppSidebarLeft {\n constructor() {\n this.sidebarEl = document.querySelector('.page-chats .chats-container');\n this.searchInput = document.getElementById('global-search');\n this.toolsBtn = this.sidebarEl.querySelector('.sidebar-tools-button');\n this.backBtn = this.sidebarEl.querySelector('.sidebar-back-button');\n this.searchContainer = this.sidebarEl.querySelector('#search-container');\n this.menuEl = this.toolsBtn.querySelector('.btn-menu');\n this.savedBtn = this.menuEl.querySelector('.menu-saved');\n this.archivedBtn = this.menuEl.querySelector('.menu-archive');\n this.archivedCount = this.archivedBtn.querySelector('.archived-count');\n this.listsContainer = null;\n this.chatsArchivedContainer = document.getElementById('chats-archived-container');\n this.chatsContainer = document.getElementById('chats-container');\n this.chatsArchivedOffsetIndex = 0;\n this.chatsOffsetIndex = 0;\n this.chatsLoadCount = 0;\n this.log = polyfill_1.logger('SL');\n this.peerID = 0;\n this.minMsgID = 0;\n this.loadedCount = 0;\n this.foundCount = 0;\n this.offsetRate = 0;\n this.searchPromise = null;\n this.searchTimeout = 0;\n this.query = '';\n this.scroll = null;\n this.scrollArchived = null;\n this.searchGroups = {\n contacts: new SearchGroup('Contacts and Chats', 'contacts'),\n globalContacts: new SearchGroup('Global Search', 'contacts'),\n globalMessages: new SearchGroup('Global Search', 'messages'),\n privateMessages: new SearchGroup('Private Search', 'messages')\n };\n this.chatsPreloader = document.createElement('div');\n this.chatsPreloader.classList.add('preloader');\n misc_1.putPreloader(this.chatsPreloader);\n this.chatsContainer.append(this.chatsPreloader);\n this.chatsLoadCount = Math.round(document.body.scrollHeight / 70 * 1.5);\n this.scroll = new scrollable_1.default(this.chatsContainer);\n this.scroll.setVirtualContainer(appDialogsManager_1.default.chatList);\n appDialogsManager_1.default.chatsHidden = this.scroll.hiddenElements;\n this.scroll.container.addEventListener('scroll', this.onChatsScroll.bind(this));\n this.scrollArchived = new scrollable_1.default(this.chatsArchivedContainer);\n this.scrollArchived.setVirtualContainer(appDialogsManager_1.default.chatListArchived);\n appDialogsManager_1.default.chatsArchivedHidden = this.scrollArchived.hiddenElements;\n this.scroll.container.addEventListener('scroll', this.onChatsArchivedScroll.bind(this));\n this.listsContainer = new scrollable_1.default(this.searchContainer).container;\n for (let i in this.searchGroups) {\n this.listsContainer.append(this.searchGroups[i].container);\n }\n this.savedBtn.addEventListener('click', (e) => {\n ///////this.log('savedbtn click');\n setTimeout(() => {\n let dom = appDialogsManager_1.default.getDialogDom(appImManager_1.default.myID);\n if (dom) {\n dom.listEl.click();\n }\n else {\n appImManager_1.default.setPeer(appImManager_1.default.myID);\n }\n }, 0);\n });\n this.archivedBtn.addEventListener('click', (e) => {\n this.chatsArchivedContainer.classList.add('active');\n this.toolsBtn.classList.remove('active');\n this.backBtn.classList.add('active');\n //this.toolsBtn.classList.remove('tgico-menu', 'btn-menu-toggle');\n //this.toolsBtn.classList.add('tgico-back');\n });\n /* this.listsContainer.insertBefore(this.searchMessagesList, this.listsContainer.lastElementChild);\n for(let i = 0; i < 25; ++i) {\n let li = document.createElement('li');\n li.innerHTML = `

Влад14:41

это важно

`;\n this.searchMessagesList.append(li);\n } */\n this.listsContainer.addEventListener('scroll', this.onSidebarScroll.bind(this));\n //this.searchContainer.append(this.listsContainer);\n this.searchInput.addEventListener('focus', (e) => {\n /* this.toolsBtn.classList.remove('tgico-menu', 'btn-menu-toggle');\n this.toolsBtn.classList.add('tgico-back'); */\n this.toolsBtn.classList.remove('active');\n this.backBtn.classList.add('active');\n this.searchContainer.classList.add('active');\n if (!this.searchInput.value) {\n for (let i in this.searchGroups) {\n this.searchGroups[i].clear();\n }\n }\n this.searchInput.addEventListener('blur', (e) => {\n if (!this.searchInput.value) {\n /* this.toolsBtn.classList.add('tgico-menu');\n this.toolsBtn.classList.remove('tgico-back'); */\n this.toolsBtn.classList.add('active');\n this.backBtn.classList.remove('active');\n this.searchContainer.classList.remove('active');\n this.backBtn.click();\n /* setTimeout(() => {\n //this.toolsBtn.click();\n this.toolsBtn.classList.add('btn-menu-toggle');\n }, 200); */\n }\n /* this.peerID = 0;\n this.loadedCount = 0;\n this.minMsgID = 0; */\n }, { once: true });\n });\n this.searchInput.addEventListener('input', (e) => {\n //console.log('messageInput input', this.innerText, serializeNodes(Array.from(messageInput.childNodes)));\n let value = this.searchInput.value;\n ////////this.log('input', value);\n if (!value.trim()) {\n //this.peerID = 0;\n return;\n }\n this.query = value;\n this.minMsgID = 0;\n this.loadedCount = 0;\n this.foundCount = 0;\n this.offsetRate = 0;\n for (let i in this.searchGroups) {\n this.searchGroups[i].clear();\n }\n this.searchPromise = null;\n this.searchMore();\n });\n this.backBtn.addEventListener('click', (e) => {\n this.chatsArchivedContainer.classList.remove('active');\n this.toolsBtn.classList.add('active');\n this.backBtn.classList.remove('active');\n this.searchInput.value = '';\n this.searchContainer.classList.remove('active');\n this.peerID = 0;\n });\n window.addEventListener('resize', () => {\n this.chatsLoadCount = Math.round(document.body.scrollHeight / 70 * 1.5);\n setTimeout(() => {\n this.onSidebarScroll();\n this.scroll.onScroll();\n this.onChatsScroll();\n this.onChatsArchivedScroll();\n }, 0);\n });\n /* appUsersManager.getTopPeers().then(categories => {\n this.log('got top categories:', categories);\n }); */\n }\n loadDialogs(archived = false) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.loadDialogsPromise /* || 1 == 1 */)\n return this.loadDialogsPromise;\n (archived ? this.chatsArchivedContainer : this.chatsContainer).append(this.chatsPreloader);\n //let offset = appMessagesManager.generateDialogIndex();/* appMessagesManager.dialogsNum */;\n let offset = archived ? this.chatsArchivedOffsetIndex : this.chatsOffsetIndex;\n //let offset = 0;\n try {\n this.loadDialogsPromise = appMessagesManager_1.default.getConversations('', offset, this.chatsLoadCount, +archived);\n let result = yield this.loadDialogsPromise;\n if (result && result.dialogs && result.dialogs.length) {\n let index = result.dialogs[result.dialogs.length - 1].index;\n if (archived)\n this.chatsArchivedOffsetIndex = index;\n else\n this.chatsOffsetIndex = index;\n result.dialogs.forEach((dialog) => {\n appDialogsManager_1.default.addDialog(dialog);\n });\n }\n /* if(archived) {\n let count = result.count;\n this.archivedCount.innerText = '' + count;\n } */\n /////this.log('loaded ' + this.chatsLoadCount + ' dialogs by offset:', offset, result, this.scroll.hiddenElements);\n this.scroll.onScroll();\n }\n catch (err) {\n this.log.error(err);\n }\n this.chatsPreloader.remove();\n this.loadDialogsPromise = undefined;\n });\n }\n onChatsScroll() {\n //this.log(this.scroll.hiddenElements.down.length, this.loadDialogsPromise, appDialogsManager.chatList.childNodes);\n if (this.scroll.hiddenElements.down.length > 0 /* || 1 == 1 */)\n return;\n if (!this.loadDialogsPromise) {\n let d = Array.from(appDialogsManager_1.default.chatList.childNodes).slice(-5);\n for (let node of d) {\n if (utils_1.isElementInViewport(node)) {\n this.loadDialogs();\n break;\n }\n }\n //console.log('last 5 dialogs:', d);\n }\n }\n onChatsArchivedScroll() {\n //this.log(this.scrollArchived.hiddenElements.down.length, this.loadDialogsPromise, appDialogsManager.chatListArchived.childNodes);\n if (this.scrollArchived.hiddenElements.down.length > 0 /* || 1 == 1 */)\n return;\n if (!this.loadDialogsPromise) {\n let d = Array.from(appDialogsManager_1.default.chatListArchived.childNodes).slice(-5);\n for (let node of d) {\n if (utils_1.isElementInViewport(node)) {\n this.loadDialogs(true);\n break;\n }\n }\n //console.log('last 5 dialogs:', d);\n }\n }\n onSidebarScroll() {\n if (!this.query.trim())\n return;\n let elements = Array.from(this.searchGroups[this.peerID ? 'privateMessages' : 'globalMessages'].list.childNodes).slice(-5);\n for (let li of elements) {\n if (utils_1.isElementInViewport(li)) {\n this.log('Will load more search');\n if (!this.searchTimeout) {\n this.searchTimeout = setTimeout(() => {\n this.searchMore();\n this.searchTimeout = 0;\n }, 0);\n }\n break;\n }\n }\n }\n beginSearch(peerID) {\n if (peerID) {\n this.peerID = peerID;\n }\n this.searchInput.focus();\n }\n searchMore() {\n if (this.searchPromise)\n return this.searchPromise;\n let query = this.query;\n if (!query.trim())\n return;\n if (this.loadedCount != 0 && this.loadedCount >= this.foundCount) {\n return Promise.resolve();\n }\n let maxID = appMessagesIDsManager_1.default.getMessageIDInfo(this.minMsgID)[0];\n if (!this.peerID && !maxID) {\n appUsersManager_1.default.searchContacts(query, 20).then((contacts) => {\n if (this.searchInput.value != query) {\n return;\n }\n ///////this.log('input search contacts result:', contacts);\n let setResults = (results, group, showMembersCount = false) => {\n results.forEach((inputPeer) => {\n let peerID = services_1.appPeersManager.getPeerID(inputPeer);\n let peer = services_1.appPeersManager.getPeer(peerID);\n let originalDialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n //////////this.log('contacts peer', peer);\n if (!originalDialog) {\n /////////this.log('no original dialog by peerID:', peerID);\n originalDialog = {\n peerID: peerID,\n pFlags: {},\n peer: peer\n };\n }\n let { dialog, dom } = appDialogsManager_1.default.addDialog(originalDialog, group.list, false);\n if (showMembersCount && (peer.participants_count || peer.participants)) {\n let isChannel = services_1.appPeersManager.isChannel(peerID) && !services_1.appPeersManager.isMegagroup(peerID);\n let participants_count = peer.participants_count || peer.participants.participants.length;\n let subtitle = utils_1.numberWithCommas(participants_count) + ' ' + (isChannel ? 'subscribers' : 'members');\n dom.lastMessageSpan.innerText = subtitle;\n }\n else {\n let username = services_1.appPeersManager.getPeerUsername(peerID);\n if (!username) {\n let user = appUsersManager_1.default.getUser(peerID);\n if (user && user.phone) {\n username = '+' + misc_1.formatPhoneNumber(user.phone).formatted;\n }\n }\n else {\n username = '@' + username;\n }\n dom.lastMessageSpan.innerText = username;\n }\n });\n if (results.length) {\n group.setActive();\n }\n };\n setResults(contacts.my_results, this.searchGroups.contacts, true);\n setResults(contacts.results, this.searchGroups.globalContacts);\n });\n }\n return this.searchPromise = appMessagesManager_1.default.getSearch(this.peerID, query, null, maxID, 20, this.offsetRate).then(res => {\n this.searchPromise = null;\n if (this.searchInput.value != query) {\n return;\n }\n /////////this.log('input search result:', this.peerID, query, null, maxID, 20, res);\n let { count, history, next_rate } = res;\n if (history[0] == this.minMsgID) {\n history.shift();\n }\n let searchGroup = this.searchGroups[this.peerID ? 'privateMessages' : 'globalMessages'];\n searchGroup.setActive();\n history.forEach((msgID) => {\n let message = appMessagesManager_1.default.getMessage(msgID);\n let originalDialog = appMessagesManager_1.default.getDialogByPeerID(message.peerID)[0];\n if (!originalDialog) {\n ////////this.log('no original dialog by message:', message);\n originalDialog = {\n peerID: message.peerID,\n pFlags: {},\n peer: message.to_id\n };\n }\n let { dialog, dom } = appDialogsManager_1.default.addDialog(originalDialog, searchGroup.list, false);\n appDialogsManager_1.default.setLastMessage(dialog, message, dom);\n });\n this.minMsgID = history[history.length - 1];\n this.offsetRate = next_rate;\n this.loadedCount += history.length;\n if (!this.foundCount) {\n this.foundCount = count;\n }\n }).catch(err => {\n this.log.error('search error', err);\n this.searchPromise = null;\n });\n }\n}\nexports.default = new AppSidebarLeft();\n" }, { "id": 27, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/apiUpdatesManager.ts", "name": "./src/lib/appManagers/apiUpdatesManager.ts", "index": 63, "index2": 57, "size": 20000, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./apiUpdatesManager", "loc": "22:44-74" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./apiUpdatesManager", "loc": "40:44-74" }, { "moduleId": 37, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "module": "./src/lib/appManagers/appProfileManager.ts", "moduleName": "./src/lib/appManagers/appProfileManager.ts", "type": "cjs require", "userRequest": "./apiUpdatesManager", "loc": "13:44-74" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/apiUpdatesManager", "loc": "10:44-86" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst networkerFactory_1 = __importDefault(require(\"../mtproto/networkerFactory\"));\nconst utils_1 = require(\"../utils\");\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nclass ApiUpdatesManager {\n constructor() {\n this.updatesState = {\n pendingPtsUpdates: [],\n pendingSeqUpdates: {},\n syncPending: false,\n syncLoading: true\n };\n this.channelStates = {};\n this.myID = 0;\n apiManager_1.default.getUserID().then((id) => {\n this.myID = id;\n });\n }\n popPendingSeqUpdate() {\n var nextSeq = this.updatesState.seq + 1;\n var pendingUpdatesData = this.updatesState.pendingSeqUpdates[nextSeq];\n if (!pendingUpdatesData) {\n return false;\n }\n var updates = pendingUpdatesData.updates;\n var length;\n for (var i = 0, length = updates.length; i < length; i++) {\n this.saveUpdate(updates[i]);\n }\n this.updatesState.seq = pendingUpdatesData.seq;\n if (pendingUpdatesData.date && this.updatesState.date < pendingUpdatesData.date) {\n this.updatesState.date = pendingUpdatesData.date;\n }\n delete this.updatesState.pendingSeqUpdates[nextSeq];\n if (!this.popPendingSeqUpdate() &&\n this.updatesState.syncPending &&\n this.updatesState.syncPending.seqAwaiting &&\n this.updatesState.seq >= this.updatesState.syncPending.seqAwaiting) {\n if (!this.updatesState.syncPending.ptsAwaiting) {\n clearTimeout(this.updatesState.syncPending.timeout);\n this.updatesState.syncPending = false;\n }\n else {\n delete this.updatesState.syncPending.seqAwaiting;\n }\n }\n return true;\n }\n popPendingPtsUpdate(channelID) {\n var curState = channelID ? this.getChannelState(channelID) : this.updatesState;\n if (!curState.pendingPtsUpdates.length) {\n return false;\n }\n curState.pendingPtsUpdates.sort((a, b) => {\n return a.pts - b.pts;\n });\n // console.log(dT(), 'pop update', channelID, curState.pendingPtsUpdates)\n var curPts = curState.pts;\n var goodPts = false;\n var goodIndex = 0;\n var update;\n for (var i = 0, length = curState.pendingPtsUpdates.length; i < length; i++) {\n update = curState.pendingPtsUpdates[i];\n curPts += update.pts_count;\n if (curPts >= update.pts) {\n goodPts = update.pts;\n goodIndex = i;\n }\n }\n if (!goodPts) {\n return false;\n }\n console.log(utils_1.dT(), 'pop pending pts updates', goodPts, curState.pendingPtsUpdates.slice(0, goodIndex + 1));\n curState.pts = goodPts;\n for (i = 0; i <= goodIndex; i++) {\n update = curState.pendingPtsUpdates[i];\n this.saveUpdate(update);\n }\n curState.pendingPtsUpdates.splice(0, goodIndex + 1);\n if (!curState.pendingPtsUpdates.length && curState.syncPending) {\n if (!curState.syncPending.seqAwaiting) {\n clearTimeout(curState.syncPending.timeout);\n curState.syncPending = false;\n }\n else {\n delete curState.syncPending.ptsAwaiting;\n }\n }\n return true;\n }\n forceGetDifference() {\n if (!this.updatesState.syncLoading) {\n this.getDifference();\n }\n }\n processUpdateMessage(updateMessage) {\n // return forceGetDifference()\n var processOpts = {\n date: updateMessage.date,\n seq: updateMessage.seq,\n seqStart: updateMessage.seq_start\n };\n switch (updateMessage._) {\n case 'updatesTooLong':\n case 'new_session_created':\n this.forceGetDifference();\n break;\n case 'updateShort':\n this.processUpdate(updateMessage.update, processOpts);\n break;\n case 'updateShortMessage':\n case 'updateShortChatMessage':\n var isOut = updateMessage.flags & 2;\n var fromID = updateMessage.from_id || (isOut ? this.myID : updateMessage.user_id);\n var toID = updateMessage.chat_id\n ? -updateMessage.chat_id\n : (isOut ? updateMessage.user_id : this.myID);\n this.processUpdate({\n _: 'updateNewMessage',\n message: {\n _: 'message',\n flags: updateMessage.flags,\n pFlags: updateMessage.pFlags,\n id: updateMessage.id,\n from_id: fromID,\n to_id: appPeersManager_1.default.getOutputPeer(toID),\n date: updateMessage.date,\n message: updateMessage.message,\n fwd_from: updateMessage.fwd_from,\n reply_to_msg_id: updateMessage.reply_to_msg_id,\n entities: updateMessage.entities\n },\n pts: updateMessage.pts,\n pts_count: updateMessage.pts_count\n }, processOpts);\n break;\n case 'updatesCombined':\n case 'updates':\n appUsersManager_1.default.saveApiUsers(updateMessage.users);\n appChatsManager_1.default.saveApiChats(updateMessage.chats);\n updateMessage.updates.forEach((update) => {\n this.processUpdate(update, processOpts);\n });\n break;\n default:\n console.warn(utils_1.dT(), 'Unknown update message', updateMessage);\n }\n }\n getDifference() {\n // console.trace(dT(), 'Get full diff')\n let updatesState = this.updatesState;\n if (!updatesState.syncLoading) {\n updatesState.syncLoading = true;\n updatesState.pendingSeqUpdates = {};\n updatesState.pendingPtsUpdates = [];\n }\n if (updatesState.syncPending) {\n clearTimeout(updatesState.syncPending.timeout);\n updatesState.syncPending = false;\n }\n apiManager_1.default.invokeApi('updates.getDifference', {\n pts: updatesState.pts,\n date: updatesState.date,\n qts: -1\n }, {\n timeout: 0x7fffffff\n }).then((differenceResult) => {\n if (differenceResult._ == 'updates.differenceEmpty') {\n console.log(utils_1.dT(), 'apply empty diff', differenceResult.seq);\n updatesState.date = differenceResult.date;\n updatesState.seq = differenceResult.seq;\n updatesState.syncLoading = false;\n utils_1.$rootScope.$broadcast('stateSynchronized');\n return false;\n }\n appUsersManager_1.default.saveApiUsers(differenceResult.users);\n appChatsManager_1.default.saveApiChats(differenceResult.chats);\n // Should be first because of updateMessageID\n // console.log(dT(), 'applying', differenceResult.other_updates.length, 'other updates')\n differenceResult.other_updates.forEach((update) => {\n switch (update._) {\n case 'updateChannelTooLong':\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n this.processUpdate(update);\n return;\n }\n this.saveUpdate(update);\n });\n // console.log(dT(), 'applying', differenceResult.new_messages.length, 'new messages')\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewMessage',\n message: apiMessage,\n pts: updatesState.pts,\n pts_count: 0\n });\n });\n var nextState = differenceResult.intermediate_state || differenceResult.state;\n updatesState.seq = nextState.seq;\n updatesState.pts = nextState.pts;\n updatesState.date = nextState.date;\n // console.log(dT(), 'apply diff', updatesState.seq, updatesState.pts)\n if (differenceResult._ == 'updates.differenceSlice') {\n this.getDifference();\n }\n else {\n // console.log(dT(), 'finished get diff')\n utils_1.$rootScope.$broadcast('stateSynchronized');\n updatesState.syncLoading = false;\n }\n }, () => {\n updatesState.syncLoading = false;\n });\n }\n getChannelDifference(channelID) {\n var channelState = this.getChannelState(channelID);\n if (!channelState.syncLoading) {\n channelState.syncLoading = true;\n channelState.pendingPtsUpdates = [];\n }\n if (channelState.syncPending) {\n clearTimeout(channelState.syncPending.timeout);\n channelState.syncPending = false;\n }\n // console.log(dT(), 'Get channel diff', appChatsManager.getChat(channelID), channelState.pts)\n apiManager_1.default.invokeApi('updates.getChannelDifference', {\n channel: appChatsManager_1.default.getChannelInput(channelID),\n filter: { _: 'channelMessagesFilterEmpty' },\n pts: channelState.pts,\n limit: 30\n }, { timeout: 0x7fffffff }).then((differenceResult) => {\n // console.log(dT(), 'channel diff result', differenceResult)\n channelState.pts = differenceResult.pts;\n if (differenceResult._ == 'updates.channelDifferenceEmpty') {\n console.log(utils_1.dT(), 'apply channel empty diff', differenceResult);\n channelState.syncLoading = false;\n utils_1.$rootScope.$broadcast('stateSynchronized');\n return false;\n }\n if (differenceResult._ == 'updates.channelDifferenceTooLong') {\n console.log(utils_1.dT(), 'channel diff too long', differenceResult);\n channelState.syncLoading = false;\n delete this.channelStates[channelID];\n this.saveUpdate({ _: 'updateChannelReload', channel_id: channelID });\n return false;\n }\n appUsersManager_1.default.saveApiUsers(differenceResult.users);\n appChatsManager_1.default.saveApiChats(differenceResult.chats);\n // Should be first because of updateMessageID\n console.log(utils_1.dT(), 'applying', differenceResult.other_updates.length, 'channel other updates');\n differenceResult.other_updates.forEach((update) => {\n this.saveUpdate(update);\n });\n console.log(utils_1.dT(), 'applying', differenceResult.new_messages.length, 'channel new messages');\n differenceResult.new_messages.forEach((apiMessage) => {\n this.saveUpdate({\n _: 'updateNewChannelMessage',\n message: apiMessage,\n pts: channelState.pts,\n pts_count: 0\n });\n });\n console.log(utils_1.dT(), 'apply channel diff', channelState.pts);\n if (differenceResult._ == 'updates.channelDifference' &&\n !differenceResult.pFlags['final']) {\n this.getChannelDifference(channelID);\n }\n else {\n console.log(utils_1.dT(), 'finished channel get diff');\n utils_1.$rootScope.$broadcast('stateSynchronized');\n channelState.syncLoading = false;\n }\n }, () => {\n channelState.syncLoading = false;\n });\n }\n addChannelState(channelID, pts) {\n if (!pts) {\n throw new Error('Add channel state without pts ' + channelID);\n }\n if (!(channelID in this.channelStates)) {\n this.channelStates[channelID] = {\n pts: pts,\n pendingPtsUpdates: [],\n syncPending: false,\n syncLoading: false\n };\n return true;\n }\n return false;\n }\n getChannelState(channelID, pts) {\n if (this.channelStates[channelID] === undefined) {\n this.addChannelState(channelID, pts);\n }\n return this.channelStates[channelID];\n }\n processUpdate(update, options = {}) {\n var channelID = false;\n switch (update._) {\n case 'updateNewChannelMessage':\n case 'updateEditChannelMessage':\n channelID = -appPeersManager_1.default.getPeerID(update.message.to_id);\n break;\n case 'updateDeleteChannelMessages':\n channelID = update.channel_id;\n break;\n case 'updateChannelTooLong':\n channelID = update.channel_id;\n if (!(channelID in this.channelStates)) {\n return false;\n }\n break;\n }\n var curState = channelID ? this.getChannelState(channelID, update.pts) : this.updatesState;\n // console.log(dT(), 'process', channelID, curState.pts, update)\n if (curState.syncLoading) {\n return false;\n }\n if (update._ == 'updateChannelTooLong') {\n if (!curState.lastPtsUpdateTime ||\n curState.lastPtsUpdateTime < utils_1.tsNow() - 10000) {\n // console.trace(dT(), 'channel too long, get diff', channelID, update)\n this.getChannelDifference(channelID);\n }\n return false;\n }\n if (update._ == 'updateNewMessage' ||\n update._ == 'updateEditMessage' ||\n update._ == 'updateNewChannelMessage' ||\n update._ == 'updateEditChannelMessage') {\n var message = update.message;\n var toPeerID = appPeersManager_1.default.getPeerID(message.to_id);\n var fwdHeader = message.fwd_from || {};\n var reason = false;\n if (message.from_id && !appUsersManager_1.default.hasUser(message.from_id, message.pFlags.post /* || channelID*/) && (reason = 'author') ||\n fwdHeader.from_id && !appUsersManager_1.default.hasUser(fwdHeader.from_id, !!fwdHeader.channel_id) && (reason = 'fwdAuthor') ||\n fwdHeader.channel_id && !appChatsManager_1.default.hasChat(fwdHeader.channel_id, true) && (reason = 'fwdChannel') ||\n toPeerID > 0 && !appUsersManager_1.default.hasUser(toPeerID) && (reason = 'toPeer User') ||\n toPeerID < 0 && !appChatsManager_1.default.hasChat(-toPeerID) && (reason = 'toPeer Chat')) {\n console.warn(utils_1.dT(), 'Not enough data for message update', toPeerID, reason, message);\n if (channelID && appChatsManager_1.default.hasChat(channelID)) {\n this.getChannelDifference(channelID);\n }\n else {\n this.forceGetDifference();\n }\n return false;\n }\n }\n else if (channelID && !appChatsManager_1.default.hasChat(channelID)) {\n // console.log(dT(), 'skip update, missing channel', channelID, update)\n return false;\n }\n var popPts;\n var popSeq;\n if (update.pts) {\n var newPts = curState.pts + (update.pts_count || 0);\n if (newPts < update.pts) {\n console.warn(utils_1.dT(), 'Pts hole', curState, update, channelID && appChatsManager_1.default.getChat(channelID));\n curState.pendingPtsUpdates.push(update);\n if (!curState.syncPending) {\n curState.syncPending = {\n timeout: setTimeout(() => {\n if (channelID) {\n this.getChannelDifference(channelID);\n }\n else {\n this.getDifference();\n }\n }, 5000)\n };\n }\n curState.syncPending.ptsAwaiting = true;\n return false;\n }\n if (update.pts > curState.pts) {\n curState.pts = update.pts;\n popPts = true;\n curState.lastPtsUpdateTime = utils_1.tsNow();\n }\n else if (update.pts_count) {\n // console.warn(dT(), 'Duplicate update', update)\n return false;\n }\n if (channelID && options.date && this.updatesState.date < options.date) {\n this.updatesState.date = options.date;\n }\n }\n else if (!channelID && options.seq > 0) {\n var seq = options.seq;\n var seqStart = options.seqStart || seq;\n if (seqStart != curState.seq + 1) {\n if (seqStart > curState.seq) {\n console.warn(utils_1.dT(), 'Seq hole', curState, curState.syncPending && curState.syncPending.seqAwaiting);\n if (curState.pendingSeqUpdates[seqStart] === undefined) {\n curState.pendingSeqUpdates[seqStart] = { seq: seq, date: options.date, updates: [] };\n }\n curState.pendingSeqUpdates[seqStart].updates.push(update);\n if (!curState.syncPending) {\n curState.syncPending = {\n timeout: setTimeout(() => {\n this.getDifference();\n }, 5000)\n };\n }\n if (!curState.syncPending.seqAwaiting ||\n curState.syncPending.seqAwaiting < seqStart) {\n curState.syncPending.seqAwaiting = seqStart;\n }\n return false;\n }\n }\n if (curState.seq != seq) {\n curState.seq = seq;\n if (options.date && curState.date < options.date) {\n curState.date = options.date;\n }\n popSeq = true;\n }\n }\n this.saveUpdate(update);\n if (popPts) {\n this.popPendingPtsUpdate(channelID);\n }\n else if (popSeq) {\n this.popPendingSeqUpdate();\n }\n }\n saveUpdate(update) {\n utils_1.$rootScope.$broadcast('apiUpdate', update);\n }\n attach() {\n networkerFactory_1.default.setUpdatesProcessor(this.processUpdateMessage.bind(this));\n apiManager_1.default.invokeApi('updates.getState', {}, { noErrorBox: true }).then((stateResult) => {\n this.updatesState.seq = stateResult.seq;\n this.updatesState.pts = stateResult.pts;\n this.updatesState.date = stateResult.date;\n setTimeout(() => {\n this.updatesState.syncLoading = false;\n }, 1000);\n // updatesState.seq = 1\n // updatesState.pts = stateResult.pts - 5000\n // updatesState.date = 1\n // getDifference()\n });\n }\n}\nexports.ApiUpdatesManager = ApiUpdatesManager;\nexports.default = new ApiUpdatesManager();\n" }, { "id": 28, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appDialogsManager.ts", "name": "./src/lib/appManagers/appDialogsManager.ts", "index": 69, "index2": 61, "size": 21847, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appDialogsManager", "loc": "29:44-74" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "./appDialogsManager", "loc": "19:44-74" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "./appDialogsManager", "loc": "7:44-74" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appDialogsManager", "loc": "12:44-86" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst apiFileManager_1 = __importDefault(require(\"../mtproto/apiFileManager\"));\nconst utils_1 = require(\"../utils\");\nconst appImManager_1 = __importDefault(require(\"./appImManager\"));\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst appMessagesManager_1 = __importDefault(require(\"./appMessagesManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst misc_1 = require(\"../../components/misc\");\nconst appSidebarLeft_1 = __importDefault(require(\"./appSidebarLeft\"));\nclass AppDialogsManager {\n constructor() {\n this.chatList = document.getElementById('dialogs');\n this.chatListArchived = document.getElementById('dialogs-archived');\n this.myID = 0;\n this.doms = {};\n this.domsArchived = {};\n this.lastActiveListElement = null;\n this.pinnedDelimiter = document.createElement('div');\n this.pinnedDelimiter.classList.add('pinned-delimiter');\n this.pinnedDelimiter.appendChild(document.createElement('span'));\n apiManager_1.default.getUserID().then((id) => {\n this.myID = id;\n });\n utils_1.$rootScope.$on('user_auth', (e) => {\n let userAuth = e.detail;\n this.myID = userAuth ? userAuth.id : 0;\n });\n //let chatClosedDiv = document.getElementById('chat-closed');\n this.setListClickListener(this.chatList);\n this.setListClickListener(this.chatListArchived);\n }\n setListClickListener(list, onFound) {\n list.addEventListener('click', (e) => {\n let target = e.target;\n let elem = target.tagName != 'LI' ? utils_1.findUpTag(target, 'LI') : target;\n if (!elem) {\n return;\n }\n /* if(this.lastActiveListElement) {\n this.lastActiveListElement.classList.remove('active');\n } */\n if (elem) {\n /* if(chatClosedDiv) {\n chatClosedDiv.style.display = 'none';\n } */\n if (onFound)\n onFound();\n let peerID = +elem.getAttribute('data-peerID');\n let lastMsgID = +elem.getAttribute('data-mid');\n appImManager_1.default.setPeer(peerID, lastMsgID);\n elem.classList.add('active');\n this.lastActiveListElement = elem;\n }\n else /* if(chatClosedDiv) */ {\n appImManager_1.default.setPeer(0);\n //chatClosedDiv.style.display = '';\n }\n });\n }\n loadDialogPhoto(div, peerID, isDialog = false) {\n return __awaiter(this, void 0, void 0, function* () {\n let inputPeer;\n let location;\n if (typeof (peerID) != 'string') {\n inputPeer = appPeersManager_1.default.getInputPeerByID(peerID);\n location = appPeersManager_1.default.getPeerPhoto(peerID);\n }\n //console.log('loadDialogPhoto location:', location, inputPeer);\n if (peerID == this.myID && (isDialog || utils_1.$rootScope.selectedPeerID == this.myID)) {\n if (div.firstChild) {\n div.firstChild.remove();\n }\n div.style.backgroundColor = '';\n div.style.fontSize = '';\n div.classList.add('tgico-savedmessages');\n return true;\n }\n //if(!location || location.empty || !location.photo_small) {\n if (div.firstChild) {\n div.firstChild.remove();\n }\n let color = '';\n if (typeof (peerID) != 'string' && peerID != this.myID) {\n color = appPeersManager_1.default.getPeerColorByID(peerID);\n }\n div.classList.remove('tgico-savedmessages');\n div.style.fontSize = '';\n div.style.backgroundColor = color;\n let abbrSplitted = (typeof (peerID) != 'string' ? appPeersManager_1.default.getPeerTitle(peerID, true) : peerID).split(' ');\n let abbr = (abbrSplitted.length == 2 ?\n abbrSplitted[0][0] + abbrSplitted[1][0] :\n abbrSplitted[0][0]).toUpperCase();\n //div.innerText = peer.initials.toUpperCase();\n div.innerText = abbr.toUpperCase();\n //return Promise.resolve(true);\n //}\n if (!location || location.empty || !location.photo_small) {\n return true;\n }\n let res = yield apiFileManager_1.default.downloadSmallFile({\n _: 'inputPeerPhotoFileLocation',\n dc_id: location.dc_id,\n flags: 0,\n peer: inputPeer,\n volume_id: location.photo_small.volume_id,\n local_id: location.photo_small.local_id\n });\n let img = new Image();\n img.src = URL.createObjectURL(res);\n div.innerHTML = '';\n div.style.fontSize = '0'; // need\n div.append(img);\n return true;\n });\n }\n sortDom(archived = false) {\n //return;\n let dialogs = appMessagesManager_1.default.dialogsStorage.dialogs.slice();\n let inUpper = [];\n let inBottom = [];\n let pinnedDialogs = [];\n let sorted = dialogs;\n if (!archived) {\n for (let i = 0; i < dialogs.length; ++i) {\n let dialog = dialogs[i];\n if (!dialog.pFlags.pinned)\n break;\n pinnedDialogs.push(dialog);\n }\n if (pinnedDialogs.length) {\n let dom = this.getDialogDom(pinnedDialogs[pinnedDialogs.length - 1].peerID);\n if (dom) {\n dom.listEl.append(this.pinnedDelimiter);\n }\n }\n else {\n if (this.pinnedDelimiter.parentElement) {\n this.pinnedDelimiter.parentElement.removeChild(this.pinnedDelimiter);\n }\n }\n sorted = sorted.filter((d) => !d.pFlags.pinned && d.folder_id != 1);\n }\n else {\n sorted = sorted.filter((d) => d.folder_id == 1);\n }\n sorted = sorted.sort((a, b) => {\n let timeA = appMessagesManager_1.default.getMessage(a.top_message).date;\n let timeB = appMessagesManager_1.default.getMessage(b.top_message).date;\n return timeB - timeA;\n });\n if (!archived) {\n sorted = pinnedDialogs.concat(sorted);\n }\n //console.log('sortDom', sorted, this.chatsHidden, this.chatsHidden.up, this.chatsHidden.down);\n let chatList = archived ? this.chatListArchived : this.chatList;\n let chatsHidden = archived ? this.chatsArchivedHidden : this.chatsHidden;\n let hiddenLength = chatsHidden.up.length;\n let inViewportLength = chatList.childElementCount;\n chatList.innerHTML = '';\n let inViewportIndex = 0;\n sorted.forEach((d, idx) => {\n let dom = this.getDialogDom(d.peerID);\n if (!dom)\n return;\n if (inUpper.length < hiddenLength) {\n inUpper.push(dom.listEl);\n }\n else if (inViewportIndex <= inViewportLength - 1) {\n chatList.append(dom.listEl);\n ++inViewportIndex;\n //this.chatList.insertBefore(dom.listEl, this.chatList.children[inViewportIndex++]);\n }\n else {\n inBottom.push(dom.listEl);\n }\n /* if(this.chatsHidden.up.find((d: HTMLLIElement) => d === dom.listEl)) {\n inUpper.push(dom.listEl);\n } else if(isElementInViewport(dom.listEl)) {\n this.chatList.insertBefore(dom.listEl, this.chatList.children[++inViewportIndex]);\n } else if(this.chatsHidden.down.find((d: HTMLLIElement) => d === dom.listEl)) {\n inBottom.push(dom.listEl);\n } else {\n //console.warn('sortDom found no dom!', dom, d);\n } */\n //this.chatList.append(dom.listEl);\n });\n //////console.log('sortDom', sorted.length, inUpper.length, chatList.childElementCount, inBottom.length);\n chatsHidden.up = inUpper;\n chatsHidden.down = inBottom;\n }\n setLastMessage(dialog, lastMessage, dom) {\n if (!lastMessage) {\n lastMessage = appMessagesManager_1.default.getMessage(dialog.top_message);\n }\n ///////console.log('setlastMessage:', lastMessage);\n if (lastMessage._ == 'messageEmpty')\n return;\n if (!dom) {\n dom = this.getDialogDom(dialog.peerID);\n }\n let peer = dialog.peer;\n let peerID = dialog.peerID;\n //let peerID = appMessagesManager.getMessagePeer(lastMessage);\n //console.log('setting last message:', lastMessage);\n /* if(!dom.lastMessageSpan.classList.contains('user-typing')) */ {\n let lastMessageText = '';\n if (lastMessage.media) {\n switch (lastMessage.media._) {\n case 'messageMediaPhoto':\n lastMessageText += 'Photo' + (lastMessage.message ? ', ' : '') + '';\n break;\n case 'messageMediaGeo':\n lastMessageText += 'Geolocation';\n break;\n case 'messageMediaDocument':\n let document = lastMessage.media.document;\n let found = false;\n for (let attribute of document.attributes) {\n if (found)\n break;\n switch (attribute._) {\n case 'documentAttributeSticker':\n lastMessageText += richtextprocessor_1.RichTextProcessor.wrapRichText(attribute.alt) + 'Sticker';\n found = true;\n break;\n case 'documentAttributeFilename':\n lastMessageText += '' + attribute.file_name + '';\n found = true;\n break;\n /* default:\n console.warn('Got unknown document type!', lastMessage);\n break; */\n }\n }\n if (document.type == 'video') {\n lastMessageText = 'Video' + (lastMessage.message ? ', ' : '') + '';\n found = true;\n }\n else if (document.type == 'voice') {\n lastMessageText = 'Voice message';\n found = true;\n }\n else if (document.type == 'gif') {\n lastMessageText = 'GIF' + (lastMessage.message ? ', ' : '') + '';\n found = true;\n }\n else if (document.type == 'round') {\n lastMessageText = 'Videomessage' + (lastMessage.message ? ', ' : '') + '';\n found = true;\n }\n if (found) {\n break;\n }\n default:\n ///////console.warn('Got unknown lastMessage.media type!', lastMessage);\n break;\n }\n }\n if (lastMessage.action) {\n // @ts-ignore\n lastMessageText = utils_1.langPack[lastMessage.action._];\n }\n dom.lastMessageSpan.innerHTML = lastMessageText +\n (lastMessage.message ? richtextprocessor_1.RichTextProcessor.wrapRichText(lastMessage.message.replace(/\\n/g, ' '), { noLinebreakers: true }) : '');\n /* if(lastMessage.from_id == auth.id) { // You: */\n if (peer._ != 'peerUser' && peerID != -lastMessage.from_id) {\n let sender = appUsersManager_1.default.getUser(lastMessage.from_id);\n if (sender && sender.id) {\n let senderBold = document.createElement('b');\n let str = '';\n if (sender.id == this.myID) {\n str = 'You';\n }\n else {\n str = sender.first_name || sender.last_name || sender.username;\n }\n senderBold.innerText = str + ': ';\n //console.log(sender, senderBold.innerText);\n dom.lastMessageSpan.prepend(senderBold);\n } //////// else console.log('no sender', lastMessage, peerID);\n }\n }\n let timeStr = '';\n let timestamp = lastMessage.date;\n let now = Date.now() / 1000;\n let time = new Date(lastMessage.date * 1000);\n if ((now - timestamp) < 86400) { // if < 1 day\n timeStr = ('0' + time.getHours()).slice(-2) +\n ':' + ('0' + time.getMinutes()).slice(-2);\n }\n else if ((now - timestamp) < (86400 * 7)) { // week\n let date = new Date(timestamp * 1000);\n timeStr = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][date.getDay()];\n }\n else {\n let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n timeStr = months[time.getMonth()] +\n ' ' + ('0' + time.getDate()).slice(-2);\n }\n dom.lastTimeSpan.innerHTML = timeStr;\n dom.listEl.setAttribute('data-mid', lastMessage.mid);\n if (this.doms[peerID]) {\n this.setUnreadMessages(dialog);\n }\n }\n setUnreadMessages(dialog) {\n let dom = this.getDialogDom(dialog.peerID);\n dom.statusSpan.innerHTML = '';\n let lastMessage = appMessagesManager_1.default.getMessage(dialog.top_message);\n if (lastMessage._ != 'messageEmpty' &&\n lastMessage.from_id == this.myID && lastMessage.peerID != this.myID &&\n dialog.read_outbox_max_id) { // maybe comment, 06.20.2020\n let outgoing = (lastMessage.pFlags && lastMessage.pFlags.unread); // maybe uncomment, 31.01.2020\n //console.log('outgoing', outgoing, lastMessage);\n if (outgoing) {\n dom.statusSpan.classList.remove('tgico-checks');\n dom.statusSpan.classList.add('tgico-check');\n }\n else {\n dom.statusSpan.classList.remove('tgico-check');\n dom.statusSpan.classList.add('tgico-checks');\n }\n }\n else\n dom.statusSpan.classList.remove('tgico-check', 'tgico-checks');\n dom.unreadMessagesSpan.innerHTML = '';\n if (dialog.unread_count) {\n dom.unreadMessagesSpan.innerHTML = dialog.unread_count;\n dom.unreadMessagesSpan.classList.remove('tgico-pinnedchat');\n dom.unreadMessagesSpan.classList.add(new Date(dialog.notify_settings.mute_until * 1000) > new Date() ?\n 'unread-muted' : 'unread');\n }\n else if (dialog.pFlags.pinned) {\n dom.unreadMessagesSpan.classList.remove('unread', 'unread-muted');\n dom.unreadMessagesSpan.classList.add('tgico-pinnedchat');\n }\n // set archived new count\n if (dialog.folder_id == 1) {\n let sum = Object.keys(this.domsArchived).map(p => +p).reduce((acc, peerID) => {\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID)[0];\n if (dialog) {\n return acc + dialog.unread_count;\n }\n return acc;\n }, 0);\n appSidebarLeft_1.default.archivedCount.innerText = '' + sum;\n }\n }\n getDialogDom(peerID) {\n return this.doms[peerID] || this.domsArchived[peerID];\n }\n addDialog(dialog, container, drawStatus = true) {\n let peerID = dialog.peerID;\n if ((this.doms[peerID] || this.domsArchived[peerID]) && !container)\n return;\n let title = appPeersManager_1.default.getPeerTitle(peerID);\n let avatarDiv = document.createElement('div');\n avatarDiv.classList.add('user-avatar');\n if (drawStatus && peerID != this.myID) {\n let peer = dialog.peer;\n switch (peer._) {\n case 'peerUser':\n let user = appUsersManager_1.default.getUser(peerID);\n //console.log('found user', user);\n if (user.status && user.status._ == 'userStatusOnline') {\n avatarDiv.classList.add('is-online');\n }\n break;\n default:\n break;\n }\n }\n let captionDiv = document.createElement('div');\n captionDiv.classList.add('user-caption');\n let titleSpan = document.createElement('span');\n titleSpan.classList.add('user-title');\n if (peerID == this.myID) {\n title = 'Saved Messages';\n }\n //console.log('trying to load photo for:', title);\n this.loadDialogPhoto(avatarDiv, dialog.peerID, true);\n titleSpan.innerHTML = title;\n //p.classList.add('')\n let span = document.createElement('span');\n span.classList.add('user-last-message');\n //captionDiv.append(titleSpan);\n //captionDiv.append(span);\n let paddingDiv = document.createElement('div');\n paddingDiv.classList.add('rp');\n paddingDiv.append(avatarDiv, captionDiv);\n misc_1.ripple(paddingDiv);\n let li = document.createElement('li');\n li.append(paddingDiv);\n li.setAttribute('data-peerID', '' + peerID);\n /* let li = document.createElement('li');\n li.classList.add('rp');\n li.append(avatarDiv, captionDiv);\n li.setAttribute('data-peerID', '' + peerID);\n \n ripple(li); */\n /* let detailsDiv = document.createElement('div');\n detailsDiv.classList.add('dialog-details'); */\n let statusSpan = document.createElement('span');\n statusSpan.classList.add('message-status');\n let lastTimeSpan = document.createElement('span');\n lastTimeSpan.classList.add('message-time');\n let unreadMessagesSpan = document.createElement('span');\n let titleP = document.createElement('p');\n let rightSpan = document.createElement('span');\n rightSpan.append(statusSpan, lastTimeSpan);\n titleP.append(titleSpan, rightSpan);\n let messageP = document.createElement('p');\n messageP.append(span, unreadMessagesSpan);\n captionDiv.append(titleP, messageP);\n let dom = {\n avatarDiv,\n captionDiv,\n titleSpan,\n statusSpan,\n lastTimeSpan,\n unreadMessagesSpan,\n lastMessageSpan: span,\n containerEl: paddingDiv,\n listEl: li\n };\n if (!container) {\n if (dialog.folder_id && dialog.folder_id == 1) {\n this.chatListArchived.append(li);\n this.domsArchived[dialog.peerID] = dom;\n }\n else {\n this.chatList.append(li);\n this.doms[dialog.peerID] = dom;\n }\n //this.appendTo.push(li);\n if (dialog.pFlags.pinned) {\n li.classList.add('dialog-pinned');\n //this.chatList.insertBefore(this.pinnedDelimiter, li.nextSibling);\n dom.listEl.append(this.pinnedDelimiter);\n }\n this.setLastMessage(dialog);\n }\n else {\n container.append(li);\n }\n return { dom, dialog };\n }\n setTyping(dialog, user) {\n let dom = this.getDialogDom(dialog.peerID);\n let str = '';\n let senderBold = document.createElement('i');\n if (dialog.peerID < 0)\n str = (user.first_name || user.last_name || user.username) + ' ';\n str += 'typing...';\n senderBold.innerText = str;\n dom.lastMessageSpan.innerHTML = '';\n dom.lastMessageSpan.append(senderBold);\n dom.lastMessageSpan.classList.add('user-typing');\n }\n unsetTyping(dialog) {\n let dom = this.getDialogDom(dialog.peerID);\n dom.lastMessageSpan.classList.remove('user-typing');\n this.setLastMessage(dialog, null, dom);\n }\n}\nexports.AppDialogsManager = AppDialogsManager;\nexports.default = new AppDialogsManager();\n" }, { "id": 29, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/preloader.ts", "name": "./src/components/preloader.ts", "index": 72, "index2": 62, "size": 3413, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "issuerId": 15, "issuerName": "./src/lib/appManagers/appMessagesManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 15, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "name": "./src/lib/appManagers/appMessagesManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 523, "building": 172, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "../../components/preloader", "loc": "30:36-73" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../../components/preloader", "loc": "43:36-73" }, { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "./preloader", "loc": "21:36-58" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "../../components/preloader", "loc": "12:36-73" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../lib/utils\");\nclass ProgressivePreloader {\n constructor(elem, cancelable = true) {\n this.cancelable = cancelable;\n this.preloader = null;\n this.circle = null;\n this.progress = 0;\n this.promise = null;\n this.tempID = 0;\n this.preloader = document.createElement('div');\n this.preloader.classList.add('preloader-container');\n this.preloader.innerHTML = `\n
\n \n \n \n
`;\n if (cancelable) {\n this.preloader.innerHTML += `\n \n \n \n `;\n }\n else {\n this.preloader.classList.add('preloader-swing');\n }\n this.circle = this.preloader.firstElementChild.firstElementChild.firstElementChild;\n if (elem) {\n this.attach(elem);\n }\n if (this.cancelable) {\n this.preloader.addEventListener('click', () => {\n if (this.promise && this.promise.cancel) {\n this.promise.cancel();\n this.detach();\n }\n });\n }\n }\n attach(elem, reset = true, promise) {\n if (promise) {\n this.promise = promise;\n let tempID = --this.tempID;\n promise.then(() => {\n if (tempID == this.tempID) {\n this.detach();\n }\n });\n promise.notify = (details) => {\n if (tempID != this.tempID)\n return;\n console.log('preloader download', promise, details);\n let percents = details.done / details.total * 100;\n this.setProgress(percents);\n };\n }\n if (this.cancelable && reset) {\n this.setProgress(0);\n }\n elem.append(this.preloader);\n /* let isIn = isInDOM(this.preloader);\n \n if(isIn && this.progress != this.defaultProgress) {\n this.setProgress(this.defaultProgress);\n }\n \n elem.append(this.preloader);\n \n if(!isIn && this.progress != this.defaultProgress) {\n this.setProgress(this.defaultProgress);\n } */\n }\n detach() {\n if (this.preloader.parentElement) {\n this.preloader.parentElement.removeChild(this.preloader);\n }\n }\n setProgress(percents) {\n this.progress = percents;\n if (!utils_1.isInDOM(this.circle)) {\n return;\n }\n if (percents == 0) {\n this.circle.style.strokeDasharray = '';\n return;\n }\n let totalLength = this.circle.getTotalLength();\n console.log('setProgress', (percents / 100 * totalLength));\n this.circle.style.strokeDasharray = '' + Math.max(5, percents / 100 * totalLength) + ', 200';\n }\n}\nexports.default = ProgressivePreloader;\n" }, { "id": 30, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "name": "./src/components/wrappers.ts", "index": 73, "index2": 68, "size": 20125, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "issuerId": 19, "issuerName": "./src/lib/appManagers/appImManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 208, "building": 300, "dependencies": 449 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../../components/wrappers", "loc": "42:19-55" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../../components/wrappers", "loc": "19:19-55" }, { "moduleId": 46, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "module": "./src/lib/appManagers/appMediaViewer.ts", "moduleName": "./src/lib/appManagers/appMediaViewer.ts", "type": "cjs require", "userRequest": "../../components/wrappers", "loc": "13:19-55" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "./wrappers", "loc": "24:19-40" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst appPhotosManager_1 = __importDefault(require(\"../lib/appManagers/appPhotosManager\"));\nconst cryptoworker_1 = __importDefault(require(\"../lib/crypto/cryptoworker\"));\nconst lottieLoader_1 = __importDefault(require(\"../lib/lottieLoader\"));\nconst appStickersManager_1 = __importDefault(require(\"../lib/appManagers/appStickersManager\"));\nconst appDocsManager_1 = __importDefault(require(\"../lib/appManagers/appDocsManager\"));\nconst utils_1 = require(\"../lib/utils\");\nconst preloader_1 = __importDefault(require(\"./preloader\"));\nconst apiFileManager_1 = __importDefault(require(\"../lib/mtproto/apiFileManager\"));\nconst appWebpManager_1 = __importDefault(require(\"../lib/appManagers/appWebpManager\"));\nconst ckin_1 = require(\"../lib/ckin\");\nconst richtextprocessor_1 = require(\"../lib/richtextprocessor\");\nfunction wrapVideo(doc, container, message, justLoader = true, preloader, controls = true, round = false) {\n if (!container.firstElementChild || (container.firstElementChild.tagName != 'IMG' && container.firstElementChild.tagName != 'VIDEO')) {\n let size = appPhotosManager_1.default.setAttachmentSize(doc, container);\n }\n let peerID = this.peerID ? this.peerID : this.currentMessageID;\n //container.classList.add('video');\n let img = container.firstElementChild || new Image();\n img.setAttribute('message-id', '' + message.mid);\n if (!container.contains(img)) {\n container.append(img);\n }\n //return Promise.resolve();\n if (!preloader) {\n preloader = new preloader_1.default(container, true);\n }\n let loadVideo = () => {\n let promise = appDocsManager_1.default.downloadDoc(doc);\n preloader.attach(container, true, promise);\n return promise.then(blob => {\n if ((this.peerID ? this.peerID : this.currentMessageID) != peerID) {\n this.log.warn('peer changed');\n return;\n }\n ///////console.log('loaded doc:', doc, blob, container);\n let video = document.createElement('video');\n /* video.loop = controls;\n video.autoplay = controls;\n \n if(!justLoader) {\n video.controls = controls;\n } else {\n video.volume = 0;\n } */\n video.setAttribute('message-id', '' + message.mid);\n let source = document.createElement('source');\n //source.src = doc.url;\n source.src = URL.createObjectURL(blob);\n source.type = doc.mime_type;\n if (img && container.contains(img)) {\n container.removeChild(img);\n }\n video.append(source);\n container.append(video);\n if (!justLoader || round) {\n video.dataset.ckin = round ? 'circle' : 'default';\n video.dataset.overlay = '1';\n let wrapper = ckin_1.wrapPlayer(video);\n if (!round) {\n wrapper.querySelector('.toggle').click();\n }\n }\n else if (doc.type == 'gif') {\n video.autoplay = true;\n video.loop = true;\n }\n //container.style.width = '';\n //container.style.height = '';\n });\n };\n if (doc.type == 'gif' || true) { // extra fix\n return this.peerID ? this.loadMediaQueuePush(loadVideo) : loadVideo();\n }\n else { // if video\n let load = () => appPhotosManager_1.default.preloadPhoto(doc).then((blob) => {\n if ((this.peerID ? this.peerID : this.currentMessageID) != peerID) {\n this.log.warn('peer changed');\n return;\n }\n img.src = URL.createObjectURL(blob);\n /* image.style.height = doc.h + 'px';\n image.style.width = doc.w + 'px'; */\n /* if(justLoader) { // extra fix\n justLoader = false;\n controls = false;\n } */\n if (!justLoader) {\n return loadVideo();\n }\n else {\n container.style.width = '';\n container.style.height = '';\n preloader.detach();\n }\n });\n return this.peerID ? this.loadMediaQueuePush(load) : load();\n }\n}\nexports.wrapVideo = wrapVideo;\nfunction wrapDocument(doc, withTime = false, uploading = false) {\n if (doc.type == 'voice') {\n return wrapAudio(doc, withTime);\n }\n let docDiv = document.createElement('div');\n docDiv.classList.add('document');\n let iconDiv = document.createElement('div');\n iconDiv.classList.add('tgico-document');\n let extSplitted = doc.file_name ? doc.file_name.split('.') : '';\n let ext = '';\n ext = extSplitted.length > 1 && Array.isArray(extSplitted) ? extSplitted.pop().toLowerCase() : 'file';\n let ext2 = ext;\n if (doc.type == 'photo') {\n docDiv.classList.add('photo');\n ext2 = ``;\n }\n let fileName = doc.file_name || 'Unknown.file';\n let size = utils_1.formatBytes(doc.size);\n if (withTime) {\n let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n let date = new Date(doc.date * 1000);\n size += ' · ' + months[date.getMonth()] + ' ' + date.getDate() + ', ' + date.getFullYear()\n + ' at ' + date.getHours() + ':' + ('0' + date.getMinutes()).slice(-2);\n }\n docDiv.innerHTML = `\n
${ext2}
\n ${!uploading ? `
` : ''}\n
${fileName}
\n
${size}
\n `;\n if (!uploading) {\n let downloadDiv = docDiv.querySelector('.document-download');\n let preloader;\n let promise;\n docDiv.addEventListener('click', () => {\n if (!promise) {\n if (downloadDiv.classList.contains('downloading')) {\n return; // means not ready yet\n }\n if (!preloader) {\n preloader = new preloader_1.default(null, true);\n }\n appDocsManager_1.default.saveDocFile(doc.id).then(res => {\n promise = res.promise;\n preloader.attach(downloadDiv, true, promise);\n promise.then(() => {\n downloadDiv.classList.remove('downloading');\n downloadDiv.remove();\n });\n });\n downloadDiv.classList.add('downloading');\n }\n else {\n downloadDiv.classList.remove('downloading');\n promise = null;\n }\n });\n }\n return docDiv;\n}\nexports.wrapDocument = wrapDocument;\nlet lastAudioToggle = null;\nfunction wrapAudio(doc, withTime = false) {\n let div = document.createElement('div');\n div.classList.add('audio');\n let duration = doc.duration;\n // @ts-ignore\n let durationStr = String(duration | 0).toHHMMSS(true);\n div.innerHTML = `\n
\n
\n
${durationStr}
\n `;\n //////console.log('wrapping audio', doc, doc.attributes[0].waveform);\n let timeDiv = div.lastElementChild;\n let downloadDiv = div.querySelector('.audio-download');\n let preloader;\n let promise;\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n svg.classList.add('audio-waveform');\n svg.setAttributeNS(null, 'width', '250');\n svg.setAttributeNS(null, 'height', '23');\n svg.setAttributeNS(null, 'viewBox', '0 0 250 23');\n div.insertBefore(svg, div.lastElementChild);\n let wave = doc.attributes[0].waveform;\n let index = 0;\n for (let uint8 of wave) {\n let percents = uint8 / 255;\n let height = 23 * percents;\n if ( /* !height || */height < 2) {\n height = 2;\n }\n svg.insertAdjacentHTML('beforeend', `\n \n `);\n ++index;\n }\n let onClick = () => {\n if (!promise) {\n if (downloadDiv.classList.contains('downloading')) {\n return; // means not ready yet\n }\n if (!preloader) {\n preloader = new preloader_1.default(null, true);\n }\n let promise = appDocsManager_1.default.downloadDoc(doc.id);\n preloader.attach(downloadDiv, true, promise);\n promise.then(blob => {\n downloadDiv.classList.remove('downloading');\n downloadDiv.remove();\n let audio = document.createElement('audio');\n let source = document.createElement('source');\n source.src = URL.createObjectURL(blob);\n source.type = doc.mime_type;\n audio.volume = 1;\n div.removeEventListener('click', onClick);\n let toggle = div.querySelector('.audio-toggle');\n let interval = 0;\n toggle.addEventListener('click', () => {\n if (audio.paused) {\n if (lastAudioToggle && lastAudioToggle.classList.contains('tgico-largepause')) {\n lastAudioToggle.click();\n }\n audio.currentTime = 0;\n audio.play();\n lastAudioToggle = toggle;\n toggle.classList.remove('tgico-largeplay');\n toggle.classList.add('tgico-largepause');\n Array.from(svg.children).forEach(node => node.classList.remove('active'));\n let lastIndex = 0;\n interval = setInterval(() => {\n if (lastIndex >= svg.childElementCount) {\n clearInterval(interval);\n return;\n }\n // @ts-ignore\n timeDiv.innerText = String(audio.currentTime | 0).toHHMMSS(true);\n //svg.children[lastIndex].setAttributeNS(null, 'fill', '#000');\n svg.children[lastIndex].classList.add('active');\n ++lastIndex;\n //console.log('lastIndex:', lastIndex, audio.currentTime);\n }, duration * 1000 / svg.childElementCount | 0 /* 63 * duration / 10 */);\n }\n else {\n audio.pause();\n toggle.classList.add('tgico-largeplay');\n toggle.classList.remove('tgico-largepause');\n clearInterval(interval);\n }\n });\n audio.addEventListener('ended', () => {\n toggle.classList.add('tgico-largeplay');\n toggle.classList.remove('tgico-largepause');\n clearInterval(interval);\n // @ts-ignore\n timeDiv.innerText = String(audio.currentTime | 0).toHHMMSS(true);\n });\n audio.append(source);\n audio.style.display = 'none';\n div.append(audio);\n });\n downloadDiv.classList.add('downloading');\n }\n else {\n downloadDiv.classList.remove('downloading');\n promise = null;\n }\n };\n div.addEventListener('click', onClick);\n div.click();\n return div;\n}\nexports.wrapAudio = wrapAudio;\nfunction wrapPhoto(photo, message, container) {\n //container.classList.add('photo');\n let peerID = this.peerID;\n let size = appPhotosManager_1.default.setAttachmentSize(photo.id, container);\n let image = container.firstElementChild || new Image();\n //let size = appPhotosManager.setAttachmentSize(photo.id, image);\n image.setAttribute('message-id', message.mid);\n if (!container.contains(image)) {\n container.append(image);\n }\n let preloader = new preloader_1.default(container, false);\n let load = () => {\n let promise = appPhotosManager_1.default.preloadPhoto(photo.id, size);\n preloader.attach(container, true, promise);\n return promise.then((blob) => {\n if (this.peerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n image.src = URL.createObjectURL(blob);\n //image.style.width = '';\n //image.style.height = '';\n //container.style.width = '';\n //container.style.height = '';\n });\n };\n /////////console.log('wrapPhoto', load, container, image);\n return this.loadMediaQueue ? this.loadMediaQueuePush(load) : load();\n}\nexports.wrapPhoto = wrapPhoto;\nfunction wrapSticker(doc, div, middleware, lazyLoadQueue, group, canvas, play = false) {\n let stickerType = doc.mime_type == \"application/x-tgsticker\" ? 2 : (doc.mime_type == \"image/webp\" ? 1 : 0);\n if (!stickerType) {\n console.error('wrong doc for wrapSticker!', doc, div);\n }\n ///////console.log('wrap sticker', doc);\n if (doc.thumbs && !div.firstElementChild) {\n let thumb = doc.thumbs[0];\n if (thumb.bytes) {\n apiFileManager_1.default.saveSmallFile(thumb.location, thumb.bytes);\n appPhotosManager_1.default.setAttachmentPreview(thumb.bytes, div, true);\n }\n }\n let load = () => apiFileManager_1.default.downloadSmallFile({\n _: 'inputDocumentFileLocation',\n access_hash: doc.access_hash,\n file_reference: doc.file_reference,\n thumb_size: '' /* document.thumbs[0].type */,\n id: doc.id,\n stickerType: stickerType\n }, { mimeType: doc.mime_type, dcID: doc.dc_id }).then(blob => {\n //console.log('loaded sticker:', blob, div);\n if (middleware && !middleware())\n return;\n if (div.firstElementChild) {\n div.firstElementChild.remove();\n }\n if (stickerType == 2) {\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => __awaiter(this, void 0, void 0, function* () {\n // @ts-ignore\n const text = e.srcElement.result;\n let json = yield cryptoworker_1.default.gzipUncompress(text, true);\n let animation = yield lottieLoader_1.default.loadAnimation({\n container: div,\n loop: false,\n autoplay: false,\n animationData: JSON.parse(json),\n renderer: canvas ? 'canvas' : 'svg'\n }, group);\n if (!canvas) {\n div.addEventListener('mouseover', (e) => {\n let animation = lottieLoader_1.default.getAnimation(div, group);\n if (animation) {\n //console.log('sticker hover', animation, div);\n // @ts-ignore\n animation.loop = true;\n // @ts-ignore\n if (animation.currentFrame == animation.totalFrames - 1) {\n animation.goToAndPlay(0, true);\n }\n else {\n animation.play();\n }\n div.addEventListener('mouseout', () => {\n // @ts-ignore\n animation.loop = false;\n }, { once: true });\n }\n });\n } /* else {\n let canvas = div.firstElementChild as HTMLCanvasElement;\n if(!canvas.width && !canvas.height) {\n console.log('Need lottie resize');\n \n // @ts-ignore\n animation.resize();\n }\n } */\n if (play) {\n animation.play();\n }\n }));\n reader.readAsArrayBuffer(blob);\n }\n else if (stickerType == 1) {\n let img = new Image();\n appWebpManager_1.default.polyfillImage(img, blob);\n //img.src = URL.createObjectURL(blob);\n /* div.style.height = doc.h + 'px';\n div.style.width = doc.w + 'px'; */\n div.append(img);\n }\n div.setAttribute('file-id', doc.id);\n appStickersManager_1.default.saveSticker(doc);\n });\n return lazyLoadQueue ? (lazyLoadQueue.push({ div, load }), Promise.resolve()) : load();\n}\nexports.wrapSticker = wrapSticker;\nfunction wrapReply(title, subtitle, media) {\n let div = document.createElement('div');\n div.classList.add('reply');\n let replyBorder = document.createElement('div');\n replyBorder.classList.add('reply-border');\n let replyContent = document.createElement('div');\n replyContent.classList.add('reply-content');\n let replyTitle = document.createElement('div');\n replyTitle.classList.add('reply-title');\n let replySubtitle = document.createElement('div');\n replySubtitle.classList.add('reply-subtitle');\n replyTitle.innerHTML = title ? richtextprocessor_1.RichTextProcessor.wrapEmojiText(title) : '';\n if (media) {\n if (media.photo) {\n replySubtitle.innerHTML = 'Photo';\n }\n else if (media.document && media.document.type) {\n replySubtitle.innerHTML = media.document.type;\n }\n else if (media.webpage) {\n replySubtitle.innerHTML = richtextprocessor_1.RichTextProcessor.wrapPlainText(media.webpage.url);\n }\n else {\n replySubtitle.innerHTML = media._;\n }\n if (media.photo || (media.document && ['video'].indexOf(media.document.type) !== -1)) {\n let replyMedia = document.createElement('div');\n replyMedia.classList.add('reply-media');\n let photo = media.photo || media.document;\n let sizes = photo.sizes || photo.thumbs;\n if (sizes && sizes[0].bytes) {\n appPhotosManager_1.default.setAttachmentPreview(sizes[0].bytes, replyMedia, false, true);\n }\n appPhotosManager_1.default.preloadPhoto(photo, appPhotosManager_1.default.choosePhotoSize(photo, 32, 32))\n .then((blob) => {\n replyMedia.style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';\n });\n replyContent.append(replyMedia);\n div.classList.add('is-reply-media');\n }\n }\n else {\n replySubtitle.innerHTML = subtitle ? richtextprocessor_1.RichTextProcessor.wrapEmojiText(subtitle) : '';\n }\n replyContent.append(replyTitle, replySubtitle);\n div.append(replyBorder, replyContent);\n /////////console.log('wrapReply', title, subtitle, media);\n return div;\n}\nexports.wrapReply = wrapReply;\n" }, { "id": 34, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/http.ts", "name": "./src/lib/mtproto/transports/http.ts", "index": 40, "index2": 32, "size": 1177, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "./transports/http", "loc": "30:31-59" }, { "moduleId": 22, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "module": "./src/lib/mtproto/dcConfigurator.ts", "moduleName": "./src/lib/mtproto/dcConfigurator.ts", "type": "cjs require", "userRequest": "./transports/http", "loc": "7:31-59" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "./transports/http", "loc": "32:31-59" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst transport_1 = __importDefault(require(\"./transport\"));\nconst bin_utils_1 = require(\"../../bin_utils\");\nclass HTTP extends transport_1.default {\n constructor(dcID, url) {\n super(dcID, url);\n this.send = (data) => {\n return fetch(this.url, { method: 'POST', body: data }).then(response => {\n //console.log('http response', response/* , response.arrayBuffer() */);\n if (response.status != 200) {\n response.arrayBuffer().then(buffer => {\n console.log('not 200', new TextDecoder(\"utf-8\").decode(new Uint8Array(bin_utils_1.bytesFromArrayBuffer(buffer))));\n });\n throw response;\n }\n return response.arrayBuffer().then(buffer => {\n return new Uint8Array(bin_utils_1.bytesFromArrayBuffer(buffer));\n });\n });\n };\n }\n}\nexports.default = HTTP;\n" }, { "id": 35, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/tl_utils.ts", "name": "./src/lib/tl_utils.ts", "index": 42, "index2": 34, "size": 24266, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "issuerId": 44, "issuerName": "./src/lib/mtproto/authorizer.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 44, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "name": "./src/lib/mtproto/authorizer.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 775, "building": 644, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 43, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/rsaKeysManager.ts", "module": "./src/lib/mtproto/rsaKeysManager.ts", "moduleName": "./src/lib/mtproto/rsaKeysManager.ts", "type": "cjs require", "userRequest": "../tl_utils", "loc": "15:19-41" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "../tl_utils", "loc": "15:19-41" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "../tl_utils", "loc": "25:19-41" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\n/*!\n * Webogram v0.7.0 - messaging web application for MTProto\n * https://github.com/zhukov/webogram\n * Copyright (C) 2014 Igor Zhukov \n * https://github.com/zhukov/webogram/blob/master/LICENSE\n */\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"./bin_utils\");\nconst utils_1 = require(\"./utils\");\nconst Config = __importStar(require(\"./config\"));\nclass TLSerialization {\n constructor(options = {}) {\n this.maxLength = 2048; // 2Kb\n this.offset = 0; // in bytes\n this.mtproto = false;\n this.debug = false; //Config.Modes.debug;\n this.maxLength = options.startMaxLength || 2048; // 2Kb\n this.mtproto = options.mtproto || false;\n this.createBuffer();\n }\n createBuffer() {\n this.buffer = new ArrayBuffer(this.maxLength);\n this.intView = new Int32Array(this.buffer);\n this.byteView = new Uint8Array(this.buffer);\n }\n getArray() {\n let resultBuffer = new ArrayBuffer(this.offset);\n let resultArray = new Int32Array(resultBuffer);\n resultArray.set(this.intView.subarray(0, this.offset / 4));\n return resultArray;\n }\n getBuffer() {\n return this.getArray().buffer;\n }\n getBytes(typed) {\n if (typed) {\n let resultBuffer = new ArrayBuffer(this.offset);\n let resultArray = new Uint8Array(resultBuffer);\n resultArray.set(this.byteView.subarray(0, this.offset));\n return resultArray;\n }\n let bytes = [];\n for (var i = 0; i < this.offset; i++) {\n bytes.push(this.byteView[i]);\n }\n return bytes;\n }\n checkLength(needBytes) {\n if (this.offset + needBytes < this.maxLength) {\n return;\n }\n ///console.trace('Increase buffer', this.offset, needBytes, this.maxLength);\n this.maxLength = Math.ceil(Math.max(this.maxLength * 2, this.offset + needBytes + 16) / 4) * 4;\n var previousBuffer = this.buffer;\n var previousArray = new Int32Array(previousBuffer);\n this.createBuffer();\n new Int32Array(this.buffer).set(previousArray);\n }\n writeInt(i, field) {\n this.debug && console.log('>>>', i.toString(16), i, field);\n this.checkLength(4);\n this.intView[this.offset / 4] = i;\n this.offset += 4;\n }\n storeInt(i, field) {\n this.writeInt(i, (field || '') + ':int');\n }\n storeBool(i, field) {\n if (i) {\n this.writeInt(0x997275b5, (field || '') + ':bool');\n }\n else {\n this.writeInt(0xbc799737, (field || '') + ':bool');\n }\n }\n storeLongP(iHigh, iLow, field) {\n this.writeInt(iLow, (field || '') + ':long[low]');\n this.writeInt(iHigh, (field || '') + ':long[high]');\n }\n storeLong(sLong, field) {\n if (Array.isArray(sLong)) {\n if (sLong.length == 2) {\n return this.storeLongP(sLong[0], sLong[1], field);\n }\n else {\n return this.storeIntBytes(sLong, 64, field);\n }\n }\n if (typeof sLong != 'string') {\n sLong = sLong ? sLong.toString() : '0';\n }\n var divRem = bin_utils_1.bigStringInt(sLong).divideAndRemainder(bin_utils_1.bigint(0x100000000));\n this.writeInt(bin_utils_1.intToUint(divRem[1].intValue()), (field || '') + ':long[low]');\n this.writeInt(bin_utils_1.intToUint(divRem[0].intValue()), (field || '') + ':long[high]');\n }\n storeDouble(f, field) {\n var buffer = new ArrayBuffer(8);\n var intView = new Int32Array(buffer);\n var doubleView = new Float64Array(buffer);\n doubleView[0] = f;\n this.writeInt(intView[0], (field || '') + ':double[low]');\n this.writeInt(intView[1], (field || '') + ':double[high]');\n }\n storeString(s, field) {\n this.debug && console.log('>>>', s, (field || '') + ':string');\n if (s === undefined) {\n s = '';\n }\n var sUTF8 = unescape(encodeURIComponent(s));\n this.checkLength(sUTF8.length + 8);\n var len = sUTF8.length;\n if (len <= 253) {\n this.byteView[this.offset++] = len;\n }\n else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n for (var i = 0; i < len; i++) {\n this.byteView[this.offset++] = sUTF8.charCodeAt(i);\n }\n // Padding\n while (this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n storeBytes(bytes, field) {\n if (bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n else if (bytes === undefined) {\n bytes = [];\n }\n this.debug && console.log('>>>', bin_utils_1.bytesToHex(bytes), (field || '') + ':bytes');\n // if uint8array were json.stringified, then will be: {'0': 123, '1': 123}\n var len = bytes.byteLength || bytes.length;\n this.checkLength(len + 8);\n if (len <= 253) {\n this.byteView[this.offset++] = len;\n }\n else {\n this.byteView[this.offset++] = 254;\n this.byteView[this.offset++] = len & 0xFF;\n this.byteView[this.offset++] = (len & 0xFF00) >> 8;\n this.byteView[this.offset++] = (len & 0xFF0000) >> 16;\n }\n this.byteView.set(bytes, this.offset);\n this.offset += len;\n // Padding\n while (this.offset % 4) {\n this.byteView[this.offset++] = 0;\n }\n }\n storeIntBytes(bytes, bits, field) {\n if (bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n var len = bytes.length;\n if ((bits % 32) || (len * 8) != bits) {\n throw new Error('Invalid bits: ' + bits + ', ' + bytes.length);\n }\n this.debug && console.log('>>>', bin_utils_1.bytesToHex(bytes), (field || '') + ':int' + bits);\n this.checkLength(len);\n this.byteView.set(bytes, this.offset);\n this.offset += len;\n }\n storeRawBytes(bytes, field) {\n if (bytes instanceof ArrayBuffer) {\n bytes = new Uint8Array(bytes);\n }\n var len = bytes.length;\n this.debug && console.log('>>>', bin_utils_1.bytesToHex(bytes), (field || ''));\n this.checkLength(len);\n this.byteView.set(bytes, this.offset);\n this.offset += len;\n }\n storeMethod(methodName, params) {\n var schema = this.mtproto ? Config.Schema.MTProto : Config.Schema.API;\n var methodData = false, i;\n for (i = 0; i < schema.methods.length; i++) {\n if (schema.methods[i].method == methodName) {\n methodData = schema.methods[i];\n break;\n }\n }\n if (!methodData) {\n throw new Error('No method ' + methodName + ' found');\n }\n this.storeInt(bin_utils_1.intToUint(methodData.id), methodName + '[id]');\n var param, type;\n var i, condType;\n var fieldBit;\n var len = methodData.params.length;\n //console.log('storeMethod', len, methodData);\n for (i = 0; i < len; i++) {\n param = methodData.params[i];\n type = param.type;\n if (type.indexOf('?') !== -1) {\n condType = type.split('?');\n fieldBit = condType[0].split('.');\n if (!(params[fieldBit[0]] & (1 << fieldBit[1]))) {\n continue;\n }\n type = condType[1];\n }\n this.storeObject(params[param.name], type, methodName + '[' + param.name + ']');\n }\n return methodData.type;\n }\n storeObject(obj, type, field) {\n //console.log('storeObject', obj, type, field, this.offset, this.getBytes(true).hex);\n switch (type) {\n case '#':\n case 'int':\n return this.storeInt(obj, field);\n case 'long':\n return this.storeLong(obj, field);\n case 'int128':\n return this.storeIntBytes(obj, 128, field);\n case 'int256':\n return this.storeIntBytes(obj, 256, field);\n case 'int512':\n return this.storeIntBytes(obj, 512, field);\n case 'string':\n return this.storeString(obj, field);\n case 'bytes':\n return this.storeBytes(obj, field);\n case 'double':\n return this.storeDouble(obj, field);\n case 'Bool':\n return this.storeBool(obj, field);\n case 'true':\n return;\n }\n if (Array.isArray(obj)) {\n if (type.substr(0, 6) == 'Vector') {\n this.writeInt(0x1cb5c415, field + '[id]');\n }\n else if (type.substr(0, 6) != 'vector') {\n throw new Error('Invalid vector type ' + type);\n }\n var itemType = type.substr(7, type.length - 8); // for \"Vector\"\n this.writeInt(obj.length, field + '[count]');\n for (var i = 0; i < obj.length; i++) {\n this.storeObject(obj[i], itemType, field + '[' + i + ']');\n }\n return true;\n }\n else if (type.substr(0, 6).toLowerCase() == 'vector') {\n throw new Error('Invalid vector object');\n }\n if (!utils_1.isObject(obj)) {\n throw new Error('Invalid object for type ' + type);\n }\n var schema = this.mtproto ? Config.Schema.MTProto : Config.Schema.API;\n var predicate = obj['_'];\n var isBare = false;\n var constructorData = false;\n if (isBare = (type.charAt(0) == '%')) {\n type = type.substr(1);\n }\n for (i = 0; i < schema.constructors.length; i++) {\n if (schema.constructors[i].predicate == predicate) {\n constructorData = schema.constructors[i];\n break;\n }\n }\n if (!constructorData) {\n throw new Error('No predicate ' + predicate + ' found');\n }\n if (predicate == type) {\n isBare = true;\n }\n if (!isBare) {\n this.writeInt(bin_utils_1.intToUint(constructorData.id), field + '[' + predicate + '][id]');\n }\n var param, type;\n var condType;\n var fieldBit;\n var len = constructorData.params.length;\n //console.log('storeObject', len, constructorData);\n for (i = 0; i < len; i++) {\n param = constructorData.params[i];\n type = param.type;\n //console.log('storeObject', param, type);\n if (type.indexOf('?') !== -1) {\n condType = type.split('?');\n fieldBit = condType[0].split('.');\n //console.log('storeObject fieldBit', fieldBit, obj[fieldBit[0]]);\n if (!(obj[fieldBit[0]] & (1 << +fieldBit[1]))) {\n continue;\n }\n type = condType[1];\n }\n //console.log('storeObject', param, type);\n this.storeObject(obj[param.name], type, field + '[' + predicate + '][' + param.name + ']');\n }\n return constructorData.type;\n }\n}\nexports.TLSerialization = TLSerialization;\nclass TLDeserialization {\n constructor(buffer, options = {}) {\n this.offset = 0; // in bytes\n // this.debug = \n this.mtproto = false;\n //buffer = addPadding(buffer, 4, true); // fix 21.01.2020 for wss\n //console.log(\"TCL: TLDeserialization -> constructor -> buffer\", buffer, buffer instanceof ArrayBuffer);\n if (buffer instanceof ArrayBuffer) {\n this.buffer = buffer;\n this.byteView = new Uint8Array(this.buffer);\n }\n else {\n this.buffer = buffer.buffer;\n this.byteView = buffer;\n }\n /* this.buffer = buffer;\n //this.intView = new Uint32Array(this.buffer);\n this.byteView = new Uint8Array(this.buffer); */\n //console.log(this.intView);\n this.override = 'override' in options ? options.override : {};\n this.mtproto = 'mtproto' in options ? options.mtproto : false;\n this.debug = options.debug !== undefined ? options.debug : /* Config.Modes.debug */ false;\n }\n readInt(field) {\n //if(this.offset >= this.intView.length * 4) {\n if ((this.byteView.length - this.offset) < 4) {\n console.error(this.byteView, this.offset);\n throw new Error('Nothing to fetch: ' + field);\n }\n //var i = this.intView[this.offset / 4];\n let i = new Uint32Array(this.byteView.buffer.slice(this.offset, this.offset + 4))[0];\n this.debug /* || field.includes('[dialog][read_outbox_max_id]') */\n && console.log('<<<', i.toString(16), i, field, this.byteView.slice(this.offset - 16, this.offset + 16), this.byteView.slice(this.offset - 16, this.offset + 16).hex);\n this.offset += 4;\n return i;\n }\n fetchInt(field) {\n return this.readInt((field || '') + ':int');\n }\n fetchDouble(field) {\n var buffer = new ArrayBuffer(8);\n var intView = new Int32Array(buffer);\n var doubleView = new Float64Array(buffer);\n intView[0] = this.readInt((field || '') + ':double[low]'),\n intView[1] = this.readInt((field || '') + ':double[high]');\n return doubleView[0];\n }\n fetchLong(field) {\n var iLow = this.readInt((field || '') + ':long[low]');\n var iHigh = this.readInt((field || '') + ':long[high]');\n var longDec = bin_utils_1.bigint(iHigh).shiftLeft(32).add(bin_utils_1.bigint(iLow)).toString();\n return longDec;\n }\n fetchBool(field) {\n var i = this.readInt((field || '') + ':bool');\n if (i == 0x997275b5) {\n return true;\n }\n else if (i == 0xbc799737) {\n return false;\n }\n this.offset -= 4;\n return this.fetchObject('Object', field);\n }\n fetchString(field) {\n var len = this.byteView[this.offset++];\n if (len == 254) {\n var len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n var sUTF8 = '';\n for (var i = 0; i < len; i++) {\n sUTF8 += String.fromCharCode(this.byteView[this.offset++]);\n }\n // Padding\n while (this.offset % 4) {\n this.offset++;\n }\n try {\n var s = decodeURIComponent(escape(sUTF8));\n }\n catch (e) {\n var s = sUTF8;\n }\n this.debug && console.log('<<<', s, (field || '') + ':string');\n return s;\n }\n fetchBytes(field) {\n var len = this.byteView[this.offset++];\n if (len == 254) {\n len = this.byteView[this.offset++] |\n (this.byteView[this.offset++] << 8) |\n (this.byteView[this.offset++] << 16);\n }\n var bytes = this.byteView.subarray(this.offset, this.offset + len);\n this.offset += len;\n // Padding\n while (this.offset % 4) {\n this.offset++;\n }\n this.debug && console.log('<<<', bin_utils_1.bytesToHex(bytes), (field || '') + ':bytes');\n return bytes;\n }\n fetchIntBytes(bits, typed, field) {\n if (bits % 32) {\n throw new Error('Invalid bits: ' + bits);\n }\n var len = bits / 8;\n if (typed) {\n var result = this.byteView.subarray(this.offset, this.offset + len);\n this.offset += len;\n return result;\n }\n var bytes = [];\n for (var i = 0; i < len; i++) {\n bytes.push(this.byteView[this.offset++]);\n }\n this.debug && console.log('<<<', bin_utils_1.bytesToHex(bytes), (field || '') + ':int' + bits);\n return bytes;\n }\n fetchRawBytes(len, typed, field) {\n if (len === false) {\n len = this.readInt((field || '') + '_length');\n if (len > this.byteView.byteLength) {\n throw new Error('Invalid raw bytes length: ' + len + ', buffer len: ' + this.byteView.byteLength);\n }\n }\n if (typed) {\n let bytes = new Uint8Array(len);\n bytes.set(this.byteView.subarray(this.offset, this.offset + len));\n this.offset += len;\n return bytes;\n }\n var bytes = [];\n for (var i = 0; i < len; i++) {\n bytes.push(this.byteView[this.offset++]);\n }\n this.debug && console.log('<<<', bin_utils_1.bytesToHex(bytes), (field || ''));\n return bytes;\n }\n fetchObject(type, field) {\n switch (type) {\n case '#':\n case 'int':\n return this.fetchInt(field);\n case 'long':\n return this.fetchLong(field);\n case 'int128':\n return this.fetchIntBytes(128, false, field);\n case 'int256':\n return this.fetchIntBytes(256, false, field);\n case 'int512':\n return this.fetchIntBytes(512, false, field);\n case 'string':\n return this.fetchString(field);\n case 'bytes':\n return this.fetchBytes(field);\n case 'double':\n return this.fetchDouble(field);\n case 'Bool':\n return this.fetchBool(field);\n case 'true':\n return true;\n }\n field = field || type || 'Object';\n if (type.substr(0, 6) == 'Vector' || type.substr(0, 6) == 'vector') {\n if (type.charAt(0) == 'V') {\n var constructor = this.readInt(field + '[id]');\n var constructorCmp = bin_utils_1.uintToInt(constructor);\n if (constructorCmp == 0x3072cfa1) { // Gzip packed\n var compressed = this.fetchBytes(field + '[packed_string]');\n var uncompressed = bin_utils_1.gzipUncompress(compressed);\n var newDeserializer = new TLDeserialization(uncompressed);\n return newDeserializer.fetchObject(type, field);\n }\n if (constructorCmp != 0x1cb5c415) {\n throw new Error('Invalid vector constructor ' + constructor);\n }\n }\n var len = this.readInt(field + '[count]');\n var result = [];\n if (len > 0) {\n var itemType = type.substr(7, type.length - 8); // for \"Vector\"\n for (var i = 0; i < len; i++) {\n result.push(this.fetchObject(itemType, field + '[' + i + ']'));\n }\n }\n return result;\n }\n var schema = (this.mtproto ? Config.Schema.MTProto : Config.Schema.API);\n var predicate = false;\n var constructorData = false;\n if (type.charAt(0) == '%') {\n var checkType = type.substr(1);\n for (var i = 0; i < schema.constructors.length; i++) {\n if (schema.constructors[i].type == checkType) {\n constructorData = schema.constructors[i];\n break;\n }\n }\n if (!constructorData) {\n throw new Error('Constructor not found for type: ' + type);\n }\n }\n else if (type.charAt(0) >= 97 && type.charAt(0) <= 122) {\n for (var i = 0; i < schema.constructors.length; i++) {\n if (schema.constructors[i].predicate == type) {\n constructorData = schema.constructors[i];\n break;\n }\n }\n if (!constructorData) {\n throw new Error('Constructor not found for predicate: ' + type);\n }\n }\n else {\n var constructor = this.readInt(field + '[id]');\n var constructorCmp = bin_utils_1.uintToInt(constructor);\n if (constructorCmp == 0x3072cfa1) { // Gzip packed\n var compressed = this.fetchBytes(field + '[packed_string]');\n var uncompressed = bin_utils_1.gzipUncompress(compressed);\n var newDeserializer = new TLDeserialization(uncompressed);\n return newDeserializer.fetchObject(type, field);\n }\n var index = schema.constructorsIndex;\n if (!index) {\n schema.constructorsIndex = index = {};\n for (var i = 0; i < schema.constructors.length; i++) {\n index[schema.constructors[i].id] = i;\n }\n }\n var i = index[constructorCmp];\n if (i) {\n constructorData = schema.constructors[i];\n }\n var fallback = false;\n if (!constructorData && this.mtproto) {\n var schemaFallback = Config.Schema.API;\n for (i = 0; i < schemaFallback.constructors.length; i++) {\n if (+schemaFallback.constructors[i].id == constructorCmp) {\n constructorData = schemaFallback.constructors[i];\n delete this.mtproto;\n fallback = true;\n break;\n }\n }\n }\n if (!constructorData) {\n throw new Error('Constructor not found: ' + constructor + ' ' + this.fetchInt() + ' ' + this.fetchInt());\n }\n }\n predicate = constructorData.predicate;\n var result = { '_': predicate };\n var overrideKey = (this.mtproto ? 'mt_' : '') + predicate;\n var self = this;\n if (this.override[overrideKey]) {\n this.override[overrideKey].apply(this, [result, field + '[' + predicate + ']']);\n }\n else {\n var i, param;\n var type, isCond;\n var condType, fieldBit;\n var value;\n var len = constructorData.params.length;\n for (i = 0; i < len; i++) {\n param = constructorData.params[i];\n type = param.type;\n if (type == '#' && result.pFlags === undefined) {\n result.pFlags = {};\n }\n if (isCond = (type.indexOf('?') !== -1)) {\n condType = type.split('?');\n fieldBit = condType[0].split('.');\n if (!(result[fieldBit[0]] & (1 << fieldBit[1]))) {\n //console.log('fetchObject bad', constructorData, result[fieldBit[0]], fieldBit);\n continue;\n }\n //console.log('fetchObject good', constructorData, result[fieldBit[0]], fieldBit);\n type = condType[1];\n }\n value = self.fetchObject(type, field + '[' + predicate + '][' + param.name + ']');\n if (isCond && type === 'true') {\n result.pFlags[param.name] = value;\n }\n else {\n /* if(param.name == 'read_outbox_max_id') {\n console.log(result, param.name, value, field + '[' + predicate + '][' + param.name + ']');\n } */\n result[param.name] = value;\n }\n }\n }\n if (fallback) {\n this.mtproto = true;\n }\n return result;\n }\n getOffset() {\n return this.offset;\n }\n fetchEnd() {\n if (this.offset != this.byteView.length) {\n throw new Error('Fetch end with non-empty buffer');\n }\n return true;\n }\n}\nexports.TLDeserialization = TLDeserialization;\n" }, { "id": 36, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/timeManager.ts", "name": "./src/lib/mtproto/timeManager.ts", "index": 43, "index2": 36, "size": 1884, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "issuerId": 16, "issuerName": "./src/lib/mtproto/mtproto.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 16, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "name": "./src/lib/mtproto/mtproto.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 820, "building": 593, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./timeManager", "loc": "19:38-62" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "./timeManager", "loc": "20:38-62" }, { "moduleId": 68, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "module": "./src/lib/mtproto/networker.ts", "moduleName": "./src/lib/mtproto/networker.ts", "type": "cjs require", "userRequest": "./timeManager", "loc": "29:38-62" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst utils_1 = require(\"../utils\");\nconst bin_utils_1 = require(\"../bin_utils\");\nclass TimeManager {\n constructor() {\n this.lastMessageID = [0, 0];\n this.timeOffset = 0;\n storage_1.default.get('server_time_offset').then((to) => {\n if (to) {\n this.timeOffset = to;\n }\n });\n }\n generateID() {\n var timeTicks = utils_1.tsNow(), timeSec = Math.floor(timeTicks / 1000) + this.timeOffset, timeMSec = timeTicks % 1000, random = bin_utils_1.nextRandomInt(0xFFFF);\n var messageID = [timeSec, (timeMSec << 21) | (random << 3) | 4];\n if (this.lastMessageID[0] > messageID[0] ||\n this.lastMessageID[0] == messageID[0] && this.lastMessageID[1] >= messageID[1]) {\n messageID = [this.lastMessageID[0], this.lastMessageID[1] + 4];\n }\n this.lastMessageID = messageID;\n // console.log('generated msg id', messageID, timeOffset)\n return bin_utils_1.longFromInts(messageID[0], messageID[1]);\n }\n applyServerTime(serverTime, localTime) {\n var newTimeOffset = serverTime - Math.floor((localTime || utils_1.tsNow()) / 1000);\n var changed = Math.abs(this.timeOffset - newTimeOffset) > 10;\n storage_1.default.set({\n server_time_offset: newTimeOffset\n });\n this.lastMessageID = [0, 0];\n this.timeOffset = newTimeOffset;\n console.log(bin_utils_1.dT(), 'Apply server time', serverTime, localTime, newTimeOffset, changed);\n return changed;\n }\n}\nexports.TimeManager = TimeManager;\nexports.default = new TimeManager();\n" }, { "id": 37, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appProfileManager.ts", "name": "./src/lib/appManagers/appProfileManager.ts", "index": 68, "index2": 60, "size": 17583, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appProfileManager", "loc": "27:44-74" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appProfileManager", "loc": "13:44-74" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appProfileManager", "loc": "14:44-86" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst appMessagesIDsManager_1 = __importDefault(require(\"./appMessagesIDsManager\"));\nconst appChatsManager_1 = __importDefault(require(\"./appChatsManager\"));\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst apiUpdatesManager_1 = __importDefault(require(\"./apiUpdatesManager\"));\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nclass AppProfileManager {\n constructor() {\n this.botInfos = {};\n this.usersFull = {};\n this.chatsFull = {};\n this.chatFullPromises = {};\n this.chatParticipantsPromises = {};\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n let update = e.detail;\n // console.log('on apiUpdate', update)\n switch (update._) {\n case 'updateChatParticipants':\n var participants = update.participants;\n var chatFull = this.chatsFull[participants.id];\n if (chatFull !== undefined) {\n chatFull.participants = update.participants;\n utils_1.$rootScope.$broadcast('chat_full_update', update.chat_id);\n }\n break;\n case 'updateChatParticipantAdd':\n var chatFull = this.chatsFull[update.chat_id];\n if (chatFull !== undefined) {\n var participants = chatFull.participants.participants || [];\n for (var i = 0, length = participants.length; i < length; i++) {\n if (participants[i].user_id == update.user_id) {\n return;\n }\n }\n participants.push({\n _: 'chatParticipant',\n user_id: update.user_id,\n inviter_id: update.inviter_id,\n date: utils_1.tsNow(true)\n });\n chatFull.participants.version = update.version;\n utils_1.$rootScope.$broadcast('chat_full_update', update.chat_id);\n }\n break;\n case 'updateChatParticipantDelete':\n var chatFull = this.chatsFull[update.chat_id];\n if (chatFull !== undefined) {\n var participants = chatFull.participants.participants || [];\n for (var i = 0, length = participants.length; i < length; i++) {\n if (participants[i].user_id == update.user_id) {\n participants.splice(i, 1);\n chatFull.participants.version = update.version;\n utils_1.$rootScope.$broadcast('chat_full_update', update.chat_id);\n return;\n }\n }\n }\n break;\n case 'updateChannelPinnedMessage':\n var channelID = update.channel_id;\n var fullChannel = this.chatsFull[channelID];\n if (fullChannel !== undefined) {\n fullChannel.pinned_msg_id = appMessagesIDsManager_1.default.getFullMessageID(update.id, channelID);\n utils_1.$rootScope.$broadcast('peer_pinned_message', -channelID);\n }\n break;\n }\n });\n utils_1.$rootScope.$on('chat_update', (e) => {\n let chatID = e.detail;\n var fullChat = this.chatsFull[chatID];\n var chat = appChatsManager_1.default.getChat(chatID);\n if (!chat.photo || !fullChat) {\n return;\n }\n var emptyPhoto = chat.photo._ == 'chatPhotoEmpty';\n //////console.log('chat_update:', fullChat);\n if (fullChat.chat_photo && emptyPhoto != (fullChat.chat_photo._ == 'photoEmpty')) {\n delete this.chatsFull[chatID];\n utils_1.$rootScope.$broadcast('chat_full_update', chatID);\n return;\n }\n if (emptyPhoto) {\n return;\n }\n var smallUserpic = chat.photo.photo_small;\n var smallPhotoSize = appPhotosManager_1.default.choosePhotoSize(fullChat.chat_photo, 0, 0);\n if (JSON.stringify(smallUserpic) !== JSON.stringify(smallPhotoSize.location)) {\n delete this.chatsFull[chatID];\n utils_1.$rootScope.$broadcast('chat_full_update', chatID);\n }\n });\n }\n saveBotInfo(botInfo) {\n var botID = botInfo && botInfo.user_id;\n if (!botID) {\n return false;\n }\n var commands = {};\n botInfo.commands.forEach((botCommand) => {\n commands[botCommand.command] = botCommand.description;\n });\n return this.botInfos[botID] = {\n id: botID,\n version: botInfo.version,\n shareText: botInfo.share_text,\n description: botInfo.description,\n commands: commands\n };\n }\n getProfile(id, override) {\n if (this.usersFull[id]) {\n return Promise.resolve(this.usersFull[id]);\n }\n return apiManager_1.default.invokeApi('users.getFullUser', {\n id: appUsersManager_1.default.getUserInput(id)\n }).then((userFull) => {\n if (override && override.phone_number) {\n userFull.user.phone = override.phone_number;\n if (override.first_name || override.last_name) {\n userFull.user.first_name = override.first_name;\n userFull.user.last_name = override.last_name;\n }\n appUsersManager_1.default.saveApiUser(userFull.user);\n }\n else {\n appUsersManager_1.default.saveApiUser(userFull.user, true);\n }\n if (userFull.profile_photo) {\n appPhotosManager_1.default.savePhoto(userFull.profile_photo, {\n user_id: id\n });\n }\n if (userFull.about !== undefined) {\n userFull.rAbout = richtextprocessor_1.RichTextProcessor.wrapRichText(userFull.about, { noLinebreaks: true });\n }\n // NotificationsManager.savePeerSettings(id, userFull.notify_settings); // warning\n if (userFull.bot_info) {\n userFull.bot_info = this.saveBotInfo(userFull.bot_info);\n }\n return this.usersFull[id] = userFull;\n });\n }\n getPeerBots(peerID) {\n var peerBots = [];\n if (peerID >= 0 && !appUsersManager_1.default.isBot(peerID) ||\n (appPeersManager_1.default.isChannel(peerID) && !appPeersManager_1.default.isMegagroup(peerID))) {\n return Promise.resolve(peerBots);\n }\n if (peerID >= 0) {\n return this.getProfile(peerID).then((userFull) => {\n var botInfo = userFull.bot_info;\n if (botInfo && botInfo._ != 'botInfoEmpty') {\n peerBots.push(botInfo);\n }\n return peerBots;\n });\n }\n return this.getChatFull(-peerID).then((chatFull) => {\n chatFull.bot_info.forEach((botInfo) => {\n peerBots.push(this.saveBotInfo(botInfo));\n });\n return peerBots;\n });\n }\n getChatFull(id) {\n if (appChatsManager_1.default.isChannel(id)) {\n return this.getChannelFull(id);\n }\n if (this.chatsFull[id] !== undefined) {\n var chat = appChatsManager_1.default.getChat(id);\n if (chat.version == this.chatsFull[id].participants.version ||\n chat.pFlags.left) {\n return Promise.resolve(this.chatsFull[id]);\n }\n }\n if (this.chatFullPromises[id] !== undefined) {\n return this.chatFullPromises[id];\n }\n // console.trace(dT(), 'Get chat full', id, appChatsManager.getChat(id))\n return this.chatFullPromises[id] = apiManager_1.default.invokeApi('messages.getFullChat', {\n chat_id: appChatsManager_1.default.getChatInput(id)\n }).then((result) => {\n appChatsManager_1.default.saveApiChats(result.chats);\n appUsersManager_1.default.saveApiUsers(result.users);\n var fullChat = result.full_chat;\n if (fullChat && fullChat.chat_photo && fullChat.chat_photo.id) {\n appPhotosManager_1.default.savePhoto(fullChat.chat_photo);\n }\n /* NotificationsManager.savePeerSettings(-id, fullChat.notify_settings); */ // warning\n delete this.chatFullPromises[id];\n this.chatsFull[id] = fullChat;\n utils_1.$rootScope.$broadcast('chat_full_update', id);\n return fullChat;\n });\n }\n getChatInviteLink(id, force) {\n return this.getChatFull(id).then((chatFull) => {\n if (!force &&\n chatFull.exported_invite &&\n chatFull.exported_invite._ == 'chatInviteExported') {\n return chatFull.exported_invite.link;\n }\n var promise;\n if (appChatsManager_1.default.isChannel(id)) {\n promise = apiManager_1.default.invokeApi('channels.exportInvite', {\n channel: appChatsManager_1.default.getChannelInput(id)\n });\n }\n else {\n promise = apiManager_1.default.invokeApi('messages.exportChatInvite', {\n chat_id: appChatsManager_1.default.getChatInput(id)\n });\n }\n return promise.then((exportedInvite) => {\n if (this.chatsFull[id] !== undefined) {\n this.chatsFull[id].exported_invite = exportedInvite;\n }\n return exportedInvite.link;\n });\n });\n }\n getChannelParticipants(id, filter, limit, offset) {\n filter = filter || { _: 'channelParticipantsRecent' };\n limit = limit || 200;\n offset = offset || 0;\n var promiseKey = [id, filter._, offset, limit].join('_');\n var promiseData = this.chatParticipantsPromises[promiseKey];\n if (filter._ == 'channelParticipantsRecent') {\n var chat = appChatsManager_1.default.getChat(id);\n if (chat &&\n chat.pFlags && (chat.pFlags.kicked ||\n chat.pFlags.broadcast && !chat.pFlags.creator && !chat.admin_rights)) {\n return Promise.reject();\n }\n }\n var fetchParticipants = (cachedParticipants) => {\n var hash = 0;\n if (cachedParticipants) {\n var userIDs = [];\n cachedParticipants.forEach((participant) => {\n userIDs.push(participant.user_id);\n });\n userIDs.sort();\n userIDs.forEach((userID) => {\n hash = ((hash * 20261) + 0x80000000 + userID) % 0x80000000;\n });\n }\n return apiManager_1.default.invokeApi('channels.getParticipants', {\n channel: appChatsManager_1.default.getChannelInput(id),\n filter: filter,\n offset: offset,\n limit: limit,\n hash: hash\n }).then((result) => {\n if (result._ == 'channels.channelParticipantsNotModified') {\n return cachedParticipants;\n }\n appUsersManager_1.default.saveApiUsers(result.users);\n return result.participants;\n });\n };\n var maybeAddSelf = (participants) => {\n var chat = appChatsManager_1.default.getChat(id);\n var selfMustBeFirst = filter._ == 'channelParticipantsRecent' &&\n !offset &&\n !chat.pFlags.kicked &&\n !chat.pFlags.left;\n if (selfMustBeFirst) {\n participants = utils_1.copy(participants);\n var myID = appUsersManager_1.default.getSelf().id;\n var myIndex = false;\n var myParticipant;\n for (var i = 0, len = participants.length; i < len; i++) {\n if (participants[i].user_id == myID) {\n myIndex = i;\n break;\n }\n }\n if (myIndex !== false) {\n myParticipant = participants[i];\n participants.splice(i, 1);\n }\n else {\n myParticipant = { _: 'channelParticipantSelf', user_id: myID };\n }\n participants.unshift(myParticipant);\n }\n return participants;\n };\n var timeNow = utils_1.tsNow();\n if (promiseData !== undefined) {\n var promise = promiseData[1];\n if (promiseData[0] > timeNow - 60000) {\n return promise;\n }\n let newPromise = promise.then((cachedParticipants) => {\n return fetchParticipants(cachedParticipants).then(maybeAddSelf);\n });\n this.chatParticipantsPromises[promiseKey] = [timeNow, newPromise];\n return newPromise;\n }\n var newPromise = fetchParticipants().then(maybeAddSelf);\n this.chatParticipantsPromises[promiseKey] = [timeNow, newPromise];\n return newPromise;\n }\n getChannelFull(id, force) {\n if (this.chatsFull[id] !== undefined && !force) {\n return Promise.resolve(this.chatsFull[id]);\n }\n if (this.chatFullPromises[id] !== undefined) {\n return this.chatFullPromises[id];\n }\n return this.chatFullPromises[id] = apiManager_1.default.invokeApi('channels.getFullChannel', {\n channel: appChatsManager_1.default.getChannelInput(id)\n }).then((result) => {\n appChatsManager_1.default.saveApiChats(result.chats);\n appUsersManager_1.default.saveApiUsers(result.users);\n var fullChannel = result.full_chat;\n if (fullChannel && fullChannel.chat_photo.id) {\n appPhotosManager_1.default.savePhoto(fullChannel.chat_photo);\n }\n /* NotificationsManager.savePeerSettings(-id, fullChannel.notify_settings) */ // warning\n if (fullChannel.pinned_msg_id) {\n fullChannel.pinned_msg_id = appMessagesIDsManager_1.default.getFullMessageID(fullChannel.pinned_msg_id, id);\n }\n delete this.chatFullPromises[id];\n this.chatsFull[id] = fullChannel;\n utils_1.$rootScope.$broadcast('chat_full_update', id);\n return fullChannel;\n }, (error) => {\n switch (error.type) {\n case 'CHANNEL_PRIVATE':\n var channel = appChatsManager_1.default.getChat(id);\n channel = { _: 'channelForbidden', access_hash: channel.access_hash, title: channel.title };\n apiUpdatesManager_1.default.processUpdateMessage({\n _: 'updates',\n updates: [{\n _: 'updateChannel',\n channel_id: id\n }],\n chats: [channel],\n users: []\n });\n break;\n }\n return Promise.reject(error);\n });\n }\n invalidateChannelParticipants(id) {\n delete this.chatsFull[id];\n delete this.chatFullPromises[id];\n for (let key in this.chatParticipantsPromises) {\n //let val = this.chatParticipantsPromises[key];\n if (+key.split('_')[0] == id) {\n delete this.chatParticipantsPromises[key];\n }\n }\n utils_1.$rootScope.$broadcast('chat_full_update', id);\n }\n getChannelPinnedMessage(id) {\n return this.getChannelFull(id).then((fullChannel) => {\n var pinnedMessageID = fullChannel && fullChannel.pinned_msg_id;\n if (!pinnedMessageID) {\n return false;\n }\n return storage_1.default.get('pinned_hidden' + id).then((hiddenMessageID) => {\n if (appMessagesIDsManager_1.default.getMessageLocalID(pinnedMessageID) == hiddenMessageID) {\n return false;\n }\n return pinnedMessageID;\n });\n });\n }\n hideChannelPinnedMessage(id, pinnedMessageID) {\n var setKeys = {};\n setKeys['pinned_hidden' + id] = appMessagesIDsManager_1.default.getMessageLocalID(pinnedMessageID);\n storage_1.default.set(setKeys);\n utils_1.$rootScope.$broadcast('peer_pinned_message', -id);\n }\n}\nexports.AppProfileManager = AppProfileManager;\nexports.default = new AppProfileManager();\n" }, { "id": 38, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appStickersManager.ts", "name": "./src/lib/appManagers/appStickersManager.ts", "index": 76, "index2": 65, "size": 3996, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appStickersManager", "loc": "18:45-93" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appStickersManager", "loc": "17:45-88" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appStickersManager", "loc": "20:45-93" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst apiManager_1 = __importDefault(require(\"../mtproto/apiManager\"));\nconst apiFileManager_1 = __importDefault(require(\"../mtproto/apiFileManager\"));\nclass appStickersManager {\n constructor() {\n this.documents = {};\n this.stickerSets = {};\n storage_1.default.get('stickerSets').then((sets) => {\n if (sets) {\n this.stickerSets = sets;\n }\n });\n }\n saveSticker(doc) {\n /* Object.keys(doc).forEach(key => {\n if(doc[key] instanceof Uint8Array) {\n doc[key] = Array.from(doc[key]);\n }\n }); */\n doc.file_reference = Array.from(doc.file_reference);\n this.documents[doc.id] = doc;\n }\n getSticker(fileID) {\n return this.documents[fileID];\n }\n getStickerSet(set) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.stickerSets[set.id])\n return this.stickerSets[set.id];\n let promise = apiManager_1.default.invokeApi('messages.getStickerSet', {\n stickerset: {\n _: 'inputStickerSetID',\n id: set.id,\n access_hash: set.access_hash\n }\n });\n let res = yield promise;\n let stickerSet = res;\n this.saveStickerSet(stickerSet);\n return stickerSet;\n });\n }\n saveStickerSet(res) {\n return __awaiter(this, void 0, void 0, function* () {\n let id = res.set.id;\n //console.log('stickers save set', res);\n this.stickerSets[id] = {\n set: res.set,\n packs: res.packs,\n documents: res.documents\n };\n res.documents.forEach(this.saveSticker.bind(this));\n //console.log('stickers wrote', this.stickerSets);\n yield storage_1.default.set({\n stickerSets: this.stickerSets\n });\n /* AppStorage.get('stickerSets').then((sets: any) => {\n this.stickerSets = sets;\n console.log('stickers got', this.stickerSets);\n }); */\n });\n }\n getStickerSetThumb(stickerSet) {\n return __awaiter(this, void 0, void 0, function* () {\n let thumb = stickerSet.thumb;\n let dcID = stickerSet.thumb_dc_id;\n let promise = apiFileManager_1.default.downloadSmallFile({\n _: 'inputStickerSetThumb',\n stickerset: {\n _: 'inputStickerSetID',\n id: stickerSet.id,\n access_hash: stickerSet.access_hash\n },\n volume_id: thumb.location.volume_id,\n local_id: thumb.location.local_id\n }, { dcID: dcID });\n return yield promise;\n });\n }\n cleanup() {\n return __awaiter(this, void 0, void 0, function* () {\n yield storage_1.default.remove('stickerSets');\n });\n }\n}\nexports.default = new appStickersManager();\n" }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "index": 21, "index2": 82, "size": 9564, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./components/pageSignIn", "loc": "71:57-91" }, { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "./pageSignIn", "loc": "15:37-60" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst misc_1 = require(\"./misc\");\nconst scrollable_1 = __importDefault(require(\"./scrollable\"));\nconst richtextprocessor_1 = require(\"../lib/richtextprocessor\");\nconst Config = __importStar(require(\"../lib/config\"));\nconst utils_1 = require(\"../lib/utils\");\nconst pageAuthCode_1 = __importDefault(require(\"./pageAuthCode\"));\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nlet installed = false;\n//import _countries from '../countries_pretty.json';\nexports.default = () => {\n //export default () => import('../countries.json').then(_countries => {\n //let pageAuthCode = await import('./pageAuthCode');\n //Array.from(document.querySelectorAll('body > .whole:not(.page-authCode)')).forEach(div => div.style.display = 'none');\n const pageEl = document.body.getElementsByClassName('page-sign')[0];\n pageEl.style.display = '';\n let btnNext = pageEl.querySelector('button');\n if (installed) {\n btnNext.textContent = 'NEXT';\n btnNext.removeAttribute('disabled');\n return;\n }\n installed = true;\n //const countries: Country[] = _countries.default.filter(c => c.emoji);\n const countries = Config.Countries.filter(c => c.emoji);\n let lastCountrySelected = '';\n var selectCountryCode = pageEl.querySelector('input[name=\"countryCode\"]');\n var parent = selectCountryCode.parentElement;\n var wrapper = document.createElement('div');\n wrapper.classList.add('select-wrapper', 'z-depth-4');\n var list = document.createElement('ul');\n wrapper.appendChild(list);\n //let wrapperScroll = OverlayScrollbars(wrapper, (window as any).scrollbarOptions);\n let scroll = new scrollable_1.default(wrapper);\n let initedSelect = false;\n selectCountryCode.addEventListener('focus', function (e) {\n /* this.removeAttribute('readonly'); */\n if (!initedSelect) {\n countries.forEach((c) => {\n initedSelect = true;\n /* let unified = unifiedCountryCodeEmoji(c.code);\n let emoji = unified.split('-').reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), ''); */\n //let emoji = countryCodeEmoji(c.code);\n let emoji = c.emoji;\n let liArr = [];\n c.phoneCode.split(' and ').forEach((phoneCode) => {\n let li = document.createElement('li');\n var spanEmoji = document.createElement('span');\n /* spanEmoji.innerHTML = countryCodeEmoji(c.code); */\n //spanEmoji.classList.add('emoji-outer', 'emoji-sizer');\n //spanEmoji.innerHTML = ``;\n let kek = richtextprocessor_1.RichTextProcessor.wrapRichText(emoji);\n //console.log(c.name, emoji, kek, spanEmoji.innerHTML);\n li.appendChild(spanEmoji);\n spanEmoji.outerHTML = kek;\n li.append(c.name);\n var span = document.createElement('span');\n span.classList.add('phone-code');\n span.innerText = '+' + phoneCode;\n li.appendChild(span);\n liArr.push(li);\n list.append(li);\n });\n c.li = liArr;\n });\n list.addEventListener('mousedown', function (e) {\n let target = e.target;\n if (target.tagName != 'LI')\n target = utils_1.findUpTag(target, 'LI');\n let countryName = target.childNodes[1].textContent; //target.innerText.split('\\n').shift();\n let phoneCode = target.querySelector('.phone-code').innerText;\n selectCountryCode.value = countryName;\n lastCountrySelected = countryName;\n telEl.value = phoneCode;\n setTimeout(() => telEl.focus(), 0);\n console.log('clicked', e, countryName, phoneCode);\n });\n }\n parent.appendChild(wrapper);\n } /* , {once: true} */);\n selectCountryCode.addEventListener('blur', function (e) {\n parent.removeChild(wrapper);\n e.cancelBubble = true;\n }, { capture: true });\n selectCountryCode.addEventListener('keyup', function (e) {\n if (e.ctrlKey || e.key == 'Control')\n return false;\n //let i = new RegExp('^' + this.value, 'i');\n let _value = this.value.toLowerCase();\n let matches = [];\n countries.forEach((c) => {\n let good = c.name.toLowerCase().indexOf(_value) !== -1 /* == 0 */; //i.test(c.name);\n c.li.forEach(li => li.style.display = good ? '' : 'none');\n if (good)\n matches.push(c);\n });\n if (matches.length == 1 && matches[0].li.length == 1) {\n if (matches[0].name == lastCountrySelected)\n return false;\n console.log('clicking', matches[0]);\n var clickEvent = document.createEvent('MouseEvents');\n clickEvent.initEvent('mousedown', true, true);\n matches[0].li[0].dispatchEvent(clickEvent);\n return false;\n }\n else if (matches.length == 0) {\n countries.forEach((c) => {\n c.li.forEach(li => li.style.display = '');\n });\n }\n });\n let arrowDown = pageEl.querySelector('.arrow-down');\n arrowDown.addEventListener('mousedown', function (e) {\n e.cancelBubble = true;\n e.preventDefault();\n if (selectCountryCode.matches(':focus'))\n selectCountryCode.blur();\n else\n selectCountryCode.focus();\n });\n let sortedCountries = countries.slice().sort((a, b) => b.phoneCode.length - a.phoneCode.length);\n let telEl = pageEl.querySelector('input[name=\"phone\"]');\n telEl.addEventListener('input', function (e) {\n this.classList.remove('error');\n let { formatted, country } = misc_1.formatPhoneNumber(this.value);\n this.value = formatted ? '+' + formatted : '';\n console.log(formatted, country);\n let countryName = country ? country.name : '' /* 'Unknown' */;\n if (countryName != selectCountryCode.value) {\n selectCountryCode.value = countryName;\n lastCountrySelected = countryName;\n }\n if (country && (this.value.length - 1) >= (country.pattern ? country.pattern.length : 9)) {\n btnNext.style.display = '';\n }\n else {\n btnNext.style.display = 'none';\n }\n });\n telEl.addEventListener('keypress', function (e) {\n if (this.value.length >= 9 && e.key == 'Enter') {\n return btnNext.click();\n }\n else if (/\\D/.test(e.key)) {\n e.preventDefault();\n return false;\n }\n });\n /* telEl.addEventListener('focus', function(this: typeof telEl, e) {\n this.removeAttribute('readonly'); // fix autocomplete\n });*/\n /* authorizer.auth(2);\n networkerFactory.startAll(); */\n btnNext.addEventListener('click', function (e) {\n this.setAttribute('disabled', 'true');\n this.textContent = 'PLEASE WAIT...';\n misc_1.putPreloader(this);\n //this.innerHTML = 'PLEASE WAIT...';\n let phone_number = telEl.value;\n apiManager_1.default.invokeApi('auth.sendCode', {\n /* flags: 0, */\n phone_number: phone_number,\n api_id: Config.App.id,\n api_hash: Config.App.hash,\n settings: {\n _: 'codeSettings',\n flags: 0\n }\n /* lang_code: navigator.language || 'en' */\n }).then((code) => {\n console.log('got code', code);\n pageEl.style.display = 'none';\n // @ts-ignore\n pageAuthCode_1.default(Object.assign(code, { phone_number: phone_number }));\n }).catch(err => {\n this.removeAttribute('disabled');\n this.innerText = 'NEXT';\n switch (err.type) {\n case 'PHONE_NUMBER_INVALID':\n telEl.classList.add('error');\n break;\n default:\n this.innerText = err.type;\n break;\n }\n });\n });\n let tryAgain = () => {\n misc_1.getNearestDc().then((nearestDcResult) => {\n let country = countries.find((c) => c.code == nearestDcResult.country);\n if (country) {\n if (!selectCountryCode.value.length && !telEl.value.length) {\n selectCountryCode.value = country.name;\n lastCountrySelected = country.name;\n telEl.value = '+' + country.phoneCode.split(' and ').shift();\n }\n }\n return console.log('woohoo', nearestDcResult, country);\n }); //.catch(tryAgain);\n };\n tryAgain();\n};\n" }, { "id": 41, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "name": "./src/lib/mtproto/passwordManager.ts", "index": 30, "index2": 26, "size": 13251, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "issuerId": 84, "issuerName": "./src/components/pagePassword.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 84, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "name": "./src/components/pagePassword.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } } ], "profile": { "factory": 1063, "building": 53, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./passwordManager", "loc": "16:42-70" }, { "moduleId": 84, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "module": "./src/components/pagePassword.ts", "moduleName": "./src/components/pagePassword.ts", "type": "cjs require", "userRequest": "../lib/mtproto/passwordManager", "loc": "19:42-83" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst apiManager_1 = __importDefault(require(\"./apiManager\"));\nconst bin_utils_1 = require(\"../bin_utils\");\nconst cryptoworker_1 = __importDefault(require(\"../crypto/cryptoworker\"));\nconst leemon_1 = require(\"leemon\");\nclass PasswordManager {\n getState(options = {}) {\n return apiManager_1.default.invokeApi('account.getPassword', {}, options).then((result) => {\n return result;\n });\n }\n /* public updateSettings(state: any, settings: any) {\n var currentHashPromise;\n var newHashPromise;\n var params: any = {\n new_settings: {\n _: 'account.passwordInputSettings',\n flags: 0,\n hint: settings.hint || ''\n }\n };\n \n if(typeof settings.cur_password === 'string' &&\n settings.cur_password.length > 0) {\n currentHashPromise = this.makePasswordHash(state.current_salt, settings.cur_password);\n } else {\n currentHashPromise = Promise.resolve([]);\n }\n \n if (typeof settings.new_password === 'string' &&\n settings.new_password.length > 0) {\n var saltRandom = new Array(8);\n var newSalt = bufferConcat(state.new_salt, saltRandom);\n secureRandom.nextBytes(saltRandom);\n newHashPromise = this.makePasswordHash(newSalt, settings.new_password);\n params.new_settings.new_salt = newSalt;\n params.new_settings.flags |= 1;\n } else {\n if(typeof settings.new_password === 'string') {\n params.new_settings.flags |= 1;\n params.new_settings.new_salt = [];\n }\n newHashPromise = Promise.resolve([]);\n }\n \n if(typeof settings.email === 'string') {\n params.new_settings.flags |= 2;\n params.new_settings.email = settings.email || '';\n }\n \n return Promise.all([currentHashPromise, newHashPromise]).then((hashes) => {\n params.current_password_hash = hashes[0];\n params.new_settings.new_password_hash = hashes[1];\n \n return apiManager.invokeApi('account.updatePasswordSettings', params);\n });\n } */\n check(state, password, options = {}) {\n return this.computeCheck(password, state).then((inputCheckPassword) => {\n return apiManager_1.default.invokeApi('auth.checkPassword', {\n password: inputCheckPassword\n }, options);\n });\n }\n requestRecovery(options = {}) {\n return apiManager_1.default.invokeApi('auth.requestPasswordRecovery', {}, options);\n }\n recover(code, options = {}) {\n return apiManager_1.default.invokeApi('auth.recoverPassword', {\n code: code\n }, options);\n }\n /* public makePasswordHash(salt: any, password: any) {\n var passwordUTF8 = unescape(encodeURIComponent(password));\n \n var buffer = new ArrayBuffer(passwordUTF8.length);\n var byteView = new Uint8Array(buffer);\n for(var i = 0, len = passwordUTF8.length; i < len; i++) {\n byteView[i] = passwordUTF8.charCodeAt(i);\n }\n \n buffer = bufferConcat(bufferConcat(salt, byteView), salt);\n \n return CryptoWorker.sha256Hash(buffer);\n } */\n makePasswordHash(password, client_salt, server_salt) {\n var passwordUTF8 = unescape(encodeURIComponent(password));\n // @ts-ignore\n const textEncoder = new TextEncoder(\"utf-8\");\n const passwordBuffer = textEncoder.encode(passwordUTF8);\n // right\n let buffer = bin_utils_1.bufferConcats(client_salt, passwordBuffer, client_salt);\n return cryptoworker_1.default.sha256Hash(buffer).then((buffer) => {\n console.log('encoded 1', bin_utils_1.bytesToHex(new Uint8Array(buffer)));\n buffer = bin_utils_1.bufferConcats(server_salt, buffer, server_salt);\n return cryptoworker_1.default.sha256Hash(buffer).then((buffer) => {\n console.log('encoded 2', buffer, bin_utils_1.bytesToHex(new Uint8Array(buffer)));\n return cryptoworker_1.default.pbkdf2(new Uint8Array(buffer), client_salt, 100000).then((hash) => {\n console.log('encoded 3', hash, bin_utils_1.bytesToHex(new Uint8Array(hash)));\n hash = bin_utils_1.bufferConcats(server_salt, hash, server_salt);\n return cryptoworker_1.default.sha256Hash(hash).then((buffer) => {\n console.log('got password hash:', buffer, bin_utils_1.bytesToHex(new Uint8Array(buffer)));\n return buffer;\n });\n });\n });\n });\n }\n computeCheck(password, state) {\n return __awaiter(this, void 0, void 0, function* () {\n let algo = state.current_algo;\n let p = leemon_1.str2bigInt(bin_utils_1.bytesToHex(algo.p), 16);\n let B = leemon_1.str2bigInt(bin_utils_1.bytesToHex(state.srp_B), 16);\n let g = leemon_1.int2bigInt(algo.g, 32, 256);\n console.log('p', leemon_1.bigInt2str(p, 16));\n console.log('B', leemon_1.bigInt2str(B, 16));\n /* if(B.compareTo(BigInteger.ZERO) < 0) {\n console.error('srp_B < 0')\n }\n \n if(B.compareTo(p) <= 0) {\n console.error('srp_B <= p');\n } */\n /* let check_prime_and_good = (bytes: any, g: number) => {\n let good_prime = 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b';\n \n if(bytesToHex(bytes) == good_prime && [3, 4, 5, 7].indexOf(g) !== -1) {\n return true;\n }\n \n // TO-DO check_prime_and_good_check\n }; */\n //check_prime_and_good(algo.p, g);\n let pw_hash = yield this.makePasswordHash(password, new Uint8Array(algo.salt1), new Uint8Array(algo.salt2));\n let x = leemon_1.str2bigInt(bin_utils_1.bytesToHex(new Uint8Array(pw_hash)), 16);\n console.warn('computed pw_hash:', pw_hash, x, bin_utils_1.bytesToHex(new Uint8Array(pw_hash)));\n var padArray = function (arr, len, fill = 0) {\n return Array(len).fill(fill).concat(arr).slice(-len);\n };\n let pForHash = padArray(bin_utils_1.bytesFromHex(leemon_1.bigInt2str(p, 16)), 256);\n let gForHash = padArray(bin_utils_1.bytesFromHex(leemon_1.bigInt2str(g, 16)), 256); // like uint8array\n let b_for_hash = padArray(bin_utils_1.bytesFromHex(leemon_1.bigInt2str(B, 16)), 256);\n console.log(bin_utils_1.bytesToHex(pForHash));\n console.log(bin_utils_1.bytesToHex(gForHash));\n console.log(bin_utils_1.bytesToHex(b_for_hash));\n let g_x = leemon_1.powMod(g, x, p);\n console.log('g_x', leemon_1.bigInt2str(g_x, 16));\n let k = yield cryptoworker_1.default.sha256Hash(bin_utils_1.bufferConcat(pForHash, gForHash));\n k = leemon_1.str2bigInt(bin_utils_1.bytesToHex(new Uint8Array(k)), 16);\n console.log('k', leemon_1.bigInt2str(k, 16));\n // kg_x = (k * g_x) % p\n let kg_x = leemon_1.mod(leemon_1.mult(k, g_x), p);\n // good\n console.log('kg_x', leemon_1.bigInt2str(kg_x, 16));\n let is_good_mod_exp_first = (modexp, prime) => {\n let diff = leemon_1.sub(prime, modexp);\n let min_diff_bits_count = 2048 - 64;\n let max_mod_exp_size = 256;\n if (leemon_1.negative(diff) ||\n leemon_1.bitSize(diff) < min_diff_bits_count ||\n leemon_1.bitSize(modexp) < min_diff_bits_count ||\n Math.floor((leemon_1.bitSize(modexp) + 7) / 8) > max_mod_exp_size)\n return false;\n return true;\n };\n let generate_and_check_random = () => __awaiter(this, void 0, void 0, function* () {\n //let random_size = 256;\n while (true) {\n /* let a = addPadding([], random_size, false, true);\n a = str2bigInt(bytesToHex(a), 16); */\n //let a = randBigInt(random_size, 1);\n let a = leemon_1.str2bigInt(bin_utils_1.bytesToHex(state.secure_random), 16);\n /* console.log('a', bigInt2str(a, 16));\n break; */\n let A = leemon_1.powMod(g, a, p);\n //console.log('A', bigInt2str(A, 16));\n if (is_good_mod_exp_first(A, p)) {\n // a_for_hash = big_num_for_hash(A)\n let a_for_hash = bin_utils_1.bytesFromHex(leemon_1.bigInt2str(A, 16));\n let s = yield cryptoworker_1.default.sha256Hash(bin_utils_1.bufferConcat(new Uint8Array(a_for_hash), new Uint8Array(b_for_hash)));\n let u = leemon_1.str2bigInt(bin_utils_1.bytesToHex(new Uint8Array(s)), 16);\n //if(u > 0)\n if (!leemon_1.isZero(u) && !leemon_1.negative(u))\n return { a, a_for_hash, u };\n }\n }\n });\n let { a, a_for_hash, u } = yield generate_and_check_random();\n console.log('a', leemon_1.bigInt2str(a, 16));\n console.log('a_for_hash', bin_utils_1.bytesToHex(a_for_hash));\n console.log('u', leemon_1.bigInt2str(u, 16));\n // g_b = (B - kg_x) % p\n console.log('B - kg_x', leemon_1.bigInt2str(leemon_1.sub(B, kg_x), 16));\n //let g_b = mod(sub(B, kg_x), p);\n /* let g_b = sub(B, kg_x);\n if(negative(g_b)) g_b = add(g_b, p);\n else g_b = mod(g_b, p); */\n /* let g_b; // g_b = sub(mod(B, p), kg_x);\n if(!negative(sub(B, kg_x))) g_b = sub(mod(B, p), kg_x);\n else g_b = mod(sub(B, kg_x), p); */\n /* let lol = trim(sub(B, kg_x), 10);\n console.log('llalala', bigInt2str(lol, 16)); */\n let g_b;\n if (!leemon_1.greater(B, kg_x)) {\n console.log('negative');\n g_b = leemon_1.add(B, p);\n }\n else\n g_b = B;\n g_b = leemon_1.mod(leemon_1.sub(g_b, kg_x), p);\n //g_b = mod(g_b, p);\n //console.log('g_b', bigInt2str(g_b, 16));\n /* if(!is_good_mod_exp_first(g_b, p))\n throw new Error('bad g_b'); */\n let ux = leemon_1.mult(u, x);\n let a_ux = leemon_1.add(a, ux);\n let S = leemon_1.powMod(g_b, a_ux, p);\n let K = yield cryptoworker_1.default.sha256Hash(padArray(bin_utils_1.bytesFromHex(leemon_1.bigInt2str(S, 16)), 256));\n let h1 = yield cryptoworker_1.default.sha256Hash(pForHash);\n let h2 = yield cryptoworker_1.default.sha256Hash(gForHash);\n h1 = bin_utils_1.bytesXor(new Uint8Array(h1), new Uint8Array(h2));\n /* let buff = bufferConcat(h1, await CryptoWorker.sha256Hash(algo.salt1));\n buff = bufferConcat(buff, await CryptoWorker.sha256Hash(algo.salt2));\n buff = bufferConcat(buff, a_for_hash);\n buff = bufferConcat(buff, b_for_hash);\n buff = bufferConcat(buff, K); */\n let buff = bin_utils_1.bufferConcats(h1, yield cryptoworker_1.default.sha256Hash(algo.salt1), yield cryptoworker_1.default.sha256Hash(algo.salt2), a_for_hash, b_for_hash, K);\n let M1 = yield cryptoworker_1.default.sha256Hash(buff);\n let out = {\n _: 'inputCheckPasswordSRP',\n srp_id: state.srp_id,\n A: new Uint8Array(a_for_hash),\n M1: new Uint8Array(M1)\n };\n console.log('out', bin_utils_1.bytesToHex(out.A), bin_utils_1.bytesToHex(out.M1));\n return out;\n /* console.log(gForHash, pForHash, bForHash); */\n });\n }\n}\nexports.PasswordManager = PasswordManager;\nexports.default = new PasswordManager();\n" }, { "id": 42, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/transport.ts", "name": "./src/lib/mtproto/transports/transport.ts", "index": 36, "index2": 27, "size": 215, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/http.ts", "issuerId": 34, "issuerName": "./src/lib/mtproto/transports/http.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 34, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/http.ts", "name": "./src/lib/mtproto/transports/http.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 31, "building": 643 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 34, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/http.ts", "module": "./src/lib/mtproto/transports/http.ts", "moduleName": "./src/lib/mtproto/transports/http.ts", "type": "cjs require", "userRequest": "./transport", "loc": "6:36-58" }, { "moduleId": 71, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "module": "./src/lib/mtproto/transports/websocket.ts", "moduleName": "./src/lib/mtproto/transports/websocket.ts", "type": "cjs require", "userRequest": "./transport", "loc": "6:36-58" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass MTTransport {\n constructor(dcID, url) {\n this.dcID = dcID;\n this.url = url;\n }\n}\nexports.default = MTTransport;\n" }, { "id": 43, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/rsaKeysManager.ts", "name": "./src/lib/mtproto/rsaKeysManager.ts", "index": 41, "index2": 35, "size": 9367, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "issuerId": 16, "issuerName": "./src/lib/mtproto/mtproto.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 16, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "name": "./src/lib/mtproto/mtproto.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 820, "building": 593, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./rsaKeysManager", "loc": "18:41-68" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "./rsaKeysManager", "loc": "18:41-68" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tl_utils_1 = require(\"../tl_utils\");\nconst bin_utils_1 = require(\"../bin_utils\");\nconst cryptoworker_1 = __importDefault(require(\"../crypto/cryptoworker\"));\nclass RSAKeysManager {\n constructor() {\n /**\n * Server public key, obtained from here: https://core.telegram.org/api/obtaining_api_id\n *\n *\n * -----BEGIN RSA PUBLIC KEY-----\n * MIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\n * lyDONS789sVoD/xCS9Y0hkkC3gtL1tSfTlgCMOOul9lcixlEKzwKENj1Yz/s7daS\n * an9tqw3bfUV/nqgbhGX81v/+7RFAEd+RwFnK7a+XYl9sluzHRyVVaTTveB2GazTw\n * Efzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+\n * 8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd9P0NsZRPsmoqVwMbMu7mStFai6aIhc3n\n * Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB\n * -----END RSA PUBLIC KEY-----\n *\n * -----BEGIN PUBLIC KEY-----\n * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAruw2yP/BCcsJliRoW5eB\n * VBVle9dtjJw+OYED160Wybum9SXtBBLXriwt4rROd9csv0t0OHCaTmRqBcQ0J8fx\n * hN6/cpR1GWgOZRUAiQxoMnlt0R93LCX/j1dnVa/gVbCjdSxpbrfY2g2L4frzjJvd\n * l84Kd9ORYjDEAyFnEA7dD556OptgLQQ2e2iVNq8NZLYTzLp5YpOdO1doK+ttrltg\n * gTCy5SrKeLoCPPbOgGsdxJxyz5KKcZnSLj16yE5HvJQn0CNpRdENvRUXe6tBP78O\n * 39oJ8BTHp9oIjd6XWXAsp2CvK45Ol8wFXGF710w9lwCGNbmNxNYhtIkdqfsEcwR5\n * JwIDAQAB\n * -----END PUBLIC KEY-----\n *\n * -----BEGIN PUBLIC KEY-----\n * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvfLHfYH2r9R70w8prHbl\n * Wt/nDkh+XkgpflqQVcnAfSuTtO05lNPspQmL8Y2XjVT4t8cT6xAkdgfmmvnvRPOO\n * KPi0OfJXoRVylFzAQG/j83u5K3kRLbae7fLccVhKZhY46lvsueI1hQdLgNV9n1cQ\n * 3TDS2pQOCtovG4eDl9wacrXOJTG2990VjgnIKNA0UMoP+KF03qzryqIt3oTvZq03\n * DyWdGK+AZjgBLaDKSnC6qD2cFY81UryRWOab8zKkWAnhw2kFpcqhI0jdV5QaSCEx\n * vnsjVaX0Y1N0870931/5Jb9ICe4nweZ9kSDF/gip3kWLG0o8XQpChDfyvsqB9OLV\n * /wIDAQAB\n * -----END PUBLIC KEY-----\n *\n * -----BEGIN PUBLIC KEY-----\n * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAs/ditzm+mPND6xkhzwFI\n * z6J/968CtkcSE/7Z2qAJiXbmZ3UDJPGrzqTDHkO30R8VeRM/Kz2f4nR05GIFiITl\n * 4bEjvpy7xqRDspJcCFIOcyXm8abVDhF+th6knSU0yLtNKuQVP6voMrnt9MV1X92L\n * GZQLgdHZbPQz0Z5qIpaKhdyA8DEvWWvSUwwc+yi1/gGaybwlzZwqXYoPOhwMebzK\n * Uk0xW14htcJrRrq+PXXQbRzTMynseCoPIoke0dtCodbA3qQxQovE16q9zz4Otv2k\n * 4j63cz53J+mhkVWAeWxVGI0lltJmWtEYK6er8VqqWot3nqmWMXogrgRLggv/Nbbo\n * oQIDAQAB\n * -----END PUBLIC KEY-----\n *\n * -----BEGIN PUBLIC KEY-----\n * MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvmpxVY7ld/8DAjz6F6q0\n * 5shjg8/4p6047bn6/m8yPy1RBsvIyvuDuGnP/RzPEhzXQ9UJ5Ynmh2XJZgHoE9xb\n * nfxL5BXHplJhMtADXKM9bWB11PU1Eioc3+AXBB8QiNFBn2XI5UkO5hPhbb9mJpjA\n * 9Uhw8EdfqJP8QetVsI/xrCEbwEXe0xvifRLJbY08/Gp66KpQvy7g8w7VB8wlgePe\n * xW3pT13Ap6vuC+mQuJPyiHvSxjEKHgqePji9NP3tJUFQjcECqcm0yV7/2d0t/pbC\n * m+ZH1sadZspQCEPPrtbkQBlvHb4OLiIWPGHKSMeRFvp3IWcmdJqXahxLCUS1Eh6M\n * AQIDAQAB\n * -----END PUBLIC KEY-----\n *\n * Bytes can be got via\n * $ openssl rsa -pubin -in key.pub -text -noout\n */\n this.publisKeysHex = [{\n modulus: 'c150023e2f70db7985ded064759cfecf0af328e69a41daf4d6f01b538135a6f91f8f8b2a0ec9ba9720ce352efcf6c5680ffc424bd634864902de0b4bd6d49f4e580230e3ae97d95c8b19442b3c0a10d8f5633fecedd6926a7f6dab0ddb7d457f9ea81b8465fcd6fffeed114011df91c059caedaf97625f6c96ecc74725556934ef781d866b34f011fce4d835a090196e9a5f0e4449af7eb697ddb9076494ca5f81104a305b6dd27665722c46b60e5df680fb16b210607ef217652e60236c255f6a28315f4083a96791d7214bf64c1df4fd0db1944fb26a2a57031b32eee64ad15a8ba68885cde74a5bfc920f6abf59ba5c75506373e7130f9042da922179251f',\n exponent: '010001'\n }, {\n modulus: 'aeec36c8ffc109cb099624685b97815415657bd76d8c9c3e398103d7ad16c9bba6f525ed0412d7ae2c2de2b44e77d72cbf4b7438709a4e646a05c43427c7f184debf72947519680e651500890c6832796dd11f772c25ff8f576755afe055b0a3752c696eb7d8da0d8be1faf38c9bdd97ce0a77d3916230c4032167100edd0f9e7a3a9b602d04367b689536af0d64b613ccba7962939d3b57682beb6dae5b608130b2e52aca78ba023cf6ce806b1dc49c72cf928a7199d22e3d7ac84e47bc9427d0236945d10dbd15177bab413fbf0edfda09f014c7a7da088dde9759702ca760af2b8e4e97cc055c617bd74c3d97008635b98dc4d621b4891da9fb0473047927',\n exponent: '010001'\n }, {\n modulus: 'bdf2c77d81f6afd47bd30f29ac76e55adfe70e487e5e48297e5a9055c9c07d2b93b4ed3994d3eca5098bf18d978d54f8b7c713eb10247607e69af9ef44f38e28f8b439f257a11572945cc0406fe3f37bb92b79112db69eedf2dc71584a661638ea5becb9e23585074b80d57d9f5710dd30d2da940e0ada2f1b878397dc1a72b5ce2531b6f7dd158e09c828d03450ca0ff8a174deacebcaa22dde84ef66ad370f259d18af806638012da0ca4a70baa83d9c158f3552bc9158e69bf332a45809e1c36905a5caa12348dd57941a482131be7b2355a5f4635374f3bd3ddf5ff925bf4809ee27c1e67d9120c5fe08a9de458b1b4a3c5d0a428437f2beca81f4e2d5ff',\n exponent: '010001'\n }, {\n modulus: 'b3f762b739be98f343eb1921cf0148cfa27ff7af02b6471213fed9daa0098976e667750324f1abcea4c31e43b7d11f1579133f2b3d9fe27474e462058884e5e1b123be9cbbc6a443b2925c08520e7325e6f1a6d50e117eb61ea49d2534c8bb4d2ae4153fabe832b9edf4c5755fdd8b19940b81d1d96cf433d19e6a22968a85dc80f0312f596bd2530c1cfb28b5fe019ac9bc25cd9c2a5d8a0f3a1c0c79bcca524d315b5e21b5c26b46babe3d75d06d1cd33329ec782a0f22891ed1db42a1d6c0dea431428bc4d7aabdcf3e0eb6fda4e23eb7733e7727e9a1915580796c55188d2596d2665ad1182ba7abf15aaa5a8b779ea996317a20ae044b820bff35b6e8a1',\n exponent: '010001'\n }, {\n modulus: 'be6a71558ee577ff03023cfa17aab4e6c86383cff8a7ad38edb9fafe6f323f2d5106cbc8cafb83b869cffd1ccf121cd743d509e589e68765c96601e813dc5b9dfc4be415c7a6526132d0035ca33d6d6075d4f535122a1cdfe017041f1088d1419f65c8e5490ee613e16dbf662698c0f54870f0475fa893fc41eb55b08ff1ac211bc045ded31be27d12c96d8d3cfc6a7ae8aa50bf2ee0f30ed507cc2581e3dec56de94f5dc0a7abee0be990b893f2887bd2c6310a1e0a9e3e38bd34fded2541508dc102a9c9b4c95effd9dd2dfe96c29be647d6c69d66ca500843cfaed6e440196f1dbe0e2e22163c61ca48c79116fa77216726749a976a1c4b0944b5121e8c01',\n exponent: '010001'\n }];\n this.publicKeysParsed = {};\n this.prepared = false;\n this.preparePromise = null;\n }\n // prepareRsaKeys\n prepare() {\n if (this.preparePromise)\n return this.preparePromise;\n else if (this.prepared) {\n return Promise.resolve();\n }\n return this.preparePromise = Promise.all(this.publisKeysHex.map(keyParsed => {\n let RSAPublicKey = new tl_utils_1.TLSerialization();\n RSAPublicKey.storeBytes(bin_utils_1.bytesFromHex(keyParsed.modulus), 'n');\n RSAPublicKey.storeBytes(bin_utils_1.bytesFromHex(keyParsed.exponent), 'e');\n let buffer = RSAPublicKey.getBuffer();\n return cryptoworker_1.default.sha1Hash(buffer).then(hash => {\n let fingerprintBytes = bin_utils_1.bytesFromArrayBuffer(hash).slice(-8);\n fingerprintBytes.reverse();\n this.publicKeysParsed[bin_utils_1.bytesToHex(fingerprintBytes)] = {\n modulus: keyParsed.modulus,\n exponent: keyParsed.exponent\n };\n });\n })).then(() => {\n this.prepared = true;\n console.log('[MT] Prepared keys');\n this.preparePromise = null;\n });\n }\n // selectRsaKeyByFingerPrint\n select(fingerprints) {\n return __awaiter(this, void 0, void 0, function* () {\n yield this.prepare();\n var fingerprintHex, foundKey, i;\n for (i = 0; i < fingerprints.length; i++) {\n fingerprintHex = bin_utils_1.bigStringInt(fingerprints[i]).toString(16);\n if (fingerprintHex.length < 16) {\n fingerprintHex = new Array(16 - fingerprintHex.length).fill('0').join('') + fingerprintHex;\n }\n console.log(fingerprintHex, this.publicKeysParsed);\n if (foundKey = this.publicKeysParsed[fingerprintHex]) {\n return Object.assign({\n fingerprint: fingerprints[i]\n }, foundKey);\n }\n }\n return false;\n });\n }\n}\nexports.RSAKeysManager = RSAKeysManager;\nexports.default = new RSAKeysManager();\n" }, { "id": 44, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "name": "./src/lib/mtproto/authorizer.ts", "index": 45, "index2": 38, "size": 22899, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "issuerId": 1, "issuerName": "./src/lib/mtproto/apiManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 196, "building": 1089, "dependencies": 820 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 1, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "module": "./src/lib/mtproto/apiManager.ts", "moduleName": "./src/lib/mtproto/apiManager.ts", "type": "cjs require", "userRequest": "./authorizer", "loc": "26:37-60" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "./authorizer", "loc": "21:37-60" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst tl_utils_1 = require(\"../tl_utils\");\nconst dcConfigurator_1 = __importDefault(require(\"./dcConfigurator\"));\nconst bin_utils_1 = require(\"../bin_utils\");\nconst rsaKeysManager_1 = __importDefault(require(\"./rsaKeysManager\"));\nconst utils_1 = require(\"../utils\");\nconst timeManager_1 = __importDefault(require(\"./timeManager\"));\n// @ts-ignore\nconst jsbn_1 = require(\"jsbn\");\nconst cryptoworker_1 = __importDefault(require(\"../crypto/cryptoworker\"));\nconst mtproto_1 = require(\"./mtproto\");\nclass Authorizer {\n constructor() {\n this.cached = {};\n }\n mtpSendPlainRequest(dcID, requestArray) {\n var requestLength = requestArray.byteLength;\n //requestArray = new /* Int32Array */Uint8Array(requestBuffer);\n var header = new tl_utils_1.TLSerialization();\n header.storeLongP(0, 0, 'auth_key_id'); // Auth key\n header.storeLong(timeManager_1.default.generateID(), 'msg_id'); // Msg_id\n header.storeInt(requestLength, 'request_length');\n let headerArray = header.getBytes(true);\n let resultArray = new Uint8Array(headerArray.byteLength + requestLength);\n resultArray.set(headerArray);\n resultArray.set(requestArray, headerArray.length);\n /* var headerBuffer = header.getBuffer(),\n headerArray = new Int32Array(headerBuffer);\n var headerLength = headerBuffer.byteLength;\n \n var resultBuffer = new ArrayBuffer(headerLength + requestLength),\n resultArray = new Int32Array(resultBuffer);\n \n resultArray.set(headerArray);\n resultArray.set(requestArray, headerArray.length);\n \n let requestData = xhrSendBuffer ? resultBuffer : resultArray; */\n let transport = dcConfigurator_1.default.chooseServer(dcID);\n let baseError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE',\n transport: transport\n };\n console.log(bin_utils_1.dT(), 'mtpSendPlainRequest: creating requestPromise');\n return transport.send(resultArray).then(result => {\n console.log(bin_utils_1.dT(), 'mtpSendPlainRequest: in good sector', result);\n if (!result || !result.byteLength) {\n return Promise.reject(baseError);\n }\n try {\n /* result = fResult ? fResult : result;\n fResult = new Uint8Array(0); */\n let deserializer = new tl_utils_1.TLDeserialization(result, { mtproto: true });\n let auth_key_id = deserializer.fetchLong('auth_key_id');\n if (auth_key_id != 0)\n console.error('auth_key_id != 0', auth_key_id);\n let msg_id = deserializer.fetchLong('msg_id');\n if (msg_id == 0)\n console.error('msg_id == 0', msg_id);\n let msg_len = deserializer.fetchInt('msg_len');\n if (!msg_len)\n console.error('no msg_len', msg_len);\n return deserializer;\n }\n catch (e) {\n console.error('mtpSendPlainRequest: deserialization went bad', e);\n let error = Object.assign(baseError, { originalError: e });\n throw error;\n }\n }, error => {\n if (!error.message && !error.type) {\n error = Object.assign(baseError, {\n originalError: error\n });\n }\n return Promise.reject(error);\n });\n }\n mtpSendReqPQ(auth) {\n return __awaiter(this, void 0, void 0, function* () {\n var request = new tl_utils_1.TLSerialization({ mtproto: true });\n request.storeMethod('req_pq_multi', { nonce: auth.nonce });\n // need\n rsaKeysManager_1.default.prepare().then(() => { });\n console.log(bin_utils_1.dT(), 'Send req_pq', auth.nonce.hex);\n try {\n var deserializer = yield this.mtpSendPlainRequest(auth.dcID, request.getBytes(true));\n }\n catch (error) {\n console.error(bin_utils_1.dT(), 'req_pq error', error.message);\n throw error;\n }\n var response = deserializer.fetchObject('ResPQ');\n if (response._ != 'resPQ') {\n throw new Error('[MT] resPQ response invalid: ' + response._);\n }\n if (!bin_utils_1.bytesCmp(auth.nonce, response.nonce)) {\n console.log(auth.nonce, response.nonce);\n throw new Error('[MT] resPQ nonce mismatch');\n }\n //auth.serverNonce = response.server_nonce;\n auth.serverNonce = new Uint8Array(response.server_nonce); // need\n auth.pq = response.pq;\n auth.fingerprints = response.server_public_key_fingerprints;\n console.log(bin_utils_1.dT(), 'Got ResPQ', bin_utils_1.bytesToHex(auth.serverNonce), bin_utils_1.bytesToHex(auth.pq), auth.fingerprints);\n let publicKey = yield rsaKeysManager_1.default.select(auth.fingerprints);\n if (!publicKey) {\n throw new Error('[MT] No public key found');\n }\n auth.publicKey = publicKey;\n console.log(bin_utils_1.dT(), 'PQ factorization start', auth.pq);\n try {\n var pAndQ = yield cryptoworker_1.default.factorize(auth.pq);\n }\n catch (error) {\n console.error('worker error factorize', error);\n throw error;\n }\n auth.p = pAndQ[0];\n auth.q = pAndQ[1];\n console.log(bin_utils_1.dT(), 'PQ factorization done', pAndQ);\n /* let p = new Uint32Array(new Uint8Array(auth.p).buffer)[0];\n let q = new Uint32Array(new Uint8Array(auth.q).buffer)[0];\n console.log(dT(), 'PQ factorization done', pAndQ, p.toString(16), q.toString(16)); */\n return this.mtpSendReqDhParams(auth);\n });\n }\n mtpSendReqDhParams(auth) {\n return __awaiter(this, void 0, void 0, function* () {\n auth.newNonce = new Uint8Array(32).randomize();\n /* auth.newNonce = new Array(32); // need array, not uint8array!\n MTProto.secureRandom.nextBytes(auth.newNonce); */\n //console.log(\"TCL: Authorizer -> mtpSendReqDhParams -> auth.newNonce\", auth.newNonce)\n // remove\n // auth.newNonce = fNewNonce ? fNewNonce : auth.newNonce;\n // console.log(\"TCL: Authorizer -> mtpSendReqDhParams -> auth.newNonce\", auth.newNonce);\n let p_q_inner_data = {\n _: 'p_q_inner_data',\n pq: auth.pq,\n p: auth.p,\n q: auth.q,\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n new_nonce: auth.newNonce\n };\n let data = new tl_utils_1.TLSerialization({ mtproto: true });\n data.storeObject(p_q_inner_data, 'P_Q_inner_data', 'DECRYPTED_DATA');\n /* console.log('p_q_inner_data', p_q_inner_data,\n bytesToHex(bytesFromArrayBuffer(data.getBuffer())),\n sha1BytesSync(data.getBuffer()),\n bytesFromArrayBuffer(await CryptoWorker.sha1Hash(data.getBuffer()))); */\n let uint8Data = data.getBytes(true);\n let sha1Hashed = yield cryptoworker_1.default.sha1Hash(uint8Data);\n //var dataWithHash = sha1BytesSync(data.getBuffer()).concat(data.getBytes() as number[]);\n let dataWithHash = sha1Hashed.concat(uint8Data);\n //dataWithHash = addPadding(dataWithHash, 255);\n //dataWithHash = dataWithHash.concat(bytesFromHex('96228ea7790e71caaabc2ab67f4412e9aa224c664d232cc08617a32ce1796aa052da4a737083211689858f461e4473fd6394afd3aa0c8014840dc13f47beaf4fc3b9229aea9cfa83f9f6e676e50ee7676542fb75606879ee7e65cf3a2295b4ba0934ceec1011560c62395a6e9593bfb117cd0da75ba56723672d100ac17ec4d805aa59f7852e3a25a79ee4'));\n //console.log('sha1Hashed', bytesToHex(sha1Hashed), 'dataWithHash', bytesToHex(dataWithHash), dataWithHash.length);\n let rsaEncrypted = yield cryptoworker_1.default.rsaEncrypt(auth.publicKey, dataWithHash);\n //let rsaEncrypted = await CryptoWorker.rsaEncrypt(auth.publicKey, dataWithHash);\n //console.log('rsaEncrypted', rsaEncrypted, new Uint8Array(rsaEncrypted).hex);\n let req_DH_params = {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n p: auth.p,\n q: auth.q,\n public_key_fingerprint: auth.publicKey.fingerprint,\n encrypted_data: rsaEncrypted\n };\n var request = new tl_utils_1.TLSerialization({ mtproto: true });\n request.storeMethod('req_DH_params', req_DH_params);\n let requestBytes = request.getBytes(true);\n console.log(bin_utils_1.dT(), 'Send req_DH_params', req_DH_params /* , requestBytes.hex */);\n try {\n var deserializer = yield this.mtpSendPlainRequest(auth.dcID, requestBytes);\n }\n catch (error) {\n console.log(bin_utils_1.dT(), 'Send req_DH_params FAIL!', error);\n throw error;\n }\n var response = deserializer.fetchObject('Server_DH_Params', 'RESPONSE');\n console.log(bin_utils_1.dT(), 'Sent req_DH_params, response:', response);\n if (response._ != 'server_DH_params_fail' && response._ != 'server_DH_params_ok') {\n throw new Error('[MT] Server_DH_Params response invalid: ' + response._);\n }\n if (!bin_utils_1.bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Server_DH_Params nonce mismatch');\n }\n if (!bin_utils_1.bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Server_DH_Params server_nonce mismatch');\n }\n if (response._ == 'server_DH_params_fail') {\n //var newNonceHash = sha1BytesSync(auth.newNonce).slice(-16);\n var newNonceHash = (yield cryptoworker_1.default.sha1Hash(auth.newNonce)).slice(-16);\n if (!bin_utils_1.bytesCmp(newNonceHash, response.new_nonce_hash)) {\n throw new Error('[MT] server_DH_params_fail new_nonce_hash mismatch');\n }\n throw new Error('[MT] server_DH_params_fail');\n }\n // fill auth object\n try {\n yield this.mtpDecryptServerDhDataAnswer(auth, response.encrypted_answer);\n }\n catch (e) {\n console.error(bin_utils_1.dT(), 'mtpDecryptServerDhDataAnswer FAILED!', e);\n throw e;\n }\n //console.log(dT(), 'mtpSendReqDhParams: executing mtpSendSetClientDhParams...');\n return this.mtpSendSetClientDhParams(auth); // костыль\n });\n }\n mtpDecryptServerDhDataAnswer(auth, encryptedAnswer) {\n return __awaiter(this, void 0, void 0, function* () {\n auth.localTime = utils_1.tsNow();\n // can't concat Array with Uint8Array!\n //auth.tmpAesKey = sha1BytesSync(auth.newNonce.concat(auth.serverNonce)).concat(sha1BytesSync(auth.serverNonce.concat(auth.newNonce)).slice(0, 12));\n //auth.tmpAesIv = sha1BytesSync(auth.serverNonce.concat(auth.newNonce)).slice(12).concat(sha1BytesSync([].concat(auth.newNonce, auth.newNonce)), auth.newNonce.slice(0, 4));\n auth.tmpAesKey = (yield cryptoworker_1.default.sha1Hash(auth.newNonce.concat(auth.serverNonce)))\n .concat((yield cryptoworker_1.default.sha1Hash(auth.serverNonce.concat(auth.newNonce))).slice(0, 12));\n auth.tmpAesIv = (yield cryptoworker_1.default.sha1Hash(auth.serverNonce.concat(auth.newNonce))).slice(12)\n .concat(yield cryptoworker_1.default.sha1Hash(auth.newNonce.concat(auth.newNonce)), auth.newNonce.slice(0, 4));\n /* console.log(auth.serverNonce.concat(auth.newNonce));\n console.log(auth.newNonce.concat(auth.serverNonce));\n console.log(auth.newNonce.concat(auth.newNonce)); */\n //var answerWithHash = aesDecryptSync(encryptedAnswer, auth.tmpAesKey, auth.tmpAesIv);\n var answerWithHash = new Uint8Array(yield cryptoworker_1.default.aesDecrypt(encryptedAnswer, auth.tmpAesKey, auth.tmpAesIv));\n var hash = answerWithHash.slice(0, 20);\n var answerWithPadding = answerWithHash.slice(20);\n // console.log('hash', hash);\n var deserializer = new tl_utils_1.TLDeserialization(answerWithPadding, { mtproto: true });\n var response = deserializer.fetchObject('Server_DH_inner_data');\n if (response._ != 'server_DH_inner_data') {\n throw new Error('[MT] server_DH_inner_data response invalid: ' + response);\n }\n if (!bin_utils_1.bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] server_DH_inner_data nonce mismatch');\n }\n if (!bin_utils_1.bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] server_DH_inner_data serverNonce mismatch');\n }\n console.log(bin_utils_1.dT(), 'Done decrypting answer');\n auth.g = response.g;\n auth.dhPrime = response.dh_prime;\n auth.gA = response.g_a;\n auth.serverTime = response.server_time;\n auth.retry = 0;\n this.mtpVerifyDhParams(auth.g, auth.dhPrime, auth.gA);\n var offset = deserializer.getOffset();\n //if(!bytesCmp(hash, sha1BytesSync(answerWithPadding.slice(0, offset)))) {\n if (!bin_utils_1.bytesCmp(hash, yield cryptoworker_1.default.sha1Hash(answerWithPadding.slice(0, offset)))) {\n throw new Error('[MT] server_DH_inner_data SHA1-hash mismatch');\n }\n timeManager_1.default.applyServerTime(auth.serverTime, auth.localTime);\n });\n }\n mtpVerifyDhParams(g, dhPrime, gA) {\n console.log(bin_utils_1.dT(), 'Verifying DH params');\n var dhPrimeHex = bin_utils_1.bytesToHex(dhPrime);\n if (g != 3 || dhPrimeHex !== 'c71caeb9c6b1c9048e6c522f70f13f73980d40238e3e21c14934d037563d930f48198a0aa7c14058229493d22530f4dbfa336f6e0ac925139543aed44cce7c3720fd51f69458705ac68cd4fe6b6b13abdc9746512969328454f18faf8c595f642477fe96bb2a941d5bcd1d4ac8cc49880708fa9b378e3c4f3a9060bee67cf9a4a4a695811051907e162753b56b0f6b410dba74d8a84b2a14b3144e0ef1284754fd17ed950d5965b4b9dd46582db1178d169c6bc465b0d6ff9ca3928fef5b9ae4e418fc15e83ebea0f87fa9ff5eed70050ded2849f47bf959d956850ce929851f0d8115f635b105ee2e4e15d04b2454bf6f4fadf034b10403119cd8e3b92fcc5b') {\n // The verified value is from https://core.telegram.org/mtproto/security_guidelines\n throw new Error('[MT] DH params are not verified: unknown dhPrime');\n }\n console.log(bin_utils_1.dT(), 'dhPrime cmp OK');\n var gABigInt = new jsbn_1.BigInteger(bin_utils_1.bytesToHex(gA), 16);\n var dhPrimeBigInt = new jsbn_1.BigInteger(dhPrimeHex, 16);\n if (gABigInt.compareTo(jsbn_1.BigInteger.ONE) <= 0) {\n throw new Error('[MT] DH params are not verified: gA <= 1');\n }\n if (gABigInt.compareTo(dhPrimeBigInt.subtract(jsbn_1.BigInteger.ONE)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA >= dhPrime - 1');\n }\n console.log(bin_utils_1.dT(), '1 < gA < dhPrime-1 OK');\n var two = new jsbn_1.BigInteger(/* null */ '');\n two.fromInt(2);\n var twoPow = two.pow(2048 - 64);\n if (gABigInt.compareTo(twoPow) < 0) {\n throw new Error('[MT] DH params are not verified: gA < 2^{2048-64}');\n }\n if (gABigInt.compareTo(dhPrimeBigInt.subtract(twoPow)) >= 0) {\n throw new Error('[MT] DH params are not verified: gA > dhPrime - 2^{2048-64}');\n }\n console.log(bin_utils_1.dT(), '2^{2048-64} < gA < dhPrime-2^{2048-64} OK');\n return true;\n }\n mtpSendSetClientDhParams(auth) {\n return __awaiter(this, void 0, void 0, function* () {\n var gBytes = bin_utils_1.bytesFromHex(auth.g.toString(16));\n auth.b = new Array(256);\n mtproto_1.MTProto.secureRandom.nextBytes(auth.b);\n try {\n var gB = yield cryptoworker_1.default.modPow(gBytes, auth.b, auth.dhPrime);\n }\n catch (error) {\n throw error;\n }\n var data = new tl_utils_1.TLSerialization({ mtproto: true });\n data.storeObject({\n _: 'client_DH_inner_data',\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n retry_id: [0, auth.retry++],\n g_b: gB\n }, 'Client_DH_Inner_Data');\n //var dataWithHash = sha1BytesSync(data.getBuffer()).concat(data.getBytes());\n var dataWithHash = (yield cryptoworker_1.default.sha1Hash(data.getBuffer())).concat(data.getBytes());\n //var encryptedData = aesEncryptSync(dataWithHash, auth.tmpAesKey, auth.tmpAesIv);\n var encryptedData = yield cryptoworker_1.default.aesEncrypt(dataWithHash, auth.tmpAesKey, auth.tmpAesIv);\n var request = new tl_utils_1.TLSerialization({ mtproto: true });\n request.storeMethod('set_client_DH_params', {\n nonce: auth.nonce,\n server_nonce: auth.serverNonce,\n encrypted_data: encryptedData\n });\n console.log(bin_utils_1.dT(), 'Send set_client_DH_params');\n try {\n var deserializer = yield this.mtpSendPlainRequest(auth.dcID, request.getBytes(true));\n }\n catch (err) {\n throw err;\n }\n let response = deserializer.fetchObject('Set_client_DH_params_answer');\n if (response._ != 'dh_gen_ok' && response._ != 'dh_gen_retry' && response._ != 'dh_gen_fail') {\n throw new Error('[MT] Set_client_DH_params_answer response invalid: ' + response._);\n }\n if (!bin_utils_1.bytesCmp(auth.nonce, response.nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer nonce mismatch');\n }\n if (!bin_utils_1.bytesCmp(auth.serverNonce, response.server_nonce)) {\n throw new Error('[MT] Set_client_DH_params_answer server_nonce mismatch');\n }\n try {\n var authKey = yield cryptoworker_1.default.modPow(auth.gA, auth.b, auth.dhPrime);\n }\n catch (err) {\n throw authKey;\n }\n //var authKeyHash = sha1BytesSync(authKey),\n let authKeyHash = yield cryptoworker_1.default.sha1Hash(authKey), authKeyAux = authKeyHash.slice(0, 8), authKeyID = authKeyHash.slice(-8);\n console.log(bin_utils_1.dT(), 'Got Set_client_DH_params_answer', response._, authKey);\n switch (response._) {\n case 'dh_gen_ok':\n var newNonceHash1 = (yield cryptoworker_1.default.sha1Hash(auth.newNonce.concat([1], authKeyAux))).slice(-16);\n //var newNonceHash1 = sha1BytesSync(auth.newNonce.concat([1], authKeyAux)).slice(-16);\n if (!bin_utils_1.bytesCmp(newNonceHash1, response.new_nonce_hash1)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash1 mismatch');\n }\n var serverSalt = bin_utils_1.bytesXor(auth.newNonce.slice(0, 8), auth.serverNonce.slice(0, 8));\n console.log('Auth successfull!', authKeyID, authKey, serverSalt);\n auth.authKeyID = authKeyID;\n auth.authKey = authKey;\n auth.serverSalt = serverSalt;\n return auth;\n break;\n case 'dh_gen_retry':\n //var newNonceHash2 = sha1BytesSync(auth.newNonce.concat([2], authKeyAux)).slice(-16);\n var newNonceHash2 = (yield cryptoworker_1.default.sha1Hash(auth.newNonce.concat([2], authKeyAux))).slice(-16);\n if (!bin_utils_1.bytesCmp(newNonceHash2, response.new_nonce_hash2)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash2 mismatch');\n }\n return this.mtpSendSetClientDhParams(auth);\n case 'dh_gen_fail':\n //var newNonceHash3 = sha1BytesSync(auth.newNonce.concat([3], authKeyAux)).slice(-16);\n var newNonceHash3 = (yield cryptoworker_1.default.sha1Hash(auth.newNonce.concat([3], authKeyAux))).slice(-16);\n if (!bin_utils_1.bytesCmp(newNonceHash3, response.new_nonce_hash3)) {\n throw new Error('[MT] Set_client_DH_params_answer new_nonce_hash3 mismatch');\n }\n throw new Error('[MT] Set_client_DH_params_answer fail');\n }\n });\n }\n // mtpAuth\n auth(dcID) {\n return __awaiter(this, void 0, void 0, function* () {\n if (dcID in this.cached) {\n return this.cached[dcID];\n }\n let nonce = /* fNonce ? fNonce : */ new Uint8Array(16).randomize();\n /* var nonce = new Array(16);\n MTProto.secureRandom.nextBytes(nonce); */\n if (!dcConfigurator_1.default.chooseServer(dcID)) {\n return Promise.reject(new Error('[MT] No server found for dc ' + dcID));\n }\n try {\n let promise = this.mtpSendReqPQ({ dcID, nonce });\n this.cached[dcID] = promise;\n return yield promise;\n }\n catch (err) {\n delete this.cached[dcID];\n throw err;\n }\n });\n }\n}\nexports.Authorizer = Authorizer;\nexports.default = new Authorizer();\n" }, { "id": 45, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "name": "./src/lib/appManagers/appSidebarRight.ts", "index": 70, "index2": 71, "size": 21590, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "issuerId": 50, "issuerName": "./src/lib/services.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } } ], "profile": { "factory": 270, "building": 981, "dependencies": 860 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appSidebarRight", "loc": "32:42-70" }, { "moduleId": 50, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "module": "./src/lib/services.ts", "moduleName": "./src/lib/services.ts", "type": "cjs require", "userRequest": "./appManagers/appSidebarRight", "loc": "19:42-82" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst misc_1 = require(\"../../components/misc\");\nconst scrollable_1 = __importDefault(require(\"../../components/scrollable\"));\nconst utils_1 = require(\"../utils\");\nconst appMessagesManager_1 = __importDefault(require(\"./appMessagesManager\"));\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst appUsersManager_1 = __importDefault(require(\"./appUsersManager\"));\nconst appProfileManager_1 = __importDefault(require(\"./appProfileManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst polyfill_1 = require(\"../polyfill\");\nconst appImManager_1 = __importDefault(require(\"./appImManager\"));\nconst appMediaViewer_1 = __importDefault(require(\"./appMediaViewer\"));\nconst lazyLoadQueue_1 = __importDefault(require(\"../../components/lazyLoadQueue\"));\nconst wrappers_1 = require(\"../../components/wrappers\");\nclass AppSidebarRight {\n constructor() {\n this.sidebarEl = document.querySelector('.profile-container');\n this.profileContentEl = document.querySelector('.profile-content');\n this.profileElements = {\n avatar: this.profileContentEl.querySelector('.profile-avatar'),\n name: this.profileContentEl.querySelector('.profile-name'),\n subtitle: this.profileContentEl.querySelector('.profile-subtitle'),\n bio: this.profileContentEl.querySelector('.profile-row-bio'),\n username: this.profileContentEl.querySelector('.profile-row-username'),\n phone: this.profileContentEl.querySelector('.profile-row-phone'),\n notificationsRow: this.profileContentEl.querySelector('.profile-row-notifications'),\n notificationsCheckbox: this.profileContentEl.querySelector('#profile-notifications'),\n notificationsStatus: this.profileContentEl.querySelector('.profile-row-notifications > p')\n };\n this.sharedMedia = {\n contentMembers: this.profileContentEl.querySelector('#content-members'),\n contentMedia: this.profileContentEl.querySelector('#content-media'),\n contentDocuments: this.profileContentEl.querySelector('#content-docs'),\n contentLinks: this.profileContentEl.querySelector('#content-links'),\n contentAudio: this.profileContentEl.querySelector('#content-audio'),\n };\n this.lastSharedMediaDiv = null;\n this.loadSidebarMediaPromises = {};\n this.sharedMediaTypes = [\n 'inputMessagesFilterContacts',\n 'inputMessagesFilterPhotoVideo',\n 'inputMessagesFilterDocument',\n 'inputMessagesFilterUrl',\n 'inputMessagesFilterVoice'\n ];\n this.sharedMediaType = '';\n this.sharedMediaSelected = null;\n this.lazyLoadQueueSidebar = new lazyLoadQueue_1.default(5);\n /* public minMediaID: {\n [type: string]: number\n } = {}; */\n this.cleared = {};\n this.historiesStorage = {};\n this.log = polyfill_1.logger('SR');\n this.peerID = 0;\n this.sidebarScroll = null;\n this.prevTabID = -1;\n this.mediaDivsByIDs = {};\n let container = this.profileContentEl.querySelector('.profile-tabs-content');\n this.profileTabs = this.profileContentEl.querySelector('.profile-tabs');\n this.sidebarScroll = new scrollable_1.default(this.sidebarEl);\n this.sidebarScroll.container.addEventListener('scroll', this.onSidebarScroll.bind(this));\n misc_1.horizontalMenu(this.profileTabs, container, (id, tabContent) => {\n this.sharedMediaType = this.sharedMediaTypes[id];\n this.sharedMediaSelected = tabContent.firstElementChild;\n if (this.prevTabID != -1) {\n this.savedVirtualStates[this.prevTabID] = {\n hiddenElements: {\n up: this.sidebarScroll.hiddenElements.up.slice(),\n down: this.sidebarScroll.hiddenElements.down.slice(),\n },\n paddings: {\n up: this.sidebarScroll.paddings.up,\n down: this.sidebarScroll.paddings.down\n }\n };\n }\n this.prevTabID = id;\n //this.log('setVirtualContainer', id, this.sharedMediaSelected);\n this.sidebarScroll.setVirtualContainer(this.sharedMediaSelected);\n if (this.savedVirtualStates[id]) {\n this.log(this.savedVirtualStates[id]);\n this.sidebarScroll.hiddenElements = this.savedVirtualStates[id].hiddenElements;\n this.sidebarScroll.paddings = this.savedVirtualStates[id].paddings;\n }\n }, this.onSidebarScroll.bind(this));\n //(this.profileTabs.children[1] as HTMLLIElement).click(); // set media\n let sidebarCloseBtn = this.sidebarEl.querySelector('.sidebar-close-button');\n sidebarCloseBtn.addEventListener('click', () => {\n this.toggleSidebar(false);\n });\n this.sharedMedia.contentMedia.addEventListener('click', (e) => {\n let target = e.target;\n let messageID = +target.getAttribute('message-id');\n if (!messageID) {\n this.log.warn('no messageID by click on target:', target);\n return;\n }\n let message = appMessagesManager_1.default.getMessage(messageID);\n let ids = Object.keys(this.mediaDivsByIDs).map(k => +k).sort();\n let idx = ids.findIndex(i => i == messageID);\n let prev = ids[idx + 1] || null;\n let next = ids[idx - 1] || null;\n appMediaViewer_1.default.openMedia(message, target, this.mediaDivsByIDs[prev] || null, this.mediaDivsByIDs[next] || null);\n });\n this.profileElements.notificationsCheckbox.addEventListener('change', () => {\n let checked = this.profileElements.notificationsCheckbox.checked;\n appImManager_1.default.mutePeer();\n });\n window.addEventListener('resize', () => {\n setTimeout(() => {\n this.sidebarScroll.onScroll();\n this.onSidebarScroll();\n }, 0);\n });\n }\n onSidebarScroll() {\n this.lazyLoadQueueSidebar.check();\n if (this.sharedMediaSelected && !this.sidebarScroll.hiddenElements.down.length /* && false */) {\n let media = Array.from(this.sharedMediaSelected.childNodes).slice(-15);\n for (let div of media) {\n if (utils_1.isElementInViewport(div)) {\n //this.log('Will load more media');\n this.loadSidebarMedia(true);\n break;\n }\n }\n }\n }\n toggleSidebar(enable) {\n /////this.log('sidebarEl', this.sidebarEl, enable, isElementInViewport(this.sidebarEl));\n /* if(enable !== undefined) {\n this.sidebarEl.style.display = enable ? 'block' : 'none';\n return;\n }\n \n this.sidebarEl.style.display = isElementInViewport(this.sidebarEl) ? 'none' : 'block'; */\n if (enable !== undefined) {\n this.sidebarEl.style.width = enable ? '25%' : '0%';\n return;\n }\n this.sidebarEl.style.width = utils_1.isElementInViewport(this.sidebarEl) ? '0%' : '25%';\n }\n loadSidebarMedia(single = false) {\n let peerID = this.peerID;\n let typesToLoad = single ? [this.sharedMediaType] : this.sharedMediaTypes;\n if (!this.historiesStorage[peerID])\n this.historiesStorage[peerID] = {};\n let historyStorage = this.historiesStorage[peerID];\n let promises = typesToLoad.map(type => {\n if (this.loadSidebarMediaPromises[type])\n return this.loadSidebarMediaPromises[type];\n if (!historyStorage[type])\n historyStorage[type] = [];\n let history = historyStorage[type];\n // заливать новую картинку сюда только после полной отправки!\n //let maxID = this.minMediaID[type] || 0;\n let maxID = history[history.length - 1] || 0;\n let ids = !maxID && appMessagesManager_1.default.historiesStorage[peerID]\n ? appMessagesManager_1.default.historiesStorage[peerID].history.slice() : [];\n maxID = !maxID && ids.length ? ids[ids.length - 1] : maxID;\n //this.log('search house of glass pre', type, ids, maxID);\n return this.loadSidebarMediaPromises[type] = appMessagesManager_1.default.getSearch(peerID, '', { _: type }, maxID, 50)\n .then(value => {\n ids = ids.concat(value.history);\n history.push(...ids);\n //this.log('search house of glass', type, value, ids, this.cleared);\n if (utils_1.$rootScope.selectedPeerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n if (this.cleared[type]) {\n ids = history;\n delete this.cleared[type];\n }\n ids.forEach(mid => {\n //this.minMediaID[type] = mid;\n let message = appMessagesManager_1.default.getMessage(mid);\n if (!message.media)\n return;\n /*'inputMessagesFilterContacts',\n 'inputMessagesFilterPhotoVideo',\n 'inputMessagesFilterDocument',\n 'inputMessagesFilterUrl',\n 'inputMessagesFilterVoice'*/\n switch (type) {\n case 'inputMessagesFilterPhotoVideo': {\n /* if(!(message.media.photo || message.media.document || message.media.webpage.document)) {\n this.log.error('no media!', message);\n break;\n } */\n let media = message.media.photo || message.media.document || (message.media.webpage && message.media.webpage.document);\n if (!media) {\n //this.log('no media!', message);\n break;\n }\n if (media._ == 'document' && media.type != 'video' /* && media.type != 'gif' */) {\n //this.log('broken video', media);\n break;\n }\n let div = document.createElement('div');\n //console.log(message, photo);\n let sizes = media.sizes || media.thumbs;\n if (sizes && sizes[0].bytes) {\n appPhotosManager_1.default.setAttachmentPreview(sizes[0].bytes, div, false, true);\n } /* else {\n this.log('no stripped size', message, media);\n } */\n //this.log('inputMessagesFilterPhotoVideo', message, media);\n let load = () => appPhotosManager_1.default.preloadPhoto(media, appPhotosManager_1.default.choosePhotoSize(media, 380, 0))\n .then((blob) => {\n if (utils_1.$rootScope.selectedPeerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n div.style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';\n });\n div.setAttribute('message-id', '' + mid);\n this.lazyLoadQueueSidebar.push({ div, load });\n this.lastSharedMediaDiv.append(div);\n if (this.lastSharedMediaDiv.childElementCount == 3) {\n this.sharedMedia.contentMedia.append(this.lastSharedMediaDiv);\n this.lastSharedMediaDiv = document.createElement('div');\n }\n this.mediaDivsByIDs[mid] = div;\n //this.sharedMedia.contentMedia.append(div);\n break;\n }\n case 'inputMessagesFilterDocument': {\n if (!message.media.document || message.media.document.type == 'voice') {\n break;\n }\n let doc = message.media.document;\n if (doc.attributes) {\n if (doc.attributes.find((a) => a._ == \"documentAttributeSticker\")) {\n break;\n }\n }\n //this.log('come back down to my knees', message);\n let div = wrappers_1.wrapDocument(message.media.document, true);\n this.sharedMedia.contentDocuments.append(div);\n break;\n }\n case 'inputMessagesFilterUrl': {\n if (!message.media.webpage || message.media.webpage._ == 'webPageEmpty') {\n break;\n }\n let webpage = message.media.webpage;\n let div = document.createElement('div');\n let previewDiv = document.createElement('div');\n previewDiv.classList.add('preview');\n //this.log('wrapping webpage', webpage);\n if (webpage.photo) {\n let load = () => appPhotosManager_1.default.preloadPhoto(webpage.photo.id, appPhotosManager_1.default.choosePhotoSize(webpage.photo, 380, 0))\n .then((blob) => {\n if (utils_1.$rootScope.selectedPeerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n previewDiv.style.backgroundImage = 'url(' + URL.createObjectURL(blob) + ')';\n });\n this.lazyLoadQueueSidebar.push({ div: previewDiv, load });\n }\n else {\n previewDiv.innerText = (webpage.title || webpage.description || webpage.url || webpage.display_url).slice(0, 1);\n previewDiv.classList.add('empty');\n }\n let title = webpage.rTitle || '';\n let subtitle = webpage.rDescription || '';\n let url = richtextprocessor_1.RichTextProcessor.wrapRichText(webpage.url || '');\n if (!title) {\n //title = new URL(webpage.url).hostname;\n title = webpage.display_url.split('/', 1)[0];\n }\n div.append(previewDiv);\n div.insertAdjacentHTML('beforeend', `\n
${title}
\n
${subtitle}
\n
${url}
\n `);\n if (div.innerText.trim().length) {\n this.sharedMedia.contentLinks.append(div);\n }\n break;\n }\n /* case 'inputMessagesFilterVoice': {\n //this.log('wrapping audio', message.media);\n if(!message.media || !message.media.document || message.media.document.type != 'voice') {\n break;\n }\n \n let doc = message.media.document;\n \n this.log('wrapping audio', doc);\n \n let audioDiv = wrapAudio(doc);\n \n this.sharedMedia.contentAudio.append(audioDiv);\n \n break;\n } */\n default:\n //console.warn('death is my friend', message);\n break;\n }\n });\n this.onSidebarScroll();\n }).then(() => {\n this.loadSidebarMediaPromises[type] = null;\n }, (err) => {\n this.log.error('load error:', err);\n this.loadSidebarMediaPromises[type] = null;\n });\n });\n return promises;\n }\n fillProfileElements() {\n let peerID = this.peerID = utils_1.$rootScope.selectedPeerID;\n this.loadSidebarMediaPromises = {};\n this.lastSharedMediaDiv = document.createElement('div');\n //this.log('fillProfileElements');\n this.savedVirtualStates = {};\n this.prevTabID = -1;\n this.sidebarScroll.setVirtualContainer(null);\n this.profileTabs.children[1].click(); // set media\n if (this.sharedMediaSelected) {\n //this.sidebarScroll.setVirtualContainer(this.sharedMediaSelected);\n }\n this.profileContentEl.parentElement.scrollTop = 0;\n this.profileElements.bio.style.display = 'none';\n this.profileElements.phone.style.display = 'none';\n this.profileElements.username.style.display = 'none';\n this.profileElements.notificationsRow.style.display = '';\n this.profileElements.notificationsCheckbox.checked = true;\n this.profileElements.notificationsStatus.innerText = 'Enabled';\n this.mediaDivsByIDs = {};\n this.lazyLoadQueueSidebar.clear();\n Object.keys(this.sharedMedia).forEach(key => {\n this.sharedMedia[key].innerHTML = '';\n });\n this.sharedMediaTypes.forEach(type => {\n //this.minMediaID[type] = 0;\n this.cleared[type] = true;\n });\n let setText = (text, el) => {\n el.style.display = '';\n if (el.childElementCount > 1) {\n el.firstElementChild.remove();\n }\n let p = document.createElement('p');\n p.innerHTML = text;\n el.prepend(p);\n };\n // username\n if (peerID != appImManager_1.default.myID) {\n let username = appPeersManager_1.default.getPeerUsername(peerID);\n if (username) {\n setText(appPeersManager_1.default.getPeerUsername(peerID), this.profileElements.username);\n }\n }\n if (peerID > 0) {\n let user = appUsersManager_1.default.getUser(peerID);\n if (user.phone && peerID != appImManager_1.default.myID) {\n setText('+' + misc_1.formatPhoneNumber(user.phone).formatted, this.profileElements.phone);\n }\n appProfileManager_1.default.getProfile(peerID, true).then(userFull => {\n if (this.peerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n if (userFull.rAbout && peerID != appImManager_1.default.myID) {\n setText(userFull.rAbout, this.profileElements.bio);\n }\n //this.log('userFull', userFull);\n if (userFull.pinned_msg_id) { // request pinned message\n appImManager_1.default.pinnedMsgID = userFull.pinned_msg_id;\n appMessagesManager_1.default.wrapSingleMessage(userFull.pinned_msg_id);\n }\n });\n }\n else {\n let chat = appPeersManager_1.default.getPeer(peerID);\n appProfileManager_1.default.getChatFull(chat.id).then((chatFull) => {\n if (this.peerID != peerID) {\n this.log.warn('peer changed');\n return;\n }\n //this.log('chatInfo res 2:', chatFull);\n if (chatFull.about) {\n setText(richtextprocessor_1.RichTextProcessor.wrapRichText(chatFull.about), this.profileElements.bio);\n }\n });\n }\n if (peerID != appImManager_1.default.myID) {\n let dialog = appMessagesManager_1.default.getDialogByPeerID(peerID);\n if (dialog.length) {\n dialog = dialog[0];\n let muted = false;\n if (dialog.notify_settings && dialog.notify_settings.mute_until) {\n muted = new Date(dialog.notify_settings.mute_until * 1000) > new Date();\n }\n appImManager_1.default.setMutedState(muted);\n }\n }\n else {\n this.profileElements.notificationsRow.style.display = 'none';\n }\n //this.loadSidebarMedia();\n }\n}\nexports.default = new AppSidebarRight();\n" }, { "id": 46, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMediaViewer.ts", "name": "./src/lib/appManagers/appMediaViewer.ts", "index": 71, "index2": 69, "size": 15034, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "issuerId": 19, "issuerName": "./src/lib/appManagers/appImManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 208, "building": 300, "dependencies": 449 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appMediaViewer", "loc": "36:41-68" }, { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "./appMediaViewer", "loc": "17:41-68" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst appPeersManager_1 = __importDefault(require(\"./appPeersManager\"));\nconst appDialogsManager_1 = __importDefault(require(\"./appDialogsManager\"));\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst appMessagesManager_1 = __importDefault(require(\"./appMessagesManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nconst polyfill_1 = require(\"../polyfill\");\nconst preloader_1 = __importDefault(require(\"../../components/preloader\"));\nconst wrappers_1 = require(\"../../components/wrappers\");\nconst utils_1 = require(\"../utils\");\nconst appDocsManager_1 = __importDefault(require(\"./appDocsManager\"));\nclass AppMediaViewer {\n constructor() {\n this.overlaysDiv = document.querySelector('.overlays');\n this.mediaViewerDiv = this.overlaysDiv.firstElementChild;\n this.author = {\n avatarEl: this.overlaysDiv.querySelector('.user-avatar'),\n nameEl: this.overlaysDiv.querySelector('.media-viewer-name'),\n date: this.overlaysDiv.querySelector('.media-viewer-date')\n };\n this.buttons = {\n delete: this.overlaysDiv.querySelector('.media-viewer-delete-button'),\n forward: this.overlaysDiv.querySelector('.media-viewer-forward-button'),\n download: this.overlaysDiv.querySelector('.media-viewer-download-button'),\n close: this.overlaysDiv.querySelector('.media-viewer-close-button'),\n prev: this.overlaysDiv.querySelector('.media-viewer-switcher-left'),\n next: this.overlaysDiv.querySelector('.media-viewer-switcher-right'),\n };\n this.content = {\n container: this.overlaysDiv.querySelector('.media-viewer-media'),\n caption: this.overlaysDiv.querySelector('.media-viewer-caption'),\n //mover: this.overlaysDiv.querySelector('.media-viewer-mover') as HTMLDivElement\n mover: document.querySelector('.media-viewer-mover')\n };\n this.currentMessageID = 0;\n this.preloader = null;\n this.lastTarget = null;\n this.prevTarget = null;\n this.nextTarget = null;\n this.log = polyfill_1.logger('AMV');\n this.preloader = new preloader_1.default();\n this.onKeyDownBinded = this.onKeyDown.bind(this);\n this.buttons.close.addEventListener('click', () => {\n //this.overlaysDiv.classList.remove('active');\n this.content.container.innerHTML = '';\n this.currentMessageID = 0;\n this.setMoverToTarget(this.lastTarget, true);\n this.lastTarget = null;\n this.prevTarget = null;\n this.nextTarget = null;\n window.removeEventListener('keydown', this.onKeyDownBinded);\n });\n this.buttons.prev.addEventListener('click', () => {\n let target = this.prevTarget;\n if (target) {\n target.click();\n }\n else {\n this.buttons.prev.style.display = 'none';\n }\n });\n this.buttons.next.addEventListener('click', () => {\n let target = this.nextTarget;\n if (target) {\n target.click();\n }\n else {\n this.buttons.next.style.display = 'none';\n }\n });\n this.buttons.download.addEventListener('click', () => {\n let message = appMessagesManager_1.default.getMessage(this.currentMessageID);\n if (message.media.photo) {\n appPhotosManager_1.default.downloadPhoto(message.media.photo.id);\n }\n else {\n let document = null;\n if (message.media.webpage)\n document = message.media.webpage.document;\n else\n document = message.media.document;\n if (document) {\n console.log('will save document:', document);\n appDocsManager_1.default.saveDocFile(document.id);\n }\n }\n });\n this.onClickBinded = (e) => {\n let target = e.target;\n let mover = null;\n ['media-viewer-mover', 'media-viewer-buttons', 'media-viewer-author'].find(s => {\n try {\n mover = utils_1.findUpClassName(target, s);\n if (mover)\n return true;\n }\n catch (err) {\n return false;\n }\n });\n if ( /* target == this.mediaViewerDiv */!mover || target.tagName == 'IMG') {\n this.buttons.close.click();\n }\n };\n this.overlaysDiv.addEventListener('click', this.onClickBinded);\n this.content.mover.addEventListener('click', this.onClickBinded);\n //this.content.mover.append(this.buttons.prev, this.buttons.next);\n }\n onKeyDown(e) {\n //this.log('onKeyDown', e);\n if (e.key == 'ArrowRight') {\n this.buttons.next.click();\n }\n else if (e.key == 'ArrowLeft') {\n this.buttons.prev.click();\n }\n }\n setMoverToTarget(target, closing = false, fromRight = 0) {\n let mover = this.content.mover;\n if (!closing) {\n mover.innerHTML = '';\n mover.append(this.buttons.prev, this.buttons.next);\n }\n let wasActive = fromRight !== 0;\n let delay = wasActive ? 350 : 200;\n /* if(wasActive) {\n this.moveTheMover(mover);\n mover = this.setNewMover();\n } */\n ///////this.log('setMoverToTarget', target, closing, wasActive, fromRight);\n let rect = target.getBoundingClientRect();\n let containerRect = this.content.container.getBoundingClientRect();\n let transform = '';\n let left;\n let top;\n if (wasActive) {\n left = fromRight === 1 ? appPhotosManager_1.default.windowW : -containerRect.width;\n top = containerRect.top;\n }\n else {\n left = rect.left;\n top = rect.top;\n }\n transform += `translate(${left}px,${top}px) `;\n mover.style.width = containerRect.width + 'px';\n mover.style.height = containerRect.height + 'px';\n mover.classList.remove('cover');\n let borderRadius = '';\n if (!wasActive) {\n let scaleX = rect.width / containerRect.width;\n let scaleY = rect.height / containerRect.height;\n transform += `scale(${scaleX},${scaleY}) `;\n borderRadius = window.getComputedStyle(target.parentElement).getPropertyValue('border-radius');\n mover.style.borderRadius = borderRadius;\n }\n mover.style.transform = transform;\n /* if(wasActive) {\n this.log('setMoverToTarget', mover.style.transform);\n } */\n if (!closing) {\n let img;\n let video;\n if (target.tagName == 'DIV') { // means backgrounded with cover\n //img.style.objectFit = 'cover';\n img = new Image();\n img.src = target.style.backgroundImage.slice(5, -2);\n //mover.classList.add('cover');\n //mover.style.backgroundImage = target.style.backgroundImage;\n }\n else if (target.tagName == 'IMG') {\n img = new Image();\n img.src = target.src;\n img.style.objectFit = 'contain';\n }\n else if (target.tagName == 'VIDEO') {\n video = document.createElement('video');\n let source = document.createElement('source');\n source.src = target.querySelector('source').src;\n video.append(source);\n }\n if (img) {\n img.style.borderRadius = borderRadius;\n mover.prepend(img);\n }\n else if (video) {\n video.style.borderRadius = borderRadius;\n mover.prepend(video);\n }\n mover.style.display = '';\n setTimeout(() => {\n mover.classList.add(wasActive ? 'moving' : 'active');\n }, 0);\n }\n else {\n setTimeout(() => {\n this.overlaysDiv.classList.remove('active');\n }, 0);\n setTimeout(() => {\n mover.style.borderRadius = borderRadius;\n if (mover.firstElementChild) {\n mover.firstElementChild.style.borderRadius = borderRadius;\n }\n if (target.tagName == 'DIV') {\n mover.classList.add('cover');\n }\n }, delay / 2);\n setTimeout(() => {\n mover.innerHTML = '';\n mover.classList.remove('moving', 'active', 'cover');\n mover.style.display = 'none';\n }, delay);\n }\n return () => {\n mover.style.transform = `translate(${containerRect.left}px,${containerRect.top}px) scale(1,1)`;\n setTimeout(() => {\n mover.style.borderRadius = '';\n if (mover.firstElementChild) {\n mover.firstElementChild.style.borderRadius = '';\n }\n mover.classList.remove('cover');\n }, delay / 2);\n };\n }\n moveTheMover(mover, toLeft = true) {\n let windowW = appPhotosManager_1.default.windowW;\n let windowH = appPhotosManager_1.default.windowH;\n mover.classList.add('moving');\n let rect = mover.getBoundingClientRect();\n let newTransform = mover.style.transform.replace(/translate\\((.+?),/, /* 'translate(-' + windowW + 'px,', */ (match, p1) => {\n /////////this.log('replace func', match, p1);\n let x = +p1.slice(0, -2);\n x = toLeft ? -rect.width : windowW;\n return match.replace(p1, x + 'px');\n });\n ////////this.log('set newTransform:', newTransform, mover.style.transform, toLeft);\n mover.style.transform = newTransform;\n setTimeout(() => {\n mover.remove();\n }, 350);\n }\n setNewMover() {\n let newMover = document.createElement('div');\n newMover.classList.add('media-viewer-mover');\n let oldMover = this.content.mover;\n oldMover.parentElement.append(newMover);\n newMover.addEventListener('click', this.onClickBinded);\n return this.content.mover = newMover;\n }\n openMedia(message, target, prevTarget, nextTarget) {\n ////////this.log('openMedia doc:', message, prevTarget, nextTarget);\n let media = message.media.photo || message.media.document || message.media.webpage.document || message.media.webpage.photo;\n let isVideo = media.mime_type == 'video/mp4';\n let fromRight = 0;\n if (this.lastTarget !== null) {\n if (this.lastTarget === prevTarget) {\n fromRight = 1;\n }\n else if (this.lastTarget === nextTarget) {\n fromRight = -1;\n }\n }\n this.currentMessageID = message.mid;\n this.prevTarget = prevTarget || null;\n this.nextTarget = nextTarget || null;\n this.lastTarget = target;\n let container = this.content.container;\n if (container.firstElementChild) {\n container.innerHTML = '';\n }\n let date = new Date(media.date * 1000);\n let months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n let dateStr = months[date.getMonth()] + ' ' + date.getDate() + ' at ' + date.getHours() + ':' + ('0' + date.getMinutes()).slice(-2);\n this.author.date.innerText = dateStr;\n let name = appPeersManager_1.default.getPeerTitle(message.fromID);\n this.author.nameEl.innerHTML = name;\n if (message.message) {\n this.content.caption.innerHTML = richtextprocessor_1.RichTextProcessor.wrapRichText(message.message, {\n entities: message.totalEntities\n });\n }\n else {\n this.content.caption.innerHTML = '';\n }\n appDialogsManager_1.default.loadDialogPhoto(this.author.avatarEl, message.fromID);\n // ok set\n let wasActive = fromRight !== 0;\n if (wasActive) {\n this.moveTheMover(this.content.mover, fromRight === 1);\n this.setNewMover();\n }\n else {\n window.addEventListener('keydown', this.onKeyDownBinded);\n this.overlaysDiv.classList.add('active');\n }\n ////////this.log('wasActive:', wasActive);\n let mover = this.content.mover;\n let maxWidth = appPhotosManager_1.default.windowW - 16;\n let maxHeight = appPhotosManager_1.default.windowH - 100;\n if (isVideo) {\n let size = appPhotosManager_1.default.setAttachmentSize(media, container, maxWidth, maxHeight);\n ////////this.log('will wrap video', media, size);\n let afterTimeout = this.setMoverToTarget(target, false, fromRight);\n //if(wasActive) return;\n setTimeout(() => {\n afterTimeout();\n wrappers_1.wrapVideo.call(this, media, mover, message, false, this.preloader).then(() => {\n if (this.currentMessageID != message.mid) {\n this.log.warn('media viewer changed video');\n return;\n }\n });\n }, 0);\n }\n else {\n let size = appPhotosManager_1.default.setAttachmentSize(media.id, container, maxWidth, maxHeight);\n let afterTimeout = this.setMoverToTarget(target, false, fromRight);\n //if(wasActive) return;\n setTimeout(() => {\n afterTimeout();\n this.preloader.attach(mover);\n let cancellablePromise = appPhotosManager_1.default.preloadPhoto(media.id, size);\n cancellablePromise.then((blob) => {\n if (this.currentMessageID != message.mid) {\n this.log.warn('media viewer changed photo');\n return;\n }\n ///////this.log('indochina', blob);\n let image = mover.firstElementChild || new Image();\n image.src = URL.createObjectURL(blob);\n mover.prepend(image);\n this.preloader.detach();\n }).catch(err => {\n this.log.error(err);\n });\n }, 0);\n }\n this.buttons.prev.style.display = this.prevTarget ? '' : 'none';\n this.buttons.next.style.display = this.nextTarget ? '' : 'none';\n }\n}\nexports.AppMediaViewer = AppMediaViewer;\nexports.default = new AppMediaViewer();\n" }, { "id": 47, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebpManager.ts", "name": "./src/lib/appManagers/appWebpManager.ts", "index": 77, "index2": 66, "size": 4230, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "issuerId": 83, "issuerName": "./src/components/emoticonsDropdown.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } }, { "id": 83, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "name": "./src/components/emoticonsDropdown.ts", "profile": { "factory": 208, "building": 300, "dependencies": 449 } } ], "profile": { "factory": 493, "building": 59 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appWebpManager", "loc": "23:41-85" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "../lib/appManagers/appWebpManager", "loc": "25:41-85" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 5, "source": "\"use strict\";\n// @ts-ignore\n//import createWorker from 'offscreen-canvas/create-worker';\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nclass AppWebpManager {\n constructor() {\n //let canvas = document.createElement('canvas');\n //console.log('got message from worker:', canvas.toDataURL());\n /* this.worker = createWorker(canvas, '/webp.bundle.js', (e: any) => {\n // Messages from the worker\n console.log('got message from worker:', e, canvas.toDataURL());\n }); */\n this.webpMachine = null;\n this.queue = [];\n //public worker: any;\n this.webpSupport = null;\n this.webpSupported().then(res => {\n });\n }\n loadWebpHero() {\n if (this.loaded)\n return this.loaded;\n this.loaded = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n let res = yield this.webpSupported();\n if (!res) {\n window.webpLoaded = () => {\n console.log('webpHero loaded');\n this.webpMachine = new window.WebpMachine();\n resolve();\n };\n let sc = document.createElement('script');\n sc.src = 'npm.webp-hero.chunk.js';\n sc.async = true;\n sc.onload = window.webpLoaded;\n document.body.appendChild(sc);\n }\n else {\n resolve();\n }\n }));\n }\n convert(bytes) {\n return this.webpMachine.decode(bytes);\n //return this.worker.post({message: 'webpBytes', bytes});\n }\n processQueue() {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.busyPromise)\n return;\n this.busyPromise = Promise.resolve('');\n let { img, bytes } = this.queue.pop();\n if (!this.loaded) {\n this.loadWebpHero();\n }\n yield this.loaded;\n this.busyPromise = this.convert(bytes);\n img.src = yield this.busyPromise;\n this.busyPromise = null;\n if (this.queue.length) {\n this.processQueue();\n }\n });\n }\n webpSupported() {\n if (this.webpSupport)\n return this.webpSupport;\n return this.webpSupport = new Promise((resolve, reject) => {\n var webP = new Image();\n webP.src = 'data:image/webp;base64,UklGRi4AAABXRUJQVlA4TCEAAAAvAUAAEB8wAiMw' +\n 'AgSSNtse/cXjxyCCmrYNWPwmHRH9jwMA';\n webP.onload = webP.onerror = () => {\n resolve(webP.height === 2);\n };\n });\n }\n polyfillImage(img, blob) {\n return __awaiter(this, void 0, void 0, function* () {\n /* console.log('polyfillImage', this);\n return this.webpMachine.polyfillImage(image); */\n //if(await this.webpMachine.webpSupport) {\n if (yield this.webpSupport) {\n img.src = URL.createObjectURL(blob);\n return;\n }\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => __awaiter(this, void 0, void 0, function* () {\n // @ts-ignore\n let bytes = new Uint8Array(e.srcElement.result);\n this.queue.push({ bytes, img });\n this.processQueue();\n }));\n reader.readAsArrayBuffer(blob);\n });\n }\n}\nexports.default = new AppWebpManager();\n" }, { "id": 48, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/lazyLoadQueue.ts", "name": "./src/components/lazyLoadQueue.ts", "index": 79, "index2": 70, "size": 4991, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "issuerId": 45, "issuerName": "./src/lib/appManagers/appSidebarRight.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 45, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "name": "./src/lib/appManagers/appSidebarRight.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 121, "building": 309, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 45, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarRight.ts", "module": "./src/lib/appManagers/appSidebarRight.ts", "moduleName": "./src/lib/appManagers/appSidebarRight.ts", "type": "cjs require", "userRequest": "../../components/lazyLoadQueue", "loc": "18:40-81" }, { "moduleId": 83, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "module": "./src/components/emoticonsDropdown.ts", "moduleName": "./src/components/emoticonsDropdown.ts", "type": "cjs require", "userRequest": "./lazyLoadQueue", "loc": "23:40-66" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../lib/utils\");\nclass LazyLoadQueue {\n constructor(parallelLimit = 0) {\n this.parallelLimit = parallelLimit;\n this.lazyLoadMedia = [];\n this.loadingMedia = 0;\n this.tempID = 0;\n }\n clear() {\n this.tempID--;\n this.lazyLoadMedia.length = 0;\n this.loadingMedia = 0;\n }\n processQueue(id) {\n return __awaiter(this, void 0, void 0, function* () {\n if (this.parallelLimit > 0 && this.loadingMedia >= this.parallelLimit)\n return;\n let item;\n let index;\n /* if(id) item = this.lazyLoadMedia.splice(id, 1) as any;\n else item = this.lazyLoadMedia.pop(); */\n if (id !== undefined)\n item = this.lazyLoadMedia.splice(id, 1)[0];\n else {\n index = this.lazyLoadMedia.findIndex(i => utils_1.isElementInViewport(i.div));\n if (index !== -1) {\n item = this.lazyLoadMedia.splice(index, 1)[0];\n }\n else {\n //index = this.lazyLoadMedia.findIndex(i => i.wasSeen);\n //if(index !== -1) {\n //item = this.lazyLoadMedia.splice(index, 1)[0];\n /*} else {\n item = this.lazyLoadMedia.pop();\n } */\n let length = this.lazyLoadMedia.length;\n for (index = length - 1; index >= 0; --index) {\n if (this.lazyLoadMedia[index].wasSeen) {\n item = this.lazyLoadMedia.splice(index, 1)[0];\n break;\n }\n }\n }\n }\n if (item) {\n this.loadingMedia++;\n let tempID = this.tempID;\n try {\n yield item.load();\n }\n catch (err) {\n console.error('loadMediaQueue error:', err, item, id, index);\n }\n if (tempID == this.tempID) {\n this.loadingMedia--;\n }\n if (this.lazyLoadMedia.length) {\n this.processQueue();\n }\n }\n });\n }\n check(id) {\n /* if(id !== undefined) {\n let {div, load} = this.lazyLoadMedia[id];\n if(isElementInViewport(div)) {\n //console.log('will load div by id:', div, div.getBoundingClientRect());\n load();\n this.lazyLoadMedia.splice(id, 1);\n }\n \n return;\n }\n \n let length = this.lazyLoadMedia.length;\n for(let i = length - 1; i >= 0; --i) {\n let {div, load} = this.lazyLoadMedia[i];\n \n if(isElementInViewport(div)) {\n console.log('will load div:', div);\n load();\n this.lazyLoadMedia.splice(i, 1);\n }\n } */\n if (id !== undefined) {\n let { div } = this.lazyLoadMedia[id];\n if (utils_1.isElementInViewport(div)) {\n //console.log('will load div by id:', div, div.getBoundingClientRect());\n this.lazyLoadMedia[id].wasSeen = true;\n this.processQueue(id);\n }\n return;\n }\n let length = this.lazyLoadMedia.length;\n for (let i = length - 1; i >= 0; --i) {\n let { div } = this.lazyLoadMedia[i];\n if (utils_1.isElementInViewport(div)) {\n //console.log('will load div:', div);\n this.lazyLoadMedia[i].wasSeen = true;\n this.processQueue(i);\n //this.lazyLoadMedia.splice(i, 1);\n }\n }\n /* this.lazyLoadMedia = this.lazyLoadMedia.filter(({div, load}) => {\n if(isElementInViewport(div)) {\n //console.log('will load div:', div, div.getBoundingClientRect());\n load();\n return false;\n }\n \n return true;\n }); */\n }\n push(el) {\n el.wasSeen = false;\n let id = this.lazyLoadMedia.push(el) - 1;\n this.check(id);\n }\n}\nexports.default = LazyLoadQueue;\n" }, { "id": 49, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appWebPagesManager.ts", "name": "./src/lib/appManagers/appWebPagesManager.ts", "index": 81, "index2": 73, "size": 5767, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "issuerId": 15, "issuerName": "./src/lib/appManagers/appMessagesManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 15, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "name": "./src/lib/appManagers/appMessagesManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 523, "building": 172, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 15, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appMessagesManager.ts", "module": "./src/lib/appManagers/appMessagesManager.ts", "moduleName": "./src/lib/appManagers/appMessagesManager.ts", "type": "cjs require", "userRequest": "./appWebPagesManager", "loc": "33:45-76" }, { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "./appWebPagesManager", "loc": "45:45-76" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst appPhotosManager_1 = __importDefault(require(\"./appPhotosManager\"));\nconst appDocsManager_1 = __importDefault(require(\"./appDocsManager\"));\nconst richtextprocessor_1 = require(\"../richtextprocessor\");\nclass AppWebPagesManager {\n constructor() {\n this.webpages = {};\n this.pendingWebPages = {};\n utils_1.$rootScope.$on('apiUpdate', (e) => {\n let update = e.detail;\n switch (update._) {\n case 'updateWebPage':\n this.saveWebPage(update.webpage);\n break;\n }\n });\n }\n saveWebPage(apiWebPage, messageID, mediaContext) {\n if (apiWebPage.photo && apiWebPage.photo._ === 'photo') {\n appPhotosManager_1.default.savePhoto(apiWebPage.photo, mediaContext);\n }\n else {\n delete apiWebPage.photo;\n }\n if (apiWebPage.document && apiWebPage.document._ === 'document') {\n appDocsManager_1.default.saveDoc(apiWebPage.document, mediaContext);\n }\n else {\n if (apiWebPage.type == 'document') {\n delete apiWebPage.type;\n }\n delete apiWebPage.document;\n }\n var siteName = apiWebPage.site_name;\n var shortTitle = apiWebPage.title || apiWebPage.author || siteName || '';\n if (siteName && shortTitle == siteName) {\n delete apiWebPage.site_name;\n }\n if (shortTitle.length > 100) {\n shortTitle = shortTitle.substr(0, 80) + '...';\n }\n apiWebPage.rTitle = richtextprocessor_1.RichTextProcessor.wrapRichText(shortTitle, { noLinks: true, noLinebreaks: true });\n var contextHashtag = '';\n if (siteName == 'GitHub') {\n var matches = apiWebPage.url.match(/(https?:\\/\\/github\\.com\\/[^\\/]+\\/[^\\/]+)/);\n if (matches) {\n contextHashtag = matches[0] + '/issues/{1}';\n }\n }\n // delete apiWebPage.description\n var shortDescriptionText = (apiWebPage.description || '');\n if (shortDescriptionText.length > 180) {\n shortDescriptionText = shortDescriptionText.substr(0, 150).replace(/(\\n|\\s)+$/, '') + '...';\n }\n apiWebPage.rDescription = richtextprocessor_1.RichTextProcessor.wrapRichText(shortDescriptionText, {\n contextSite: siteName || 'external',\n contextHashtag: contextHashtag\n });\n if (apiWebPage.type != 'photo' &&\n apiWebPage.type != 'video' &&\n apiWebPage.type != 'gif' &&\n apiWebPage.type != 'document' &&\n !apiWebPage.description &&\n apiWebPage.photo) {\n apiWebPage.type = 'photo';\n }\n if (messageID) {\n if (this.pendingWebPages[apiWebPage.id] === undefined) {\n this.pendingWebPages[apiWebPage.id] = {};\n }\n this.pendingWebPages[apiWebPage.id][messageID] = true;\n this.webpages[apiWebPage.id] = apiWebPage;\n }\n if (this.webpages[apiWebPage.id] === undefined) {\n this.webpages[apiWebPage.id] = apiWebPage;\n }\n else {\n utils_1.safeReplaceObject(this.webpages[apiWebPage.id], apiWebPage);\n }\n if (!messageID && this.pendingWebPages[apiWebPage.id] !== undefined) {\n var msgs = [];\n for (let msgID in this.pendingWebPages[apiWebPage.id]) {\n msgs.push(msgID);\n }\n utils_1.$rootScope.$broadcast('webpage_updated', {\n id: apiWebPage.id,\n msgs: msgs\n });\n }\n }\n wrapForHistory(webPageID) {\n var webPage = utils_1.copy(this.webpages[webPageID]) || { _: 'webPageEmpty' };\n if (webPage.photo && webPage.photo.id) {\n webPage.photo = appPhotosManager_1.default.wrapForHistory(webPage.photo.id, { website: webPage.type != 'photo' && webPage.type != 'video' });\n }\n /* if (webPage.document && webPage.document.id) {\n webPage.document = appDocsManager.wrapForHistory(webPage.document.id)\n } */ // warning\n return webPage;\n }\n wrapForFull(webPageID) {\n var webPage = this.wrapForHistory(webPageID);\n if (!webPage.embed_url) {\n return webPage;\n }\n var fullWidth = window.innerWidth;\n var fullHeight = window.innerHeight;\n var full = {\n width: fullWidth,\n height: fullHeight\n };\n if (!webPage.embed_width || !webPage.embed_height) {\n full.height = full.width = Math.min(fullWidth, fullHeight);\n }\n else {\n var wh = utils_1.calcImageInBox(webPage.embed_width, webPage.embed_height, fullWidth, fullHeight);\n full.width = wh.w;\n full.height = wh.h;\n }\n var embedTag = Config.Modes.chrome_packed ? 'webview' : 'iframe';\n var embedType = webPage.embed_type != 'iframe' ? webPage.embed_type || 'text/html' : 'text/html';\n var embedHtml = '<' + embedTag + ' src=\"' + utils_1.encodeEntities(webPage.embed_url) + '\" type=\"' + utils_1.encodeEntities(embedType) + '\" frameborder=\"0\" border=\"0\" webkitallowfullscreen mozallowfullscreen allowfullscreen width=\"' + full.width + '\" height=\"' + full.height + '\" style=\"width: ' + full.width + 'px; height: ' + full.height + 'px;\">';\n full.html = embedHtml;\n webPage.full = full;\n return webPage;\n }\n}\nexports.default = new AppWebPagesManager();\n" }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "index": 82, "index2": 76, "size": 2695, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "issuerId": 25, "issuerName": "./src/components/pageIm.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 323, "building": 561, "dependencies": 110 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 25, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "module": "./src/components/pageIm.ts", "moduleName": "./src/components/pageIm.ts", "type": "cjs require", "userRequest": "../lib/services", "loc": "22:66-92" }, { "moduleId": 26, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appSidebarLeft.ts", "module": "./src/lib/appManagers/appSidebarLeft.ts", "moduleName": "./src/lib/appManagers/appSidebarLeft.ts", "type": "cjs require", "userRequest": "../services", "loc": "24:19-41" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconsole.log('Services included!');\nconst appUsersManager_1 = __importDefault(require(\"./appManagers/appUsersManager\"));\nconst appChatsManager_1 = __importDefault(require(\"./appManagers/appChatsManager\"));\nconst appMessagesIDsManager_1 = __importDefault(require(\"./appManagers/appMessagesIDsManager\"));\nconst apiUpdatesManager_1 = __importDefault(require(\"./appManagers/apiUpdatesManager\"));\nconst appPhotosManager_1 = __importDefault(require(\"./appManagers/appPhotosManager\"));\nconst appDialogsManager_1 = __importDefault(require(\"./appManagers/appDialogsManager\"));\nconst appMessagesManager_1 = __importDefault(require(\"./appManagers/appMessagesManager\"));\nconst appProfileManager_1 = __importDefault(require(\"./appManagers/appProfileManager\"));\nconst appImManager_1 = __importDefault(require(\"./appManagers/appImManager\"));\nconst appPeersManager_1 = __importDefault(require(\"./appManagers/appPeersManager\"));\nconst appStickersManager_1 = __importDefault(require(\"./appManagers/appStickersManager\"));\nconst appDocsManager_1 = __importDefault(require(\"./appManagers/appDocsManager\"));\nconst appSidebarRight_1 = __importDefault(require(\"./appManagers/appSidebarRight\"));\nconst appSidebarLeft_1 = __importDefault(require(\"./appManagers/appSidebarLeft\"));\n//import AppSharedMediaManager from './appManagers/appSharedMediaManager';\nexports.appUsersManager = appUsersManager_1.default;\nexports.appChatsManager = appChatsManager_1.default;\nexports.appMessagesIDsManager = appMessagesIDsManager_1.default;\nexports.apiUpdatesManager = apiUpdatesManager_1.default;\nexports.appPhotosManager = appPhotosManager_1.default;\nexports.appDialogsManager = appDialogsManager_1.default;\nexports.appMessagesManager = appMessagesManager_1.default;\nexports.appProfileManager = appProfileManager_1.default;\nexports.appImManager = appImManager_1.default;\nexports.appPeersManager = appPeersManager_1.default;\nexports.appStickersManager = appStickersManager_1.default;\nexports.appDocsManager = appDocsManager_1.default;\n//export const appSharedMediaManager = AppSharedMediaManager;\nexports.appSidebarRight = appSidebarRight_1.default;\nexports.appSidebarLeft = appSidebarLeft_1.default;\n/* (window as any).Services = {\n appUsersManager,\n appChatsManager,\n apiUpdatesManager,\n appMessagesManager,\n appPeersManager,\n appProfileManager,\n appPhotosManager,\n appDocsManager,\n\n appDialogsManager,\n appImManager,\n appStickersManager,\n appSidebarRight,\n appSidebarLeft\n //appSharedMediaManager\n}; */\n" }, { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "index": 0, "index2": 83, "size": 4365, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": null, "issuerId": null, "issuerName": null, "issuerPath": null, "profile": { "factory": 41, "building": 1632 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": null, "moduleIdentifier": null, "module": null, "moduleName": null, "type": "single entry", "userRequest": "./src/index.ts", "loc": "index" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 0, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nrequire(\"./materialize.scss\");\n//import 'overlayscrollbars/css/OverlayScrollbars.min.css';\nrequire(\"./scss/style.scss\");\nrequire(\"./scss/tgico.scss\");\nconst utils_1 = require(\"./lib/utils\");\n//import {appUsersManager} from './lib/services';\n/* import pageIm from './components/pageIm';\nimport pageSignIn from './components/pageSignIn';\nimport { ripple } from './components/misc'; */\n//import { getNearestDc } from './components/misc';\n/* import registerServiceWorker from './registerServiceWorker';\n\nregisterServiceWorker(); */\n//console.log('pineapples in my head');\n/* Promise.all([\n import('./components/pageIm'),\n import('./components/pageSignIn'),\n import('./components/misc'),\n import('./lib/storage')\n]).then(imports => {\n let [pageIm, pageSignIn, misc, AppStorage] = imports; */\ndocument.addEventListener('DOMContentLoaded', () => __awaiter(void 0, void 0, void 0, function* () {\n /* pageAuthCode({\n \"_\": \"auth.sentCode\",\n \"pFlags\": {},\n \"flags\": 6,\n \"type\": {\n \"_\": \"auth.sentCodeTypeSms\",\n \"length\": 5\n },\n \"phone_code_hash\": \"98008787f0546e7419\",\n \"next_type\": {\n \"_\": \"auth.codeTypeCall\"\n },\n \"timeout\": 120,\n \"phone_number\": \"+380509144504\"\n }); */\n //let socket = new Socket(2);\n /* authorizer.auth(2).then((auth: any) => {\n console.log('authorized', auth);\n }, (error: any) => {\n console.log('Get networker error', error, error.stack);\n return Promise.reject(error);\n //return $q.reject(error);\n });\n \n return; */\n //pagePassword();\n let AppStorage = (yield Promise.resolve().then(() => __importStar(require('./lib/storage')))).default;\n let auth = yield AppStorage.get('user_auth');\n let userID = auth.id || 0;\n if (!userID) {\n (yield Promise.resolve().then(() => __importStar(require('./components/pageSignIn')))).default();\n }\n else {\n (yield Promise.resolve().then(() => __importStar(require('./components/pageIm')))).default();\n //getNearestDc();\n }\n let misc = yield Promise.resolve().then(() => __importStar(require('./components/misc')));\n Array.from(document.getElementsByClassName('rp')).forEach(misc.ripple);\n Array.from(document.body.getElementsByClassName('popup-close')).forEach(el => {\n let popup = utils_1.findUpClassName(el, 'popup');\n el.addEventListener('click', () => {\n popup.classList.remove('active');\n });\n });\n //MTProto.apiFileManager.uploadFile(photo).then(function (inputFile) {\n //console.log('uploaded smthn', inputFile);\n /* MTProto.apiManager.invokeApi('photos.uploadProfilePhoto', {\n file: inputFile,\n caption: '',\n geo_point: {_: 'inputGeoPointEmpty'}\n }).then(function (updateResult) {\n AppUsersManager.saveApiUsers(updateResult.users)\n MtpApiManager.getUserID().then(function (id) {\n AppPhotosManager.savePhoto(updateResult.photo, {\n user_id: id\n })\n ApiUpdatesManager.processUpdateMessage({\n _: 'updateShort',\n update: {\n _: 'updateUserPhoto',\n user_id: id,\n date: tsNow(true),\n photo: AppUsersManager.getUser(id).photo,\n previous: true\n }\n })\n $scope.photo = {}\n })\n }) */\n //});\n}));\n//});\n" }, { "id": 53, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "name": "./src/materialize.scss", "index": 1, "index2": 3, "size": 504, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./materialize.scss", "loc": "19:0-29" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "var content = require(\"!!../node_modules/css-loader/dist/cjs.js!../node_modules/resolve-url-loader/index.js!../node_modules/sass-loader/dist/cjs.js??ref--4-3!./materialize.scss\");\n\nif (typeof content === 'string') {\n content = [[module.id, content, '']];\n}\n\nvar options = {}\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = require(\"!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\")(content, options);\n\nif (content.locals) {\n module.exports = content.locals;\n}\n" }, { "id": 54, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/materialize.scss", "index": 2, "index2": 1, "size": 4380, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "issuerId": 53, "issuerName": "./src/materialize.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 53, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "name": "./src/materialize.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 537, "building": 1988, "dependencies": 349 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 53, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "module": "./src/materialize.scss", "moduleName": "./src/materialize.scss", "type": "cjs require", "userRequest": "!!../node_modules/css-loader/dist/cjs.js!../node_modules/resolve-url-loader/index.js!../node_modules/sass-loader/dist/cjs.js??ref--4-3!./materialize.scss", "loc": "1:14-178" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "exports = module.exports = require(\"../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Module\nexports.push([module.id, \"/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,footer,header,nav,section{display:block}h1{font-size:2em;margin:0.67em 0}figcaption,figure,main{display:block}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace, monospace;font-size:1em}a{background-color:transparent;-webkit-text-decoration-skip:objects}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em}dfn{font-style:italic}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}audio,video{display:inline-block}audio:not([controls]){display:none;height:0}img{border-style:none}svg:not(:root){overflow:hidden}button,input,optgroup,select,textarea{font-family:sans-serif;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}button,html [type=\\\"button\\\"],[type=\\\"reset\\\"],[type=\\\"submit\\\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\\\"button\\\"]::-moz-focus-inner,[type=\\\"reset\\\"]::-moz-focus-inner,[type=\\\"submit\\\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\\\"button\\\"]:-moz-focusring,[type=\\\"reset\\\"]:-moz-focusring,[type=\\\"submit\\\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{display:inline-block;vertical-align:baseline}textarea{overflow:auto}[type=\\\"checkbox\\\"],[type=\\\"radio\\\"]{box-sizing:border-box;padding:0}[type=\\\"number\\\"]::-webkit-inner-spin-button,[type=\\\"number\\\"]::-webkit-outer-spin-button{height:auto}[type=\\\"search\\\"]{-webkit-appearance:textfield;outline-offset:-2px}[type=\\\"search\\\"]::-webkit-search-cancel-button,[type=\\\"search\\\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details,menu{display:block}summary{display:list-item}canvas{display:inline-block}template{display:none}[hidden]{display:none}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ul:not(.browser-default){padding-left:0;list-style-type:none}ul:not(.browser-default)>li{list-style-type:none}a{text-decoration:none;-webkit-tap-highlight-color:transparent}.valign-wrapper{display:flex;align-items:center}.clearfix{clear:both}.z-depth-0{box-shadow:none !important}.z-depth-1{box-shadow:0 2px 2px 0 rgba(0,0,0,0.14),0 3px 1px -2px rgba(0,0,0,0.12),0 1px 5px 0 rgba(0,0,0,0.2)}.z-depth-1-half{box-shadow:0 3px 3px 0 rgba(0,0,0,0.14),0 1px 7px 0 rgba(0,0,0,0.12),0 3px 1px -1px rgba(0,0,0,0.2)}.z-depth-2{box-shadow:0 4px 5px 0 rgba(0,0,0,0.14),0 1px 10px 0 rgba(0,0,0,0.12),0 2px 4px -1px rgba(0,0,0,0.3)}.z-depth-3{box-shadow:0 8px 17px 2px rgba(0,0,0,0.14),0 3px 14px 2px rgba(0,0,0,0.12),0 5px 5px -3px rgba(0,0,0,0.2)}.z-depth-4{box-shadow:0 16px 24px 2px rgba(0,0,0,0.14),0 6px 30px 5px rgba(0,0,0,0.12),0 8px 10px -7px rgba(0,0,0,0.2)}.z-depth-5{box-shadow:0 24px 38px 3px rgba(0,0,0,0.14),0 9px 46px 8px rgba(0,0,0,0.12),0 11px 15px -7px rgba(0,0,0,0.2)}.hoverable{transition:box-shadow .25s}.hoverable:hover{box-shadow:0 8px 17px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)}i{line-height:inherit}i.left{float:left;margin-right:15px}i.right{float:right;margin-left:15px}i.tiny{font-size:1rem}i.small{font-size:2rem}i.medium{font-size:4rem}i.large{font-size:6rem}ul.staggered-list li{opacity:0}.fade-in{opacity:0;transform-origin:0 50%}.hide{display:none !important}.left-align{text-align:left}.right-align{text-align:right}.center,.center-align{text-align:center}.left{float:left !important}.right{float:right !important}.no-select{user-select:none}.circle{border-radius:50%}a{text-decoration:none}html{line-height:1.5;font-weight:normal}h1,h2,h3,h4,h5,h6{font-weight:400;line-height:1.3}h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{font-weight:inherit}em{font-style:italic}strong{font-weight:500}small{font-size:75%}\\n\", \"\"]);\n" }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "index": 5, "index2": 10, "size": 510, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./scss/style.scss", "loc": "21:0-28" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "var content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/dist/cjs.js??ref--4-3!./style.scss\");\n\nif (typeof content === 'string') {\n content = [[module.id, content, '']];\n}\n\nvar options = {}\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\")(content, options);\n\nif (content.locals) {\n module.exports = content.locals;\n}\n" }, { "id": 56, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "index": 6, "index2": 9, "size": 62278, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "issuerId": 55, "issuerName": "./src/scss/style.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 536, "building": 3038, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 55, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./src/scss/style.scss", "moduleName": "./src/scss/style.scss", "type": "cjs require", "userRequest": "!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/dist/cjs.js??ref--4-3!./style.scss", "loc": "1:14-181" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "exports = module.exports = require(\"../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Imports\nvar getUrl = require(\"../../node_modules/css-loader/dist/runtime/getUrl.js\");\nvar ___CSS_LOADER_URL___0___ = getUrl(require(\"../../public/assets/img/camomile.jpg\"));\nvar ___CSS_LOADER_URL___1___ = getUrl(require(\"../assets/img/msg-tail-left.svg\"));\nvar ___CSS_LOADER_URL___2___ = getUrl(require(\"../assets/img/msg-tail-right.svg\"));\nvar ___CSS_LOADER_URL___3___ = getUrl(require(\"../assets/img/doc-in.svg\"));\n// Module\nexports.push([module.id, \".chats-container .input-search{position:relative;width:100%;margin-left:1rem}.chats-container .input-search input{background-color:rgba(112,117,121,0.08);border:2px solid transparent;height:3rem;border-radius:22px;box-sizing:border-box;padding:0 1.5rem 0 3rem;-webkit-transition:all .15s ease-out;transition:all .15s ease-out;width:100%}.chats-container .input-search input:focus{background-color:rgba(112,117,121,0);border:2px solid #4EA4F6}.chats-container .input-search input:focus+.tgico{color:#4EA4F6;opacity:1}.chats-container .input-search .tgico{position:absolute;left:1rem;top:50%;transform:translateY(-50%);text-align:center;font-size:1.65rem;color:#707579;opacity:.6;-webkit-transition:all .15s ease-out;transition:all .15s ease-out}.chats-container ul{margin:0;display:flex;flex-direction:column;width:100%}.chats-container li{padding:2px 0;overflow:hidden;background-color:#fff}.chats-container li>.rp{height:70px;max-height:70px;border-radius:8px;display:grid;align-items:center;grid-template-columns:64px calc(100% - 64px - 6.5px);position:relative;cursor:pointer;padding:0 8.5px;margin:0 8.5px 0 8px;overflow:hidden}.chats-container li>.rp:hover{background:rgba(112,117,121,0.08)}.chats-container li.active>.rp{background:rgba(112,117,121,0.08)}.chats-container .pinned-delimiter{display:flex;padding:8px 0 4px}.chats-container .pinned-delimiter span{margin:0;width:100%;height:1px;background-color:#DADCE0}.chats-container p{margin:0;display:flex;justify-content:space-between;align-items:center;height:1.7rem}.chats-container p .user-title+span{font-size:.8rem}.chats-container p .user-last-message+span:not(.tgico-pinnedchat){font-size:.9rem}.chats-container span{display:inline-block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;vertical-align:middle;margin:.1rem 0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chats-container .user-caption{max-width:100%;max-height:100%;overflow:hidden;color:#707579}.chats-container .user-title{max-width:80%}.chats-container .user-title img.emoji{vertical-align:top;width:18px;height:18px}.chats-container .user-title span.emoji{overflow:visible;margin:0;width:auto;font-size:14px;vertical-align:unset}.chats-container .user-last-message{max-width:80%}.chats-container .user-last-message i{font-style:normal;color:#50a2e9}.chats-container .user-last-message img.emoji{width:20px;height:20px}.chats-container .user-last-message span.emoji{font-size:1.2rem;margin:0 .125rem;overflow:visible}.chats-container .message-status{margin-right:.1rem;margin-top:.3rem}.chats-container .message-status[class*=\\\" tgico-\\\"]{color:#4DCD5E;font-size:1.25rem}.chats-container .unread,.chats-container .unread-muted{border-radius:12px;min-width:24px;padding:0 8px;height:24px;text-align:center;line-height:24px;color:#fff;font-weight:500}.chats-container .tgico-pinnedchat{border-radius:50%;width:24px;height:24px;line-height:24px;font-size:1.5rem;color:#fff;text-align:center}.chats-container .unread:empty,.chats-container .unread-muted:empty{visibility:hidden}.chats-container .unread{background:#4DCD5E}.chats-container .unread-muted,.chats-container .tgico-pinnedchat{background:#c5c9cc}.chat-container{display:flex;width:100%;align-items:center;height:100vh;overflow:hidden;flex-direction:column;position:relative;background-image:url(\" + ___CSS_LOADER_URL___0___ + \");background-size:cover;background-position:center center}.chat-container #im-title{cursor:pointer}.chat-container #im-title span.emoji{vertical-align:inherit}.chat-container #chat-background-canvas{display:none}.chat-container #topbar{width:100%;background-color:#fff;box-sizing:border-box;user-select:none;-webkit-user-select:none;display:flex;align-items:center;box-shadow:0 1px 2px 0 rgba(16,35,47,0.07);padding:.5rem 1rem;flex:0 0 auto;min-height:60px;max-height:60px}.chat-container #topbar>*{margin:0 2px}.chat-container #topbar .chat-info{flex-grow:1}.chat-container #topbar .content{padding-left:1rem;flex:1}.chat-container #topbar .person{display:flex;align-items:center;cursor:pointer}.chat-container #topbar .person:hover{background-color:transparent}.chat-container #topbar .person .user-avatar{width:44px;height:44px;line-height:44px}.chat-container #topbar .person .bottom{font-size:14px;line-height:18px;color:#9e9e9e}.chat-container #topbar .person .bottom .online{color:#50a2e9}.chat-container #bubbles{width:100%;height:100%;max-height:100%;flex:1 1 auto;overflow:hidden;position:relative}.chat-container #bubbles>.scrollable{position:unset}.chat-container #bubbles:not(.scrolled-down){-webkit-mask-image:-webkit-linear-gradient(bottom, transparent, #000 20px);mask-image:linear-gradient(0deg, transparent 0, #000 20px)}.chat-container #bubbles:not(.scrolled-down) #bubbles-go-down{opacity:1}.chat-container #bubbles .preloader{width:100%;height:100%}.chat-container #bubbles .preloader svg{width:50px;height:50px}.chat-container #bubbles #bubbles-inner{max-width:700px;width:100%;display:flex;flex-direction:column;flex-shrink:1;padding-top:9px;margin:0 auto;box-sizing:border-box;min-height:100%;justify-content:flex-end}.chat-container #bubbles #bubbles-inner.is-chat .in{padding-left:45px}.chat-container #bubbles #bubbles-go-down{position:absolute;background-color:#fff;border-radius:50%;width:3.25rem;height:3.25rem;color:#9e9e9e;font-size:30px;display:flex;align-items:center;justify-content:center;right:17.5px;bottom:17.5px;cursor:pointer;opacity:0;transition:.2s opacity;user-select:none;-webkit-user-select:none}.chat-container #bubbles #bubbles-go-down:before{margin-left:.75px}.chat-container #bubbles .service{margin:1rem 0;align-self:center}.chat-container #bubbles .service .service-msg{color:#fff;background-color:rgba(0,0,0,0.22);padding:0 8px;line-height:24px;font-size:15px;border-radius:12px;user-select:none;display:flex;align-items:center;justify-content:center}.chat-container #bubbles .service .service-msg .name{cursor:pointer;margin-right:5px}.chat-container #bubbles .bubble{min-width:60px;max-width:85%;border-radius:12px;box-shadow:0 1px 2px 0 rgba(16,35,47,0.15);position:relative;display:flex;flex-direction:column-reverse;font-size:0;width:max-content;height:fit-content}.chat-container #bubbles .bubble.forwarded .forward{opacity:0;position:absolute;right:-46px;bottom:0;width:38px;height:38px;font-size:1.5rem;align-items:center;display:flex;justify-content:center;color:#fff;border-radius:50%;background:rgba(0,0,0,0.16);cursor:pointer;transition:.2s opacity}.chat-container #bubbles .bubble.forwarded .forward svg{width:20px;height:20px}.chat-container #bubbles .bubble:not(.hide-name) .audio{margin:4px 0}.chat-container #bubbles .bubble:hover .forward{opacity:1}.chat-container #bubbles .bubble .reply{width:auto}.chat-container #bubbles .bubble .reply .reply-content{height:auto;min-height:32px}.chat-container #bubbles .bubble.photo,.chat-container #bubbles .bubble.video{width:min-content}.chat-container #bubbles .bubble.photo .box.web,.chat-container #bubbles .bubble.video .box.web{max-width:100%}.chat-container #bubbles .bubble.webpage .time{float:none;width:0}.chat-container #bubbles .bubble img.emoji{height:18px;width:18px;margin:0 .05rem}.chat-container #bubbles .bubble span.emoji{height:auto;width:auto;overflow:visible;vertical-align:unset}.chat-container #bubbles .bubble.emoji-big{font-size:0;background:none !important;box-shadow:none;line-height:1;user-select:none;-webkit-user-select:none}.chat-container #bubbles .bubble.emoji-big .attachment{padding-top:.5rem;padding-bottom:1.5rem;max-width:fit-content !important;max-height:fit-content !important}.chat-container #bubbles .bubble.emoji-big .attachment span.emoji{height:auto;width:auto}.chat-container #bubbles .bubble.emoji-1x{font-size:96px}.chat-container #bubbles .bubble.emoji-1x img.emoji{height:64px;width:64px}.chat-container #bubbles .bubble.emoji-2x{font-size:64px}.chat-container #bubbles .bubble.emoji-2x img.emoji{height:48px;width:48px}.chat-container #bubbles .bubble.emoji-3x{font-size:52px}.chat-container #bubbles .bubble.emoji-3x img.emoji{height:32px;width:32px}.chat-container #bubbles .bubble.sticker,.chat-container #bubbles .bubble.round{cursor:pointer;background:none !important;box-shadow:none;max-width:300px;max-height:300px}.chat-container #bubbles .bubble.sticker img,.chat-container #bubbles .bubble.round img{object-fit:contain}.chat-container #bubbles .bubble.sticker .message.message-empty,.chat-container #bubbles .bubble.round .message.message-empty{display:none}.chat-container #bubbles .bubble.sticker:hover .message.message-empty,.chat-container #bubbles .bubble.round:hover .message.message-empty{display:block}.chat-container #bubbles .bubble.round .attachment{max-width:200px;max-height:200px}.chat-container #bubbles .bubble .message:not(.message-empty)+.attachment,.chat-container #bubbles .bubble.is-reply .message:not(.message-empty)+.attachment{border-bottom-left-radius:0;border-bottom-right-radius:0}.chat-container #bubbles .bubble:not(.emoji-big) .attachment{font-size:0}.chat-container #bubbles .bubble .attachment{max-width:100%;border-radius:inherit;overflow:hidden;display:flex;justify-content:center;position:relative}.chat-container #bubbles .bubble .attachment img,.chat-container #bubbles .bubble .attachment video{width:auto;height:auto;max-width:100%;cursor:pointer}.chat-container #bubbles .bubble:not(.sticker) .attachment{max-width:380px;max-height:380px;width:max-content}.chat-container #bubbles .bubble:not(.sticker) img:not(.emoji),.chat-container #bubbles .bubble:not(.sticker) video{object-fit:cover;width:100%;height:100%}.chat-container #bubbles .bubble.round.video .attachment{max-height:200px;max-width:200px}.chat-container #bubbles .bubble .box,.chat-container #bubbles .bubble .reply{font-size:.95rem;margin:4px 4px 4px 6px;padding:.25rem;margin-bottom:-5px;border-radius:4px}.chat-container #bubbles .bubble .box.web,.chat-container #bubbles .bubble .reply.web{margin-top:-6px;max-width:100%;overflow:hidden}.chat-container #bubbles .bubble .box.web .preview,.chat-container #bubbles .bubble .reply.web .preview{max-height:300px;max-width:380px;border-radius:4px;margin-bottom:3px;overflow:hidden;user-select:none;-webkit-user-select:none;cursor:pointer;position:relative;width:max-content}.chat-container #bubbles .bubble .box.web .preview img,.chat-container #bubbles .bubble .box.web .preview video,.chat-container #bubbles .bubble .reply.web .preview img,.chat-container #bubbles .bubble .reply.web .preview video{max-width:100%}.chat-container #bubbles .bubble .box.web .title,.chat-container #bubbles .bubble .reply.web .title{letter-spacing:-0.2px;line-height:1.2;font-weight:500}.chat-container #bubbles .bubble .box.web .name,.chat-container #bubbles .bubble .reply.web .name{letter-spacing:-0.3px;display:block}.chat-container #bubbles .bubble .box.web .name:hover,.chat-container #bubbles .bubble .reply.web .name:hover{text-decoration:underline}.chat-container #bubbles .bubble .box.web .text,.chat-container #bubbles .bubble .reply.web .text{overflow:hidden;text-overflow:ellipsis;line-height:1.2;letter-spacing:-0.3px;margin-top:2px;font-size:0.965rem}.chat-container #bubbles .bubble .box .quote,.chat-container #bubbles .bubble .reply .quote{padding-left:0.55rem;max-width:100%;overflow:hidden;width:100%}.chat-container #bubbles .bubble .box .text,.chat-container #bubbles .bubble .reply .text{line-height:1.2}.chat-container #bubbles .bubble .box .name,.chat-container #bubbles .bubble .box .reply-title,.chat-container #bubbles .bubble .reply .name,.chat-container #bubbles .bubble .reply .reply-title{font-weight:500;display:inline !important}.chat-container #bubbles .bubble .reply{max-width:300px;margin-bottom:6px;margin-top:0;cursor:pointer}.chat-container #bubbles .bubble.is-reply.emoji-big .reply,.chat-container #bubbles .bubble.is-reply.sticker .reply{padding:10px;border-radius:12px;border:1px solid #ccc;max-width:300px;height:54px;max-height:54px;white-space:nowrap;position:absolute;top:0;margin-bottom:0}.chat-container #bubbles .bubble.is-reply.emoji-big .reply .reply-content,.chat-container #bubbles .bubble.is-reply.sticker .reply .reply-content{margin-top:0}.chat-container #bubbles .bubble.is-reply .reply-content{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.chat-container #bubbles .bubble .message{font-size:16px;padding:0 .6rem 6px .6rem;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:#000;line-height:21px}.chat-container #bubbles .bubble .message *{overflow:hidden;text-overflow:ellipsis}.chat-container #bubbles .bubble .message:last-child{padding-top:6px}.chat-container #bubbles .bubble .message.message-empty{position:absolute;bottom:.1rem;right:.1rem;border-radius:12px;background-color:rgba(0,0,0,0.4);padding:0 .3rem;z-index:2}.chat-container #bubbles .bubble .message.message-empty .time{color:#fff}.chat-container #bubbles .bubble .message .emoji{font-size:1.2rem}.chat-container #bubbles .bubble .time{font-size:.8rem;user-select:none;float:right;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;height:20px;line-height:20px}.chat-container #bubbles .bubble .time .inner{position:absolute;bottom:0;right:0;font-size:12px;display:flex;align-items:center;line-height:1}.chat-container #bubbles .bubble .time .inner i{font-size:1.15rem;margin-right:.4rem;margin-left:.1rem}.chat-container #bubbles .bubble .time .inner i.edited{overflow:visible;font-size:.8rem}.chat-container #bubbles .bubble.is-edited.channel-post .time{width:calc(5rem + 42px)}.chat-container #bubbles .bubble.channel-post .time{width:5rem}.chat-container #bubbles .bubble.is-edited .time{width:90px}.chat-container #bubbles .bubble .message.message-empty .time{padding:0;display:flex;align-items:center;width:auto}.chat-container #bubbles .bubble .message.message-empty .time .inner{margin-bottom:0;position:relative;padding:0 2.5px;bottom:0}.chat-container #bubbles .bubble .user-avatar{position:absolute;left:-3rem;width:40px;height:40px;line-height:40px;bottom:0;font-size:1rem;cursor:pointer}.chat-container #bubbles .bubble:not(.forwarded).hide-name .name,.chat-container #bubbles .bubble.emoji-big .name{display:none}.chat-container #bubbles .bubble .name{cursor:pointer}.chat-container #bubbles .bubble>.name{padding:.32rem .6rem 0 .6rem;font-weight:500;color:#50a2e9;font-size:.9rem;width:max-content;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-container #bubbles .bubble:not(.webpage).photo .name,.chat-container #bubbles .bubble:not(.webpage).video .name{padding-bottom:6px}.chat-container #bubbles .bubble:not(.webpage).photo .message:not(.message-empty),.chat-container #bubbles .bubble:not(.webpage).video .message:not(.message-empty){padding-top:6px}.chat-container #bubbles .bubble.hide-name:not(.is-reply) .message:not(.message-empty){padding-top:6px}.chat-container #bubbles .bubble.hide-name:not(.sticker):not(.emoji-big) .reply{margin-top:6px}.chat-container #bubbles .bubble:not(.sticker):not(.emoji-big):not(.round):last-child:after{position:absolute;bottom:-1px;width:11px;height:20px;background-repeat:no-repeat repeat;content:'';background-size:11px 20px}.chat-container #bubbles .bubble+.bubble{margin-top:5px}.chat-container #bubbles .in,.chat-container #bubbles .out{display:flex;flex-direction:column;padding:5px 0}.chat-container #bubbles .in{align-items:flex-start}.chat-container #bubbles .in a{color:#50a2e9}.chat-container #bubbles .in .quote:hover,.chat-container #bubbles .in .reply:hover{background-color:rgba(112,117,121,0.08)}.chat-container #bubbles .in .bubble.is-reply.emoji-big .box,.chat-container #bubbles .in .bubble.is-reply.emoji-big .reply,.chat-container #bubbles .in .bubble.is-reply.sticker .box,.chat-container #bubbles .in .bubble.is-reply.sticker .reply{left:calc(100% + 10px);background-color:#fff}.chat-container #bubbles .in .quote{border-left:2px #50a2e9 solid}.chat-container #bubbles .in .quote *{overflow:hidden;text-overflow:ellipsis}.chat-container #bubbles .in .quote .name,.chat-container #bubbles .in .reply-title{color:#50a2e9}.chat-container #bubbles .in .time{color:#a3adb6;width:36px}.chat-container #bubbles .in .time .inner{padding:0 7px 0 5px;margin-bottom:4px}.chat-container #bubbles .in .bubble{background-color:#ffffff;border-radius:6px 12px 12px 6px}.chat-container #bubbles .in .bubble:first-child{border-radius:12px 12px 12px 6px}.chat-container #bubbles .in .bubble:last-child{border-radius:6px 12px 12px 0px}.chat-container #bubbles .in .bubble:last-child:after{left:-8.4px;background-image:url(\" + ___CSS_LOADER_URL___1___ + \")}.chat-container #bubbles .in .bubble:first-child:last-child{border-radius:12px 12px 12px 0px}.chat-container #bubbles .in .bubble.forwarded .attachment,.chat-container #bubbles .in .bubble.is-reply .attachment,.chat-container #bubbles .in .bubble:not(.hide-name) .message-empty+.attachment{border-top-left-radius:0;border-top-right-radius:0}.chat-container #bubbles .out{align-items:flex-end}.chat-container #bubbles .out .quote:hover,.chat-container #bubbles .out .reply:hover{background-color:rgba(77,205,94,0.12)}.chat-container #bubbles .out .bubble.is-reply.emoji-big .box,.chat-container #bubbles .out .bubble.is-reply.emoji-big .reply,.chat-container #bubbles .out .bubble.is-reply.sticker .box,.chat-container #bubbles .out .bubble.is-reply.sticker .reply{background-color:#eeffde;right:calc(100% + 10px);border-color:rgba(77,205,94,0.12)}.chat-container #bubbles .out .quote{border-left:2px #50af4f solid}.chat-container #bubbles .out .reply-border{background-color:#50af4f}.chat-container #bubbles .out .quote .name,.chat-container #bubbles .out .reply-title{color:#50af4f}.chat-container #bubbles .out .time{color:#50af4f;width:50px;display:inline-block}.chat-container #bubbles .out .time .inner{padding:0 4px 0 4px;bottom:1px}.chat-container #bubbles .out .bubble .time .tgico:after{font-size:19px;vertical-align:middle;margin-left:1px}.chat-container #bubbles .out .bubble.forwarded .name{color:#50af4f}.chat-container #bubbles .out .bubble.is-read .time .tgico:after{content:\\\"\\\"}.chat-container #bubbles .out .bubble.is-sent .time .tgico:after{content:\\\"\\\"}.chat-container #bubbles .out .bubble.is-sending .time .tgico:after{content:\\\"\\\"}.chat-container #bubbles .out .bubble.is-reply .name{display:none}.chat-container #bubbles .out .bubble.is-edited .time{width:85px}.chat-container #bubbles .out .bubble{background-color:#eeffde;border-radius:12px 6px 6px 12px}.chat-container #bubbles .out .bubble:first-child{border-radius:12px 12px 6px 12px}.chat-container #bubbles .out .bubble:last-child{border-radius:12px 6px 0px 12px}.chat-container #bubbles .out .bubble:last-child:after{right:-8.4px;background-image:url(\" + ___CSS_LOADER_URL___2___ + \")}.chat-container #bubbles .out .bubble:first-child:last-child{border-radius:12px 12px 0px 12px}.chat-container #bubbles .out .bubble.forwarded .attachment,.chat-container #bubbles .out .bubble.is-reply .attachment{border-top-left-radius:0;border-top-right-radius:0}.chat-container #bubbles .out .user-avatar{left:auto;right:-2.5rem}.chat-container #bubbles .out .audio-waveform rect{fill:#B8DDA9}.chat-container #bubbles .out .audio-waveform rect.active{fill:#68AB5A}.chat-container #bubbles .out .audio-time{color:#68AB5A}.chat-container #bubbles .out .audio-toggle,.chat-container #bubbles .out .audio-download{background-color:#4FAE4E}.chat-container #chat-input{display:flex;align-items:center;width:100%;max-width:700px;padding-top:.35rem;padding-bottom:1rem;justify-content:space-between;flex:0 0 auto;position:relative}.chat-container #chat-input #input-message{background:none;border:none;width:100%;padding:.5rem .5rem;font-size:.95rem;max-height:30rem;overflow-y:none;resize:none;border:none;outline:none;cursor:text}.chat-container #chat-input [contenteditable=true]:empty:before{content:attr(data-placeholder);color:#9e9e9e;display:block}.chat-container #chat-input .btn-circle{flex:0 0 auto;font-size:1.5rem;line-height:1.5rem;height:3.25rem;width:3.25rem;color:#9e9e9e;background-color:#fff;align-self:flex-end}.chat-container #chat-input .btn-circle.tgico-send{color:#50a2e9}.chat-container #chat-input .os-scrollbar-handle{background:rgba(0,0,0,0.2)}.chat-container .input-message{display:flex;align-items:center;flex-direction:column;width:calc(100% - 3.75rem);justify-content:center;background-color:#fff;border-radius:12px;border-bottom-right-radius:0;box-shadow:0 1px 2px 0 rgba(16,35,47,0.07);margin-right:9px;padding:4.5px .5rem;min-height:3.25rem;max-height:30rem;caret-color:#4EA4F6;flex:1;position:relative}.chat-container .input-message:after{position:absolute;bottom:-1px;width:11px;height:20px;background-repeat:no-repeat repeat;content:'';background-size:11px 20px;right:-9px;background-image:url(\" + ___CSS_LOADER_URL___1___ + \");transform:scaleX(-1)}.chat-container .input-message #attach-file.menu-open{color:#50a2e9}.chat-container .input-message>div{display:flex;justify-content:space-between;align-items:center;width:100%}.chat-container .input-message .reply-wrapper{justify-content:flex-start;overflow:hidden;transition:.2s all;height:0px}.chat-container .input-message .reply-wrapper.active{height:39px}.chat-container .input-message .reply-wrapper .reply{width:100%;margin-left:.5rem;min-height:35px}.chat-container .input-message .new-message-wrapper{align-items:flex-end}.chat-container .input-message .new-message-wrapper .btn-icon:before{vertical-align:bottom}.chat-container .input-message .input-message-container{width:1%;max-height:inherit;flex:1 1 auto;position:relative;overflow:hidden}.chat-container .input-message .btn-icon{display:block;color:#9e9e9e;font-size:1.5rem;line-height:1.5rem;transition:.2s color;flex:0 0 auto}.chat-container .input-message .btn-icon.active{color:#50a2e9}.chat-container .input-message .emoji{font-size:24px;height:24px;width:24px}.chat-container .pinned-message,.chat-container .reply{cursor:pointer;display:flex;flex-direction:row;align-items:center;overflow:hidden;box-sizing:border-box;width:187px;margin-right:1rem;max-height:35px;position:relative}.chat-container .pinned-message.is-reply-media .pinned-message-content,.chat-container .pinned-message.is-reply-media .reply-content,.chat-container .reply.is-reply-media .pinned-message-content,.chat-container .reply.is-reply-media .reply-content{padding-left:40px}.chat-container .pinned-message:hover,.chat-container .reply:hover{background-color:rgba(112,117,121,0.08)}.chat-container .pinned-message-border,.chat-container .reply-border{height:32px;border-radius:1px;min-width:2px;background:#50a2e9}.chat-container .pinned-message-content,.chat-container .reply-content{margin-left:8px;flex-grow:1;flex-shrink:1;overflow:hidden;pointer-events:none;position:relative;height:32px;display:flex;flex-direction:column;justify-content:space-between}.chat-container .pinned-message-title,.chat-container .reply-title{color:#50a2e9}.chat-container .pinned-message-title,.chat-container .pinned-message-subtitle,.chat-container .reply-title,.chat-container .reply-subtitle{font-size:14px;line-height:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.chat-container .pinned-message-subtitle,.chat-container .reply-subtitle{white-space:nowrap;color:#111}.chat-container .pinned-message-media,.chat-container .reply-media{height:32px;width:32px;border-radius:8px;overflow:hidden;position:absolute;left:0;top:0;background-repeat:no-repeat;background-size:cover;background-position:center center}.chat-container .pinned-message img.emoji,.chat-container .reply img.emoji{height:16px;width:16px;vertical-align:top}.chat-container .pinned-message span.emoji,.chat-container .reply span.emoji{font-size:16px;vertical-align:unset}#bubble-contextmenu{position:fixed;right:auto;bottom:auto}.emoji-dropdown{position:absolute;left:0;top:calc(-420px + -0.75rem);display:flex;flex-direction:column;width:420px;height:420px;background:#fff;box-shadow:0px 5px 10px 5px rgba(16,35,47,0.14);border-radius:12px;z-index:2;display:flex;overflow:hidden;transition:all 0.2s ease-out;transform:scale(0);transform-origin:0 100%}.emoji-dropdown.active{transition:all 0.2s ease-in;transform:scale(1)}.emoji-dropdown>.menu-horizontal{padding:0 3rem}.emoji-dropdown .emoji-container{width:100%;max-width:100%;overflow:hidden;height:100%}.emoji-dropdown .tabs-container{height:100%}.emoji-dropdown .tabs-container .emoji-category{font-size:2.25rem;line-height:2.25rem;margin-top:1px}.emoji-dropdown .tabs-container .emoji-category>*{margin:0;padding:5px 5px;line-height:inherit;border-radius:8px;cursor:pointer;user-select:none;-webkit-user-select:none;width:44px;height:44px}.emoji-dropdown .tabs-container .emoji-category>* .emoji{width:100%;height:100%}.emoji-dropdown .tabs-container .emoji-category>*:hover{background-color:rgba(112,117,121,0.08)}.emoji-dropdown .tabs-container .emoji-category,.emoji-dropdown .tabs-container .sticker-category{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap}.emoji-dropdown .tabs-container .emoji-category::after,.emoji-dropdown .tabs-container .sticker-category::after{content:\\\"\\\";flex:auto}.emoji-dropdown .tabs-container .sticker-category>div{width:80px;height:80px;display:flex;align-items:center;cursor:pointer;user-select:none;-webkit-user-select:none;padding:1px 2.5px;justify-content:center;border-radius:12px}.emoji-dropdown .tabs-container .sticker-category>div:hover{background-color:rgba(112,117,121,0.08)}.emoji-dropdown .tabs-container .sticker-category>div>*{max-width:100%;max-height:100%}.emoji-dropdown .tabs-container>div{min-height:100%;flex-direction:column;height:100%}.emoji-dropdown .tabs-container>div>div:first-of-type{flex:1;padding:0;padding-top:10px}.emoji-dropdown .tabs-container .scrollable{padding:0 10px}.emoji-dropdown .emoji-padding .menu-horizontal{border-top:1px solid #dadce0}.emoji-dropdown .emoji-padding .menu-horizontal,.emoji-dropdown .stickers-padding .menu-horizontal{height:50px;border-bottom:none;padding:0;width:100%}.emoji-dropdown .emoji-padding .menu-horizontal li,.emoji-dropdown .stickers-padding .menu-horizontal li{padding:0;width:50px;height:50px;line-height:50px;display:flex;align-items:center}.emoji-dropdown .emoji-padding .menu-horizontal li.active:after,.emoji-dropdown .stickers-padding .menu-horizontal li.active:after{display:none}.emoji-dropdown .emoji-padding .menu-horizontal>li{font-size:1.65rem}.emoji-dropdown .stickers-padding .menu-wrapper{padding:0;height:50px;max-width:100%;border-top:1px solid #dadce0}.emoji-dropdown .stickers-padding .menu-wrapper .menu-horizontal{width:100%;height:100%}.emoji-dropdown .stickers-padding li{flex:0 0 auto}.emoji-dropdown .stickers-padding li.active:not(.tgico-recent){background-color:rgba(112,117,121,0.08)}.emoji-dropdown .stickers-padding li>*{padding:.75rem;max-width:100%;max-height:100%;width:100%;height:100%}.popup.popup-delete-message .popup-header{margin-bottom:1rem}.popup .popup-buttons{display:flex;flex-direction:column;justify-content:flex-end;align-items:flex-end}.popup .popup-buttons button{background:none;outline:none;border:none;padding:.5rem .5rem;text-transform:uppercase;transition:.2s;border-radius:8px;cursor:pointer;color:#50a2e9}.popup .popup-buttons button:hover{background-color:rgba(112,117,121,0.08)}.popup .popup-buttons button+button{margin-top:.5rem}.sidebar{background-color:#fff;overflow:hidden}.sidebar-left{border-right:1px solid #DADCE0}.sidebar-right{border-left:1px solid #DADCE0}.sidebar-header{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1.25rem;min-height:60px}.sidebar-header .sidebar-title{flex:1;padding-left:2rem;font-weight:500;font-size:1.4rem}.sidebar-header .btn-icon+.btn-icon{margin-left:.5rem}.profile-content .profile-name{text-align:center;font-size:23px;font-weight:500;margin:3px 0}.profile-content .profile-name span.emoji{vertical-align:inherit;min-width:min-content}.profile-content .profile-subtitle{text-align:center;color:#707579;font-size:14px;margin:0 0 18px}.profile-content .profile-subtitle.online{color:#50a2e9}.profile-content .profile-row{display:flex;width:100%;flex-direction:column;padding-left:80px;padding-top:2px;padding-right:12px;font-size:15px;position:relative;margin:1.75rem 0}.profile-content .profile-row:before{position:absolute;left:24px;font-size:24px;color:#707579}.profile-content .profile-row p{color:#000;margin:0}.profile-content .profile-row .profile-row-label{color:#9e9e9e;font-size:14px;margin-top:1px}.profile-content .profile-row-bio .emoji{width:24px;height:24px}.profile-content .user-avatar{width:120px;height:120px;margin:0 auto 20px;font-size:4rem !important}.profile-content [type=\\\"checkbox\\\"]+span{padding-left:54px;margin-left:-54px}.profile-content .content-container{width:100%;max-width:100%;overflow:hidden}.profile-content .profile-tabs{margin-top:40px}.profile-content .profile-tabs-content #content-media{width:100%;display:flex;flex-direction:column}.profile-content .profile-tabs-content #content-media>div{display:grid;grid-template-columns:1fr 1fr 1fr;grid-auto-rows:max-content;grid-gap:3.5px;place-items:start}.profile-content .profile-tabs-content #content-media>div+div{margin-top:3.5px}.profile-content .profile-tabs-content #content-media>div>div{width:100%;cursor:pointer;background-repeat:no-repeat;background-size:cover;background-position:center center}.profile-content .profile-tabs-content #content-media>div>div::before{content:\\\"\\\";display:inline-block;width:1px;height:0;padding-bottom:100%}.profile-content .profile-tabs-content #content-docs{padding:7px 20px}.profile-content .profile-tabs-content #content-docs .document{padding-left:4rem;padding-right:1rem;height:calc(50px + 1.5rem)}.profile-content .profile-tabs-content #content-docs .document-ico,.profile-content .profile-tabs-content #content-docs .document-download{width:48px;height:48px}.profile-content .profile-tabs-content #content-docs .document-name{font-weight:normal;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis}.profile-content .profile-tabs-content #content-links{padding:0 30px 15px 15px}.profile-content .profile-tabs-content #content-links>div{display:flex;flex-direction:column;margin-top:20px;margin-left:5px;padding-bottom:2px;position:relative;padding-left:60px;overflow:hidden;min-height:58px}.profile-content .profile-tabs-content #content-links>div .preview{height:48px;width:48px;border-radius:5px;overflow:hidden;position:absolute;left:0;top:0;background-repeat:no-repeat;background-size:cover;background-position:center center}.profile-content .profile-tabs-content #content-links>div .preview.empty{display:flex;align-items:center;justify-content:center;font-size:2rem;color:#fff;text-transform:uppercase;background-color:#50a2e9}.profile-content .profile-tabs-content #content-links>div .url{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.profile-content .profile-tabs-content #content-links .title{font-size:16px;margin-top:3px}.profile-content .profile-tabs-content #content-links .subtitle{font-size:14px}.profile-content .profile-tabs-content #content-audio{padding:0 15px 15px 15px}.profile-content .profile-tabs-content #content-audio>div{margin-top:15px;padding-bottom:10px;min-height:60px}.chats-container{display:flex;flex-direction:column}.chats-container .sidebar-content{width:100%;max-height:100%;height:100%;overflow:hidden;display:flex;position:relative}.chats-container .sidebar-content>div{width:100%}.chats-container #chats-container{max-height:100%;overflow:hidden;position:relative}.chats-container #search-container,.chats-container #chats-archived-container{display:none;width:100%;max-height:100%;height:100%;overflow:hidden;position:absolute;left:0;top:0;z-index:3;background:#fff}.chats-container #search-container.active,.chats-container #chats-archived-container.active{display:flex}.chats-container .sidebar-header__btn-container{position:relative;width:39.75px;height:39px}.chats-container .sidebar-header__btn-container>*{visibility:hidden;opacity:0;position:absolute;left:0;top:0;transition:.2s opacity;z-index:2}.chats-container .sidebar-header__btn-container>*:before{transition:.2s transform;transform:rotate(180deg)}.chats-container .sidebar-header__btn-container>*+*{margin-left:0 !important}.chats-container .sidebar-header__btn-container>*.active{margin-top:1px;opacity:1;visibility:visible;color:#707579}.chats-container .sidebar-header__btn-container>*.active:before{transform:rotate(0deg)}.chats-container .sidebar-tools-button .btn-menu{width:217px}.chats-container .sidebar-tools-button .btn-menu .archived-count{border-radius:12px;min-width:24px;padding:0 8px;height:24px;text-align:center;line-height:24px;color:#fff;font-weight:500;background-color:#c5c9cc;justify-self:flex-end;position:absolute;right:16px}.chats-container .sidebar-tools-button .btn-menu .archived-count:empty{display:none}.chats-container .search-group{width:100%;border-bottom:1px solid #DADCE0;padding:1rem 0 .5rem;margin-bottom:.5rem}.chats-container .search-group__name{color:#707579;padding:0 1.85rem;padding-bottom:1rem}.media-viewer{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.9);display:flex;align-items:center;justify-content:center}.media-viewer-author{position:absolute;top:0;left:0;height:60px;padding:8px 8px 8px 80px;display:flex;flex-direction:column;justify-content:center;color:#8b8b8b;transition:.2s}.media-viewer-author:hover{color:#fff}.media-viewer-author .user-avatar{width:44px;height:44px;position:absolute;top:8px;left:20px}.media-viewer-author .media-viewer-name{font-weight:500}.media-viewer-author .media-viewer-date{font-size:15px}.media-viewer-buttons{position:absolute;top:0;right:0;display:flex;flex-flow:row nowrap;padding:8px}.media-viewer-buttons .btn-icon{margin:0 .25rem;transition:.2s}.media-viewer-buttons .btn-icon:hover{color:#fff}.media-viewer-content{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;max-height:100%;max-width:100%;overflow:hidden}.media-viewer-content .media-viewer-stub{flex:1}.media-viewer-content .media-viewer-container{align-self:center;position:relative;max-width:100%;max-height:100%;overflow:hidden;flex:1 1 auto;display:flex;align-items:center}.media-viewer-content .media-viewer-media{display:flex;align-items:center;justify-content:center;visibility:hidden}.media-viewer-content .media-viewer-media.loading img,.media-viewer-content .media-viewer-media.loading video{object-fit:cover;width:100%;height:100%}.media-viewer-content img,.media-viewer-content video{max-height:calc(100vh - 100px);max-width:calc(100vw - 16px)}.media-viewer-content img{object-fit:contain}.media-viewer-content video{width:100%;height:100%;object-fit:contain}.media-viewer-content .media-viewer-caption{flex:1;text-align:center;display:flex;flex-direction:column;justify-content:center;align-items:center;color:#707579;transition:.2s}.media-viewer-content .media-viewer-caption:hover{color:#fff}.media-viewer-switcher-left,.media-viewer-switcher-right{position:absolute;left:0;top:0;width:10rem;height:100%;cursor:pointer;z-index:5}.media-viewer-switcher-left:hover>span,.media-viewer-switcher-right:hover>span{opacity:1}.media-viewer-switcher-right{left:auto;right:0}.media-viewer-prev-button,.media-viewer-next-button{cursor:pointer;position:absolute;color:#fff;font-size:3rem;left:2rem;top:50%;transform:translateY(-50%) rotate(90deg);opacity:0;transition:.2s opacity;z-index:5}.media-viewer-next-button{left:auto;right:2rem;transform:translateY(-50%) rotate(-90deg)}.media-viewer-mover{position:fixed !important;z-index:4;display:flex;justify-content:center;min-height:auto !important;left:0;top:0;transform-origin:top left;overflow:hidden;background-repeat:no-repeat;background-size:cover;background-position:center center}.media-viewer-mover .ckin__player{width:100%;height:100%}.media-viewer-mover img,.media-viewer-mover video{width:100%;height:100%;opacity:1;transition:.2s opacity;user-select:none}.media-viewer-mover.cover{align-items:center}.media-viewer-mover.cover img,.media-viewer-mover.cover video{width:auto;height:auto;overflow:hidden;opacity:0}.media-viewer-mover.active{transition:.2s transform}.media-viewer-mover.moving{transition:350ms transform ease}.ckin__player{letter-spacing:0.02em}.ckin__overlay{position:relative}.ckin__overlay:before{background:radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.5) 100%)}.ckin__overlay--2:before{background:rgba(24,24,24,0.8)}.ckin__player.ckin__fullscreen{position:fixed;top:0;left:0;right:0;bottom:0;height:100%;width:100%;z-index:10000000;background:#000;border-radius:0 !important;display:-ms-flexbox;display:flex}.ckin__player.ckin__fullscreen video{max-height:none;max-width:none}.default{border:0 solid rgba(0,0,0,0.2);box-shadow:0 0 20px rgba(0,0,0,0.2);position:relative;font-size:0;overflow:hidden;cursor:pointer}.default:before{content:'';position:absolute;top:0;left:0;bottom:0;right:0;transition:opacity .2s;opacity:1;visibility:visible}.default__title{position:absolute;left:20px;top:20px;z-index:1;font-size:24px;color:rgba(255,255,255,0.8);font-style:italic}.default__button{background:none;border:0;color:#fff;outline:0;padding:3px 10px 6px 10px;cursor:pointer;font-size:24px;line-height:1;display:flex;align-items:center}.default__button i{-ms-flex-item-align:center;-ms-grid-row-align:center;align-self:center}.default__button--big{background:none;border:0;line-height:1;color:#fff;text-align:center;outline:0;padding:0;cursor:pointer;position:absolute;opacity:1;visibility:visible;top:50%;left:50%;-ms-transform:translate(-50%, -50%) scale(1);transform:translate(-50%, -50%) scale(1);font-size:64px;transition:all .2s;-ms-touch-action:manipulation;touch-action:manipulation}.default__slider{width:10px;height:30px}.default__controls{position:absolute;bottom:0;right:0;left:0;transition:all .3s;text-align:left;direction:ltr;border-radius:0 0 5px 5px;z-index:6}.default__gradient-bottom{height:49px;padding-top:93px;bottom:0;z-index:2;background-position:bottom;width:100%;position:absolute;background-repeat:repeat-x;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==);-moz-transition:all .3s;-webkit-transition:all .3s;transition:all .3s;pointer-events:none}.default.is-playing .default__gradient-bottom{-ms-transform:translateY(50px);transform:translateY(50px)}.default.is-playing:hover .default__gradient-bottom{-ms-transform:translateY(0px);transform:translateY(0px)}.default.is-playing:before{opacity:0;visibility:hidden;-ms-transform:translate(-50%, -50%) scale(1.3);transform:translate(-50%, -50%) scale(1.3)}.default.is-playing .default__button--big{opacity:0;visibility:hidden}.default.is-playing .default__controls{-ms-transform:translateY(52px);transform:translateY(52px)}.default.is-playing:hover .default__controls{-ms-transform:translateY(0);transform:translateY(0)}.default .progress{position:relative;margin:0 16px;height:5px;transition:height 0.3s;background:rgba(255,255,255,0.38);cursor:pointer;border-radius:4px;overflow:visible}.default .progress__filled{background:#63a2e3;transform-origin:left;border-radius:4px;height:5px;transform:scaleX(0)}@media (max-width: 480px){.ckin__player button{font-size:18px}}video::-webkit-media-controls-enclosure{display:none !important}.progress input{-webkit-appearance:none;-moz-appearance:none;background:transparent;height:4.5px;cursor:pointer;padding:0;outline:none}.progress input[type=range]:focus{outline:none}.progress input[type=range]::-webkit-slider-runnable-track{width:100%;cursor:pointer;border-radius:1.3px;-webkit-appearance:none;transition:all 0.4s ease}.progress input[type=range]::-webkit-slider-thumb{height:15px;width:15px;border-radius:16px;background:#63a2e3;cursor:pointer;-webkit-appearance:none;margin-left:-1px}.progress input[type=range]:focus::-webkit-slider-runnable-track{background:transparent}.progress input[type=range]::-moz-range-track{width:100%;height:8.4px;cursor:pointer;border:1px solid transparent;background:transparent;border-radius:1.3px}.progress input[type=range]::-moz-range-thumb{height:14px;width:14px;border-radius:50px;border:1px solid #63a2e3;background:#63a2e3;cursor:pointer;margin-top:5px}.progress input[type=range]:focus::-moz-range-track{outline:none}input[type=range]::-ms-track{visibility:hidden}input[type=range]::-ms-ticks{background:none;color:none;border:none}input[type=range]::-ms-thumb{visibility:hidden}input[type=range]::-ms-tooltip{visibility:hidden}.seek{position:absolute;top:0;width:100%;cursor:pointer;margin:0}.seek:hover+.seek-tooltip{display:block}.left-controls{display:flex;align-items:center}.right-controls{float:right}.bottom-controls{padding:3px 4px 0px 4px;display:flex;justify-content:space-between;align-items:center}.time{float:right;padding:7px 0px 9px 14px;font-size:15px;color:white}.circle .circle-time{color:#fff;font-size:13px;float:left}.circle .circle-time-left{position:absolute;top:3px;left:2px;border-radius:12px;background-color:rgba(0,0,0,0.23);padding:1px 7px 2px 7px;z-index:2;display:flex;align-items:center}video[data-ckin=\\\"circle\\\"]{border-radius:50%;overflow:hidden}.progress-ring{position:absolute;top:0;left:0;cursor:pointer}.progress-ring__circle{transition:stroke-dashoffset}.ckin__player.circle{position:relative;width:200px;height:200px}.iconVolume{padding:0 1px 0 3px;display:flex;align-items:center;font-size:1.25rem;color:#fff}html,body{height:100%;width:100%}html{font-size:15px}a{color:#50a2e9}button,input,optgroup,select,textarea,html{font-family:\\\"Roboto\\\", -apple-system, BlinkMacSystemFont, \\\"Segoe UI\\\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \\\"Helvetica Neue\\\", sans-serif}.whole{height:100vh;min-height:100vh;width:100%;min-width:100%}.container{margin:0 auto}h1,h2,h3,h4,h5,h6{letter-spacing:-.66px;font-weight:500}h4{font-size:2.28rem;margin:1.52rem 0 .912rem 0;line-height:110%}input{caret-color:#4EA4F6}.subtitle{font-size:1rem;color:#9e9e9e;line-height:1.25}.page-sign .input-wrapper,.page-authCode .input-wrapper,.page-signUp .input-wrapper,.page-password .input-wrapper{margin-top:3rem}.page-authCode .phone-wrapper{display:flex;align-items:center;justify-content:center;margin:1.52rem 0 0.912rem 0}.page-authCode .phone-wrapper h4{margin:0}.page-authCode .phone-wrapper h4[contenteditable=\\\"true\\\"]{padding:0 1rem;border:none;outline:none;padding:0 1rem;border-bottom:2px solid #4EA4F6}.page-authCode .phone-wrapper .phone.error{border-color:#E53935 !important}.btn-icon{text-align:center;font-size:1.65rem;line-height:1.65rem;border-radius:50%;-webkit-transition:background-color .15s ease-out;transition:background-color .15s ease-out;color:#707579;cursor:pointer;background:none;border:none;padding:.5rem;position:relative;display:flex;align-items:center;justify-content:center}.btn-icon.active{color:#50a2e9}.btn-icon:hover{background-color:rgba(112,117,121,0.08)}.danger{color:#E53935 !important}.btn-menu-toggle{position:relative;overflow:visible}.btn-menu-toggle.menu-open{background-color:rgba(112,117,121,0.08)}.btn-menu{visibility:hidden;position:absolute;background:#fff;box-shadow:0 5px 8px 1px rgba(0,0,0,0.24);z-index:3;top:100%;margin-top:8px;padding:9px 0;border-radius:8px;opacity:0;transform:scale(0.8);transition-property:opacity,transform,visibility;transition-duration:.2s;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);font-size:16px}.btn-menu.active{visibility:visible;opacity:1;transform:scale(1)}.btn-menu.bottom-left{right:0;top:100%;transform-origin:top right}.btn-menu.bottom-right{left:0;top:100%;transform-origin:top left}.btn-menu.top-left{top:initial;right:0;bottom:100%;transform-origin:bottom right}.btn-menu.top-right{top:initial;left:0;bottom:100%;transform-origin:bottom left}.btn-menu>div{display:flex;position:relative;padding:0 40px 0 20px;height:56px;cursor:pointer;background-position:16px center;background-size:24px 24px;background-repeat:no-repeat;color:#000;text-transform:none;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;align-items:center}.btn-menu>div:hover{background-color:rgba(112,117,121,0.06)}.btn-menu>div:before{color:#707579;font-size:1.5rem;margin-right:35px}.btn-menu>div.danger:before{color:#E53935}.user-avatar{color:#fff;width:54px;height:54px;line-height:54px;border-radius:50%;background-color:#4EA4F6;text-align:center;font-size:1.25em;position:relative;user-select:none;display:flex;align-items:center;justify-content:center}.user-avatar img{width:100%;height:100%;border-radius:inherit;user-select:none}.user-avatar[class*=\\\" tgico-\\\"]{line-height:52px;font-size:1.5rem}.user-avatar path{fill:white}.user-avatar.is-online:after{position:absolute;content:\\\" \\\";display:block;border-radius:50%;border:2px solid white;background-color:#4DCD5E;left:70%;top:79%;width:12px;height:12px}.user-title,b,.user-last-message b{color:#000;font-weight:normal}.rp{position:relative}.c-ripple{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;background:transparent;border-radius:inherit}.c-ripple__circle{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);opacity:0;width:0;height:0;border-radius:50%;background:rgba(112,117,121,0.08)}.c-ripple.active .c-ripple__circle{will-change:padding-bottom, width, opacity;-webkit-animation:a-ripple 625ms ease-in-out;animation:a-ripple 625ms ease-in-out}@-webkit-keyframes a-ripple{0%{opacity:0}25%{opacity:1}100%{width:200%;padding-bottom:200%;opacity:0}}@keyframes a-ripple{0%{opacity:0}25%{opacity:1}100%{width:200%;padding-bottom:200%;opacity:0}}.document{padding-left:4.5rem;height:70px}.document-ico,.document-download{font-weight:500;letter-spacing:1px;font-size:1.1rem;background-size:contain;overflow:hidden;text-overflow:ellipsis}.document-download{background-color:#65a1e3;border-radius:8px}.document:not(.photo) .document-ico{padding-top:1.5rem;background-image:url(\" + ___CSS_LOADER_URL___3___ + \")}.document.photo .document-ico{border-radius:8px}.document-name{white-space:nowrap;font-weight:500;line-height:1.3}.document-size{white-space:nowrap;color:#707579;font-size:14px;padding-right:32px;line-height:1.3}.document,.audio{display:flex;flex-direction:column;justify-content:center;cursor:pointer;position:relative}.document-ico,.document-download,.audio-ico,.audio-download{position:absolute;left:0;width:54px;height:54px;color:#fff;display:flex;justify-content:center}.document-download,.audio-download{z-index:2;align-items:center;font-size:24px;cursor:pointer}.document-download .tgico-download,.audio-download .tgico-download{transform:scale(1);transition:.2s scale}.document-download.downloading .tgico-download,.audio-download.downloading .tgico-download{transform:scale(0)}.document .preloader-container,.audio .preloader-container{width:42px;height:42px}.audio{position:relative;padding-left:67px;min-height:58px;max-width:286px;overflow:visible !important}.audio-toggle,.audio-download{border-radius:50%;background-color:#50a2e9;font-size:2.2rem;align-items:center}.audio-download{z-index:2}.audio-waveform{height:23px}.audio-waveform rect{fill:#CBCBCB}.audio-waveform rect.active{fill:#50a2e9}.audio-time{font-size:14px;color:#707579;margin-top:3px;margin-left:-1px}.page-signUp .auth-image{border-radius:50%;cursor:pointer;position:relative;overflow:hidden}.page-signUp .auth-image canvas{max-width:100%;max-height:100%;width:100%;height:100%;background-color:#4EA4F6}.page-signUp .auth-image svg{position:absolute;width:36px;height:36px;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);z-index:2}.input-wrapper{width:350px;margin:0 auto}.input-field{position:relative}.input-field .arrow-down{position:absolute;content:\\\" \\\";top:50%;bottom:0;right:15px;cursor:pointer;height:0;width:0;border:solid #bdbdbd;border-radius:1px;border-width:0 2px 2px 0;display:inline-block;padding:4px;vertical-align:middle;z-index:2;margin-top:-7px;transform:rotate(45deg);-webkit-transform:rotate(45deg);transition:.2s all}.input-field label{position:absolute;color:#9e9e9e;left:12.5px;right:auto;z-index:2;top:50%;transform:translateY(-50%);background-color:#fff;font-size:0.85rem;transition:.2s all, .1s opacity;display:inline-block;cursor:text}.input-field input{border:1px solid #DADCE0;border-radius:8px;padding:0 12.5px;box-sizing:border-box;font-size:0.85rem;width:100%;height:45px;transition:.2s border-color;position:relative;z-index:1}.input-field input:focus{border-color:#4EA4F6;border-width:1.5px;padding:0 12px}.input-field input:disabled{background-color:#fff;color:#000}.input-field input.error{border-color:#E53935;transition:.2s border-width}.input-field input.error+label{color:#E53935 !important}.input-field input:focus ~ .arrow-down{margin-top:-2px;transform:rotate(225deg);-webkit-transform:rotate(225deg);border-color:#4EA4F6}.input-field input:focus+label{color:#4EA4F6}.input-field input:focus+label,.input-field input:valid+label,.input-field input:disabled+label{top:-8.5px;transform:none;padding:0 5px;left:7.5px;font-size:0.85rem !important;opacity:1}.checkbox-field{margin:1rem 0;display:block;text-align:left;padding:0 1rem;position:relative}[type=\\\"checkbox\\\"]{position:absolute;opacity:0;pointer-events:none;-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=\\\"checkbox\\\"]+span{position:relative;padding-left:35px;cursor:pointer;display:inline-block;height:25px;line-height:25px;font-size:1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}[type=\\\"checkbox\\\"]+span:before,[type=\\\"checkbox\\\"]+span:after{content:'';left:0;position:absolute;-webkit-transition:border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s;transition:border .25s, background-color .25s, width .20s .1s, height .20s .1s, top .20s .1s, left .20s .1s}[type=\\\"checkbox\\\"]+span:before{border-radius:2px;z-index:1}[type=\\\"checkbox\\\"]+span:after{height:18px;width:18px;z-index:0;border:2px solid #4EA4F6;border-radius:3px;top:50%;transform:translateY(-50%)}[type=\\\"checkbox\\\"]:not(:checked)+span:before{width:0;height:0;border:2px solid transparent;left:6px;top:10px;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}[type=\\\"checkbox\\\"]:checked+span:before{top:4px;left:-1px;width:8px;height:14px;border-top:2px solid transparent;border-left:2px solid transparent;border-right:2px solid #fff;border-bottom:2px solid #fff;-webkit-transform:rotateZ(45deg);transform:rotateZ(45deg);-webkit-transform-origin:100% 100%;transform-origin:100% 100%}[type=\\\"checkbox\\\"]:not(:checked)+span:after{background-color:transparent}[type=\\\"checkbox\\\"]:checked+span:after{background-color:#4EA4F6}.input-wrapper>* ~ *{margin-top:1.2rem}.select-wrapper{max-height:300px;position:absolute;width:100%;top:calc(100% + 10px);left:0;overflow:hidden;background-color:#fff;z-index:3;border-radius:8px;display:flex;flex-direction:column;flex-wrap:wrap}.select-wrapper ul{margin:10px 0}.select-wrapper li{align-items:center;padding:0 12.5px;justify-content:space-between;height:50px;cursor:pointer;font-weight:500;text-align:left;display:grid;grid-template-columns:15% 60% 25%}.select-wrapper li:hover{background-color:rgba(112,117,121,0.08)}.select-wrapper .emoji{height:24px;width:24px;font-size:24px;line-height:1}.phone-code{color:#9e9e9e;text-align:right}::placeholder{color:#9e9e9e;opacity:1}:-ms-input-placeholder{color:#9e9e9e}::-ms-input-placeholder{color:#9e9e9e}input:focus,button:focus{outline:none}.auth-image{width:133px;height:133px;margin-left:auto;margin-right:auto;margin-bottom:1rem}.phone-edit{display:inline-block;width:24px;height:24px;margin-left:.4rem;opacity:.5;transition:.2s;cursor:pointer;font-size:1.5rem}.phone-edit:hover{opacity:1}.btn-primary{background:#4EA4F6;color:#fff;border-radius:8px;width:100%;text-align:center;font-size:0.85rem;height:45px;border:none;font-weight:500;cursor:pointer;overflow:hidden;position:relative;padding:0}.btn-primary:hover{background:#2790f4}.btn-primary svg,.btn-primary use{height:calc(100% - 20px);right:12.5px;left:auto;margin:auto 0}.preloader-circular{animation:rotate 2s linear infinite;height:100%;transform-origin:center center;position:absolute;top:0;bottom:0;left:0;right:0;margin:auto}.preloader-path{stroke-dasharray:1, 200;stroke-dashoffset:0;animation:dash 1.5s ease-in-out infinite;stroke-linecap:round;stroke:white;stroke-width:3}.preloader-container{position:absolute;top:0;bottom:0;left:0;right:0;margin:auto;width:50px;height:50px}.preloader-container .you-spin-me-round{width:100%;height:100%;animation:rotate 2s linear infinite}.preloader-container .preloader-circular{animation:none;cursor:pointer;background-color:rgba(0,0,0,0.7);border-radius:50%;width:100%;height:100%}.preloader-container .preloader-path-new{stroke-dasharray:5, 200;stroke-dashoffset:0;transition:stroke-dasharray 400ms ease-in-out;stroke-linecap:round;stroke:white;stroke-width:1.5}.preloader-container.preloader-swing{cursor:default}.preloader-container.preloader-swing .preloader-circular{cursor:default}.preloader-container.preloader-swing .preloader-path-new{stroke-dasharray:1, 200;stroke-dashoffset:0;animation:dashNew 1.5s ease-in-out infinite}.preloader-container .preloader-close{cursor:pointer;position:absolute;top:0;left:0;bottom:0;right:0;margin:auto;color:#fff;stroke:#fff;width:34%;height:34%}.preloader-container .preloader-close:hover{background:none}@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35px}100%{stroke-dasharray:89, 200;stroke-dashoffset:-124px}}@keyframes dashNew{0%{stroke-dasharray:1, 200;stroke-dashoffset:0}50%{stroke-dasharray:89, 200;stroke-dashoffset:-35px}100%{stroke-dasharray:89, 200;stroke-dashoffset:-286%}}.emoji{display:inline-block;max-width:100%;max-height:100%;vertical-align:middle;line-height:1em;font-size:1em;font-family:apple color emoji,segoe ui emoji,noto color emoji,android emoji,emojisymbols,emojione mozilla,twemoji mozilla,segoe ui symbol}img.emoji{width:18px;height:18px}.popup{position:fixed !important;left:0;top:0;height:100%;max-width:none;width:100%;z-index:3;background-color:rgba(0,0,0,0.35);margin:0;padding:0;box-shadow:none;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s 0s, visibility 0s 0.3s;-moz-transition:opacity 0.3s 0s, visibility 0s 0.3s;transition:opacity 0.3s 0s, visibility 0s 0.3s;overflow:auto;display:flex;align-items:center;justify-content:center}.popup.active{opacity:1;visibility:visible;-webkit-transition:opacity 0.3s 0s, visibility 0s 0s;-moz-transition:opacity 0.3s 0s, visibility 0s 0s;transition:opacity 0.3s 0s, visibility 0s 0s}.popup-container{position:relative;border-radius:8px;background-color:#fff;padding:1rem;-webkit-transform:translateY(-40px);-moz-transform:translateY(-40px);-ms-transform:translateY(-40px);-o-transform:translateY(-40px);transform:translateY(-40px);backface-visibility:hidden;-webkit-backface-visibility:hidden;-webkit-transition-property:-webkit-transform;-moz-transition-property:-moz-transform;transition-property:transform;-webkit-transition-duration:0.3s;-moz-transition-duration:0.3s;transition-duration:0.3s}span.popup-close{cursor:pointer;color:#707579;z-index:3;text-align:center;justify-self:center;line-height:1;transition:.2s}span.popup-close:hover{color:#000}.popup.active .popup-container{-webkit-transform:translateY(0);-moz-transform:translateY(0);-ms-transform:translateY(0);-o-transform:translateY(0);transform:translateY(0)}.btn-circle{border-radius:50%;width:44px;height:44px}.btn-circle path{fill:white}.popup-header{display:flex;margin-bottom:2rem;align-items:center}.popup-avatar .popup-container{max-width:600px;max-height:600px}.popup-avatar .popup-container>button{position:absolute;bottom:15px;right:15px}.popup-avatar .popup-close{font-size:1.5rem}.popup-avatar h6{font-size:1.1rem;text-align:left;margin:0;margin-left:1.5rem;font-weight:400}.popup-avatar .crop{max-width:200%;max-height:200%;padding:0 2.75rem 2.75rem;border-radius:8px}.popup-avatar .crop img{border-radius:8px}.overlay::selection{background:transparent}.crop-component::selection{background:transparent}.crop-image,.overlay>img{width:auto;height:auto;display:block;object-fit:contain;object-position:center}.crop-image{display:block;position:relative;pointer-events:none}.crop-component{position:relative;z-index:999;background-color:white;margin:0 auto;overflow:hidden}.crop-component>img{max-width:100%}.crop-component .crop-overlay-color{position:absolute;top:0;left:0;width:100%;height:100%;background-color:rgba(255,255,255,0.7);border-radius:8px}.overlay{position:absolute;left:50%;top:50%;z-index:999;margin-left:-100px;margin-top:-100px;width:200px;height:200px;overflow:hidden;box-sizing:content-box;border-radius:50%}.overlay:hover,.overlay:active{cursor:move}.overlay>img{position:absolute;display:block}.overlays{top:0;left:0;width:100%;height:100%;position:fixed !important;background-color:rgba(0,0,0,0.2);z-index:4;opacity:0;visibility:hidden;-webkit-transition:opacity 0.2s 0s, visibility 0s 0.2s;-moz-transition:opacity 0.2s 0s, visibility 0s 0.2s;transition:opacity 0.2s 0s, visibility 0s 0.2s}.overlays.active{opacity:1;visibility:visible;-webkit-transition:opacity 0.2s 0s, visibility 0s 0s;-moz-transition:opacity 0.2s 0s, visibility 0s 0s;transition:opacity 0.2s 0s, visibility 0s 0s}div.scrollable::-webkit-scrollbar{width:0;height:0}div.scrollable::-webkit-scrollbar-thumb{width:0;height:0}::-webkit-scrollbar-button{width:0;height:0;display:none}::-webkit-scrollbar-corner{background-color:transparent}.scrollable{width:100%;height:100%;overflow-y:hidden;overflow-x:hidden;max-height:100%;position:relative}.scrollable.scrollable-x{overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.scrollable.scrollable-y{overflow-y:auto;scrollbar-width:none;-ms-overflow-style:none}.scrollable.scrollable-x ~ .scrollbar-thumb{top:auto;right:auto;width:auto;height:4px;bottom:0px}.scrollbar-thumb{position:absolute;top:0;right:2px;width:4px;background-color:#000;cursor:default;opacity:0;transition-property:opacity,width,right;transition-duration:.2s;transition-timing-function:ease-in-out;border-radius:8px;z-index:2}:hover>.scrollbar-thumb{opacity:.4}[contenteditable]{-webkit-user-select:text;user-select:text}.menu-horizontal{width:100%;color:#707579;margin-top:0px;margin-bottom:0;border-bottom:1px solid #dadce0;display:flex;justify-content:space-around;align-items:center}.menu-horizontal>li{display:inline-block;padding:.75rem 1rem;cursor:pointer;text-align:center;flex:1;user-select:none;font-size:16px}.menu-horizontal>li.active{position:relative;color:#50a2e9}.menu-horizontal>li.active:after{content:'';position:absolute;background:#50a2e9;left:24px;right:24px;bottom:-1px;height:4px;border-top-left-radius:2px;border-top-right-radius:2px}.tabs-container{min-width:100%;display:flex;overflow-x:hidden}.tabs-container.animated{transition:.2s margin-left}.tabs-container>div{width:100%;max-width:100%;overflow:hidden;display:none}.tabs-container>div.active{display:flex;flex-direction:column}.tabs-container>div>div:not(.scroll-padding){width:100%;padding:7.5px;max-width:100%;overflow:hidden;position:relative}.justify-start{justify-content:flex-start}.popup-send-photo .popup-container{width:420px;max-width:420px;max-height:425px;overflow:hidden;padding:12px 20px 32.5px;border-radius:10px}.popup-send-photo .popup-header{justify-content:space-between;align-items:center;margin-bottom:12.5px}.popup-send-photo .popup-header .popup-close{font-size:1.5rem;margin-left:.5rem}.popup-send-photo .popup-header .popup-title{flex:1;padding:0 2rem;margin:0;font-size:1.35rem;font-weight:500}.popup-send-photo .popup-header .btn-primary{width:80px;height:35px;font-size:1rem;padding:0;border-radius:10px}.popup-send-photo .popup-photo{max-width:378px;max-height:256px;display:flex;overflow:hidden;justify-content:center;width:fit-content;border-radius:10px;margin:0 auto}.popup-send-photo .popup-photo.is-document{margin-left:0}.popup-send-photo .popup-photo .document{max-width:100%;overflow:hidden;cursor:default}.popup-send-photo .popup-photo .document .document-name{font-weight:normal;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis}.popup-send-photo .popup-photo img{object-fit:contain}.popup-send-photo .input-field{margin-top:25px}.popup-send-photo .input-field input{height:55px;font-size:1.15rem;padding:0 15px;border-radius:10px}.popup-send-photo .input-field input:focus{padding:0 14.5px}.popup-send-photo .input-field label{font-size:inherit;opacity:0}.page-chats{display:flex;max-height:100vh;min-height:100vh}.page-chats>div{height:100%;position:relative;min-height:100%;max-height:100%}.page-chats .chats-container{width:25%}.page-chats .chat-container{background-color:#e6ebee;width:100%;flex:1}.page-chats .profile-container{width:0%;position:relative;transition:.2s ease-in-out}.page-chats .profile-container>.scrollable{min-width:25vw}.page-chats .preloader{width:50px;height:50px;position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}.page-chats .preloader .preloader-path{stroke:#4EA4F6}.page-password #password{padding-right:2.5rem}.page-password #password[type=\\\"password\\\"]{font-size:2.25rem;padding-left:10px}.page-password .toggle-visible{position:absolute;right:.25rem;z-index:2;top:50%;transform:translateY(-50%);font-size:1.25rem;color:#9e9e9e;cursor:pointer;transition:.2s;padding:.5rem}.page-password .toggle-visible:hover{color:#000}\\n\", \"\"]);\n" }, { "id": 57, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/public/assets/img/camomile.jpg", "name": "./public/assets/img/camomile.jpg", "index": 8, "index2": 5, "size": 43, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "issuerId": 56, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 56, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "profile": { "factory": 536, "building": 3038, "dependencies": 1 } } ], "profile": { "factory": 73, "building": 18 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/img/camomile.jpg" ], "reasons": [ { "moduleId": 56, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "type": "cjs require", "userRequest": "../../public/assets/img/camomile.jpg", "loc": "4:38-85" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/img/camomile.jpg\";" }, { "id": 58, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/img/msg-tail-left.svg", "name": "./src/assets/img/msg-tail-left.svg", "index": 9, "index2": 6, "size": 48, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "issuerId": 56, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 56, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "profile": { "factory": 536, "building": 3038, "dependencies": 1 } } ], "profile": { "factory": 73, "building": 18 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/img/msg-tail-left.svg" ], "reasons": [ { "moduleId": 56, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "type": "cjs require", "userRequest": "../assets/img/msg-tail-left.svg", "loc": "5:38-80" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/img/msg-tail-left.svg\";" }, { "id": 59, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/img/msg-tail-right.svg", "name": "./src/assets/img/msg-tail-right.svg", "index": 10, "index2": 7, "size": 49, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "issuerId": 56, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 56, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "profile": { "factory": 536, "building": 3038, "dependencies": 1 } } ], "profile": { "factory": 73, "building": 18 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/img/msg-tail-right.svg" ], "reasons": [ { "moduleId": 56, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "type": "cjs require", "userRequest": "../assets/img/msg-tail-right.svg", "loc": "6:38-81" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/img/msg-tail-right.svg\";" }, { "id": 60, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/img/doc-in.svg", "name": "./src/assets/img/doc-in.svg", "index": 11, "index2": 8, "size": 41, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "issuerId": 56, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 55, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./src/scss/style.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 56, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "profile": { "factory": 536, "building": 3038, "dependencies": 1 } } ], "profile": { "factory": 73, "building": 18 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/img/doc-in.svg" ], "reasons": [ { "moduleId": 56, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "type": "cjs require", "userRequest": "../assets/img/doc-in.svg", "loc": "7:38-73" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/img/doc-in.svg\";" }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "index": 12, "index2": 16, "size": 510, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "issuerId": 52, "issuerName": "./src/index.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } } ], "profile": { "factory": 633, "building": 0, "dependencies": 536 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 52, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "module": "./src/index.ts", "moduleName": "./src/index.ts", "type": "cjs require", "userRequest": "./scss/tgico.scss", "loc": "22:0-28" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "var content = require(\"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/dist/cjs.js??ref--4-3!./tgico.scss\");\n\nif (typeof content === 'string') {\n content = [[module.id, content, '']];\n}\n\nvar options = {}\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = require(\"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\")(content, options);\n\nif (content.locals) {\n module.exports = content.locals;\n}\n" }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "index": 13, "index2": 15, "size": 5269, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 61, "issuerName": "./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 536, "building": 1483 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 61, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./src/scss/tgico.scss", "moduleName": "./src/scss/tgico.scss", "type": "cjs require", "userRequest": "!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/resolve-url-loader/index.js!../../node_modules/sass-loader/dist/cjs.js??ref--4-3!./tgico.scss", "loc": "1:14-181" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "exports = module.exports = require(\"../../node_modules/css-loader/dist/runtime/api.js\")(false);\n// Imports\nvar getUrl = require(\"../../node_modules/css-loader/dist/runtime/getUrl.js\");\nvar ___CSS_LOADER_URL___0___ = getUrl(require(\"../assets/fonts/tgico.eot\"));\nvar ___CSS_LOADER_URL___1___ = getUrl(require(\"../assets/fonts/tgico.ttf\"));\nvar ___CSS_LOADER_URL___2___ = getUrl(require(\"../assets/fonts/tgico.woff\"));\nvar ___CSS_LOADER_URL___3___ = getUrl(require(\"../assets/fonts/tgico.svg\"));\n// Module\nexports.push([module.id, \"@font-face{font-family:\\\"tgico\\\";src:url(\" + ___CSS_LOADER_URL___0___ + \");src:url(\" + ___CSS_LOADER_URL___0___ + \") format(\\\"embedded-opentype\\\"),url(\" + ___CSS_LOADER_URL___1___ + \") format(\\\"truetype\\\"),url(\" + ___CSS_LOADER_URL___2___ + \") format(\\\"woff\\\"),url(\" + ___CSS_LOADER_URL___3___ + \") format(\\\"svg\\\");font-weight:normal;font-style:normal;font-display:block}[class^=\\\"tgico-\\\"],.tgico:before,.tgico:after,[class*=\\\" tgico-\\\"]:before,[class*=\\\" tgico-\\\"]:after{font-family:\\\"tgico\\\" !important;speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.tgico-check:before{content:\\\"\\\"}.tgico-settings:before{content:\\\"\\\\e901\\\"}.tgico-smallscreen:before{content:\\\"\\\\e902\\\"}.tgico-smile:before{content:\\\"\\\\e903\\\"}.tgico-sport:before{content:\\\"\\\\e904\\\"}.tgico-stop:before{content:\\\"\\\\e905\\\"}.tgico-unarchive:before{content:\\\"\\\\e906\\\"}.tgico-unlock:before{content:\\\"\\\\e907\\\"}.tgico-unmute:before{content:\\\"\\\\e908\\\"}.tgico-unpin:before{content:\\\"\\\\e909\\\"}.tgico-unread:before{content:\\\"\\\\e90a\\\"}.tgico-up:before{content:\\\"\\\\e90b\\\"}.tgico-username:before{content:\\\"\\\\e90c\\\"}.tgico-user:before{content:\\\"\\\\e90d\\\"}.tgico-play:before{content:\\\"\\\\e90e\\\"}.tgico-poll:before{content:\\\"\\\\e90f\\\"}.tgico-radiooff:before{content:\\\"\\\\e910\\\"}.tgico-radioon:before{content:\\\"\\\\e911\\\"}.tgico-recent:before{content:\\\"\\\\e912\\\"}.tgico-reply:before{content:\\\"\\\\e913\\\"}.tgico-revote:before{content:\\\"\\\\e914\\\"}.tgico-savedmessages:before{content:\\\"\\\\e915\\\"}.tgico-search:before{content:\\\"\\\\e916\\\"}.tgico-send:before{content:\\\"\\\\e917\\\"}.tgico-send2:before{content:\\\"\\\\e918\\\"}.tgico-sending:before{content:\\\"\\\"}.tgico-sendingerror:before{content:\\\"\\\\e91a\\\"}.tgico-mute:before{content:\\\"\\\\e91b\\\"}.tgico-newchannel:before{content:\\\"\\\\e91c\\\"}.tgico-newchat_filled:before{content:\\\"\\\\e91d\\\"}.tgico-newgroup:before{content:\\\"\\\\e91e\\\"}.tgico-newprivate:before{content:\\\"\\\\e91f\\\"}.tgico-next:before{content:\\\"\\\\e920\\\"}.tgico-nosound:before{content:\\\"\\\\e921\\\"}.tgico-pause:before{content:\\\"\\\\e922\\\"}.tgico-permissions:before{content:\\\"\\\\e923\\\"}.tgico-phone:before{content:\\\"\\\\e924\\\"}.tgico-photo:before{content:\\\"\\\\e925\\\"}.tgico-pin:before{content:\\\"\\\\e926\\\"}.tgico-pinnedchat:before{content:\\\"\\\\e927\\\"}.tgico-largepause:before{content:\\\"\\\\e928\\\"}.tgico-largeplay:before{content:\\\"\\\\e929\\\"}.tgico-livelocation:before{content:\\\"\\\\e92a\\\"}.tgico-location:before{content:\\\"\\\\e92b\\\"}.tgico-lock:before{content:\\\"\\\\e92c\\\"}.tgico-logout:before{content:\\\"\\\\e92d\\\"}.tgico-menu:before{content:\\\"\\\\e92e\\\"}.tgico-message:before{content:\\\"\\\\e92f\\\"}.tgico-microphone:before{content:\\\"\\\\e930\\\"}.tgico-microphone2:before{content:\\\"\\\\e931\\\"}.tgico-minus:before{content:\\\"\\\\e932\\\"}.tgico-more:before{content:\\\"\\\\e933\\\"}.tgico-download:before{content:\\\"\\\\e934\\\"}.tgico-eats:before{content:\\\"\\\\e935\\\"}.tgico-edit:before{content:\\\"\\\\e936\\\"}.tgico-eye1:before{content:\\\"\\\\e937\\\"}.tgico-eye2:before{content:\\\"\\\\e938\\\"}.tgico-flag:before{content:\\\"\\\\e939\\\"}.tgico-forward:before{content:\\\"\\\\e93a\\\"}.tgico-fullscreen:before{content:\\\"\\\\e93b\\\"}.tgico-group:before{content:\\\"\\\\e93c\\\"}.tgico-help:before{content:\\\"\\\\e93d\\\"}.tgico-info:before{content:\\\"\\\\e93e\\\"}.tgico-lamp:before{content:\\\"\\\\e93f\\\"}.tgico-language:before{content:\\\"\\\\e940\\\"}.tgico-checkboxempty:before{content:\\\"\\\\e941\\\"}.tgico-checkboxon:before{content:\\\"\\\\e942\\\"}.tgico-close:before{content:\\\"\\\\e943\\\"}.tgico-colorize:before{content:\\\"\\\\e944\\\"}.tgico-copy:before{content:\\\"\\\\e945\\\"}.tgico-data:before{content:\\\"\\\\e946\\\"}.tgico-delete_filled:before{content:\\\"\\\\e947\\\"}.tgico-delete:before{content:\\\"\\\\e948\\\"}.tgico-deleteuser:before{content:\\\"\\\\e949\\\"}.tgico-document:before{content:\\\"\\\\e94a\\\"}.tgico-down:before{content:\\\"\\\\e94b\\\"}.tgico-attach:before{content:\\\"\\\\e94c\\\"}.tgico-avatar_archivedchats:before{content:\\\"\\\\e94d\\\"}.tgico-avatar_deletedaccount:before{content:\\\"\\\\e94e\\\"}.tgico-avatar_savedmessages:before{content:\\\"\\\\e94f\\\"}.tgico-back:before{content:\\\"\\\\e950\\\"}.tgico-camera:before{content:\\\"\\\\e951\\\"}.tgico-cameraadd:before{content:\\\"\\\\e952\\\"}.tgico-car:before{content:\\\"\\\\e953\\\"}.tgico-channel:before{content:\\\"\\\\e954\\\"}.tgico-channelviews:before{content:\\\"\\\\e955\\\"}.tgico-chatsplaceholder:before{content:\\\"\\\\e956\\\"}.tgico-check1:before{content:\\\"\\\\e957\\\"}.tgico-checkbox:before{content:\\\"\\\\e958\\\"}.tgico-checkboxblock:before{content:\\\"\\\\e959\\\"}.tgico-checks:before{content:\\\"\\\"}.tgico-activesessions:before{content:\\\"\\\\e95b\\\"}.tgico-add:before{content:\\\"\\\\e95c\\\"}.tgico-addmember_filled:before{content:\\\"\\\\e95d\\\"}.tgico-adduser:before{content:\\\"\\\\e95e\\\"}.tgico-admin:before{content:\\\"\\\\e95f\\\"}.tgico-animals:before{content:\\\"\\\\e960\\\"}.tgico-archive:before{content:\\\"\\\\e961\\\"}\\n\", \"\"]);\n" }, { "id": 63, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/fonts/tgico.eot", "name": "./src/assets/fonts/tgico.eot", "index": 14, "index2": 11, "size": 42, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 62, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "profile": { "factory": 536, "building": 1483 } } ], "profile": { "factory": 1461, "building": 153 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/fonts/tgico.eot" ], "reasons": [ { "moduleId": 62, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "type": "cjs require", "userRequest": "../assets/fonts/tgico.eot", "loc": "4:38-74" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/fonts/tgico.eot\";" }, { "id": 64, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/fonts/tgico.ttf", "name": "./src/assets/fonts/tgico.ttf", "index": 15, "index2": 12, "size": 42, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 62, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "profile": { "factory": 536, "building": 1483 } } ], "profile": { "factory": 1461, "building": 153 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/fonts/tgico.ttf" ], "reasons": [ { "moduleId": 62, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "type": "cjs require", "userRequest": "../assets/fonts/tgico.ttf", "loc": "5:38-74" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/fonts/tgico.ttf\";" }, { "id": 65, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/fonts/tgico.woff", "name": "./src/assets/fonts/tgico.woff", "index": 16, "index2": 13, "size": 43, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 62, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "profile": { "factory": 536, "building": 1483 } } ], "profile": { "factory": 1461, "building": 153 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/fonts/tgico.woff" ], "reasons": [ { "moduleId": 62, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "type": "cjs require", "userRequest": "../assets/fonts/tgico.woff", "loc": "6:38-75" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/fonts/tgico.woff\";" }, { "id": 66, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/file-loader/dist/cjs.js??ref--7!/Users/kuzmenko/Documents/projects/tweb/src/assets/fonts/tgico.svg", "name": "./src/assets/fonts/tgico.svg", "index": 17, "index2": 14, "size": 42, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 62, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "profile": { "factory": 536, "building": 1483 } } ], "profile": { "factory": 1461, "building": 153 }, "failed": false, "errors": 0, "warnings": 0, "assets": [ "assets/fonts/tgico.svg" ], "reasons": [ { "moduleId": 62, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "type": "cjs require", "userRequest": "../assets/fonts/tgico.svg", "loc": "7:38-74" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "module.exports = \"assets/fonts/tgico.svg\";" }, { "id": 68, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networker.ts", "name": "./src/lib/mtproto/networker.ts", "index": 28, "index2": 45, "size": 44866, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networkerFactory.ts", "issuerId": 21, "issuerName": "./src/lib/mtproto/networkerFactory.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 21, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networkerFactory.ts", "name": "./src/lib/mtproto/networkerFactory.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 79, "building": 579, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 21, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/networkerFactory.ts", "module": "./src/lib/mtproto/networkerFactory.ts", "moduleName": "./src/lib/mtproto/networkerFactory.ts", "type": "cjs require", "userRequest": "./networker", "loc": "3:20-42" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\n result[\"default\"] = mod;\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst utils_1 = require(\"../utils\");\nconst bin_utils_1 = require(\"../bin_utils\");\nconst mtproto_1 = require(\"./mtproto\");\nconst tl_utils_1 = require(\"../tl_utils\");\nconst cryptoworker_1 = __importDefault(require(\"../crypto/cryptoworker\"));\nconst storage_1 = __importDefault(require(\"../storage\"));\nconst Config = __importStar(require(\"../config\"));\nconst timeManager_1 = __importDefault(require(\"./timeManager\"));\nconst networkerFactory_1 = __importDefault(require(\"./networkerFactory\"));\nconst dcConfigurator_1 = __importDefault(require(\"./dcConfigurator\"));\nconst http_1 = __importDefault(require(\"./transports/http\"));\nconst polyfill_1 = require(\"../polyfill\");\nclass MTPNetworker {\n constructor(dcID, authKey, authKeyID, serverSalt, options = {}) {\n this.dcID = dcID;\n this.authKey = authKey;\n this.authKeyID = authKeyID;\n this.serverSalt = serverSalt;\n this.options = options;\n this.lastServerMessages = [];\n this.sentMessages = {};\n this.pendingMessages = {};\n this.pendingAcks = [];\n this.pendingResends = [];\n this.connectionInited = false;\n //private longPollInt: number;\n this.longPollPending = 0;\n this.seqNo = 0;\n this.prevSessionID = [];\n this.sessionID = [];\n this.sleepAfter = 0;\n this.offline = false;\n this.checkConnectionPeriod = 0;\n this.nextReq = 0;\n this.onOnlineCb = this.checkConnection.bind(this);\n this.debug = false;\n this.lastResendReq = null;\n this.authKeyUint8 = bin_utils_1.convertToUint8Array(this.authKey);\n //this.authKeyID = sha1BytesSync(this.authKey).slice(-8);\n this.upload = this.options.fileUpload || this.options.fileDownload || false;\n this.log = polyfill_1.logger('NET-' + dcID + (this.upload ? '-U' : ''));\n this.log('constructor' /* , this.authKey, this.authKeyID, this.serverSalt */);\n this.updateSession();\n if (!networkerFactory_1.default.offlineInited) {\n networkerFactory_1.default.offlineInited = true;\n /* $rootScope.offline = true\n $rootScope.offlineConnecting = true */\n }\n if (Config.Navigator.mobile) {\n this.setupMobileSleep();\n }\n this.transport = dcConfigurator_1.default.chooseServer(this.dcID, this.upload);\n if (this.transport instanceof http_1.default) {\n /* this.longPollInt = */ window.setInterval(this.checkLongPoll.bind(this), 10000);\n this.checkLongPoll();\n }\n else {\n this.transport.networker = this;\n }\n }\n updateSession() {\n this.seqNo = 0;\n this.prevSessionID = this.sessionID;\n this.sessionID = new Array(8);\n mtproto_1.MTProto.secureRandom.nextBytes(this.sessionID);\n }\n setupMobileSleep() {\n /* $rootScope.$watch('idle.isIDLE', (isIDLE) => {\n if(isIDLE) {\n this.sleepAfter = tsNow() + 30000;\n } else {\n delete this.sleepAfter;\n this.checkLongPoll();\n }\n })\n \n $rootScope.$on('push_received', function() {\n // this.log('push recieved', self.sleepAfter)\n if(this.sleepAfter) {\n this.sleepAfter = tsNow() + 30000;\n this.checkLongPoll();\n }\n }) */\n }\n updateSentMessage(sentMessageID) {\n var sentMessage = this.sentMessages[sentMessageID];\n if (!sentMessage) {\n return false;\n }\n var self = this;\n if (sentMessage.container) {\n var newInner = [];\n sentMessage.inner.forEach((innerSentMessageID) => {\n var innerSentMessage = self.updateSentMessage(innerSentMessageID);\n if (innerSentMessage) {\n newInner.push(innerSentMessage.msg_id);\n }\n });\n sentMessage.inner = newInner;\n }\n sentMessage.msg_id = timeManager_1.default.generateID();\n sentMessage.seq_no = this.generateSeqNo(sentMessage.notContentRelated ||\n sentMessage.container);\n this.sentMessages[sentMessage.msg_id] = sentMessage;\n delete self.sentMessages[sentMessageID];\n return sentMessage;\n }\n generateSeqNo(notContentRelated) {\n var seqNo = this.seqNo * 2;\n if (!notContentRelated) {\n seqNo++;\n this.seqNo++;\n }\n return seqNo;\n }\n wrapMtpCall(method, params = {}, options = {}) {\n var serializer = new tl_utils_1.TLSerialization({ mtproto: true });\n serializer.storeMethod(method, params);\n var messageID = timeManager_1.default.generateID();\n var seqNo = this.generateSeqNo();\n var message = {\n msg_id: messageID,\n seq_no: seqNo,\n body: serializer.getBytes()\n };\n if (Config.Modes.debug) {\n this.log('MT call', method, params, messageID, seqNo);\n }\n return this.pushMessage(message, options);\n }\n wrapMtpMessage(object = {}, options = {}) {\n var serializer = new tl_utils_1.TLSerialization({ mtproto: true });\n serializer.storeObject(object, 'Object');\n var messageID = timeManager_1.default.generateID();\n var seqNo = this.generateSeqNo(options.notContentRelated);\n var message = {\n msg_id: messageID,\n seq_no: seqNo,\n body: serializer.getBytes()\n };\n if (Config.Modes.debug) {\n this.log('MT message', object, messageID, seqNo);\n }\n return this.pushMessage(message, options);\n }\n wrapApiCall(method, params = {}, options = {}) {\n let serializer = new tl_utils_1.TLSerialization(options);\n if (!this.connectionInited) { // this will call once for each new session\n ///////this.log('Wrap api call !this.connectionInited');\n let invokeWithLayer = Config.Schema.API.methods.find((m) => m.method == 'invokeWithLayer');\n if (!invokeWithLayer)\n throw new Error('no invokeWithLayer!');\n serializer.storeInt(+invokeWithLayer.id >>> 0, 'invokeWithLayer');\n // @ts-ignore\n serializer.storeInt(Config.Schema.API.layer, 'layer');\n let initConnection = Config.Schema.API.methods.find((m) => m.method == 'initConnection');\n if (!initConnection)\n throw new Error('no initConnection!');\n serializer.storeInt(+initConnection.id >>> 0, 'initConnection');\n serializer.storeInt(0x0, 'flags');\n serializer.storeInt(Config.App.id, 'api_id');\n serializer.storeString(navigator.userAgent || 'Unknown UserAgent', 'device_model');\n serializer.storeString(navigator.platform || 'Unknown Platform', 'system_version');\n serializer.storeString(Config.App.version, 'app_version');\n serializer.storeString(navigator.language || 'en', 'system_lang_code');\n serializer.storeString('', 'lang_pack');\n serializer.storeString(navigator.language || 'en', 'lang_code');\n //serializer.storeInt(0x0, 'proxy');\n /* serializer.storeMethod('initConnection', {\n 'flags': 0,\n 'api_id': Config.App.id,\n 'device_model': navigator.userAgent || 'Unknown UserAgent',\n 'system_version': navigator.platform || 'Unknown Platform',\n 'app_version': Config.App.version,\n 'system_lang_code': navigator.language || 'en',\n 'lang_pack': '',\n 'lang_code': navigator.language || 'en'\n }); */\n }\n if (options.afterMessageID) {\n this.log('Api call options.afterMessageID!');\n serializer.storeInt(0xcb9f372d, 'invokeAfterMsg');\n serializer.storeLong(options.afterMessageID, 'msg_id');\n }\n options.resultType = serializer.storeMethod(method, params);\n /* if(method == 'account.updateNotifySettings') {\n this.log('api call body:', serializer.getBytes(true));\n } */\n var messageID = timeManager_1.default.generateID();\n var seqNo = this.generateSeqNo();\n var message = {\n msg_id: messageID,\n seq_no: seqNo,\n body: serializer.getBytes(true),\n isAPI: true\n };\n if (Config.Modes.debug /* || true */) {\n this.log('Api call', method, message, params, options);\n }\n else {\n //////this.log('Api call', method);\n }\n return this.pushMessage(message, options);\n }\n checkLongPoll() {\n var isClean = this.cleanupSent();\n //this.log('Check lp', this.longPollPending, tsNow(), this.dcID, isClean, this);\n if ((this.longPollPending && utils_1.tsNow() < this.longPollPending) ||\n this.offline ||\n networkerFactory_1.default.akStopped) {\n //this.log('No lp this time');\n return false;\n }\n var self = this;\n storage_1.default.get('dc').then((baseDcID) => {\n if (isClean && (baseDcID != self.dcID ||\n self.upload ||\n (self.sleepAfter && utils_1.tsNow() > self.sleepAfter))) {\n //console.warn(dT(), 'Send long-poll for DC is delayed', self.dcID, self.sleepAfter);\n return;\n }\n self.sendLongPoll();\n });\n }\n sendLongPoll() {\n let maxWait = 25000;\n this.longPollPending = utils_1.tsNow() + maxWait;\n //this.log('Set lp', this.longPollPending, tsNow())\n this.wrapMtpCall('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: maxWait\n }, {\n noResponse: true,\n longPoll: true\n }).then(() => {\n this.longPollPending = 0;\n setTimeout(this.checkLongPoll.bind(this), 0);\n }, (error) => {\n this.log('Long-poll failed', error);\n });\n }\n pushMessage(message, options = {}) {\n return new Promise((resolve, reject) => {\n this.sentMessages[message.msg_id] = Object.assign(message, options, {\n deferred: { resolve, reject }\n });\n // this.log('Networker pushMessage:', this.sentMessages[message.msg_id]);\n this.pendingMessages[message.msg_id] = 0;\n if (!options || !options.noSchedule) {\n this.scheduleRequest();\n }\n if (utils_1.isObject(options)) {\n options.messageID = message.msg_id;\n }\n });\n }\n pushResend(messageID, delay = 0) {\n var value = delay ? utils_1.tsNow() + delay : 0;\n var sentMessage = this.sentMessages[messageID];\n if (sentMessage.container) {\n for (var i = 0; i < sentMessage.inner.length; i++) {\n this.pendingMessages[sentMessage.inner[i]] = value;\n }\n }\n else {\n this.pendingMessages[messageID] = value;\n }\n // this.log('Resend due', messageID, this.pendingMessages)\n this.scheduleRequest(delay);\n }\n getMsgKey(dataWithPadding, isOut) {\n return __awaiter(this, void 0, void 0, function* () {\n var authKey = this.authKeyUint8;\n var x = isOut ? 0 : 8;\n var msgKeyLargePlain = bin_utils_1.bufferConcat(authKey.subarray(88 + x, 88 + x + 32), dataWithPadding);\n let msgKeyLarge = yield cryptoworker_1.default.sha256Hash(msgKeyLargePlain);\n var msgKey = new Uint8Array(msgKeyLarge).subarray(8, 24);\n return msgKey;\n });\n }\n ;\n getAesKeyIv(msgKey, isOut) {\n var authKey = this.authKeyUint8;\n var x = isOut ? 0 : 8;\n var sha2aText = new Uint8Array(52);\n var sha2bText = new Uint8Array(52);\n var promises = [];\n sha2aText.set(msgKey, 0);\n sha2aText.set(authKey.subarray(x, x + 36), 16);\n promises.push(cryptoworker_1.default.sha256Hash(sha2aText));\n sha2bText.set(authKey.subarray(40 + x, 40 + x + 36), 0);\n sha2bText.set(msgKey, 36);\n promises.push(cryptoworker_1.default.sha256Hash(sha2bText));\n return Promise.all(promises).then((results) => {\n var aesKey = new Uint8Array(32);\n var aesIv = new Uint8Array(32);\n var sha2a = new Uint8Array(results[0]);\n var sha2b = new Uint8Array(results[1]);\n aesKey.set(sha2a.subarray(0, 8));\n aesKey.set(sha2b.subarray(8, 24), 8);\n aesKey.set(sha2a.subarray(24, 32), 24);\n aesIv.set(sha2b.subarray(0, 8));\n aesIv.set(sha2a.subarray(8, 24), 8);\n aesIv.set(sha2b.subarray(24, 32), 24);\n return [aesKey, aesIv];\n });\n }\n checkConnection(event) {\n /* $rootScope.offlineConnecting = true */\n this.log('Check connection', event);\n clearTimeout(this.checkConnectionTimeout);\n this.checkConnectionTimeout = 0;\n var serializer = new tl_utils_1.TLSerialization({ mtproto: true });\n var pingID = [bin_utils_1.nextRandomInt(0xFFFFFFFF), bin_utils_1.nextRandomInt(0xFFFFFFFF)];\n serializer.storeMethod('ping', {\n ping_id: pingID\n });\n var pingMessage = {\n msg_id: timeManager_1.default.generateID(),\n seq_no: this.generateSeqNo(true),\n body: serializer.getBytes()\n };\n var self = this;\n this.sendEncryptedRequest(pingMessage, {\n timeout: 15000\n }).then((result) => {\n /* delete $rootScope.offlineConnecting */\n self.toggleOffline(false);\n }, () => {\n this.log('Delay ', self.checkConnectionPeriod * 1000);\n self.checkConnectionTimeout = setTimeout(self.checkConnection.bind(self), self.checkConnectionPeriod * 1000 | 0);\n self.checkConnectionPeriod = Math.min(60, self.checkConnectionPeriod * 1.5);\n /* setTimeout(function() {\n delete $rootScope.offlineConnecting\n }, 1000); */\n });\n }\n toggleOffline(enabled) {\n // this.log('toggle ', enabled, this.dcID, this.iii)\n if (this.offline !== undefined && this.offline == enabled) {\n return false;\n }\n this.offline = enabled;\n /* $rootScope.offline = enabled;\n $rootScope.offlineConnecting = false; */\n if (!(this.transport instanceof http_1.default)) {\n this.log('toggle ', enabled, this.dcID);\n return;\n }\n if (this.offline) {\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n this.nextReq = 0;\n if (this.checkConnectionPeriod < 1.5) {\n this.checkConnectionPeriod = 0;\n }\n this.checkConnectionTimeout = setTimeout(this.checkConnection.bind(this), this.checkConnectionPeriod * 1000 | 0);\n this.checkConnectionPeriod = Math.min(30, (1 + this.checkConnectionPeriod) * 1.5);\n document.body.addEventListener('online', this.onOnlineCb, false);\n document.body.addEventListener('focus', this.onOnlineCb, false);\n }\n else {\n this.checkLongPoll();\n this.scheduleRequest();\n document.body.removeEventListener('online', this.onOnlineCb);\n document.body.removeEventListener('focus', this.onOnlineCb);\n clearTimeout(this.checkConnectionTimeout);\n this.checkConnectionTimeout = 0;\n }\n }\n performScheduledRequest() {\n // this.log('scheduled', this.dcID, this.iii)\n if (this.offline || networkerFactory_1.default.akStopped) {\n this.log('Cancel scheduled');\n return false;\n }\n this.nextReq = 0;\n if (this.pendingAcks.length) {\n var ackMsgIDs = this.pendingAcks.slice();\n /* for(var i = 0; i < this.pendingAcks.length; i++) {\n ackMsgIDs.push(this.pendingAcks[i]);\n } */\n // this.log('acking messages', ackMsgIDs)\n this.wrapMtpMessage({\n _: 'msgs_ack',\n msg_ids: ackMsgIDs\n }, {\n notContentRelated: true,\n noSchedule: true\n });\n }\n if (this.pendingResends.length) {\n var resendMsgIDs = this.pendingResends.slice();\n var resendOpts = {\n noSchedule: true,\n notContentRelated: true,\n messageID: '' // will set in wrapMtpMessage->pushMessage\n };\n /* for(var i = 0; i < this.pendingResends.length; i++) {\n resendMsgIDs.push(this.pendingResends[i]);\n } */\n // this.log('resendReq messages', resendMsgIDs)\n this.wrapMtpMessage({\n _: 'msg_resend_req',\n msg_ids: resendMsgIDs\n }, resendOpts);\n this.lastResendReq = {\n req_msg_id: resendOpts.messageID,\n resend_msg_ids: resendMsgIDs\n };\n }\n var messages = [], message;\n var messagesByteLen = 0;\n var currentTime = utils_1.tsNow();\n var hasApiCall = false;\n var hasHttpWait = false;\n var lengthOverflow = false;\n var singlesCount = 0;\n var self = this;\n for (let messageID in this.pendingMessages) {\n let value = this.pendingMessages[messageID];\n if (!value || value >= currentTime) {\n if (message = this.sentMessages[messageID]) {\n //this.log('performScheduledRequest message:', message);\n var messageByteLength = ( /* message.body.byteLength || */message.body.length) + 32;\n if (!message.notContentRelated &&\n lengthOverflow) {\n continue; // maybe break here\n }\n if (!message.notContentRelated &&\n messagesByteLen &&\n messagesByteLen + messageByteLength > 655360) { // 640 Kb\n this.log.warn('lengthOverflow', message);\n lengthOverflow = true;\n continue; // maybe break here\n }\n if (message.singleInRequest) {\n singlesCount++;\n if (singlesCount > 1) {\n continue; // maybe break here\n }\n }\n messages.push(message);\n messagesByteLen += messageByteLength;\n if (message.isAPI) {\n hasApiCall = true;\n }\n else if (message.longPoll) {\n hasHttpWait = true;\n }\n }\n else {\n // this.log(message, messageID)\n }\n delete self.pendingMessages[messageID];\n }\n }\n if (hasApiCall && !hasHttpWait && this.transport instanceof http_1.default) {\n var serializer = new tl_utils_1.TLSerialization({ mtproto: true });\n serializer.storeMethod('http_wait', {\n max_delay: 500,\n wait_after: 150,\n max_wait: 3000\n });\n messages.push({\n msg_id: timeManager_1.default.generateID(),\n seq_no: this.generateSeqNo(),\n body: serializer.getBytes()\n });\n }\n if (!messages.length) {\n // this.log('no scheduled messages')\n return;\n }\n var noResponseMsgs = [];\n if (messages.length > 1) {\n var container = new tl_utils_1.TLSerialization({\n mtproto: true,\n startMaxLength: messagesByteLen + 64\n });\n container.storeInt(0x73f1f8dc, 'CONTAINER[id]');\n container.storeInt(messages.length, 'CONTAINER[count]');\n var innerMessages = [];\n messages.forEach((message, i) => {\n container.storeLong(message.msg_id, 'CONTAINER[' + i + '][msg_id]');\n innerMessages.push(message.msg_id);\n container.storeInt(message.seq_no, 'CONTAINER[' + i + '][seq_no]');\n container.storeInt(message.body.length, 'CONTAINER[' + i + '][bytes]');\n container.storeRawBytes(message.body, 'CONTAINER[' + i + '][body]');\n if (message.noResponse) {\n noResponseMsgs.push(message.msg_id);\n }\n });\n var containerSentMessage = {\n msg_id: timeManager_1.default.generateID(),\n seq_no: this.generateSeqNo(true),\n container: true,\n inner: innerMessages\n };\n message = Object.assign({\n body: container.getBytes(true)\n }, containerSentMessage);\n this.sentMessages[message.msg_id] = containerSentMessage;\n if (Config.Modes.debug || true) {\n this.log('Container', innerMessages, message.msg_id, message.seq_no);\n }\n }\n else {\n if (message.noResponse) {\n noResponseMsgs.push(message.msg_id);\n }\n this.sentMessages[message.msg_id] = message;\n }\n this.pendingAcks = [];\n let promise = this.sendEncryptedRequest(message);\n if (!(this.transport instanceof http_1.default)) {\n if (noResponseMsgs.length)\n this.log.error('noResponseMsgs length!', noResponseMsgs);\n }\n else\n promise.then((result) => {\n self.toggleOffline(false);\n // this.log('parse for', message)\n self.parseResponse(result).then((response) => {\n if (Config.Modes.debug) {\n this.log('Server response', self.dcID, response);\n }\n self.processMessage(response.response, response.messageID, response.sessionID);\n noResponseMsgs.forEach((msgID) => {\n if (self.sentMessages[msgID]) {\n var deferred = self.sentMessages[msgID].deferred;\n delete self.sentMessages[msgID];\n deferred.resolve();\n }\n });\n if (self.transport instanceof http_1.default) {\n self.checkLongPoll();\n this.checkConnectionPeriod = Math.max(1.1, Math.sqrt(this.checkConnectionPeriod));\n }\n });\n }, (error) => {\n this.log.error('Encrypted request failed', error, message);\n if (message.container) {\n message.inner.forEach((msgID) => {\n self.pendingMessages[msgID] = 0;\n });\n delete self.sentMessages[message.msg_id];\n }\n else {\n self.pendingMessages[message.msg_id] = 0;\n }\n noResponseMsgs.forEach((msgID) => {\n if (self.sentMessages[msgID]) {\n var deferred = self.sentMessages[msgID].deferred;\n delete self.sentMessages[msgID];\n delete self.pendingMessages[msgID];\n deferred.reject();\n }\n });\n self.toggleOffline(true);\n });\n if (lengthOverflow || singlesCount > 1) {\n this.scheduleRequest();\n }\n }\n getEncryptedMessage(dataWithPadding) {\n return __awaiter(this, void 0, void 0, function* () {\n let msgKey = yield this.getMsgKey(dataWithPadding, true);\n let keyIv = yield this.getAesKeyIv(msgKey, true);\n // this.log('after msg key iv')\n let encryptedBytes = yield cryptoworker_1.default.aesEncrypt(dataWithPadding, keyIv[0], keyIv[1]);\n // this.log('Finish encrypt')\n return {\n bytes: encryptedBytes,\n msgKey: msgKey\n };\n });\n }\n getDecryptedMessage(msgKey, encryptedData) {\n // this.log('get decrypted start')\n return this.getAesKeyIv(msgKey, false).then((keyIv) => {\n // this.log('after msg key iv')\n return cryptoworker_1.default.aesDecrypt(encryptedData, keyIv[0], keyIv[1]);\n });\n }\n sendEncryptedRequest(message, options = {}) {\n var self = this;\n this.debug && this.log('Send encrypted', message, options, this.authKeyID);\n // console.trace()\n var data = new tl_utils_1.TLSerialization({\n startMaxLength: message.body.length + 2048\n });\n data.storeIntBytes(this.serverSalt, 64, 'salt');\n data.storeIntBytes(this.sessionID, 64, 'session_id');\n data.storeLong(message.msg_id, 'message_id');\n data.storeInt(message.seq_no, 'seq_no');\n data.storeInt(message.body.length, 'message_data_length');\n data.storeRawBytes(message.body, 'message_data');\n var dataBuffer = data.getBuffer();\n var paddingLength = (16 - (data.offset % 16)) + 16 * (1 + bin_utils_1.nextRandomInt(5));\n var padding = new Array(paddingLength);\n mtproto_1.MTProto.secureRandom.nextBytes(padding);\n var dataWithPadding = bin_utils_1.bufferConcat(dataBuffer, padding);\n // this.log('Adding padding', dataBuffer, padding, dataWithPadding)\n // this.log('auth_key_id', bytesToHex(self.authKeyID))\n return this.getEncryptedMessage(dataWithPadding).then((encryptedResult) => {\n this.debug && this.log('Got encrypted out message', encryptedResult);\n let request = new tl_utils_1.TLSerialization({\n startMaxLength: encryptedResult.bytes.byteLength + 256\n });\n request.storeIntBytes(self.authKeyID, 64, 'auth_key_id');\n request.storeIntBytes(encryptedResult.msgKey, 128, 'msg_key');\n request.storeRawBytes(encryptedResult.bytes, 'encrypted_data');\n //var requestData = xhrSendBuffer ? request.getBuffer() : request.getBytes(true) as Uint8Array;\n let requestData = request.getBytes(true);\n let baseError = {\n code: 406,\n type: 'NETWORK_BAD_RESPONSE',\n transport: this.transport\n };\n let promise = this.transport.send(requestData);\n if (!(this.transport instanceof http_1.default))\n return promise;\n return promise.then((result) => {\n if (!result || !result.byteLength) {\n return Promise.reject(baseError);\n }\n return result;\n }, (error) => {\n if (!error.message && !error.type) {\n error = Object.assign(baseError, {\n type: 'NETWORK_BAD_REQUEST',\n originalError: error\n });\n }\n return Promise.reject(error);\n });\n });\n }\n parseResponse(responseBuffer) {\n this.debug && this.log('Start parsing response' /* , responseBuffer */);\n let self = this;\n let deserializer = new tl_utils_1.TLDeserialization(responseBuffer);\n let authKeyID = deserializer.fetchIntBytes(64, true, 'auth_key_id');\n if (!bin_utils_1.bytesCmp(authKeyID, this.authKeyID)) {\n throw new Error('[MT] Invalid server auth_key_id: ' + authKeyID.hex);\n }\n let msgKey = deserializer.fetchIntBytes(128, true, 'msg_key');\n let encryptedData = deserializer.fetchRawBytes(responseBuffer.byteLength - deserializer.getOffset(), true, 'encrypted_data');\n return self.getDecryptedMessage(msgKey, encryptedData).then((dataWithPadding) => {\n // this.log('after decrypt')\n return self.getMsgKey(dataWithPadding, false).then((calcMsgKey) => {\n if (!bin_utils_1.bytesCmp(msgKey, calcMsgKey)) {\n this.log.warn('[MT] msg_keys', msgKey, calcMsgKey);\n this.updateSession(); // fix 28.01.2020\n throw new Error('[MT] server msgKey mismatch, updating session');\n }\n // this.log('after msgKey check')\n let deserializer = new tl_utils_1.TLDeserialization(dataWithPadding, { mtproto: true });\n /* let salt = */ deserializer.fetchIntBytes(64, false, 'salt'); // need\n let sessionID = deserializer.fetchIntBytes(64, false, 'session_id');\n let messageID = deserializer.fetchLong('message_id');\n if (!bin_utils_1.bytesCmp(sessionID, self.sessionID) &&\n (!self.prevSessionID || !bin_utils_1.bytesCmp(sessionID, self.prevSessionID))) {\n this.log.warn('Sessions', sessionID, self.sessionID, self.prevSessionID, dataWithPadding);\n //this.updateSession();\n //this.sessionID = sessionID;\n throw new Error('[MT] Invalid server session_id: ' + bin_utils_1.bytesToHex(sessionID));\n }\n let seqNo = deserializer.fetchInt('seq_no');\n let totalLength = dataWithPadding.byteLength;\n let messageBodyLength = deserializer.fetchInt('message_data[length]');\n let offset = deserializer.getOffset();\n if ((messageBodyLength % 4) ||\n messageBodyLength > totalLength - offset) {\n throw new Error('[MT] Invalid body length: ' + messageBodyLength);\n }\n let messageBody = deserializer.fetchRawBytes(messageBodyLength, true, 'message_data');\n offset = deserializer.getOffset();\n let paddingLength = totalLength - offset;\n if (paddingLength < 12 || paddingLength > 1024) {\n throw new Error('[MT] Invalid padding length: ' + paddingLength);\n }\n //let buffer = bytesToArrayBuffer(messageBody);\n deserializer = new tl_utils_1.TLDeserialization(/* buffer */ messageBody, { mtproto: true });\n // костыль\n deserializer.override = {\n mt_message: (function (result, field) {\n result.msg_id = this.fetchLong(field + '[msg_id]');\n result.seqno = this.fetchInt(field + '[seqno]');\n result.bytes = this.fetchInt(field + '[bytes]');\n var offset = this.getOffset();\n //self.log('mt_message!!!!!', result, field);\n try {\n result.body = this.fetchObject('Object', field + '[body]');\n }\n catch (e) {\n self.log.error('parse error', e.message, e.stack);\n result.body = {\n _: 'parse_error',\n error: e\n };\n }\n if (this.offset != offset + result.bytes) {\n // console.warn(dT(), 'set offset', this.offset, offset, result.bytes)\n // this.log(result)\n this.offset = offset + result.bytes;\n }\n // this.log('override message', result)\n }).bind(deserializer),\n mt_rpc_result: (function (result, field) {\n result.req_msg_id = this.fetchLong(field + '[req_msg_id]');\n var sentMessage = self.sentMessages[result.req_msg_id];\n var type = sentMessage && sentMessage.resultType || 'Object';\n if (result.req_msg_id && !sentMessage) {\n // console.warn(dT(), 'Result for unknown message', result);\n return;\n }\n result.result = this.fetchObject(type, field + '[result]');\n // self.log(dT(), 'override rpc_result', sentMessage, type, result);\n }).bind(deserializer)\n };\n var response = deserializer.fetchObject('', 'INPUT');\n return {\n response: response,\n messageID: messageID,\n sessionID: sessionID,\n seqNo: seqNo\n };\n });\n });\n }\n applyServerSalt(newServerSalt) {\n var serverSalt = bin_utils_1.longToBytes(newServerSalt);\n storage_1.default.set({\n ['dc' + this.dcID + '_server_salt']: bin_utils_1.bytesToHex(serverSalt)\n });\n this.serverSalt = serverSalt;\n return true;\n }\n scheduleRequest(delay = 0) {\n if (!(this.transport instanceof http_1.default)) { // if socket\n return this.performScheduledRequest();\n }\n if (this.offline /* && this.transport instanceof HTTP */) {\n this.checkConnection('forced schedule');\n }\n /* if(delay && !(this.transport instanceof HTTP)) {\n delay = 0;\n } */\n var nextReq = utils_1.tsNow() + delay;\n if (delay && this.nextReq && this.nextReq <= nextReq) {\n return false;\n }\n // this.log('schedule req', delay)\n // console.trace()\n clearTimeout(this.nextReqTimeout);\n this.nextReqTimeout = 0;\n if (delay > 0) {\n this.nextReqTimeout = window.setTimeout(this.performScheduledRequest.bind(this), delay || 0);\n }\n else {\n setTimeout(this.performScheduledRequest.bind(this), 0);\n }\n this.nextReq = nextReq;\n }\n ackMessage(msgID) {\n // this.log('ack message', msgID)\n this.pendingAcks.push(msgID);\n this.scheduleRequest(30000);\n }\n reqResendMessage(msgID) {\n this.log('Req resend', msgID);\n this.pendingResends.push(msgID);\n this.scheduleRequest(100);\n }\n cleanupSent() {\n var self = this;\n var notEmpty = false;\n // this.log('clean start', this.dcID/*, this.sentMessages*/)\n Object.keys(this.sentMessages).forEach((msgID) => {\n let message = this.sentMessages[msgID];\n // this.log('clean iter', msgID, message)\n if (message.notContentRelated && self.pendingMessages[msgID] === undefined) {\n // this.log('clean notContentRelated', msgID)\n delete self.sentMessages[msgID];\n }\n else if (message.container) {\n for (var i = 0; i < message.inner.length; i++) {\n if (self.sentMessages[message.inner[i]] !== undefined) {\n // this.log('clean failed, found', msgID, message.inner[i], self.sentMessages[message.inner[i]].seq_no)\n notEmpty = true;\n return;\n }\n }\n // this.log('clean container', msgID)\n delete self.sentMessages[msgID];\n }\n else {\n notEmpty = true;\n }\n });\n return !notEmpty;\n }\n processMessageAck(messageID) {\n var sentMessage = this.sentMessages[messageID];\n if (sentMessage && !sentMessage.acked) {\n delete sentMessage.body;\n sentMessage.acked = true;\n return true;\n }\n return false;\n }\n processError(rawError) {\n var matches = (rawError.error_message || '').match(/^([A-Z_0-9]+\\b)(: (.+))?/) || [];\n rawError.error_code = bin_utils_1.uintToInt(rawError.error_code);\n return {\n code: !rawError.error_code || rawError.error_code <= 0 ? 500 : rawError.error_code,\n type: matches[1] || 'UNKNOWN',\n description: matches[3] || ('CODE#' + rawError.error_code + ' ' + rawError.error_message),\n originalError: rawError\n };\n }\n processMessage(message, messageID, sessionID) {\n var msgidInt = parseInt(messageID /* .toString(10) */.substr(0, -10), 10);\n if (msgidInt % 2) {\n this.log.warn('[MT] Server even message id: ', messageID, message);\n return;\n }\n this.debug && this.log('process message', message, messageID, sessionID);\n switch (message._) {\n case 'msg_container':\n var len = message.messages.length;\n for (var i = 0; i < len; i++) {\n this.processMessage(message.messages[i], message.messages[i].msg_id, sessionID);\n }\n break;\n case 'bad_server_salt':\n this.log('Bad server salt', message);\n var sentMessage = this.sentMessages[message.bad_msg_id];\n if (!sentMessage || sentMessage.seq_no != message.bad_msg_seqno) {\n this.log(message.bad_msg_id, message.bad_msg_seqno);\n throw new Error('[MT] Bad server salt for invalid message');\n }\n this.applyServerSalt(message.new_server_salt);\n this.pushResend(message.bad_msg_id);\n this.ackMessage(messageID);\n break;\n case 'bad_msg_notification':\n this.log('Bad msg notification', message);\n var sentMessage = this.sentMessages[message.bad_msg_id];\n if (!sentMessage || sentMessage.seq_no != message.bad_msg_seqno) {\n this.log(message.bad_msg_id, message.bad_msg_seqno);\n throw new Error('[MT] Bad msg notification for invalid message');\n }\n if (message.error_code == 16 || message.error_code == 17) {\n if (timeManager_1.default.applyServerTime(bin_utils_1.bigStringInt(messageID).shiftRight(32).toString(10))) {\n this.log('Update session');\n this.updateSession();\n }\n var badMessage = this.updateSentMessage(message.bad_msg_id);\n if (badMessage)\n this.pushResend(badMessage.msg_id); // fix 23.01.2020\n this.ackMessage(messageID);\n }\n break;\n case 'message':\n if (this.lastServerMessages.indexOf(messageID) != -1) {\n // console.warn('[MT] Server same messageID: ', messageID)\n this.ackMessage(messageID);\n return;\n }\n this.lastServerMessages.push(messageID);\n if (this.lastServerMessages.length > 100) {\n this.lastServerMessages.shift();\n }\n this.processMessage(message.body, message.msg_id, sessionID);\n break;\n case 'new_session_created':\n this.ackMessage(messageID);\n this.log('new_session_created in my head');\n //this.updateSession();\n this.processMessageAck(message.first_msg_id);\n this.applyServerSalt(message.server_salt);\n storage_1.default.get('dc').then((baseDcID) => {\n if (baseDcID == this.dcID && !this.upload && networkerFactory_1.default.updatesProcessor) {\n networkerFactory_1.default.updatesProcessor(message, true);\n }\n });\n break;\n case 'msgs_ack':\n for (var i = 0; i < message.msg_ids.length; i++) {\n this.processMessageAck(message.msg_ids[i]);\n }\n break;\n case 'msg_detailed_info':\n if (!this.sentMessages[message.msg_id]) {\n this.ackMessage(message.answer_msg_id);\n break;\n }\n case 'msg_new_detailed_info':\n if (this.pendingAcks.indexOf(message.answer_msg_id)) {\n break;\n }\n this.reqResendMessage(message.answer_msg_id);\n break;\n case 'msgs_state_info':\n this.ackMessage(message.answer_msg_id);\n if (this.lastResendReq &&\n this.lastResendReq.req_msg_id == message.req_msg_id &&\n this.pendingResends.length) {\n var badMsgID, pos;\n for (let i = 0; i < this.lastResendReq.resend_msg_ids.length; i++) {\n badMsgID = this.lastResendReq.resend_msg_ids[i];\n pos = this.pendingResends.indexOf(badMsgID);\n if (pos != -1) {\n this.pendingResends.splice(pos, 1);\n }\n }\n }\n break;\n case 'rpc_result':\n this.ackMessage(messageID);\n var sentMessageID = message.req_msg_id;\n var sentMessage = this.sentMessages[sentMessageID];\n this.processMessageAck(sentMessageID);\n if (sentMessage) {\n var deferred = sentMessage.deferred;\n if (message.result._ == 'rpc_error') {\n var error = this.processError(message.result);\n this.log('Rpc error', error);\n if (deferred) {\n deferred.reject(error);\n }\n }\n else {\n if (deferred) {\n if (Config.Modes.debug) {\n this.debug && this.log('Rpc response', message.result);\n }\n else {\n var dRes = message.result._;\n if (!dRes) {\n if (message.result.length > 5) {\n dRes = '[..' + message.result.length + '..]';\n }\n else {\n dRes = message.result;\n }\n }\n this.debug && this.log('Rpc response', dRes, sentMessage);\n }\n sentMessage.deferred.resolve(message.result);\n }\n if (sentMessage.isAPI && !this.connectionInited) {\n this.connectionInited = true;\n ////this.log('Rpc set connectionInited to:', this.connectionInited);\n }\n }\n delete this.sentMessages[sentMessageID];\n }\n break;\n default:\n this.ackMessage(messageID);\n this.debug && this.log('Update', message);\n if (networkerFactory_1.default.updatesProcessor !== null) {\n networkerFactory_1.default.updatesProcessor(message, true);\n }\n break;\n }\n }\n}\nexports.MTPNetworker = MTPNetworker;\n" }, { "id": 69, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/worker-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/crypto.worker.js", "name": "./src/lib/crypto/crypto.worker.js", "index": 32, "index2": 23, "size": 113, "cacheable": false, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/cryptoworker.ts", "issuerId": 7, "issuerName": "./src/lib/crypto/cryptoworker.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 7, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/cryptoworker.ts", "name": "./src/lib/crypto/cryptoworker.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } } ], "profile": { "factory": 886, "building": 908 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 7, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/crypto/cryptoworker.ts", "module": "./src/lib/crypto/cryptoworker.ts", "moduleName": "./src/lib/crypto/cryptoworker.ts", "type": "cjs require", "userRequest": "./crypto.worker.js", "loc": "24:54-83" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "module.exports = function() {\n return new Worker(__webpack_public_path__ + \"69d45fed4230730b6030.worker.js\");\n};" }, { "id": 71, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "name": "./src/lib/mtproto/transports/websocket.ts", "index": 35, "index2": 31, "size": 6124, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "issuerId": 22, "issuerName": "./src/lib/mtproto/dcConfigurator.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 22, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "name": "./src/lib/mtproto/dcConfigurator.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 20, "building": 660, "dependencies": 2 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 22, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "module": "./src/lib/mtproto/dcConfigurator.ts", "moduleName": "./src/lib/mtproto/dcConfigurator.ts", "type": "cjs require", "userRequest": "./transports/websocket", "loc": "6:36-69" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst transport_1 = __importDefault(require(\"./transport\"));\nconst aes_js_1 = __importDefault(require(\"aes-js\"));\nconst abridged_1 = __importDefault(require(\"./abridged\"));\nconst polyfill_1 = require(\"../../polyfill\");\nclass Obfuscation {\n init() {\n const initPayload = new Uint8Array(64);\n initPayload.randomize();\n while (true) {\n let val = (initPayload[3] << 24) | (initPayload[2] << 16) | (initPayload[1] << 8) | (initPayload[0]);\n let val2 = (initPayload[7] << 24) | (initPayload[6] << 16) | (initPayload[5] << 8) | (initPayload[4]);\n if (initPayload[0] != 0xef &&\n val != 0x44414548 &&\n val != 0x54534f50 &&\n val != 0x20544547 &&\n val != 0x4954504f &&\n val != 0xeeeeeeee &&\n val2 != 0x00000000) {\n //initPayload[56] = initPayload[57] = initPayload[58] = initPayload[59] = transport;\n break;\n }\n initPayload.randomize();\n }\n ////////////////////////initPayload.subarray(60, 62).hex = dcID;\n const reversedPayload = initPayload.slice().reverse();\n let encKey = initPayload.slice(8, 40);\n let encIv = initPayload.slice(40, 56);\n let decKey = reversedPayload.slice(8, 40);\n let decIv = reversedPayload.slice(40, 56);\n this.enc = new aes_js_1.default.ModeOfOperation.ctr(encKey, new aes_js_1.default.Counter(encIv));\n this.dec = new aes_js_1.default.ModeOfOperation.ctr(decKey, new aes_js_1.default.Counter(decIv));\n initPayload.set(abridged_1.default.obfuscateTag, 56);\n const encrypted = this.encode(initPayload);\n initPayload.set(encrypted.slice(56, 64), 56);\n return initPayload;\n }\n encode(payload) {\n return this.enc.encrypt(payload);\n }\n decode(data) {\n return this.dec.encrypt(data);\n }\n}\nexports.Obfuscation = Obfuscation;\nclass Socket extends transport_1.default {\n constructor(dcID, url) {\n super(dcID, url);\n this.pending = [];\n this.connected = false;\n this.transport = 'websocket';\n this.obfuscation = new Obfuscation();\n this.debug = false;\n this.connect = () => {\n if (this.ws) {\n this.ws.removeEventListener('open', this.handleOpen);\n this.ws.removeEventListener('close', this.handleClose);\n this.ws.removeEventListener('message', this.handleMessage);\n this.ws.close(1000);\n }\n this.ws = new WebSocket(this.url, 'binary');\n this.ws.binaryType = 'arraybuffer';\n this.ws.onopen = this.handleOpen;\n this.ws.onclose = this.handleClose;\n this.ws.onmessage = this.handleMessage;\n };\n this.handleOpen = () => {\n this.log('opened');\n this.ws.send(this.obfuscation.init());\n this.connected = true;\n this.releasePending();\n };\n this.handleClose = (event) => {\n this.log('closed', event);\n this.connected = false;\n this.pending.length = 0;\n if (this.networker) {\n this.networker.cleanupSent();\n }\n this.log('trying to reconnect...');\n this.connect();\n };\n this.handleMessage = (event) => {\n this.debug && this.log('<-', 'handleMessage', event);\n let data = this.obfuscation.decode(new Uint8Array(event.data));\n data = abridged_1.default.readPacket(data);\n if (this.networker) { // authenticated!\n //this.pending = this.pending.filter(p => p.body); // clear pending\n this.debug && this.log('redirecting to networker');\n return this.networker.parseResponse(data).then(response => {\n this.debug && this.log('redirecting to networker response:', response);\n this.networker.processMessage(response.response, response.messageID, response.sessionID);\n });\n }\n //console.log('got hex:', data.hex);\n let pending = this.pending.shift();\n if (!pending) {\n return this.log('no pending for res:', data.hex);\n }\n pending.resolve(data);\n };\n this.send = (body) => {\n this.debug && this.log('-> body length to pending:', body.length);\n if (this.networker) {\n this.pending.push({ body });\n this.releasePending();\n }\n else {\n let promise = new Promise((resolve, reject) => {\n this.pending.push({ resolve, reject, body });\n });\n this.releasePending();\n return promise;\n }\n };\n this.log = polyfill_1.logger(`WS-${dcID}`);\n this.log('constructor');\n this.connect();\n }\n releasePending() {\n if (!this.connected) {\n //this.connect();\n return;\n }\n let length = this.pending.length;\n for (let i = length - 1; i >= 0; --i) {\n let pending = this.pending[i];\n let { body } = pending;\n if (body) {\n let toEncode = abridged_1.default.encodePacket(body);\n //console.log('send before obf:', /* body.hex, nonce.hex, */ toEncode.hex);\n let enc = this.obfuscation.encode(toEncode);\n //console.log('send after obf:', enc.hex);\n this.debug && this.log('-> body length to send:', enc.length);\n this.ws.send(enc);\n if (!pending.resolve) { // remove if no response needed\n this.pending.splice(i, 1);\n }\n delete pending.body;\n }\n }\n }\n}\nexports.default = Socket;\n" }, { "id": 73, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/abridged.ts", "name": "./src/lib/mtproto/transports/abridged.ts", "index": 38, "index2": 29, "size": 1101, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "issuerId": 71, "issuerName": "./src/lib/mtproto/transports/websocket.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 22, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "name": "./src/lib/mtproto/dcConfigurator.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } }, { "id": 71, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "name": "./src/lib/mtproto/transports/websocket.ts", "profile": { "factory": 20, "building": 660, "dependencies": 2 } } ], "profile": { "factory": 803, "building": 43, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 71, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "module": "./src/lib/mtproto/transports/websocket.ts", "moduleName": "./src/lib/mtproto/transports/websocket.ts", "type": "cjs require", "userRequest": "./abridged", "loc": "8:35-56" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 5, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"../../bin_utils\");\nclass AbridgedPacketCodec {\n constructor() {\n this.tag = 0xef;\n this.obfuscateTag = new Uint8Array([this.tag, this.tag, this.tag, this.tag]);\n }\n encodePacket(data) {\n let len = data.byteLength >> 2;\n let header;\n if (len < 127) {\n header = new Uint8Array([len]);\n }\n else {\n header = new Uint8Array([0x7f, ...bin_utils_1.addPadding(bin_utils_1.bytesFromHex(len.toString(16)).reverse(), 3, true) /* .reverse() */]);\n //console.log('got nobody cause im braindead', header, len);\n }\n return new Uint8Array([...header, ...data]);\n }\n readPacket(data) {\n let length = data[0];\n if (length >= 127) { // 0x7f\n length = data[1] | (data[2] << 8) | (data[3] << 16);\n return data.slice(4, length << 2 + 1); // need +1\n }\n return data.slice(1, length << 2 + 1); // need +1\n }\n}\nexports.default = new AbridgedPacketCodec();\n" }, { "id": 74, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/idb.ts", "name": "./src/lib/idb.ts", "index": 47, "index2": 42, "size": 8812, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "issuerId": 9, "issuerName": "./src/lib/mtproto/apiFileManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 78, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "name": "./src/components/pageSignUp.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } }, { "id": 9, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "name": "./src/lib/mtproto/apiFileManager.ts", "profile": { "factory": 1027, "building": 121, "dependencies": 1 } } ], "profile": { "factory": 630, "building": 30, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 9, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiFileManager.ts", "module": "./src/lib/mtproto/apiFileManager.ts", "moduleName": "./src/lib/mtproto/apiFileManager.ts", "type": "cjs require", "userRequest": "../idb", "loc": "16:30-47" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 5, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst bin_utils_1 = require(\"./bin_utils\");\nconst filemanager_1 = __importDefault(require(\"./filemanager\"));\nclass IdbFileStorage {\n constructor() {\n this.dbName = 'cachedFiles';\n this.dbStoreName = 'files';\n this.dbVersion = 2;\n this.name = 'IndexedDB';\n // @ts-ignore\n //window.indexedDB = window.indexedDB || window.webkitIndexedDB || window.mozIndexedDB || window.OIndexedDB || window.msIndexedDB;\n // @ts-ignore\n window.IDBTransaction = window.IDBTransaction || window.webkitIDBTransaction || window.OIDBTransaction || window.msIDBTransaction;\n this.storageIsAvailable = window.indexedDB !== undefined && window.IDBTransaction !== undefined;\n // IndexedDB is REALLY slow without blob support in Safari 8, no point in it\n if (this.storageIsAvailable &&\n navigator.userAgent.indexOf('Safari') != -1 &&\n navigator.userAgent.indexOf('Chrome') == -1 &&\n navigator.userAgent.match(/Version\\/[678]/)) {\n this.storageIsAvailable = false;\n }\n this.storeBlobsAvailable = this.storageIsAvailable || false;\n this.openDatabase();\n }\n isAvailable() {\n return this.storageIsAvailable;\n }\n openDatabase() {\n if (this.openDbPromise) {\n return this.openDbPromise;\n }\n var createObjectStore;\n try {\n var request = indexedDB.open(this.dbName, this.dbVersion);\n createObjectStore = (db) => {\n db.createObjectStore(this.dbStoreName);\n };\n if (!request) {\n throw new Error();\n }\n }\n catch (error) {\n console.error('error opening db', error.message);\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n var finished = false;\n setTimeout(() => {\n if (!finished) {\n request.onerror({ type: 'IDB_CREATE_TIMEOUT' });\n }\n }, 3000);\n return this.openDbPromise = new Promise((resolve, reject) => {\n request.onsuccess = (event) => {\n finished = true;\n var db = request.result;\n db.onerror = (error) => {\n this.storageIsAvailable = false;\n console.error('Error creating/accessing IndexedDB database', error);\n reject(error);\n };\n resolve(db);\n };\n request.onerror = (event) => {\n finished = true;\n this.storageIsAvailable = false;\n console.error('Error creating/accessing IndexedDB database', event);\n reject(event);\n };\n request.onupgradeneeded = (event) => {\n finished = true;\n console.warn('performing idb upgrade from', event.oldVersion, 'to', event.newVersion);\n // @ts-ignore\n var db = event.target.result;\n if (event.oldVersion == 1) {\n db.deleteObjectStore(this.dbStoreName);\n }\n createObjectStore(db);\n };\n });\n }\n deleteFile(fileName) {\n return this.openDatabase().then((db) => {\n try {\n // @ts-ignore\n var objectStore = db.transaction([this.dbStoreName], IDBTransaction.READ_WRITE || 'readwrite')\n .objectStore(this.dbStoreName);\n console.log('Delete file: `' + fileName + '`');\n var request = objectStore.delete(fileName);\n }\n catch (error) {\n return Promise.reject(error);\n }\n return new Promise((resolve, reject) => {\n request.onsuccess = function (event) {\n console.log('deleted file', event);\n resolve();\n };\n request.onerror = function (error) {\n reject(error);\n };\n });\n });\n }\n saveFile(fileName, blob) {\n return this.openDatabase().then((db) => {\n if (!this.storeBlobsAvailable) {\n return this.saveFileBase64(db, fileName, blob);\n }\n if (!(blob instanceof Blob)) {\n blob = bin_utils_1.blobConstruct([blob]);\n }\n try {\n // @ts-ignore\n var objectStore = db.transaction([this.dbStoreName], IDBTransaction.READ_WRITE || 'readwrite')\n .objectStore(this.dbStoreName);\n var request = objectStore.put(blob, fileName);\n }\n catch (error) {\n if (this.storeBlobsAvailable) {\n this.storeBlobsAvailable = false;\n return this.saveFileBase64(db, fileName, blob);\n }\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n return new Promise((resolve, reject) => {\n request.onsuccess = function (event) {\n resolve(blob);\n };\n request.onerror = function (error) {\n reject(error);\n };\n });\n });\n }\n saveFileBase64(db, fileName, blob) {\n if (this.getBlobSize(blob) > 10 * 1024 * 1024) {\n return Promise.reject();\n }\n if (!(blob instanceof Blob)) {\n var safeMimeType = bin_utils_1.blobSafeMimeType(blob.type || 'image/jpeg');\n var address = 'data:' + safeMimeType + ';base64,' + bin_utils_1.bytesToBase64(blob);\n return this.storagePutB64String(db, fileName, address).then(() => {\n return blob;\n });\n }\n try {\n var reader = new FileReader();\n }\n catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n let promise = new Promise((resolve, reject) => {\n reader.onloadend = () => {\n this.storagePutB64String(db, fileName, reader.result).then(() => {\n resolve(blob);\n }, reject);\n };\n reader.onerror = reject;\n });\n try {\n reader.readAsDataURL(blob);\n }\n catch (e) {\n this.storageIsAvailable = false;\n return Promise.reject();\n }\n return promise;\n }\n storagePutB64String(db, fileName, b64string) {\n try {\n // @ts-ignore\n var objectStore = db.transaction([this.dbStoreName], IDBTransaction.READ_WRITE || 'readwrite')\n .objectStore(this.dbStoreName);\n var request = objectStore.put(b64string, fileName);\n }\n catch (error) {\n this.storageIsAvailable = false;\n return Promise.reject(error);\n }\n return new Promise((resolve, reject) => {\n request.onsuccess = function (event) {\n resolve();\n };\n request.onerror = reject;\n });\n }\n getBlobSize(blob) {\n return blob.size || blob.byteLength || blob.length;\n }\n getFile(fileName, size) {\n return this.openDatabase().then((db) => {\n // @ts-ignore\n var objectStore = db.transaction([this.dbStoreName], IDBTransaction.READ || 'readonly')\n .objectStore(this.dbStoreName);\n var request = objectStore.get(fileName);\n return new Promise((resolve, reject) => {\n request.onsuccess = function (event) {\n // @ts-ignore\n var result = event.target.result;\n if (result === undefined) {\n reject();\n }\n else if (typeof result === 'string' &&\n result.substr(0, 5) === 'data:') {\n resolve(bin_utils_1.dataUrlToBlob(result));\n }\n else {\n resolve(result);\n }\n };\n request.onerror = reject;\n });\n });\n }\n getFileWriter(fileName, mimeType) {\n var fakeWriter = filemanager_1.default.getFakeFileWriter(mimeType, (blob) => {\n this.saveFile(fileName, blob);\n });\n return Promise.resolve(fakeWriter);\n }\n}\nconst idbFileStorage = new IdbFileStorage();\nwindow.IdbFileStorage = idbFileStorage;\nexports.default = idbFileStorage;\n" }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "index": 53, "index2": 81, "size": 10348, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "issuerId": 40, "issuerName": "./src/components/pageSignIn.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 392, "building": 505, "dependencies": 2 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 40, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "module": "./src/components/pageSignIn.ts", "moduleName": "./src/components/pageSignIn.ts", "type": "cjs require", "userRequest": "./pageAuthCode", "loc": "18:39-64" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst pageSignIn_1 = __importDefault(require(\"./pageSignIn\"));\nconst pageSignUp_1 = __importDefault(require(\"./pageSignUp\"));\nconst pageIm_1 = __importDefault(require(\"./pageIm\"));\nconst pagePassword_1 = __importDefault(require(\"./pagePassword\"));\nconst cryptoworker_1 = __importDefault(require(\"../lib/crypto/cryptoworker\"));\nconst lottieLoader_1 = __importDefault(require(\"../lib/lottieLoader\"));\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nlet installed = false;\nlet authCode = null;\nconst EDITONSAMEPAGE = false;\nexports.default = (_authCode) => __awaiter(void 0, void 0, void 0, function* () {\n authCode = _authCode;\n //let LottieLoader = (await import('../lib/lottieLoader')).default;\n let pageElement = document.body.getElementsByClassName('page-authCode')[0];\n pageElement.style.display = '';\n let headerElement = pageElement.getElementsByClassName('phone')[0];\n headerElement.innerText = authCode.phone_number;\n let sentTypeElement = pageElement.getElementsByClassName('sent-type')[0];\n switch (authCode.type._) {\n case 'auth.sentCodeTypeSms':\n sentTypeElement.innerHTML = 'We have sent you an SMS
with the code.';\n break;\n case 'auth.sentCodeTypeApp':\n sentTypeElement.innerHTML = 'We have sent you a message in Telegram
with the code.';\n break;\n case 'auth.sentCodeTypeCall':\n sentTypeElement.innerHTML = 'We will call you and voice
the code.';\n break;\n default:\n sentTypeElement.innerHTML = `Please check everything
for a code (type: ${authCode.type._})`;\n break;\n }\n if (installed)\n return;\n installed = true;\n let needFrame = 0, lastLength = 0;\n let animation = /* AnimationItem */ undefined;\n const CODELENGTH = authCode.type.length;\n fetch('assets/img/TwoFactorSetupMonkeyTracking.tgs')\n .then(res => res.arrayBuffer())\n .then((data) => __awaiter(void 0, void 0, void 0, function* () {\n let str = yield cryptoworker_1.default.gzipUncompress(data, true);\n animation = yield lottieLoader_1.default.loadAnimation({\n container: document.body.querySelector('.page-authCode .auth-image'),\n renderer: 'svg',\n loop: false,\n autoplay: false,\n animationData: JSON.parse(str)\n });\n animation.setSpeed(1);\n //console.log(animation.getDuration(), animation.getDuration(true));\n animation.addEventListener('enterFrame', (e) => {\n //console.log('enterFrame', e, needFrame);\n let currentFrame = Math.round(e.currentTime);\n if ((e.direction == 1 && currentFrame >= needFrame) ||\n (e.direction == -1 && currentFrame <= needFrame)) {\n animation.setSpeed(1);\n animation.pause();\n }\n });\n }));\n const codeInput = document.getElementById('code');\n const codeInputLabel = codeInput.nextElementSibling;\n const editButton = document.querySelector('.phone-edit');\n if (EDITONSAMEPAGE) {\n let editable = false;\n let changePhonePromise;\n let changePhone = () => {\n if (changePhonePromise)\n return;\n let phone_number = '+' + headerElement.innerText.replace(/\\D/g, '');\n if (authCode.phone_number == phone_number)\n return;\n codeInput.setAttribute('disabled', 'true');\n changePhonePromise = apiManager_1.default.invokeApi('auth.sendCode', {\n /* flags: 0, */\n phone_number: phone_number,\n api_id: Config.App.id,\n api_hash: Config.App.hash,\n settings: {\n _: 'codeSettings',\n flags: 0\n }\n /* lang_code: navigator.language || 'en' */\n }).then((code) => {\n console.log('got code 2', code);\n authCode = Object.assign(code, { phone_number });\n changePhonePromise = undefined;\n codeInput.removeAttribute('disabled');\n codeInput.focus();\n }).catch(err => {\n switch (err.type) {\n case 'PHONE_NUMBER_INVALID':\n headerElement.classList.add('error');\n editable = true;\n headerElement.setAttribute('contenteditable', '' + editable);\n headerElement.focus();\n break;\n default:\n codeInputLabel.innerText = err.type;\n break;\n }\n changePhonePromise = undefined;\n codeInput.removeAttribute('disabled');\n });\n };\n headerElement.addEventListener('keypress', function (e) {\n if (e.key == 'Enter') {\n editable = false;\n headerElement.setAttribute('contenteditable', '' + editable);\n changePhone();\n }\n if (/\\D/.test(e.key)) {\n e.preventDefault();\n return false;\n }\n this.classList.remove('error');\n });\n editButton.addEventListener('click', function () {\n if (changePhonePromise)\n return;\n editable = !editable;\n headerElement.setAttribute('contenteditable', '' + editable);\n if (!editable)\n changePhone();\n });\n }\n else {\n editButton.addEventListener('click', function () {\n pageElement.style.display = 'none';\n return pageSignIn_1.default();\n });\n }\n let submitCode = (code) => {\n codeInput.setAttribute('disabled', 'true');\n let params = {\n phone_number: authCode.phone_number,\n phone_code_hash: authCode.phone_code_hash,\n phone_code: code\n };\n console.log('invoking auth.signIn with params:', params);\n apiManager_1.default.invokeApi('auth.signIn', params)\n .then((response) => {\n console.log('auth.signIn response:', response);\n switch (response._) {\n case 'auth.authorization':\n apiManager_1.default.setUserAuth({\n id: response.user.id\n });\n pageElement.style.display = 'none';\n pageIm_1.default();\n if (animation)\n animation.destroy();\n break;\n case 'auth.authorizationSignUpRequired':\n console.log('Registration needed!');\n pageElement.style.display = 'none';\n pageSignUp_1.default({\n 'phone_number': authCode.phone_number,\n 'phone_code_hash': authCode.phone_code_hash\n });\n if (animation)\n animation.destroy();\n break;\n default:\n codeInput.innerText = response._;\n break;\n }\n }).catch(err => {\n codeInput.removeAttribute('disabled');\n switch (err.type) {\n case 'SESSION_PASSWORD_NEEDED':\n console.warn('pageAuthCode: SESSION_PASSWORD_NEEDED');\n err.handled = true;\n pageElement.style.display = 'none';\n if (animation)\n animation.destroy();\n pagePassword_1.default();\n break;\n case 'PHONE_CODE_EMPTY':\n case 'PHONE_CODE_INVALID':\n codeInput.classList.add('error');\n codeInputLabel.innerText = 'Invalid Code';\n break;\n default:\n codeInputLabel.innerText = err.type;\n break;\n }\n });\n };\n const max = 45;\n // 1st symbol = frame 15\n // end symbol = frame 165\n codeInput.addEventListener('input', function (e) {\n this.classList.remove('error');\n this.value = this.value.replace(/\\D/g, '');\n if (this.value.length > CODELENGTH) {\n this.value = this.value.slice(0, CODELENGTH);\n }\n let length = this.value.length;\n if (length == CODELENGTH) { // submit code\n submitCode(this.value);\n }\n else if (length == lastLength) {\n return;\n }\n lastLength = length;\n if (!animation)\n return;\n let frame;\n if (length)\n frame = Math.round((length > max ? max : length) * (165 / max) + 11.33);\n else\n frame = 0;\n //animation.playSegments([1, 2]);\n let direction = needFrame > frame ? -1 : 1;\n //console.log('keydown', length, frame, direction);\n // @ts-ignore\n animation.setDirection(direction);\n if (needFrame != 0 && frame == 0) {\n animation.setSpeed(7);\n }\n /* let diff = Math.abs(needFrame - frame * direction);\n if((diff / 20) > 1) animation.setSpeed(diff / 20 | 0); */\n needFrame = frame;\n animation.play();\n /* animation.goToAndStop(15, true); */\n //animation.goToAndStop(length / max * );\n });\n});\n" }, { "id": 78, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "name": "./src/components/pageSignUp.ts", "index": 54, "index2": 79, "size": 6341, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "issuerId": 77, "issuerName": "./src/components/pageAuthCode.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 278, "building": 994, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "./pageSignUp", "loc": "16:37-60" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst misc_1 = require(\"./misc\");\nlet installed = false;\nlet authCode = null;\nconst cropper_1 = __importDefault(require(\"../lib/cropper\"));\nconst pageIm_1 = __importDefault(require(\"./pageIm\"));\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nconst apiFileManager_1 = __importDefault(require(\"../lib/mtproto/apiFileManager\"));\nexports.default = (_authCode) => {\n authCode = _authCode;\n if (installed)\n return;\n installed = true;\n let pageElement = document.body.getElementsByClassName('page-signUp')[0];\n pageElement.style.display = '';\n const avatarInput = document.getElementById('avatar-input');\n const avatarPopup = pageElement.getElementsByClassName('popup-avatar')[0];\n const avatarPreview = pageElement.querySelector('#canvas-avatar');\n const cropContainer = avatarPopup.getElementsByClassName('crop')[0];\n let avatarImage = new Image();\n cropContainer.append(avatarImage);\n let avatarBlob;\n avatarPopup.getElementsByClassName('popup-close')[0]\n .addEventListener('click', function (e) {\n /* let popup = findUpClassName(this, 'popup');\n popup.classList.remove('active'); */\n setTimeout(() => {\n cropper.removeHandlers();\n if (avatarImage) {\n avatarImage.remove();\n }\n }, 200);\n /* e.cancelBubble = true;\n return false; */\n });\n let cropper = {\n crop: () => { },\n removeHandlers: () => { }\n };\n // apply\n avatarPopup.getElementsByClassName('btn-crop')[0].addEventListener('click', () => {\n cropper.crop();\n avatarPopup.classList.remove('active');\n cropper.removeHandlers();\n avatarPreview.toBlob(blob => {\n avatarBlob = blob; // save blob to send after reg\n // darken\n let ctx = avatarPreview.getContext('2d');\n ctx.fillStyle = \"rgba(0, 0, 0, 0.3)\";\n ctx.fillRect(0, 0, avatarPreview.width, avatarPreview.height);\n }, 'image/jpeg', 1);\n avatarImage.remove();\n });\n avatarInput.addEventListener('change', (e) => {\n var file = e.target.files[0];\n if (!file) {\n return;\n }\n var reader = new FileReader();\n reader.onload = (e) => {\n var contents = e.target.result;\n avatarImage = new Image();\n cropContainer.append(avatarImage);\n avatarImage.src = contents;\n avatarImage.onload = () => {\n cropper = cropper_1.default(avatarImage, avatarPreview);\n avatarInput.value = '';\n };\n avatarPopup.classList.add('active');\n };\n reader.readAsDataURL(file);\n }, false);\n pageElement.querySelector('.auth-image').addEventListener('click', () => {\n avatarInput.click();\n });\n const headerName = pageElement.getElementsByClassName('fullName')[0];\n let handleInput = function (e) {\n let name = fieldName.value || '';\n let lastName = fieldLastName.value || '';\n let fullName = name || lastName\n ? (name + ' ' + lastName).trim()\n : 'Your Name';\n if (headerName.innerText != fullName)\n headerName.innerText = fullName;\n this.classList.remove('error');\n };\n let sendAvatar = () => new Promise((resolve, reject) => {\n if (!avatarBlob) {\n console.log('User has not selected avatar');\n return resolve();\n }\n console.log('invoking uploadFile...');\n apiFileManager_1.default.uploadFile(avatarBlob).then((inputFile) => {\n console.log('uploaded smthn', inputFile);\n apiManager_1.default.invokeApi('photos.uploadProfilePhoto', {\n file: inputFile\n }).then((updateResult) => {\n console.log('updated photo!');\n resolve();\n }, reject);\n }, reject);\n });\n const fieldName = document.getElementById('name');\n fieldName.addEventListener('input', handleInput);\n const fieldLastName = document.getElementById('lastName');\n fieldLastName.addEventListener('input', handleInput);\n const signUpButton = document.getElementById('signUp');\n signUpButton.addEventListener('click', function (e) {\n this.setAttribute('disabled', 'true');\n if (!fieldName.value.length) {\n fieldName.classList.add('error');\n return false;\n }\n let name = fieldName.value;\n let lastName = fieldLastName.value;\n let params = {\n 'phone_number': authCode.phone_number,\n 'phone_code_hash': authCode.phone_code_hash,\n 'first_name': name,\n 'last_name': lastName\n };\n console.log('invoking auth.signUp with params:', params);\n this.textContent = 'PLEASE WAIT...';\n misc_1.putPreloader(this);\n apiManager_1.default.invokeApi('auth.signUp', params)\n .then((response) => {\n console.log('auth.signUp response:', response);\n switch (response._) {\n case 'auth.authorization': // success\n apiManager_1.default.setUserAuth({\n id: response.user.id\n });\n sendAvatar().then(() => {\n pageElement.style.display = 'none';\n pageIm_1.default();\n }, () => {\n pageElement.style.display = 'none';\n pageIm_1.default();\n });\n break;\n default:\n this.innerText = response._;\n break;\n }\n /* (document.body.getElementsByClassName('page-sign')[0] as HTMLDivElement).style.display = 'none';\n pageAuthCode(Object.assign(code, {phoneNumber})); */\n }).catch(err => {\n this.removeAttribute('disabled');\n switch (err.type) {\n default:\n this.innerText = err.type;\n break;\n }\n });\n });\n};\n" }, { "id": 79, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/cropper.ts", "name": "./src/lib/cropper.ts", "index": 55, "index2": 51, "size": 7687, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "issuerId": 78, "issuerName": "./src/components/pageSignUp.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 78, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "name": "./src/components/pageSignUp.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } } ], "profile": { "factory": 1027, "building": 121, "dependencies": 1 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 78, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignUp.ts", "module": "./src/components/pageSignUp.ts", "moduleName": "./src/components/pageSignUp.ts", "type": "cjs require", "userRequest": "../lib/cropper", "loc": "9:34-59" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nfunction resizeableImage(image_target, resize_canvas) {\n var cropComponent, container, crop_img, event_state = {}, ratio = 1.0, keyZoomValue = 4.0, MINWIDTH = 50\n //, MINHEIGHT = 50\n , CROPWIDTH = 200, CROPHEIGHT = 200, cropLeft = 0, cropTop = 0, cropWidth = 0, cropHeight = 0;\n if (image_target.complete) {\n init();\n }\n else {\n image_target.onload = init;\n }\n function removeHandlers() {\n container.removeEventListener('mousedown', startMoving);\n container.removeEventListener('touchstart', startMoving);\n container.removeEventListener('wheel', resizing);\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n document.removeEventListener('keypress', keyHandler);\n cropComponent.remove();\n container.remove();\n crop_img.remove();\n }\n function addHandlers() {\n container.addEventListener('mousedown', startMoving, false);\n container.addEventListener('touchstart', startMoving, false);\n container.addEventListener('wheel', resizing, false);\n document.addEventListener('keypress', keyHandler, false);\n //document.querySelector('.btn-crop').addEventListener('click', openCropCanvasImg);\n }\n function init() {\n var wraper, left, top;\n if (image_target.dataset.isCrop) {\n throw 'image is already crop';\n }\n image_target.dataset.isCrop = 'true';\n image_target.classList.add('crop-blur');\n image_target.draggable = false;\n crop_img = new Image();\n crop_img.crossOrigin = image_target.crossOrigin;\n crop_img.src = image_target.src;\n crop_img.draggable = false;\n if (!resize_canvas) {\n resize_canvas = document.createElement('canvas');\n }\n cropComponent = document.createElement('div');\n cropComponent.classList.add('crop-component');\n container = document.createElement('div');\n container.classList.add('overlay');\n let overlayColor = document.createElement('div');\n overlayColor.classList.add('crop-overlay-color');\n cropComponent.appendChild(container);\n wraper = image_target.parentNode;\n wraper.appendChild(cropComponent);\n cropComponent.appendChild(crop_img);\n cropComponent.appendChild(image_target);\n cropComponent.appendChild(overlayColor);\n container.appendChild(crop_img);\n crop_img.style.maxWidth = image_target.width + 'px';\n left = image_target.offsetWidth / 2 - CROPWIDTH / 2;\n top = image_target.offsetHeight / 2 - CROPHEIGHT / 2;\n updateCropImage(left, top);\n addHandlers();\n }\n function updateCropSize(width, height) {\n container.style.width = width + 'px';\n container.style.height = height + 'px';\n }\n function updateCropImage(left, top) {\n cropLeft = -left * ratio;\n cropTop = -top * ratio;\n crop_img.style.top = -top + 'px';\n crop_img.style.left = -left + 'px';\n }\n function updateContainer(left, top) {\n let _top = top + (CROPWIDTH / 2) + 'px';\n let _left = left + (CROPHEIGHT / 2) + 'px';\n container.style.top = _top;\n container.style.left = _left;\n }\n // Save the initial event details and container state\n function saveEventState(e) {\n event_state.container_width = container.offsetWidth;\n event_state.container_height = container.offsetHeight;\n event_state.container_left = container.offsetLeft;\n event_state.container_top = container.offsetTop;\n event_state.mouse_x = (e.clientX || e.pageX || e.touches && e.touches[0].clientX) + window.scrollX;\n event_state.mouse_y = (e.clientY || e.pageY || e.touches && e.touches[0].clientY) + window.scrollY;\n }\n function imgZoom(zoom) {\n zoom = zoom * Math.PI * 2;\n var newWidth = Math.floor(container.clientWidth + zoom), newHeight = Math.floor(container.clientHeight + zoom), w = crop_img.clientWidth, h = crop_img.clientHeight, left, top, right, bottom;\n if (newWidth < MINWIDTH) {\n return;\n }\n else if (newWidth > w) {\n return;\n }\n left = container.offsetLeft - (zoom / 2);\n top = container.offsetTop - (zoom / 2);\n right = left + newWidth;\n bottom = top + newHeight;\n if (left < 0) {\n left = 0;\n }\n if (top < 0) {\n top = 0;\n }\n if (right > w) {\n return;\n }\n if (bottom > h) {\n return;\n }\n ratio = CROPWIDTH / newWidth;\n updateCropSize(newWidth, newWidth);\n updateCropImage(left, top);\n updateContainer(left, top);\n //crop();\n }\n function keyHandler(e) {\n e.preventDefault();\n switch (String.fromCharCode(e.charCode)) {\n case '+':\n imgZoom(keyZoomValue);\n break;\n case '-':\n imgZoom(-keyZoomValue);\n break;\n }\n }\n function resizing(e) {\n e.preventDefault();\n imgZoom(e.deltaY > 0 ? 1 : -1);\n }\n function startMoving(e) {\n e.preventDefault();\n e.stopPropagation();\n saveEventState(e);\n document.addEventListener('mousemove', moving);\n document.addEventListener('touchmove', moving);\n document.addEventListener('mouseup', endMoving);\n document.addEventListener('touchend', endMoving);\n }\n function endMoving(e) {\n e.preventDefault();\n document.removeEventListener('mouseup', endMoving);\n document.removeEventListener('touchend', endMoving);\n document.removeEventListener('mousemove', moving);\n document.removeEventListener('touchmove', moving);\n }\n function moving(e) {\n var curuntTouch = { x: 0, y: 0 }, left, top, w, h;\n e.preventDefault();\n e.stopPropagation();\n curuntTouch.x = e.pageX || e.touches && e.touches[0].pageX;\n curuntTouch.y = e.pageY || e.touches && e.touches[0].pageY;\n left = curuntTouch.x - (event_state.mouse_x - event_state.container_left);\n top = curuntTouch.y - (event_state.mouse_y - event_state.container_top);\n w = container.offsetWidth;\n h = container.offsetHeight;\n if (left < 0) {\n left = 0;\n }\n else if (left > crop_img.offsetWidth - w) {\n left = crop_img.offsetWidth - w;\n }\n if (top < 0) {\n top = 0;\n }\n else if (top > crop_img.offsetHeight - h) {\n top = crop_img.offsetHeight - h;\n }\n updateCropImage(left, top);\n updateContainer(left, top);\n }\n function crop() {\n cropWidth = crop_img.width * ratio;\n cropHeight = crop_img.height * ratio;\n resize_canvas.width = CROPWIDTH;\n resize_canvas.height = CROPHEIGHT;\n var ctx = resize_canvas.getContext('2d');\n ctx.drawImage(crop_img, cropLeft, cropTop, cropWidth, cropHeight);\n }\n return { crop, removeHandlers };\n /* function openCropCanvasImg() {\n crop();\n \n try {\n var base64Img = resize_canvas.toDataURL('image/png', 1.0);\n window.open(base64Img);\n } catch(e) {\n alert(e);\n } finally {\n // removeHandlers();\n }\n \n } */\n}\n//resizeableImage(document.querySelector('.crop-image'));\nexports.default = resizeableImage;\n" }, { "id": 80, "identifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/StackBlur.js", "name": "./src/lib/StackBlur.js", "index": 57, "index2": 52, "size": 17696, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "issuerId": 25, "issuerName": "./src/components/pageIm.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 323, "building": 561, "dependencies": 110 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 25, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "module": "./src/components/pageIm.ts", "moduleName": "./src/components/pageIm.ts", "type": "cjs require", "userRequest": "../lib/StackBlur", "loc": "16:20-47" } ], "usedExports": true, "providedExports": [ "stackBlurImage", "stackBlurCanvasRGBA", "stackBlurCanvasRGB" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/components/pageIm.ts (referenced with cjs require)" ], "depth": 2, "source": "/*\n\nStackBlur - a fast almost Gaussian Blur For Canvas\n\nVersion: \t0.5\nAuthor:\t\tMario Klingemann\nContact: \tmario@quasimondo.com\nWebsite:\thttp://www.quasimondo.com/StackBlurForCanvas\nTwitter:\t@quasimondo\n\nIn case you find this class useful - especially in commercial projects -\nI am not totally unhappy for a small donation to my PayPal account\nmario@quasimondo.de\n\nOr support me on flattr: \nhttps://flattr.com/thing/72791/StackBlur-a-fast-almost-Gaussian-Blur-Effect-for-CanvasJavascript\n\nCopyright (c) 2010 Mario Klingemann\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n*/\n\nvar mul_table = [\n 512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,\n 454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,\n 482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,\n 437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,\n 497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,\n 320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,\n 446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,\n 329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,\n 505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,\n 399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,\n 324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,\n 268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,\n 451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,\n 385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,\n 332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,\n 289,287,285,282,280,278,275,273,271,269,267,265,263,261,259\n];\n\n\nvar shg_table = [\n 9, 11, 12, 13, 13, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, \n 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 19, \n 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20,\n 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,\n 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, \n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,\n 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, \n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,\n 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, \n 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, \n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,\n 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24 \n];\n\nexport function stackBlurImage(imageID, canvasID, radius, blurAlphaChannel) {\n // modifications 02.02.2020\n var img;\n if(typeof(imageID) === 'string') {\n img = document.getElementById(imageID);\n } else {\n img = imageID;\n }\n \n var w = img.naturalWidth;\n var h = img.naturalHeight;\n \n var canvas = document.getElementById(canvasID);\n \n canvas.style.width = w + \"px\";\n canvas.style.height = h + \"px\";\n canvas.width = w;\n canvas.height = h;\n \n var context = canvas.getContext(\"2d\");\n context.clearRect(0, 0, w, h);\n context.drawImage(img, 0, 0);\n \n if(isNaN(radius) || radius < 1) return;\n \n if(blurAlphaChannel) return stackBlurCanvasRGBA(canvasID, 0, 0, w, h, radius);\n else return stackBlurCanvasRGB(canvasID, 0, 0, w, h, radius);\n}\n\n\nexport function stackBlurCanvasRGBA(id, top_x, top_y, width, height, radius) {\n if(isNaN(radius) || radius < 1) return;\n radius |= 0;\n \n var canvas = document.getElementById( id );\n var context = canvas.getContext(\"2d\");\n var imageData;\n \n try {\n try {\n imageData = context.getImageData( top_x, top_y, width, height );\n } catch(e) {\n \n // NOTE: this part is supposedly only needed if you want to work with local files\n // so it might be okay to remove the whole try/catch block and just use\n // imageData = context.getImageData( top_x, top_y, width, height );\n try {\n //netscape.security.PrivilegeManager.enablePrivilege(\"UniversalBrowserRead\");\n imageData = context.getImageData( top_x, top_y, width, height );\n } catch(e) {\n alert(\"Cannot access local image\");\n throw new Error(\"unable to access local image data: \" + e);\n return;\n }\n }\n } catch(e) {\n alert(\"Cannot access image\");\n throw new Error(\"unable to access image data: \" + e);\n }\n \n var pixels = imageData.data;\n \n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum, a_sum, \n r_out_sum, g_out_sum, b_out_sum, a_out_sum,\n r_in_sum, g_in_sum, b_in_sum, a_in_sum, \n pr, pg, pb, pa, rbs;\n \n var div = radius + radius + 1;\n var w4 = width << 2;\n var widthMinus1 = width - 1;\n var heightMinus1 = height - 1;\n var radiusPlus1 = radius + 1;\n var sumFactor = radiusPlus1 * ( radiusPlus1 + 1 ) / 2;\n \n var stackStart = new BlurStack();\n var stack = stackStart;\n for ( i = 1; i < div; i++ )\n {\n stack = stack.next = new BlurStack();\n if ( i == radiusPlus1 ) var stackEnd = stack;\n }\n stack.next = stackStart;\n var stackIn = null;\n var stackOut = null;\n \n yw = yi = 0;\n \n var mul_sum = mul_table[radius];\n var shg_sum = shg_table[radius];\n \n for ( y = 0; y < height; y++ )\n {\n r_in_sum = g_in_sum = b_in_sum = a_in_sum = r_sum = g_sum = b_sum = a_sum = 0;\n \n r_out_sum = radiusPlus1 * ( pr = pixels[yi] );\n g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] );\n b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] );\n a_out_sum = radiusPlus1 * ( pa = pixels[yi+3] );\n \n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n \n stack = stackStart;\n \n for( i = 0; i < radiusPlus1; i++ )\n {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n \n for( i = 1; i < radiusPlus1; i++ )\n {\n p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 );\n r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i );\n g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs;\n b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs;\n a_sum += ( stack.a = ( pa = pixels[p+3])) * rbs;\n \n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n \n stack = stack.next;\n }\n \n \n stackIn = stackStart;\n stackOut = stackEnd;\n for ( x = 0; x < width; x++ )\n {\n pixels[yi+3] = pa = (a_sum * mul_sum) >> shg_sum;\n if ( pa != 0 )\n {\n pa = 255 / pa;\n pixels[yi] = ((r_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi+1] = ((g_sum * mul_sum) >> shg_sum) * pa;\n pixels[yi+2] = ((b_sum * mul_sum) >> shg_sum) * pa;\n } else {\n pixels[yi] = pixels[yi+1] = pixels[yi+2] = 0;\n }\n \n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n \n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n \n p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2;\n \n r_in_sum += ( stackIn.r = pixels[p]);\n g_in_sum += ( stackIn.g = pixels[p+1]);\n b_in_sum += ( stackIn.b = pixels[p+2]);\n a_in_sum += ( stackIn.a = pixels[p+3]);\n \n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n a_sum += a_in_sum;\n \n stackIn = stackIn.next;\n \n r_out_sum += ( pr = stackOut.r );\n g_out_sum += ( pg = stackOut.g );\n b_out_sum += ( pb = stackOut.b );\n a_out_sum += ( pa = stackOut.a );\n \n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n \n stackOut = stackOut.next;\n \n yi += 4;\n }\n yw += width;\n }\n \n \n for ( x = 0; x < width; x++ )\n {\n g_in_sum = b_in_sum = a_in_sum = r_in_sum = g_sum = b_sum = a_sum = r_sum = 0;\n \n yi = x << 2;\n r_out_sum = radiusPlus1 * ( pr = pixels[yi]);\n g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]);\n b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]);\n a_out_sum = radiusPlus1 * ( pa = pixels[yi+3]);\n \n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n a_sum += sumFactor * pa;\n \n stack = stackStart;\n \n for( i = 0; i < radiusPlus1; i++ )\n {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack.a = pa;\n stack = stack.next;\n }\n \n yp = width;\n \n for( i = 1; i <= radius; i++ )\n {\n yi = ( yp + x ) << 2;\n \n r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i );\n g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs;\n b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs;\n a_sum += ( stack.a = ( pa = pixels[yi+3])) * rbs;\n \n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n a_in_sum += pa;\n \n stack = stack.next;\n \n if( i < heightMinus1 )\n {\n yp += width;\n }\n }\n \n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for ( y = 0; y < height; y++ )\n {\n p = yi << 2;\n pixels[p+3] = pa = (a_sum * mul_sum) >> shg_sum;\n if ( pa > 0 )\n {\n pa = 255 / pa;\n pixels[p] = ((r_sum * mul_sum) >> shg_sum ) * pa;\n pixels[p+1] = ((g_sum * mul_sum) >> shg_sum ) * pa;\n pixels[p+2] = ((b_sum * mul_sum) >> shg_sum ) * pa;\n } else {\n pixels[p] = pixels[p+1] = pixels[p+2] = 0;\n }\n \n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n a_sum -= a_out_sum;\n \n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n a_out_sum -= stackIn.a;\n \n p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2;\n \n r_sum += ( r_in_sum += ( stackIn.r = pixels[p]));\n g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1]));\n b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2]));\n a_sum += ( a_in_sum += ( stackIn.a = pixels[p+3]));\n \n stackIn = stackIn.next;\n \n r_out_sum += ( pr = stackOut.r );\n g_out_sum += ( pg = stackOut.g );\n b_out_sum += ( pb = stackOut.b );\n a_out_sum += ( pa = stackOut.a );\n \n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n a_in_sum -= pa;\n \n stackOut = stackOut.next;\n \n yi += width;\n }\n }\n \n context.putImageData( imageData, top_x, top_y );\n return imageData;\n}\n\n\nexport function stackBlurCanvasRGB(id, top_x, top_y, width, height, radius) {\n if(isNaN(radius) || radius < 1) return;\n radius |= 0;\n \n var canvas = document.getElementById(id);\n var context = canvas.getContext(\"2d\");\n var imageData;\n \n try {\n try {\n imageData = context.getImageData(top_x, top_y, width, height);\n } catch(e) {\n \n // NOTE: this part is supposedly only needed if you want to work with local files\n // so it might be okay to remove the whole try/catch block and just use\n // imageData = context.getImageData( top_x, top_y, width, height );\n try {\n //netscape.security.PrivilegeManager.enablePrivilege(\"UniversalBrowserRead\");\n imageData = context.getImageData(top_x, top_y, width, height);\n } catch(e) {\n //alert(\"Cannot access local image\");\n throw new Error(\"unable to access local image data: \" + e);\n return;\n }\n }\n } catch(e) {\n //alert(\"Cannot access image\");\n throw new Error(\"unable to access image data: \" + e);\n }\n \n var pixels = imageData.data;\n \n var x, y, i, p, yp, yi, yw, r_sum, g_sum, b_sum,\n r_out_sum, g_out_sum, b_out_sum,\n r_in_sum, g_in_sum, b_in_sum,\n pr, pg, pb, rbs;\n \n var div = radius + radius + 1;\n var w4 = width << 2;\n var widthMinus1 = width - 1;\n var heightMinus1 = height - 1;\n var radiusPlus1 = radius + 1;\n var sumFactor = radiusPlus1 * (radiusPlus1 + 1) / 2;\n \n var stackStart = new BlurStack();\n var stack = stackStart;\n for(i = 1; i < div; i++) {\n stack = stack.next = new BlurStack();\n if(i == radiusPlus1) var stackEnd = stack;\n }\n stack.next = stackStart;\n var stackIn = null;\n var stackOut = null;\n \n yw = yi = 0;\n \n var mul_sum = mul_table[radius];\n var shg_sum = shg_table[radius];\n \n for(y = 0; y < height; y++) {\n r_in_sum = g_in_sum = b_in_sum = r_sum = g_sum = b_sum = 0;\n \n r_out_sum = radiusPlus1 * ( pr = pixels[yi] );\n g_out_sum = radiusPlus1 * ( pg = pixels[yi+1] );\n b_out_sum = radiusPlus1 * ( pb = pixels[yi+2] );\n \n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n \n stack = stackStart;\n \n for( i = 0; i < radiusPlus1; i++ )\n {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack = stack.next;\n }\n \n for( i = 1; i < radiusPlus1; i++ )\n {\n p = yi + (( widthMinus1 < i ? widthMinus1 : i ) << 2 );\n r_sum += ( stack.r = ( pr = pixels[p])) * ( rbs = radiusPlus1 - i );\n g_sum += ( stack.g = ( pg = pixels[p+1])) * rbs;\n b_sum += ( stack.b = ( pb = pixels[p+2])) * rbs;\n \n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n \n stack = stack.next;\n }\n \n \n stackIn = stackStart;\n stackOut = stackEnd;\n for ( x = 0; x < width; x++ )\n {\n pixels[yi] = (r_sum * mul_sum) >> shg_sum;\n pixels[yi+1] = (g_sum * mul_sum) >> shg_sum;\n pixels[yi+2] = (b_sum * mul_sum) >> shg_sum;\n \n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n \n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n \n p = ( yw + ( ( p = x + radius + 1 ) < widthMinus1 ? p : widthMinus1 ) ) << 2;\n \n r_in_sum += ( stackIn.r = pixels[p]);\n g_in_sum += ( stackIn.g = pixels[p+1]);\n b_in_sum += ( stackIn.b = pixels[p+2]);\n \n r_sum += r_in_sum;\n g_sum += g_in_sum;\n b_sum += b_in_sum;\n \n stackIn = stackIn.next;\n \n r_out_sum += ( pr = stackOut.r );\n g_out_sum += ( pg = stackOut.g );\n b_out_sum += ( pb = stackOut.b );\n \n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n \n stackOut = stackOut.next;\n \n yi += 4;\n }\n yw += width;\n }\n \n \n for ( x = 0; x < width; x++ )\n {\n g_in_sum = b_in_sum = r_in_sum = g_sum = b_sum = r_sum = 0;\n \n yi = x << 2;\n r_out_sum = radiusPlus1 * ( pr = pixels[yi]);\n g_out_sum = radiusPlus1 * ( pg = pixels[yi+1]);\n b_out_sum = radiusPlus1 * ( pb = pixels[yi+2]);\n \n r_sum += sumFactor * pr;\n g_sum += sumFactor * pg;\n b_sum += sumFactor * pb;\n \n stack = stackStart;\n \n for( i = 0; i < radiusPlus1; i++ )\n {\n stack.r = pr;\n stack.g = pg;\n stack.b = pb;\n stack = stack.next;\n }\n \n yp = width;\n \n for( i = 1; i <= radius; i++ )\n {\n yi = ( yp + x ) << 2;\n \n r_sum += ( stack.r = ( pr = pixels[yi])) * ( rbs = radiusPlus1 - i );\n g_sum += ( stack.g = ( pg = pixels[yi+1])) * rbs;\n b_sum += ( stack.b = ( pb = pixels[yi+2])) * rbs;\n \n r_in_sum += pr;\n g_in_sum += pg;\n b_in_sum += pb;\n \n stack = stack.next;\n \n if( i < heightMinus1 )\n {\n yp += width;\n }\n }\n \n yi = x;\n stackIn = stackStart;\n stackOut = stackEnd;\n for ( y = 0; y < height; y++ )\n {\n p = yi << 2;\n pixels[p] = (r_sum * mul_sum) >> shg_sum;\n pixels[p+1] = (g_sum * mul_sum) >> shg_sum;\n pixels[p+2] = (b_sum * mul_sum) >> shg_sum;\n \n r_sum -= r_out_sum;\n g_sum -= g_out_sum;\n b_sum -= b_out_sum;\n \n r_out_sum -= stackIn.r;\n g_out_sum -= stackIn.g;\n b_out_sum -= stackIn.b;\n \n p = ( x + (( ( p = y + radiusPlus1) < heightMinus1 ? p : heightMinus1 ) * width )) << 2;\n \n r_sum += ( r_in_sum += ( stackIn.r = pixels[p]));\n g_sum += ( g_in_sum += ( stackIn.g = pixels[p+1]));\n b_sum += ( b_in_sum += ( stackIn.b = pixels[p+2]));\n \n stackIn = stackIn.next;\n \n r_out_sum += ( pr = stackOut.r );\n g_out_sum += ( pg = stackOut.g );\n b_out_sum += ( pb = stackOut.b );\n \n r_in_sum -= pr;\n g_in_sum -= pg;\n b_in_sum -= pb;\n \n stackOut = stackOut.next;\n \n yi += width;\n }\n }\n \n context.putImageData(imageData, top_x, top_y);\n\n return imageData;\n}\n\nfunction BlurStack() {\n this.r = 0;\n this.g = 0;\n this.b = 0;\n this.a = 0;\n this.next = null;\n}\n" }, { "id": 82, "identifier": "/Users/kuzmenko/Documents/projects/tweb/src/lib/ckin.js", "name": "./src/lib/ckin.js", "index": 78, "index2": 67, "size": 11282, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "issuerId": 30, "issuerName": "./src/components/wrappers.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } }, { "id": 30, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "name": "./src/components/wrappers.ts", "profile": { "factory": 208, "building": 300, "dependencies": 449 } } ], "profile": { "factory": 451, "building": 74 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 30, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/wrappers.ts", "module": "./src/components/wrappers.ts", "moduleName": "./src/components/wrappers.ts", "type": "cjs require", "userRequest": "../lib/ckin", "loc": "24:15-37" } ], "usedExports": true, "providedExports": [ "wrapPlayer" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/components/wrappers.ts (referenced with cjs require)" ], "depth": 5, "source": "(function () {\n\tif (typeof NodeList.prototype.forEach === \"function\") return false;\n\tNodeList.prototype.forEach = Array.prototype.forEach;\n})();\n\nString.prototype.toHHMMSS = function(leadZero) {\n let sec_num = parseInt(this, 10);\n let hours = Math.floor(sec_num / 3600);\n let minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n let seconds = sec_num - (hours * 3600) - (minutes * 60);\n \n if(hours < 10) hours = \"0\" + hours;\n if(minutes < 10) minutes = leadZero ? \"0\" + minutes : minutes;\n if(seconds < 10) seconds = \"0\" + seconds;\n return minutes + ':' + seconds;\n}\n\nfunction stylePlayer(player, video) {\n\tlet skin = attachSkin(video.dataset.ckin);\n\tplayer.classList.add(skin);\n\n\tlet html = buildControls(skin);\n\tplayer.insertAdjacentHTML('beforeend', html);\n\tlet updateInterval = 0;\n\tlet elapsed = 0;\n\tlet prevTime = 0;\n\n\tif (skin === 'default') {\n\t\tvar progress = player.querySelector('.progress');;\n\t\tvar progressBar = player.querySelector('.progress__filled');\n\t\tvar toggle = player.querySelectorAll('.toggle');\n\t\tvar fullScreenButton = player.querySelector('.fullscreen');\n\t\tvar seek = player.querySelector('#seek');\n\t\tvar timeElapsed = player.querySelector('#time-elapsed');\n\t\tvar timeDuration = player.querySelector('#time-duration');\n\t\ttimeDuration.innerHTML = String(video.duration | 0).toHHMMSS();\n\n\t\ttoggle.forEach((button) => {\n\t\t\treturn button.addEventListener('click', () => {\n\t\t\t\ttogglePlay(video, player);\n\t\t\t});\n\t\t});\n\n\t\tvideo.addEventListener('click', function () {\n\t\t\ttogglePlay(this, player);\n\t\t});\n\n\t\tvideo.addEventListener('play', function () {\n\t\t\tupdateButton(this, toggle);\n\t\t\tupdateInterval = setInterval(function () {\n\t\t\t\tif (video.paused) return; //chtob ne prigal seek pri peremotke\n\t\t\t\t//elapsed += 0.02; // Increase with timer interval\n\t\t\t\tif (video.currentTime != prevTime) {\n\t\t\t\t\telapsed = video.currentTime; // Update if getCurrentTime was changed\n\t\t\t\t\tprevTime = video.currentTime;\n\t\t\t\t}\n\t\t\t\tlet scaleX = (elapsed / video.duration);\n\t\t\t\tprogressBar.style.transform = 'scaleX(' + scaleX + ')';\n\t\t\t\tif (video.paused) clearInterval(updateInterval);\n\t\t\t\tseek.value = video.currentTime * 1000;\n\t\t\t}, 20);\n\t\t});\n\n\t\tvideo.addEventListener('ended', function () {\n\t\t\tprogressBar.style.transform = 'scaleX(1)';\n\t\t\tseek.value = video.currentTime * 1000;\n\t\t});\n\n\t\tvideo.addEventListener('pause', function () {\n\t\t\tupdateButton(this, toggle);\n\t\t\tclearInterval(updateInterval);\n\t\t});\n\n\t\tvideo.addEventListener('dblclick', function () {\n\t\t\treturn toggleFullScreen(player, fullScreenButton);\n\t\t})\n\n\t\tlet mousedown = false;\n\t\tlet stopAndScrubTimeout = 0;\n\t\tprogress.addEventListener('mousemove', (e) => {\n\t\t\treturn mousedown && scrub(e, video, progress, progressBar);\n\t\t});\n\t\tprogress.addEventListener('mousedown', (e) => {\n\t\t\tscrub(e, video, progress, progressBar, updateInterval);\n\t\t\t//Таймер для того, чтобы стопать видео, если зажал мышку и не отпустил клик\n\t\t\tstopAndScrubTimeout = setTimeout(function () {\n\t\t\t\ttogglePlay(video, player, 1);\n\t\t\t}, 150);\n\n\t\t\treturn mousedown = true;\n\t\t});\n\t\tprogress.addEventListener('mouseup', () => {\n\t\t\tif (typeof stopAndScrubTimeout !== 'undefined') {\n\t\t\t\tclearTimeout(stopAndScrubTimeout);\n\t\t\t}\n\t\t\ttogglePlay(video, player, 0);\n\t\t\treturn mousedown = false;\n\t\t});\n\t\tfullScreenButton.addEventListener('click', (e) => {\n\t\t\treturn toggleFullScreen(player, fullScreenButton);\n\t\t});\n\t\taddListenerMulti(player, 'webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange', (e) => {\n\t\t\treturn onFullScreen(e, player);\n\t\t});\n\t}\n\n\tif (skin === 'circle') {\n\t\tlet wrapper = document.createElement('div');\n\t\twrapper.classList.add('circle-time-left');\n\t\tvideo.parentNode.insertBefore(wrapper, video);\n\t\twrapper.innerHTML = '
';\n\n\t\tvar circle = player.querySelector('.progress-ring__circle');\n\t\tvar radius = circle.r.baseVal.value;\n\t\tvar circumference = 2 * Math.PI * radius;\n\t\tvar timeDuration = player.querySelector('.circle-time');\n\t\tvar iconVolume = player.querySelector('.iconVolume');\n\t\tcircle.style.strokeDasharray = circumference + ' ' + circumference;\n\t\tcircle.style.strokeDashoffset = circumference;\n\t\tcircle.addEventListener('click', () => {\n\t\t\ttogglePlay(video, player);\n\t\t});\n\n\t\tvideo.addEventListener('play', () => {\n\t\t\ticonVolume.style.display = 'none';\n\t\t\tupdateInterval = setInterval(function () {\n\t\t\t\t//elapsed += 0.02; // Increase with timer interval\n\t\t\t\tif (video.currentTime != prevTime) {\n\t\t\t\t\telapsed = video.currentTime; // Update if getCurrentTime was changed\n\t\t\t\t\tprevTime = video.currentTime;\n\t\t\t\t}\n\t\t\t\tlet offset = circumference - elapsed / video.duration * circumference;\n\t\t\t\tcircle.style.strokeDashoffset = offset;\n\t\t\t\tif (video.paused) clearInterval(updateInterval);\n\t\t\t}, 20);\n\t\t});\n\n\t\tvideo.addEventListener('pause', () => {\n\t\t\ticonVolume.style.display = '';\n\t\t});\n\t}\n\n\t//Для хрома\n\ttimeDuration.innerHTML = String(Math.round(video.duration)).toHHMMSS();\n\tif (skin === 'default') seek.setAttribute('max', video.duration * 1000);\n\t//Для Opera / Safari / IE\n\tvideo.addEventListener('loadeddata', function () {\n\t\ttimeDuration.innerHTML = String(Math.round(video.duration)).toHHMMSS();\n\t\tif (skin === 'default') seek.setAttribute('max', video.duration * 1000);\n\t})\n\n\tvideo.addEventListener('timeupdate', function () {\n\t\tupdateInterval = handleProgress(this, skin, timeDuration, circumference, circle, progressBar, seek, timeElapsed, updateInterval);\n\t});\n}\n\nfunction showControls(video) {\n\tvideo.setAttribute(\"controls\", \"controls\");\n}\n\nfunction togglePlay(video, player, stop) {\n\tif (stop == 1) {\n\t\tvideo['pause']();\n\t\tplayer.classList.remove('is-playing');\n\t\treturn;\n\t} else if (stop == 0) {\n\t\tvideo['play']();\n\t\tplayer.classList.add('is-playing');\n\t\treturn;\n\t}\n\n\tlet method = video.paused ? 'play' : 'pause';\n\tvideo[method]();\n\tvideo.paused ? player.classList.remove('is-playing') : player.classList.add('is-playing');\n}\n\nfunction updateButton(video, toggle) {\n\tlet icon = video.paused ? 'tgico-play' : 'tgico-pause';\n\ttoggle.forEach((button) => {\n\t\tbutton.classList.remove('tgico-play', 'tgico-pause');\n\t\tbutton.classList.add(icon);\n\t});\n}\n\nfunction handleProgress(video, skin, timeDuration, circumference, circle, progressBar, seek, timeElapsed, updateInterval, mousemove) {\n\tclearInterval(updateInterval);\n\tlet elapsed = 0;\n\tlet prevTime = 0;\n\tif (skin === 'default') {\n\t\tupdateInterval = setInterval(function () {\n\t\t\tif (video.paused) return;\n\t\t\tif (video.currentTime != prevTime) {\n\t\t\t\telapsed = video.currentTime; // Update if getCurrentTime was changed\n\t\t\t\tprevTime = video.currentTime;\n\t\t\t}\n\t\t\tlet scaleX = (elapsed / video.duration);\n\t\t\tprogressBar.style.transform = 'scaleX(' + scaleX + ')';\n\t\t\tif (video.paused) clearInterval(updateInterval);\n\t\t\tseek.value = video.currentTime * 1000;\n\t\t}, 20);\n\t\ttimeElapsed.innerHTML = String(video.currentTime | 0).toHHMMSS();\n\t\treturn updateInterval;\n\t} else if (skin === 'circle') {\n\t\tupdateInterval = setInterval(function () {\n\t\t\tif (video.currentTime != prevTime) {\n\t\t\t\telapsed = video.currentTime; // Update if getCurrentTime was changed\n\t\t\t\tprevTime = video.currentTime;\n\t\t\t}\n\t\t\tlet offset = circumference - elapsed / video.duration * circumference;\n\t\t\tcircle.style.strokeDashoffset = offset;\n\t\t\tif (video.paused) clearInterval(updateInterval);\n\t\t}, 20);\n\t\tlet timeLeft = String((video.duration - video.currentTime) | 0).toHHMMSS();\n\t\tif (timeLeft != 0 | 0) timeDuration.innerHTML = timeLeft;\n\t}\n}\n\nfunction scrub(e, video, progress, progressBar) {\n\tlet scrubTime = e.offsetX / progress.offsetWidth * video.duration;\n\tvideo.currentTime = scrubTime;\n\tlet scaleX = scrubTime / video.duration;\n\n\tif (scaleX > 1) scaleX = 1;\n\tif (scaleX < 0) scaleX = 0;\n\n\tprogressBar.style.transform = 'scaleX(' + scaleX + ')';\n}\n\nexport function wrapPlayer(video) {\n\tlet wrapper = document.createElement('div');\n\twrapper.classList.add('ckin__player');\n\n\tvideo.parentNode.insertBefore(wrapper, video);\n\twrapper.appendChild(video);\n\n\tstylePlayer(wrapper, video);\n\n\treturn wrapper;\n}\n\nfunction buildControls(skin) {\n\tlet html = [];\n\tif (skin === 'default') {\n\t\thtml.push('');\n\t\thtml.push('
');\n\t\thtml.push('
');\n\t\thtml.push('
',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t'',\n\t\t\t' / ',\n\t\t\t'',\n\t\t\t'
',\n\t\t\t'
',\n\t\t\t'
');\n\t\thtml.push('
');\n\t} else if (skin === 'circle') {\n\t\thtml.push('',\n\t\t\t'',\n\t\t\t'');\n\t}\n\n\treturn html.join('');\n}\n\nfunction attachSkin(skin) {\n\t//console.log(\"skin: \" + skin);\n\tif (typeof skin != 'undefined' && skin != '') {\n\t\treturn skin;\n\t} else {\n\t\treturn 'default';\n\t}\n}\n\nfunction toggleFullScreen(player, fullScreenButton) {\n\t// alternative standard method\n\tif (!document.fullscreenElement && !document.mozFullScreenElement && !document.webkitFullscreenElement && !document.msFullscreenElement) {\n\t\tplayer.classList.add('ckin__fullscreen');\n\n\t\tif (player.requestFullscreen) {\n\t\t\tplayer.requestFullscreen();\n\t\t} else if (player.mozRequestFullScreen) {\n\t\t\tplayer.mozRequestFullScreen(); // Firefox\n\t\t} else if (player.webkitRequestFullscreen) {\n\t\t\tplayer.webkitRequestFullscreen(); // Chrome and Safari\n\t\t} else if (player.msRequestFullscreen) {\n\t\t\tplayer.msRequestFullscreen();\n\t\t}\n\n\t\tfullScreenButton.classList.remove('tgico-fullscreen');\n\t\tfullScreenButton.classList.add('tgico-smallscreen');\n\t\tfullScreenButton.setAttribute('title', 'Exit Full Screen');\n\t} else {\n\t\tplayer.classList.remove('ckin__fullscreen');\n\n\t\tif (document.cancelFullScreen) {\n\t\t\tdocument.cancelFullScreen();\n\t\t} else if (document.mozCancelFullScreen) {\n\t\t\tdocument.mozCancelFullScreen();\n\t\t} else if (document.webkitCancelFullScreen) {\n\t\t\tdocument.webkitCancelFullScreen();\n\t\t} else if (document.msExitFullscreen) {\n\t\t\tdocument.msExitFullscreen();\n\t\t}\n\n\t\tfullScreenButton.classList.remove('tgico-smallscreen');\n\t\tfullScreenButton.classList.add('tgico-fullscreen');\n\t\tfullScreenButton.setAttribute('title', 'Full Screen');\n\t}\n}\n\nfunction onFullScreen(e, player) {\n\tlet isFullscreenNow = document.webkitFullscreenElement !== null;\n\tif (!isFullscreenNow) {\n\t\tplayer.classList.remove('ckin__fullscreen');\n\t} else {\n\t}\n}\n\nfunction addListenerMulti(element, eventNames, listener) {\n\tlet events = eventNames.split(' ');\n\tfor (let i = 0, iLen = events.length; i < iLen; i++) {\n\t\telement.addEventListener(events[i], listener, false);\n\t}\n}\n" }, { "id": 83, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/emoticonsDropdown.ts", "name": "./src/components/emoticonsDropdown.ts", "index": 80, "index2": 72, "size": 14859, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "issuerId": 19, "issuerName": "./src/lib/appManagers/appImManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 25, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageIm.ts", "name": "./src/components/pageIm.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 50, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/services.ts", "name": "./src/lib/services.ts", "profile": { "factory": 323, "building": 561, "dependencies": 110 } }, { "id": 19, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "name": "./src/lib/appManagers/appImManager.ts", "profile": { "factory": 270, "building": 981, "dependencies": 860 } } ], "profile": { "factory": 208, "building": 300, "dependencies": 449 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 19, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/appManagers/appImManager.ts", "module": "./src/lib/appManagers/appImManager.ts", "moduleName": "./src/lib/appManagers/appImManager.ts", "type": "cjs require", "userRequest": "../../components/emoticonsDropdown", "loc": "41:41-86" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst misc_1 = require(\"./misc\");\nconst lottieLoader_1 = __importDefault(require(\"../lib/lottieLoader\"));\nconst scrollable_1 = __importDefault(require(\"./scrollable\"));\nconst utils_1 = require(\"../lib/utils\");\nconst richtextprocessor_1 = require(\"../lib/richtextprocessor\");\nconst appStickersManager_1 = __importDefault(require(\"../lib/appManagers/appStickersManager\"));\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nconst cryptoworker_1 = __importDefault(require(\"../lib/crypto/cryptoworker\"));\nconst lazyLoadQueue_1 = __importDefault(require(\"./lazyLoadQueue\"));\nconst wrappers_1 = require(\"./wrappers\");\nconst appWebpManager_1 = __importDefault(require(\"../lib/appManagers/appWebpManager\"));\nexports.EMOTICONSSTICKERGROUP = 'emoticons-dropdown';\nconst initEmoticonsDropdown = (pageEl, appImManager, appMessagesManager, messageInput, toggleEl, btnSend) => {\n let dropdown = pageEl.querySelector('.emoji-dropdown');\n dropdown.classList.add('active'); // need\n let lazyLoadQueue = new lazyLoadQueue_1.default(5);\n let container = pageEl.querySelector('.emoji-container .tabs-container');\n let tabs = pageEl.querySelector('.emoji-dropdown .emoji-tabs');\n misc_1.horizontalMenu(tabs, container, (id) => {\n lottieLoader_1.default.checkAnimations(true, exports.EMOTICONSSTICKERGROUP);\n if (id == 1 && stickersInit) {\n stickersInit();\n }\n }, () => {\n lottieLoader_1.default.checkAnimations(false, exports.EMOTICONSSTICKERGROUP);\n lazyLoadQueue.check(); // for stickers\n });\n tabs.children[0].click(); // set media\n let emoticonsMenuOnClick = (menu, heights, scroll, menuScroll) => {\n menu.addEventListener('click', function (e) {\n let target = e.target;\n target = utils_1.findUpTag(target, 'LI');\n let index = utils_1.whichChild(target);\n let y = heights[index - 1 /* 2 */] || 0; // 10 == padding .scrollable\n /* if(menuScroll) {\n menuScroll.container.scrollLeft = target.scrollWidth * index;\n }\n console.log('emoticonsMenuOnClick', menu.getBoundingClientRect(), target.getBoundingClientRect());\n */\n scroll.onAddedBottom = () => {\n scroll.container.scrollTop = y;\n scroll.onAddedBottom = () => { };\n };\n scroll.container.scrollTop = y;\n });\n };\n let emoticonsContentOnScroll = (menu, heights, prevCategoryIndex, scroll, menuScroll) => {\n let y = scroll.scrollTop;\n //console.log(heights, y);\n for (let i = 0; i < heights.length; ++i) {\n let height = heights[i];\n if (y < height) {\n menu.children[prevCategoryIndex].classList.remove('active');\n prevCategoryIndex = i /* + 1 */;\n menu.children[prevCategoryIndex].classList.add('active');\n if (menuScroll) {\n if (i < heights.length - 4) {\n menuScroll.container.scrollLeft = (i - 3) * 50;\n }\n else {\n menuScroll.container.scrollLeft = i * 50;\n }\n }\n break;\n }\n }\n return prevCategoryIndex;\n };\n {\n let categories = [\"Smileys & Emotion\", \"Animals & Nature\", \"Food & Drink\", \"Travel & Places\", \"Activities\", \"Objects\", \"Symbols\", \"Flags\", \"Skin Tones\"];\n let divs = {};\n let keyCategory = Config.Emoji.keyCategory;\n let sorted = {};\n for (let unified in Config.Emoji.emoji) {\n // @ts-ignore\n let details = Config.Emoji.emoji[unified];\n let category = details[keyCategory];\n details.unified = unified;\n if (!sorted[category])\n sorted[category] = [];\n sorted[category][details.sort_order] = details;\n }\n Object.keys(sorted).forEach(c => sorted[c].sort());\n categories.pop();\n delete sorted[\"Skin Tones\"];\n //console.time('emojiParse');\n for (let category in sorted) {\n let div = document.createElement('div');\n div.classList.add('emoji-category');\n let emojis = sorted[category];\n emojis.forEach(details => {\n let emoji = details.unified;\n //let emoji = (details.unified as string).split('-')\n //.reduce((prev, curr) => prev + String.fromCodePoint(parseInt(curr, 16)), '');\n let spanEmoji = document.createElement('span');\n let kek = richtextprocessor_1.RichTextProcessor.wrapRichText(emoji);\n if (!kek.includes('emoji')) {\n console.log(details, emoji, kek, spanEmoji, emoji.length, new TextEncoder().encode(emoji));\n return;\n }\n //console.log(kek);\n spanEmoji.innerHTML = kek;\n //spanEmoji = spanEmoji.firstElementChild as HTMLSpanElement;\n //spanEmoji.setAttribute('emoji', emoji);\n div.appendChild(spanEmoji);\n });\n divs[category] = div;\n }\n //console.timeEnd('emojiParse');\n let heights = [0];\n let contentEmojiDiv = document.getElementById('content-emoji');\n categories.forEach(category => {\n let div = divs[category];\n if (!div) {\n console.error('no div by category:', category);\n }\n contentEmojiDiv.append(div);\n heights.push((heights[heights.length - 1] || 0) + div.scrollHeight);\n //console.log(div, div.scrollHeight);\n });\n contentEmojiDiv.addEventListener('click', function (e) {\n let target = e.target;\n //if(target.tagName != 'SPAN') return;\n if (target.tagName == 'SPAN' && !target.classList.contains('emoji')) {\n target = target.firstElementChild;\n }\n else if (target.tagName == 'DIV')\n return;\n //console.log('contentEmoji div', target);\n /* if(!target.classList.contains('emoji')) {\n target = target.parentElement as HTMLSpanElement;\n \n if(!target.classList.contains('emoji')) {\n return;\n }\n } */\n //messageInput.innerHTML += target.innerHTML;\n messageInput.innerHTML += target.outerHTML;\n btnSend.classList.add('tgico-send');\n btnSend.classList.remove('tgico-microphone2');\n });\n let prevCategoryIndex = 1;\n let menu = contentEmojiDiv.nextElementSibling;\n let emojiScroll = new scrollable_1.default(contentEmojiDiv);\n emojiScroll.container.addEventListener('scroll', (e) => {\n prevCategoryIndex = emoticonsContentOnScroll(menu, heights, prevCategoryIndex, emojiScroll.container);\n });\n //emojiScroll.setVirtualContainer(emojiScroll.container);\n emoticonsMenuOnClick(menu, heights, emojiScroll);\n }\n let stickersInit = () => {\n let contentStickersDiv = document.getElementById('content-stickers');\n //let stickersDiv = contentStickersDiv.querySelector('.os-content') as HTMLDivElement;\n let menuWrapper = contentStickersDiv.nextElementSibling;\n let menu = menuWrapper.firstElementChild;\n let menuScroll = new scrollable_1.default(menuWrapper, true, false);\n let stickersDiv = document.createElement('div');\n stickersDiv.classList.add('stickers-categories');\n contentStickersDiv.append(stickersDiv);\n stickersDiv.addEventListener('mouseover', (e) => {\n let target = e.target;\n if (target.tagName == 'CANVAS') { // turn on sticker\n let animation = lottieLoader_1.default.getAnimation(target.parentElement, exports.EMOTICONSSTICKERGROUP);\n if (animation) {\n // @ts-ignore\n if (animation.currentFrame == animation.totalFrames - 1) {\n animation.goToAndPlay(0, true);\n }\n else {\n animation.play();\n }\n }\n }\n });\n stickersDiv.addEventListener('click', (e) => {\n let target = e.target;\n target = utils_1.findUpTag(target, 'DIV');\n let fileID = target.getAttribute('file-id');\n let document = appStickersManager_1.default.getSticker(fileID);\n if (document) {\n appMessagesManager.sendFile(appImManager.peerID, document, { isMedia: true });\n appImManager.scroll.scrollTop = appImManager.scroll.scrollHeight;\n dropdown.classList.remove('active');\n toggleEl.classList.remove('active');\n }\n else {\n console.warn('got no sticker by id:', fileID);\n }\n });\n let heights = [];\n let categoryPush = (categoryDiv, docs, prepend) => {\n //if((docs.length % 5) != 0) categoryDiv.classList.add('not-full');\n docs.forEach(doc => {\n let div = document.createElement('div');\n wrappers_1.wrapSticker(doc, div, undefined, lazyLoadQueue, exports.EMOTICONSSTICKERGROUP, true);\n categoryDiv.append(div);\n });\n /* if(prepend) {\n stickersDiv.prepend(categoryDiv);\n } else {\n stickersDiv.append(categoryDiv);\n } */\n setTimeout(() => lazyLoadQueue.check(), 0);\n /* let scrollHeight = categoryDiv.scrollHeight;\n let prevHeight = heights[heights.length - 1] || 0;\n //console.log('scrollHeight', scrollHeight, categoryDiv, stickersDiv.childElementCount);\n if(prepend && heights.length) {// all stickers loaded faster than recent\n heights.forEach((h, i) => heights[i] += scrollHeight);\n \n return heights.unshift(scrollHeight) - 1;\n } */\n heights.length = 0;\n Array.from(stickersDiv.children).forEach((div, i) => {\n heights[i] = (heights[i - 1] || 0) + div.scrollHeight;\n });\n //stickersScroll.onScroll();\n //return heights.push(prevHeight + scrollHeight) - 1;\n };\n apiManager_1.default.invokeApi('messages.getRecentStickers', { flags: 0, hash: 0 }).then((res) => {\n let stickers = res;\n let categoryDiv = document.createElement('div');\n categoryDiv.classList.add('sticker-category');\n stickersDiv.prepend(categoryDiv);\n categoryPush(categoryDiv, stickers.stickers, true);\n });\n apiManager_1.default.invokeApi('messages.getAllStickers', { hash: 0 }).then((res) => {\n let stickers = res;\n stickers.sets /* .slice(0, 10) */.forEach((set) => __awaiter(void 0, void 0, void 0, function* () {\n let categoryDiv = document.createElement('div');\n categoryDiv.classList.add('sticker-category');\n let li = document.createElement('li');\n li.classList.add('btn-icon');\n menu.append(li);\n stickersDiv.append(categoryDiv);\n let stickerSet = yield appStickersManager_1.default.getStickerSet(set);\n if (stickerSet.set.thumb) {\n let thumb = stickerSet.set.thumb;\n appStickersManager_1.default.getStickerSetThumb(stickerSet.set).then((blob) => __awaiter(void 0, void 0, void 0, function* () {\n if (thumb.w == 1 && thumb.h == 1) { // means animated\n const reader = new FileReader();\n reader.addEventListener('loadend', (e) => __awaiter(void 0, void 0, void 0, function* () {\n // @ts-ignore\n const text = e.srcElement.result;\n let json = yield cryptoworker_1.default.gzipUncompress(text, true);\n let animation = yield lottieLoader_1.default.loadAnimation({\n container: li,\n loop: true,\n autoplay: false,\n animationData: JSON.parse(json)\n }, exports.EMOTICONSSTICKERGROUP);\n }));\n reader.readAsArrayBuffer(blob);\n }\n else {\n let image = new Image();\n //image.src = URL.createObjectURL(blob);\n appWebpManager_1.default.polyfillImage(image, blob);\n li.append(image);\n }\n }));\n }\n else { // as thumb will be used first sticker\n wrappers_1.wrapSticker(stickerSet.documents[0], li, undefined, undefined, exports.EMOTICONSSTICKERGROUP); // kostil\n }\n categoryPush(categoryDiv, stickerSet.documents);\n }));\n });\n let prevCategoryIndex = 0;\n let stickersScroll = new scrollable_1.default(contentStickersDiv);\n stickersScroll.container.addEventListener('scroll', (e) => {\n lazyLoadQueue.check();\n lottieLoader_1.default.checkAnimations();\n prevCategoryIndex = emoticonsContentOnScroll(menu, heights, prevCategoryIndex, stickersScroll.container, menuScroll);\n });\n stickersScroll.setVirtualContainer(stickersDiv);\n emoticonsMenuOnClick(menu, heights, stickersScroll, menuScroll);\n stickersInit = null;\n };\n return { dropdown, lazyLoadQueue };\n};\nexports.default = initEmoticonsDropdown;\n" }, { "id": 84, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "name": "./src/components/pagePassword.ts", "index": 83, "index2": 80, "size": 5472, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "issuerId": 77, "issuerName": "./src/components/pageAuthCode.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } } ], "profile": { "factory": 278, "building": 994, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 77, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "module": "./src/components/pageAuthCode.ts", "moduleName": "./src/components/pageAuthCode.ts", "type": "cjs require", "userRequest": "./pagePassword", "loc": "18:39-64" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nconst pageIm_1 = __importDefault(require(\"./pageIm\"));\nconst cryptoworker_1 = __importDefault(require(\"../lib/crypto/cryptoworker\"));\nconst misc_1 = require(\"./misc\");\nconst lottieLoader_1 = __importDefault(require(\"../lib/lottieLoader\"));\nconst passwordManager_1 = __importDefault(require(\"../lib/mtproto/passwordManager\"));\nconst apiManager_1 = __importDefault(require(\"../lib/mtproto/apiManager\"));\nlet installed = false;\nexports.default = () => __awaiter(void 0, void 0, void 0, function* () {\n //let LottieLoader = (await import('../lib/lottieLoader')).default;\n if (installed)\n return;\n installed = true;\n let needFrame = 0;\n let animation = /* AnimationItem */ undefined;\n let passwordVisible = false;\n let pageElement = document.body.getElementsByClassName('page-password')[0];\n pageElement.style.display = '';\n fetch('assets/img/TwoFactorSetupMonkeyClose.tgs')\n .then(res => res.arrayBuffer())\n .then((data) => __awaiter(void 0, void 0, void 0, function* () {\n let str = yield cryptoworker_1.default.gzipUncompress(data, true);\n animation = yield lottieLoader_1.default.loadAnimation({\n container: pageElement.querySelector('.auth-image'),\n renderer: 'svg',\n loop: false,\n autoplay: false,\n animationData: JSON.parse(str)\n });\n console.log(animation.getDuration(true));\n //animation.goToAndStop(822);\n animation.addEventListener('enterFrame', (e) => {\n //console.log('enterFrame', e, needFrame);\n let currentFrame = Math.round(e.currentTime);\n if ((e.direction == 1 && currentFrame >= needFrame) ||\n (e.direction == -1 && currentFrame <= needFrame)) {\n animation.setSpeed(1);\n animation.pause();\n }\n });\n needFrame = 49;\n animation.play();\n }));\n const btnNext = pageElement.querySelector('button');\n const passwordInput = document.getElementById('password');\n //const passwordInputLabel = passwordInput.nextElementSibling as HTMLLabelElement;\n const toggleVisible = pageElement.querySelector('.toggle-visible');\n let handleError = (err) => {\n btnNext.removeAttribute('disabled');\n switch (err.type) {\n default:\n btnNext.innerText = err.type;\n break;\n }\n };\n toggleVisible.addEventListener('click', function (e) {\n if (!passwordVisible) {\n this.classList.add('tgico-eye2');\n passwordInput.setAttribute('type', 'text');\n animation.setDirection(-1);\n needFrame = 0;\n animation.play();\n }\n else {\n this.classList.remove('tgico-eye2');\n passwordInput.setAttribute('type', 'password');\n animation.setDirection(1);\n needFrame = 49;\n animation.play();\n }\n passwordVisible = !passwordVisible;\n });\n btnNext.addEventListener('click', function (e) {\n if (!passwordInput.value.length) {\n passwordInput.classList.add('error');\n return;\n }\n this.setAttribute('disabled', 'true');\n let value = passwordInput.value;\n this.textContent = 'PLEASE WAIT...';\n misc_1.putPreloader(this);\n passwordManager_1.default.getState()\n .then(state => {\n console.log(state);\n passwordManager_1.default.check(state, value).then((response) => {\n console.log('passwordManager response:', response);\n switch (response._) {\n case 'auth.authorization':\n apiManager_1.default.setUserAuth({\n id: response.user.id\n });\n pageElement.style.display = 'none';\n pageIm_1.default();\n if (animation)\n animation.destroy();\n break;\n default:\n btnNext.removeAttribute('disabled');\n btnNext.innerText = response._;\n break;\n }\n }).catch(handleError);\n }).catch(handleError);\n });\n passwordInput.addEventListener('keypress', function (e) {\n this.classList.remove('error');\n if (e.key == 'Enter') {\n return btnNext.click();\n }\n });\n /* passwordInput.addEventListener('input', function(this, e) {\n \n }); */\n});\n" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "index", "request": "./src/index.ts", "reasons": [] } ] }, { "id": 1, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendor) (name: npm.aes-js)", "size": 63732, "names": [ "npm.aes-js" ], "files": [ "npm.aes-js.chunk.js" ], "hash": "a746edb3c6a96a83eeac", "siblings": [ 0, 2, 3, 4, 5, 7 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 72, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/aes-js/index.js", "name": "./node_modules/aes-js/index.js", "index": 37, "index2": 28, "size": 63732, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 1 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "issuerId": 71, "issuerName": "./src/lib/mtproto/transports/websocket.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 22, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/dcConfigurator.ts", "name": "./src/lib/mtproto/dcConfigurator.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } }, { "id": 71, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "name": "./src/lib/mtproto/transports/websocket.ts", "profile": { "factory": 20, "building": 660, "dependencies": 2 } } ], "profile": { "factory": 803, "building": 43, "dependencies": 0 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 71, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/transports/websocket.ts", "module": "./src/lib/mtproto/transports/websocket.ts", "moduleName": "./src/lib/mtproto/transports/websocket.ts", "type": "cjs require", "userRequest": "aes-js", "loc": "7:33-50" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 5, "source": "/*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */\n(function(root) {\n \"use strict\";\n\n function checkInt(value) {\n return (parseInt(value) === value);\n }\n\n function checkInts(arrayish) {\n if (!checkInt(arrayish.length)) { return false; }\n\n for (var i = 0; i < arrayish.length; i++) {\n if (!checkInt(arrayish[i]) || arrayish[i] < 0 || arrayish[i] > 255) {\n return false;\n }\n }\n\n return true;\n }\n\n function coerceArray(arg, copy) {\n\n // ArrayBuffer view\n if (arg.buffer && arg.name === 'Uint8Array') {\n\n if (copy) {\n if (arg.slice) {\n arg = arg.slice();\n } else {\n arg = Array.prototype.slice.call(arg);\n }\n }\n\n return arg;\n }\n\n // It's an array; check it is a valid representation of a byte\n if (Array.isArray(arg)) {\n if (!checkInts(arg)) {\n throw new Error('Array contains invalid value: ' + arg);\n }\n\n return new Uint8Array(arg);\n }\n\n // Something else, but behaves like an array (maybe a Buffer? Arguments?)\n if (checkInt(arg.length) && checkInts(arg)) {\n return new Uint8Array(arg);\n }\n\n throw new Error('unsupported array-like object');\n }\n\n function createArray(length) {\n return new Uint8Array(length);\n }\n\n function copyArray(sourceArray, targetArray, targetStart, sourceStart, sourceEnd) {\n if (sourceStart != null || sourceEnd != null) {\n if (sourceArray.slice) {\n sourceArray = sourceArray.slice(sourceStart, sourceEnd);\n } else {\n sourceArray = Array.prototype.slice.call(sourceArray, sourceStart, sourceEnd);\n }\n }\n targetArray.set(sourceArray, targetStart);\n }\n\n\n\n var convertUtf8 = (function() {\n function toBytes(text) {\n var result = [], i = 0;\n text = encodeURI(text);\n while (i < text.length) {\n var c = text.charCodeAt(i++);\n\n // if it is a % sign, encode the following 2 bytes as a hex value\n if (c === 37) {\n result.push(parseInt(text.substr(i, 2), 16))\n i += 2;\n\n // otherwise, just the actual byte\n } else {\n result.push(c)\n }\n }\n\n return coerceArray(result);\n }\n\n function fromBytes(bytes) {\n var result = [], i = 0;\n\n while (i < bytes.length) {\n var c = bytes[i];\n\n if (c < 128) {\n result.push(String.fromCharCode(c));\n i++;\n } else if (c > 191 && c < 224) {\n result.push(String.fromCharCode(((c & 0x1f) << 6) | (bytes[i + 1] & 0x3f)));\n i += 2;\n } else {\n result.push(String.fromCharCode(((c & 0x0f) << 12) | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f)));\n i += 3;\n }\n }\n\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n var convertHex = (function() {\n function toBytes(text) {\n var result = [];\n for (var i = 0; i < text.length; i += 2) {\n result.push(parseInt(text.substr(i, 2), 16));\n }\n\n return result;\n }\n\n // http://ixti.net/development/javascript/2011/11/11/base64-encodedecode-of-utf8-in-browser-with-js.html\n var Hex = '0123456789abcdef';\n\n function fromBytes(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i++) {\n var v = bytes[i];\n result.push(Hex[(v & 0xf0) >> 4] + Hex[v & 0x0f]);\n }\n return result.join('');\n }\n\n return {\n toBytes: toBytes,\n fromBytes: fromBytes,\n }\n })();\n\n\n // Number of rounds by keysize\n var numberOfRounds = {16: 10, 24: 12, 32: 14}\n\n // Round constant words\n var rcon = [0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91];\n\n // S-box and Inverse S-box (S is for Substitution)\n var S = [0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16];\n var Si =[0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d];\n\n // Transformations for encryption\n var T1 = [0xc66363a5, 0xf87c7c84, 0xee777799, 0xf67b7b8d, 0xfff2f20d, 0xd66b6bbd, 0xde6f6fb1, 0x91c5c554, 0x60303050, 0x02010103, 0xce6767a9, 0x562b2b7d, 0xe7fefe19, 0xb5d7d762, 0x4dababe6, 0xec76769a, 0x8fcaca45, 0x1f82829d, 0x89c9c940, 0xfa7d7d87, 0xeffafa15, 0xb25959eb, 0x8e4747c9, 0xfbf0f00b, 0x41adadec, 0xb3d4d467, 0x5fa2a2fd, 0x45afafea, 0x239c9cbf, 0x53a4a4f7, 0xe4727296, 0x9bc0c05b, 0x75b7b7c2, 0xe1fdfd1c, 0x3d9393ae, 0x4c26266a, 0x6c36365a, 0x7e3f3f41, 0xf5f7f702, 0x83cccc4f, 0x6834345c, 0x51a5a5f4, 0xd1e5e534, 0xf9f1f108, 0xe2717193, 0xabd8d873, 0x62313153, 0x2a15153f, 0x0804040c, 0x95c7c752, 0x46232365, 0x9dc3c35e, 0x30181828, 0x379696a1, 0x0a05050f, 0x2f9a9ab5, 0x0e070709, 0x24121236, 0x1b80809b, 0xdfe2e23d, 0xcdebeb26, 0x4e272769, 0x7fb2b2cd, 0xea75759f, 0x1209091b, 0x1d83839e, 0x582c2c74, 0x341a1a2e, 0x361b1b2d, 0xdc6e6eb2, 0xb45a5aee, 0x5ba0a0fb, 0xa45252f6, 0x763b3b4d, 0xb7d6d661, 0x7db3b3ce, 0x5229297b, 0xdde3e33e, 0x5e2f2f71, 0x13848497, 0xa65353f5, 0xb9d1d168, 0x00000000, 0xc1eded2c, 0x40202060, 0xe3fcfc1f, 0x79b1b1c8, 0xb65b5bed, 0xd46a6abe, 0x8dcbcb46, 0x67bebed9, 0x7239394b, 0x944a4ade, 0x984c4cd4, 0xb05858e8, 0x85cfcf4a, 0xbbd0d06b, 0xc5efef2a, 0x4faaaae5, 0xedfbfb16, 0x864343c5, 0x9a4d4dd7, 0x66333355, 0x11858594, 0x8a4545cf, 0xe9f9f910, 0x04020206, 0xfe7f7f81, 0xa05050f0, 0x783c3c44, 0x259f9fba, 0x4ba8a8e3, 0xa25151f3, 0x5da3a3fe, 0x804040c0, 0x058f8f8a, 0x3f9292ad, 0x219d9dbc, 0x70383848, 0xf1f5f504, 0x63bcbcdf, 0x77b6b6c1, 0xafdada75, 0x42212163, 0x20101030, 0xe5ffff1a, 0xfdf3f30e, 0xbfd2d26d, 0x81cdcd4c, 0x180c0c14, 0x26131335, 0xc3ecec2f, 0xbe5f5fe1, 0x359797a2, 0x884444cc, 0x2e171739, 0x93c4c457, 0x55a7a7f2, 0xfc7e7e82, 0x7a3d3d47, 0xc86464ac, 0xba5d5de7, 0x3219192b, 0xe6737395, 0xc06060a0, 0x19818198, 0x9e4f4fd1, 0xa3dcdc7f, 0x44222266, 0x542a2a7e, 0x3b9090ab, 0x0b888883, 0x8c4646ca, 0xc7eeee29, 0x6bb8b8d3, 0x2814143c, 0xa7dede79, 0xbc5e5ee2, 0x160b0b1d, 0xaddbdb76, 0xdbe0e03b, 0x64323256, 0x743a3a4e, 0x140a0a1e, 0x924949db, 0x0c06060a, 0x4824246c, 0xb85c5ce4, 0x9fc2c25d, 0xbdd3d36e, 0x43acacef, 0xc46262a6, 0x399191a8, 0x319595a4, 0xd3e4e437, 0xf279798b, 0xd5e7e732, 0x8bc8c843, 0x6e373759, 0xda6d6db7, 0x018d8d8c, 0xb1d5d564, 0x9c4e4ed2, 0x49a9a9e0, 0xd86c6cb4, 0xac5656fa, 0xf3f4f407, 0xcfeaea25, 0xca6565af, 0xf47a7a8e, 0x47aeaee9, 0x10080818, 0x6fbabad5, 0xf0787888, 0x4a25256f, 0x5c2e2e72, 0x381c1c24, 0x57a6a6f1, 0x73b4b4c7, 0x97c6c651, 0xcbe8e823, 0xa1dddd7c, 0xe874749c, 0x3e1f1f21, 0x964b4bdd, 0x61bdbddc, 0x0d8b8b86, 0x0f8a8a85, 0xe0707090, 0x7c3e3e42, 0x71b5b5c4, 0xcc6666aa, 0x904848d8, 0x06030305, 0xf7f6f601, 0x1c0e0e12, 0xc26161a3, 0x6a35355f, 0xae5757f9, 0x69b9b9d0, 0x17868691, 0x99c1c158, 0x3a1d1d27, 0x279e9eb9, 0xd9e1e138, 0xebf8f813, 0x2b9898b3, 0x22111133, 0xd26969bb, 0xa9d9d970, 0x078e8e89, 0x339494a7, 0x2d9b9bb6, 0x3c1e1e22, 0x15878792, 0xc9e9e920, 0x87cece49, 0xaa5555ff, 0x50282878, 0xa5dfdf7a, 0x038c8c8f, 0x59a1a1f8, 0x09898980, 0x1a0d0d17, 0x65bfbfda, 0xd7e6e631, 0x844242c6, 0xd06868b8, 0x824141c3, 0x299999b0, 0x5a2d2d77, 0x1e0f0f11, 0x7bb0b0cb, 0xa85454fc, 0x6dbbbbd6, 0x2c16163a];\n var T2 = [0xa5c66363, 0x84f87c7c, 0x99ee7777, 0x8df67b7b, 0x0dfff2f2, 0xbdd66b6b, 0xb1de6f6f, 0x5491c5c5, 0x50603030, 0x03020101, 0xa9ce6767, 0x7d562b2b, 0x19e7fefe, 0x62b5d7d7, 0xe64dabab, 0x9aec7676, 0x458fcaca, 0x9d1f8282, 0x4089c9c9, 0x87fa7d7d, 0x15effafa, 0xebb25959, 0xc98e4747, 0x0bfbf0f0, 0xec41adad, 0x67b3d4d4, 0xfd5fa2a2, 0xea45afaf, 0xbf239c9c, 0xf753a4a4, 0x96e47272, 0x5b9bc0c0, 0xc275b7b7, 0x1ce1fdfd, 0xae3d9393, 0x6a4c2626, 0x5a6c3636, 0x417e3f3f, 0x02f5f7f7, 0x4f83cccc, 0x5c683434, 0xf451a5a5, 0x34d1e5e5, 0x08f9f1f1, 0x93e27171, 0x73abd8d8, 0x53623131, 0x3f2a1515, 0x0c080404, 0x5295c7c7, 0x65462323, 0x5e9dc3c3, 0x28301818, 0xa1379696, 0x0f0a0505, 0xb52f9a9a, 0x090e0707, 0x36241212, 0x9b1b8080, 0x3ddfe2e2, 0x26cdebeb, 0x694e2727, 0xcd7fb2b2, 0x9fea7575, 0x1b120909, 0x9e1d8383, 0x74582c2c, 0x2e341a1a, 0x2d361b1b, 0xb2dc6e6e, 0xeeb45a5a, 0xfb5ba0a0, 0xf6a45252, 0x4d763b3b, 0x61b7d6d6, 0xce7db3b3, 0x7b522929, 0x3edde3e3, 0x715e2f2f, 0x97138484, 0xf5a65353, 0x68b9d1d1, 0x00000000, 0x2cc1eded, 0x60402020, 0x1fe3fcfc, 0xc879b1b1, 0xedb65b5b, 0xbed46a6a, 0x468dcbcb, 0xd967bebe, 0x4b723939, 0xde944a4a, 0xd4984c4c, 0xe8b05858, 0x4a85cfcf, 0x6bbbd0d0, 0x2ac5efef, 0xe54faaaa, 0x16edfbfb, 0xc5864343, 0xd79a4d4d, 0x55663333, 0x94118585, 0xcf8a4545, 0x10e9f9f9, 0x06040202, 0x81fe7f7f, 0xf0a05050, 0x44783c3c, 0xba259f9f, 0xe34ba8a8, 0xf3a25151, 0xfe5da3a3, 0xc0804040, 0x8a058f8f, 0xad3f9292, 0xbc219d9d, 0x48703838, 0x04f1f5f5, 0xdf63bcbc, 0xc177b6b6, 0x75afdada, 0x63422121, 0x30201010, 0x1ae5ffff, 0x0efdf3f3, 0x6dbfd2d2, 0x4c81cdcd, 0x14180c0c, 0x35261313, 0x2fc3ecec, 0xe1be5f5f, 0xa2359797, 0xcc884444, 0x392e1717, 0x5793c4c4, 0xf255a7a7, 0x82fc7e7e, 0x477a3d3d, 0xacc86464, 0xe7ba5d5d, 0x2b321919, 0x95e67373, 0xa0c06060, 0x98198181, 0xd19e4f4f, 0x7fa3dcdc, 0x66442222, 0x7e542a2a, 0xab3b9090, 0x830b8888, 0xca8c4646, 0x29c7eeee, 0xd36bb8b8, 0x3c281414, 0x79a7dede, 0xe2bc5e5e, 0x1d160b0b, 0x76addbdb, 0x3bdbe0e0, 0x56643232, 0x4e743a3a, 0x1e140a0a, 0xdb924949, 0x0a0c0606, 0x6c482424, 0xe4b85c5c, 0x5d9fc2c2, 0x6ebdd3d3, 0xef43acac, 0xa6c46262, 0xa8399191, 0xa4319595, 0x37d3e4e4, 0x8bf27979, 0x32d5e7e7, 0x438bc8c8, 0x596e3737, 0xb7da6d6d, 0x8c018d8d, 0x64b1d5d5, 0xd29c4e4e, 0xe049a9a9, 0xb4d86c6c, 0xfaac5656, 0x07f3f4f4, 0x25cfeaea, 0xafca6565, 0x8ef47a7a, 0xe947aeae, 0x18100808, 0xd56fbaba, 0x88f07878, 0x6f4a2525, 0x725c2e2e, 0x24381c1c, 0xf157a6a6, 0xc773b4b4, 0x5197c6c6, 0x23cbe8e8, 0x7ca1dddd, 0x9ce87474, 0x213e1f1f, 0xdd964b4b, 0xdc61bdbd, 0x860d8b8b, 0x850f8a8a, 0x90e07070, 0x427c3e3e, 0xc471b5b5, 0xaacc6666, 0xd8904848, 0x05060303, 0x01f7f6f6, 0x121c0e0e, 0xa3c26161, 0x5f6a3535, 0xf9ae5757, 0xd069b9b9, 0x91178686, 0x5899c1c1, 0x273a1d1d, 0xb9279e9e, 0x38d9e1e1, 0x13ebf8f8, 0xb32b9898, 0x33221111, 0xbbd26969, 0x70a9d9d9, 0x89078e8e, 0xa7339494, 0xb62d9b9b, 0x223c1e1e, 0x92158787, 0x20c9e9e9, 0x4987cece, 0xffaa5555, 0x78502828, 0x7aa5dfdf, 0x8f038c8c, 0xf859a1a1, 0x80098989, 0x171a0d0d, 0xda65bfbf, 0x31d7e6e6, 0xc6844242, 0xb8d06868, 0xc3824141, 0xb0299999, 0x775a2d2d, 0x111e0f0f, 0xcb7bb0b0, 0xfca85454, 0xd66dbbbb, 0x3a2c1616];\n var T3 = [0x63a5c663, 0x7c84f87c, 0x7799ee77, 0x7b8df67b, 0xf20dfff2, 0x6bbdd66b, 0x6fb1de6f, 0xc55491c5, 0x30506030, 0x01030201, 0x67a9ce67, 0x2b7d562b, 0xfe19e7fe, 0xd762b5d7, 0xabe64dab, 0x769aec76, 0xca458fca, 0x829d1f82, 0xc94089c9, 0x7d87fa7d, 0xfa15effa, 0x59ebb259, 0x47c98e47, 0xf00bfbf0, 0xadec41ad, 0xd467b3d4, 0xa2fd5fa2, 0xafea45af, 0x9cbf239c, 0xa4f753a4, 0x7296e472, 0xc05b9bc0, 0xb7c275b7, 0xfd1ce1fd, 0x93ae3d93, 0x266a4c26, 0x365a6c36, 0x3f417e3f, 0xf702f5f7, 0xcc4f83cc, 0x345c6834, 0xa5f451a5, 0xe534d1e5, 0xf108f9f1, 0x7193e271, 0xd873abd8, 0x31536231, 0x153f2a15, 0x040c0804, 0xc75295c7, 0x23654623, 0xc35e9dc3, 0x18283018, 0x96a13796, 0x050f0a05, 0x9ab52f9a, 0x07090e07, 0x12362412, 0x809b1b80, 0xe23ddfe2, 0xeb26cdeb, 0x27694e27, 0xb2cd7fb2, 0x759fea75, 0x091b1209, 0x839e1d83, 0x2c74582c, 0x1a2e341a, 0x1b2d361b, 0x6eb2dc6e, 0x5aeeb45a, 0xa0fb5ba0, 0x52f6a452, 0x3b4d763b, 0xd661b7d6, 0xb3ce7db3, 0x297b5229, 0xe33edde3, 0x2f715e2f, 0x84971384, 0x53f5a653, 0xd168b9d1, 0x00000000, 0xed2cc1ed, 0x20604020, 0xfc1fe3fc, 0xb1c879b1, 0x5bedb65b, 0x6abed46a, 0xcb468dcb, 0xbed967be, 0x394b7239, 0x4ade944a, 0x4cd4984c, 0x58e8b058, 0xcf4a85cf, 0xd06bbbd0, 0xef2ac5ef, 0xaae54faa, 0xfb16edfb, 0x43c58643, 0x4dd79a4d, 0x33556633, 0x85941185, 0x45cf8a45, 0xf910e9f9, 0x02060402, 0x7f81fe7f, 0x50f0a050, 0x3c44783c, 0x9fba259f, 0xa8e34ba8, 0x51f3a251, 0xa3fe5da3, 0x40c08040, 0x8f8a058f, 0x92ad3f92, 0x9dbc219d, 0x38487038, 0xf504f1f5, 0xbcdf63bc, 0xb6c177b6, 0xda75afda, 0x21634221, 0x10302010, 0xff1ae5ff, 0xf30efdf3, 0xd26dbfd2, 0xcd4c81cd, 0x0c14180c, 0x13352613, 0xec2fc3ec, 0x5fe1be5f, 0x97a23597, 0x44cc8844, 0x17392e17, 0xc45793c4, 0xa7f255a7, 0x7e82fc7e, 0x3d477a3d, 0x64acc864, 0x5de7ba5d, 0x192b3219, 0x7395e673, 0x60a0c060, 0x81981981, 0x4fd19e4f, 0xdc7fa3dc, 0x22664422, 0x2a7e542a, 0x90ab3b90, 0x88830b88, 0x46ca8c46, 0xee29c7ee, 0xb8d36bb8, 0x143c2814, 0xde79a7de, 0x5ee2bc5e, 0x0b1d160b, 0xdb76addb, 0xe03bdbe0, 0x32566432, 0x3a4e743a, 0x0a1e140a, 0x49db9249, 0x060a0c06, 0x246c4824, 0x5ce4b85c, 0xc25d9fc2, 0xd36ebdd3, 0xacef43ac, 0x62a6c462, 0x91a83991, 0x95a43195, 0xe437d3e4, 0x798bf279, 0xe732d5e7, 0xc8438bc8, 0x37596e37, 0x6db7da6d, 0x8d8c018d, 0xd564b1d5, 0x4ed29c4e, 0xa9e049a9, 0x6cb4d86c, 0x56faac56, 0xf407f3f4, 0xea25cfea, 0x65afca65, 0x7a8ef47a, 0xaee947ae, 0x08181008, 0xbad56fba, 0x7888f078, 0x256f4a25, 0x2e725c2e, 0x1c24381c, 0xa6f157a6, 0xb4c773b4, 0xc65197c6, 0xe823cbe8, 0xdd7ca1dd, 0x749ce874, 0x1f213e1f, 0x4bdd964b, 0xbddc61bd, 0x8b860d8b, 0x8a850f8a, 0x7090e070, 0x3e427c3e, 0xb5c471b5, 0x66aacc66, 0x48d89048, 0x03050603, 0xf601f7f6, 0x0e121c0e, 0x61a3c261, 0x355f6a35, 0x57f9ae57, 0xb9d069b9, 0x86911786, 0xc15899c1, 0x1d273a1d, 0x9eb9279e, 0xe138d9e1, 0xf813ebf8, 0x98b32b98, 0x11332211, 0x69bbd269, 0xd970a9d9, 0x8e89078e, 0x94a73394, 0x9bb62d9b, 0x1e223c1e, 0x87921587, 0xe920c9e9, 0xce4987ce, 0x55ffaa55, 0x28785028, 0xdf7aa5df, 0x8c8f038c, 0xa1f859a1, 0x89800989, 0x0d171a0d, 0xbfda65bf, 0xe631d7e6, 0x42c68442, 0x68b8d068, 0x41c38241, 0x99b02999, 0x2d775a2d, 0x0f111e0f, 0xb0cb7bb0, 0x54fca854, 0xbbd66dbb, 0x163a2c16];\n var T4 = [0x6363a5c6, 0x7c7c84f8, 0x777799ee, 0x7b7b8df6, 0xf2f20dff, 0x6b6bbdd6, 0x6f6fb1de, 0xc5c55491, 0x30305060, 0x01010302, 0x6767a9ce, 0x2b2b7d56, 0xfefe19e7, 0xd7d762b5, 0xababe64d, 0x76769aec, 0xcaca458f, 0x82829d1f, 0xc9c94089, 0x7d7d87fa, 0xfafa15ef, 0x5959ebb2, 0x4747c98e, 0xf0f00bfb, 0xadadec41, 0xd4d467b3, 0xa2a2fd5f, 0xafafea45, 0x9c9cbf23, 0xa4a4f753, 0x727296e4, 0xc0c05b9b, 0xb7b7c275, 0xfdfd1ce1, 0x9393ae3d, 0x26266a4c, 0x36365a6c, 0x3f3f417e, 0xf7f702f5, 0xcccc4f83, 0x34345c68, 0xa5a5f451, 0xe5e534d1, 0xf1f108f9, 0x717193e2, 0xd8d873ab, 0x31315362, 0x15153f2a, 0x04040c08, 0xc7c75295, 0x23236546, 0xc3c35e9d, 0x18182830, 0x9696a137, 0x05050f0a, 0x9a9ab52f, 0x0707090e, 0x12123624, 0x80809b1b, 0xe2e23ddf, 0xebeb26cd, 0x2727694e, 0xb2b2cd7f, 0x75759fea, 0x09091b12, 0x83839e1d, 0x2c2c7458, 0x1a1a2e34, 0x1b1b2d36, 0x6e6eb2dc, 0x5a5aeeb4, 0xa0a0fb5b, 0x5252f6a4, 0x3b3b4d76, 0xd6d661b7, 0xb3b3ce7d, 0x29297b52, 0xe3e33edd, 0x2f2f715e, 0x84849713, 0x5353f5a6, 0xd1d168b9, 0x00000000, 0xeded2cc1, 0x20206040, 0xfcfc1fe3, 0xb1b1c879, 0x5b5bedb6, 0x6a6abed4, 0xcbcb468d, 0xbebed967, 0x39394b72, 0x4a4ade94, 0x4c4cd498, 0x5858e8b0, 0xcfcf4a85, 0xd0d06bbb, 0xefef2ac5, 0xaaaae54f, 0xfbfb16ed, 0x4343c586, 0x4d4dd79a, 0x33335566, 0x85859411, 0x4545cf8a, 0xf9f910e9, 0x02020604, 0x7f7f81fe, 0x5050f0a0, 0x3c3c4478, 0x9f9fba25, 0xa8a8e34b, 0x5151f3a2, 0xa3a3fe5d, 0x4040c080, 0x8f8f8a05, 0x9292ad3f, 0x9d9dbc21, 0x38384870, 0xf5f504f1, 0xbcbcdf63, 0xb6b6c177, 0xdada75af, 0x21216342, 0x10103020, 0xffff1ae5, 0xf3f30efd, 0xd2d26dbf, 0xcdcd4c81, 0x0c0c1418, 0x13133526, 0xecec2fc3, 0x5f5fe1be, 0x9797a235, 0x4444cc88, 0x1717392e, 0xc4c45793, 0xa7a7f255, 0x7e7e82fc, 0x3d3d477a, 0x6464acc8, 0x5d5de7ba, 0x19192b32, 0x737395e6, 0x6060a0c0, 0x81819819, 0x4f4fd19e, 0xdcdc7fa3, 0x22226644, 0x2a2a7e54, 0x9090ab3b, 0x8888830b, 0x4646ca8c, 0xeeee29c7, 0xb8b8d36b, 0x14143c28, 0xdede79a7, 0x5e5ee2bc, 0x0b0b1d16, 0xdbdb76ad, 0xe0e03bdb, 0x32325664, 0x3a3a4e74, 0x0a0a1e14, 0x4949db92, 0x06060a0c, 0x24246c48, 0x5c5ce4b8, 0xc2c25d9f, 0xd3d36ebd, 0xacacef43, 0x6262a6c4, 0x9191a839, 0x9595a431, 0xe4e437d3, 0x79798bf2, 0xe7e732d5, 0xc8c8438b, 0x3737596e, 0x6d6db7da, 0x8d8d8c01, 0xd5d564b1, 0x4e4ed29c, 0xa9a9e049, 0x6c6cb4d8, 0x5656faac, 0xf4f407f3, 0xeaea25cf, 0x6565afca, 0x7a7a8ef4, 0xaeaee947, 0x08081810, 0xbabad56f, 0x787888f0, 0x25256f4a, 0x2e2e725c, 0x1c1c2438, 0xa6a6f157, 0xb4b4c773, 0xc6c65197, 0xe8e823cb, 0xdddd7ca1, 0x74749ce8, 0x1f1f213e, 0x4b4bdd96, 0xbdbddc61, 0x8b8b860d, 0x8a8a850f, 0x707090e0, 0x3e3e427c, 0xb5b5c471, 0x6666aacc, 0x4848d890, 0x03030506, 0xf6f601f7, 0x0e0e121c, 0x6161a3c2, 0x35355f6a, 0x5757f9ae, 0xb9b9d069, 0x86869117, 0xc1c15899, 0x1d1d273a, 0x9e9eb927, 0xe1e138d9, 0xf8f813eb, 0x9898b32b, 0x11113322, 0x6969bbd2, 0xd9d970a9, 0x8e8e8907, 0x9494a733, 0x9b9bb62d, 0x1e1e223c, 0x87879215, 0xe9e920c9, 0xcece4987, 0x5555ffaa, 0x28287850, 0xdfdf7aa5, 0x8c8c8f03, 0xa1a1f859, 0x89898009, 0x0d0d171a, 0xbfbfda65, 0xe6e631d7, 0x4242c684, 0x6868b8d0, 0x4141c382, 0x9999b029, 0x2d2d775a, 0x0f0f111e, 0xb0b0cb7b, 0x5454fca8, 0xbbbbd66d, 0x16163a2c];\n\n // Transformations for decryption\n var T5 = [0x51f4a750, 0x7e416553, 0x1a17a4c3, 0x3a275e96, 0x3bab6bcb, 0x1f9d45f1, 0xacfa58ab, 0x4be30393, 0x2030fa55, 0xad766df6, 0x88cc7691, 0xf5024c25, 0x4fe5d7fc, 0xc52acbd7, 0x26354480, 0xb562a38f, 0xdeb15a49, 0x25ba1b67, 0x45ea0e98, 0x5dfec0e1, 0xc32f7502, 0x814cf012, 0x8d4697a3, 0x6bd3f9c6, 0x038f5fe7, 0x15929c95, 0xbf6d7aeb, 0x955259da, 0xd4be832d, 0x587421d3, 0x49e06929, 0x8ec9c844, 0x75c2896a, 0xf48e7978, 0x99583e6b, 0x27b971dd, 0xbee14fb6, 0xf088ad17, 0xc920ac66, 0x7dce3ab4, 0x63df4a18, 0xe51a3182, 0x97513360, 0x62537f45, 0xb16477e0, 0xbb6bae84, 0xfe81a01c, 0xf9082b94, 0x70486858, 0x8f45fd19, 0x94de6c87, 0x527bf8b7, 0xab73d323, 0x724b02e2, 0xe31f8f57, 0x6655ab2a, 0xb2eb2807, 0x2fb5c203, 0x86c57b9a, 0xd33708a5, 0x302887f2, 0x23bfa5b2, 0x02036aba, 0xed16825c, 0x8acf1c2b, 0xa779b492, 0xf307f2f0, 0x4e69e2a1, 0x65daf4cd, 0x0605bed5, 0xd134621f, 0xc4a6fe8a, 0x342e539d, 0xa2f355a0, 0x058ae132, 0xa4f6eb75, 0x0b83ec39, 0x4060efaa, 0x5e719f06, 0xbd6e1051, 0x3e218af9, 0x96dd063d, 0xdd3e05ae, 0x4de6bd46, 0x91548db5, 0x71c45d05, 0x0406d46f, 0x605015ff, 0x1998fb24, 0xd6bde997, 0x894043cc, 0x67d99e77, 0xb0e842bd, 0x07898b88, 0xe7195b38, 0x79c8eedb, 0xa17c0a47, 0x7c420fe9, 0xf8841ec9, 0x00000000, 0x09808683, 0x322bed48, 0x1e1170ac, 0x6c5a724e, 0xfd0efffb, 0x0f853856, 0x3daed51e, 0x362d3927, 0x0a0fd964, 0x685ca621, 0x9b5b54d1, 0x24362e3a, 0x0c0a67b1, 0x9357e70f, 0xb4ee96d2, 0x1b9b919e, 0x80c0c54f, 0x61dc20a2, 0x5a774b69, 0x1c121a16, 0xe293ba0a, 0xc0a02ae5, 0x3c22e043, 0x121b171d, 0x0e090d0b, 0xf28bc7ad, 0x2db6a8b9, 0x141ea9c8, 0x57f11985, 0xaf75074c, 0xee99ddbb, 0xa37f60fd, 0xf701269f, 0x5c72f5bc, 0x44663bc5, 0x5bfb7e34, 0x8b432976, 0xcb23c6dc, 0xb6edfc68, 0xb8e4f163, 0xd731dcca, 0x42638510, 0x13972240, 0x84c61120, 0x854a247d, 0xd2bb3df8, 0xaef93211, 0xc729a16d, 0x1d9e2f4b, 0xdcb230f3, 0x0d8652ec, 0x77c1e3d0, 0x2bb3166c, 0xa970b999, 0x119448fa, 0x47e96422, 0xa8fc8cc4, 0xa0f03f1a, 0x567d2cd8, 0x223390ef, 0x87494ec7, 0xd938d1c1, 0x8ccaa2fe, 0x98d40b36, 0xa6f581cf, 0xa57ade28, 0xdab78e26, 0x3fadbfa4, 0x2c3a9de4, 0x5078920d, 0x6a5fcc9b, 0x547e4662, 0xf68d13c2, 0x90d8b8e8, 0x2e39f75e, 0x82c3aff5, 0x9f5d80be, 0x69d0937c, 0x6fd52da9, 0xcf2512b3, 0xc8ac993b, 0x10187da7, 0xe89c636e, 0xdb3bbb7b, 0xcd267809, 0x6e5918f4, 0xec9ab701, 0x834f9aa8, 0xe6956e65, 0xaaffe67e, 0x21bccf08, 0xef15e8e6, 0xbae79bd9, 0x4a6f36ce, 0xea9f09d4, 0x29b07cd6, 0x31a4b2af, 0x2a3f2331, 0xc6a59430, 0x35a266c0, 0x744ebc37, 0xfc82caa6, 0xe090d0b0, 0x33a7d815, 0xf104984a, 0x41ecdaf7, 0x7fcd500e, 0x1791f62f, 0x764dd68d, 0x43efb04d, 0xccaa4d54, 0xe49604df, 0x9ed1b5e3, 0x4c6a881b, 0xc12c1fb8, 0x4665517f, 0x9d5eea04, 0x018c355d, 0xfa877473, 0xfb0b412e, 0xb3671d5a, 0x92dbd252, 0xe9105633, 0x6dd64713, 0x9ad7618c, 0x37a10c7a, 0x59f8148e, 0xeb133c89, 0xcea927ee, 0xb761c935, 0xe11ce5ed, 0x7a47b13c, 0x9cd2df59, 0x55f2733f, 0x1814ce79, 0x73c737bf, 0x53f7cdea, 0x5ffdaa5b, 0xdf3d6f14, 0x7844db86, 0xcaaff381, 0xb968c43e, 0x3824342c, 0xc2a3405f, 0x161dc372, 0xbce2250c, 0x283c498b, 0xff0d9541, 0x39a80171, 0x080cb3de, 0xd8b4e49c, 0x6456c190, 0x7bcb8461, 0xd532b670, 0x486c5c74, 0xd0b85742];\n var T6 = [0x5051f4a7, 0x537e4165, 0xc31a17a4, 0x963a275e, 0xcb3bab6b, 0xf11f9d45, 0xabacfa58, 0x934be303, 0x552030fa, 0xf6ad766d, 0x9188cc76, 0x25f5024c, 0xfc4fe5d7, 0xd7c52acb, 0x80263544, 0x8fb562a3, 0x49deb15a, 0x6725ba1b, 0x9845ea0e, 0xe15dfec0, 0x02c32f75, 0x12814cf0, 0xa38d4697, 0xc66bd3f9, 0xe7038f5f, 0x9515929c, 0xebbf6d7a, 0xda955259, 0x2dd4be83, 0xd3587421, 0x2949e069, 0x448ec9c8, 0x6a75c289, 0x78f48e79, 0x6b99583e, 0xdd27b971, 0xb6bee14f, 0x17f088ad, 0x66c920ac, 0xb47dce3a, 0x1863df4a, 0x82e51a31, 0x60975133, 0x4562537f, 0xe0b16477, 0x84bb6bae, 0x1cfe81a0, 0x94f9082b, 0x58704868, 0x198f45fd, 0x8794de6c, 0xb7527bf8, 0x23ab73d3, 0xe2724b02, 0x57e31f8f, 0x2a6655ab, 0x07b2eb28, 0x032fb5c2, 0x9a86c57b, 0xa5d33708, 0xf2302887, 0xb223bfa5, 0xba02036a, 0x5ced1682, 0x2b8acf1c, 0x92a779b4, 0xf0f307f2, 0xa14e69e2, 0xcd65daf4, 0xd50605be, 0x1fd13462, 0x8ac4a6fe, 0x9d342e53, 0xa0a2f355, 0x32058ae1, 0x75a4f6eb, 0x390b83ec, 0xaa4060ef, 0x065e719f, 0x51bd6e10, 0xf93e218a, 0x3d96dd06, 0xaedd3e05, 0x464de6bd, 0xb591548d, 0x0571c45d, 0x6f0406d4, 0xff605015, 0x241998fb, 0x97d6bde9, 0xcc894043, 0x7767d99e, 0xbdb0e842, 0x8807898b, 0x38e7195b, 0xdb79c8ee, 0x47a17c0a, 0xe97c420f, 0xc9f8841e, 0x00000000, 0x83098086, 0x48322bed, 0xac1e1170, 0x4e6c5a72, 0xfbfd0eff, 0x560f8538, 0x1e3daed5, 0x27362d39, 0x640a0fd9, 0x21685ca6, 0xd19b5b54, 0x3a24362e, 0xb10c0a67, 0x0f9357e7, 0xd2b4ee96, 0x9e1b9b91, 0x4f80c0c5, 0xa261dc20, 0x695a774b, 0x161c121a, 0x0ae293ba, 0xe5c0a02a, 0x433c22e0, 0x1d121b17, 0x0b0e090d, 0xadf28bc7, 0xb92db6a8, 0xc8141ea9, 0x8557f119, 0x4caf7507, 0xbbee99dd, 0xfda37f60, 0x9ff70126, 0xbc5c72f5, 0xc544663b, 0x345bfb7e, 0x768b4329, 0xdccb23c6, 0x68b6edfc, 0x63b8e4f1, 0xcad731dc, 0x10426385, 0x40139722, 0x2084c611, 0x7d854a24, 0xf8d2bb3d, 0x11aef932, 0x6dc729a1, 0x4b1d9e2f, 0xf3dcb230, 0xec0d8652, 0xd077c1e3, 0x6c2bb316, 0x99a970b9, 0xfa119448, 0x2247e964, 0xc4a8fc8c, 0x1aa0f03f, 0xd8567d2c, 0xef223390, 0xc787494e, 0xc1d938d1, 0xfe8ccaa2, 0x3698d40b, 0xcfa6f581, 0x28a57ade, 0x26dab78e, 0xa43fadbf, 0xe42c3a9d, 0x0d507892, 0x9b6a5fcc, 0x62547e46, 0xc2f68d13, 0xe890d8b8, 0x5e2e39f7, 0xf582c3af, 0xbe9f5d80, 0x7c69d093, 0xa96fd52d, 0xb3cf2512, 0x3bc8ac99, 0xa710187d, 0x6ee89c63, 0x7bdb3bbb, 0x09cd2678, 0xf46e5918, 0x01ec9ab7, 0xa8834f9a, 0x65e6956e, 0x7eaaffe6, 0x0821bccf, 0xe6ef15e8, 0xd9bae79b, 0xce4a6f36, 0xd4ea9f09, 0xd629b07c, 0xaf31a4b2, 0x312a3f23, 0x30c6a594, 0xc035a266, 0x37744ebc, 0xa6fc82ca, 0xb0e090d0, 0x1533a7d8, 0x4af10498, 0xf741ecda, 0x0e7fcd50, 0x2f1791f6, 0x8d764dd6, 0x4d43efb0, 0x54ccaa4d, 0xdfe49604, 0xe39ed1b5, 0x1b4c6a88, 0xb8c12c1f, 0x7f466551, 0x049d5eea, 0x5d018c35, 0x73fa8774, 0x2efb0b41, 0x5ab3671d, 0x5292dbd2, 0x33e91056, 0x136dd647, 0x8c9ad761, 0x7a37a10c, 0x8e59f814, 0x89eb133c, 0xeecea927, 0x35b761c9, 0xede11ce5, 0x3c7a47b1, 0x599cd2df, 0x3f55f273, 0x791814ce, 0xbf73c737, 0xea53f7cd, 0x5b5ffdaa, 0x14df3d6f, 0x867844db, 0x81caaff3, 0x3eb968c4, 0x2c382434, 0x5fc2a340, 0x72161dc3, 0x0cbce225, 0x8b283c49, 0x41ff0d95, 0x7139a801, 0xde080cb3, 0x9cd8b4e4, 0x906456c1, 0x617bcb84, 0x70d532b6, 0x74486c5c, 0x42d0b857];\n var T7 = [0xa75051f4, 0x65537e41, 0xa4c31a17, 0x5e963a27, 0x6bcb3bab, 0x45f11f9d, 0x58abacfa, 0x03934be3, 0xfa552030, 0x6df6ad76, 0x769188cc, 0x4c25f502, 0xd7fc4fe5, 0xcbd7c52a, 0x44802635, 0xa38fb562, 0x5a49deb1, 0x1b6725ba, 0x0e9845ea, 0xc0e15dfe, 0x7502c32f, 0xf012814c, 0x97a38d46, 0xf9c66bd3, 0x5fe7038f, 0x9c951592, 0x7aebbf6d, 0x59da9552, 0x832dd4be, 0x21d35874, 0x692949e0, 0xc8448ec9, 0x896a75c2, 0x7978f48e, 0x3e6b9958, 0x71dd27b9, 0x4fb6bee1, 0xad17f088, 0xac66c920, 0x3ab47dce, 0x4a1863df, 0x3182e51a, 0x33609751, 0x7f456253, 0x77e0b164, 0xae84bb6b, 0xa01cfe81, 0x2b94f908, 0x68587048, 0xfd198f45, 0x6c8794de, 0xf8b7527b, 0xd323ab73, 0x02e2724b, 0x8f57e31f, 0xab2a6655, 0x2807b2eb, 0xc2032fb5, 0x7b9a86c5, 0x08a5d337, 0x87f23028, 0xa5b223bf, 0x6aba0203, 0x825ced16, 0x1c2b8acf, 0xb492a779, 0xf2f0f307, 0xe2a14e69, 0xf4cd65da, 0xbed50605, 0x621fd134, 0xfe8ac4a6, 0x539d342e, 0x55a0a2f3, 0xe132058a, 0xeb75a4f6, 0xec390b83, 0xefaa4060, 0x9f065e71, 0x1051bd6e, 0x8af93e21, 0x063d96dd, 0x05aedd3e, 0xbd464de6, 0x8db59154, 0x5d0571c4, 0xd46f0406, 0x15ff6050, 0xfb241998, 0xe997d6bd, 0x43cc8940, 0x9e7767d9, 0x42bdb0e8, 0x8b880789, 0x5b38e719, 0xeedb79c8, 0x0a47a17c, 0x0fe97c42, 0x1ec9f884, 0x00000000, 0x86830980, 0xed48322b, 0x70ac1e11, 0x724e6c5a, 0xfffbfd0e, 0x38560f85, 0xd51e3dae, 0x3927362d, 0xd9640a0f, 0xa621685c, 0x54d19b5b, 0x2e3a2436, 0x67b10c0a, 0xe70f9357, 0x96d2b4ee, 0x919e1b9b, 0xc54f80c0, 0x20a261dc, 0x4b695a77, 0x1a161c12, 0xba0ae293, 0x2ae5c0a0, 0xe0433c22, 0x171d121b, 0x0d0b0e09, 0xc7adf28b, 0xa8b92db6, 0xa9c8141e, 0x198557f1, 0x074caf75, 0xddbbee99, 0x60fda37f, 0x269ff701, 0xf5bc5c72, 0x3bc54466, 0x7e345bfb, 0x29768b43, 0xc6dccb23, 0xfc68b6ed, 0xf163b8e4, 0xdccad731, 0x85104263, 0x22401397, 0x112084c6, 0x247d854a, 0x3df8d2bb, 0x3211aef9, 0xa16dc729, 0x2f4b1d9e, 0x30f3dcb2, 0x52ec0d86, 0xe3d077c1, 0x166c2bb3, 0xb999a970, 0x48fa1194, 0x642247e9, 0x8cc4a8fc, 0x3f1aa0f0, 0x2cd8567d, 0x90ef2233, 0x4ec78749, 0xd1c1d938, 0xa2fe8cca, 0x0b3698d4, 0x81cfa6f5, 0xde28a57a, 0x8e26dab7, 0xbfa43fad, 0x9de42c3a, 0x920d5078, 0xcc9b6a5f, 0x4662547e, 0x13c2f68d, 0xb8e890d8, 0xf75e2e39, 0xaff582c3, 0x80be9f5d, 0x937c69d0, 0x2da96fd5, 0x12b3cf25, 0x993bc8ac, 0x7da71018, 0x636ee89c, 0xbb7bdb3b, 0x7809cd26, 0x18f46e59, 0xb701ec9a, 0x9aa8834f, 0x6e65e695, 0xe67eaaff, 0xcf0821bc, 0xe8e6ef15, 0x9bd9bae7, 0x36ce4a6f, 0x09d4ea9f, 0x7cd629b0, 0xb2af31a4, 0x23312a3f, 0x9430c6a5, 0x66c035a2, 0xbc37744e, 0xcaa6fc82, 0xd0b0e090, 0xd81533a7, 0x984af104, 0xdaf741ec, 0x500e7fcd, 0xf62f1791, 0xd68d764d, 0xb04d43ef, 0x4d54ccaa, 0x04dfe496, 0xb5e39ed1, 0x881b4c6a, 0x1fb8c12c, 0x517f4665, 0xea049d5e, 0x355d018c, 0x7473fa87, 0x412efb0b, 0x1d5ab367, 0xd25292db, 0x5633e910, 0x47136dd6, 0x618c9ad7, 0x0c7a37a1, 0x148e59f8, 0x3c89eb13, 0x27eecea9, 0xc935b761, 0xe5ede11c, 0xb13c7a47, 0xdf599cd2, 0x733f55f2, 0xce791814, 0x37bf73c7, 0xcdea53f7, 0xaa5b5ffd, 0x6f14df3d, 0xdb867844, 0xf381caaf, 0xc43eb968, 0x342c3824, 0x405fc2a3, 0xc372161d, 0x250cbce2, 0x498b283c, 0x9541ff0d, 0x017139a8, 0xb3de080c, 0xe49cd8b4, 0xc1906456, 0x84617bcb, 0xb670d532, 0x5c74486c, 0x5742d0b8];\n var T8 = [0xf4a75051, 0x4165537e, 0x17a4c31a, 0x275e963a, 0xab6bcb3b, 0x9d45f11f, 0xfa58abac, 0xe303934b, 0x30fa5520, 0x766df6ad, 0xcc769188, 0x024c25f5, 0xe5d7fc4f, 0x2acbd7c5, 0x35448026, 0x62a38fb5, 0xb15a49de, 0xba1b6725, 0xea0e9845, 0xfec0e15d, 0x2f7502c3, 0x4cf01281, 0x4697a38d, 0xd3f9c66b, 0x8f5fe703, 0x929c9515, 0x6d7aebbf, 0x5259da95, 0xbe832dd4, 0x7421d358, 0xe0692949, 0xc9c8448e, 0xc2896a75, 0x8e7978f4, 0x583e6b99, 0xb971dd27, 0xe14fb6be, 0x88ad17f0, 0x20ac66c9, 0xce3ab47d, 0xdf4a1863, 0x1a3182e5, 0x51336097, 0x537f4562, 0x6477e0b1, 0x6bae84bb, 0x81a01cfe, 0x082b94f9, 0x48685870, 0x45fd198f, 0xde6c8794, 0x7bf8b752, 0x73d323ab, 0x4b02e272, 0x1f8f57e3, 0x55ab2a66, 0xeb2807b2, 0xb5c2032f, 0xc57b9a86, 0x3708a5d3, 0x2887f230, 0xbfa5b223, 0x036aba02, 0x16825ced, 0xcf1c2b8a, 0x79b492a7, 0x07f2f0f3, 0x69e2a14e, 0xdaf4cd65, 0x05bed506, 0x34621fd1, 0xa6fe8ac4, 0x2e539d34, 0xf355a0a2, 0x8ae13205, 0xf6eb75a4, 0x83ec390b, 0x60efaa40, 0x719f065e, 0x6e1051bd, 0x218af93e, 0xdd063d96, 0x3e05aedd, 0xe6bd464d, 0x548db591, 0xc45d0571, 0x06d46f04, 0x5015ff60, 0x98fb2419, 0xbde997d6, 0x4043cc89, 0xd99e7767, 0xe842bdb0, 0x898b8807, 0x195b38e7, 0xc8eedb79, 0x7c0a47a1, 0x420fe97c, 0x841ec9f8, 0x00000000, 0x80868309, 0x2bed4832, 0x1170ac1e, 0x5a724e6c, 0x0efffbfd, 0x8538560f, 0xaed51e3d, 0x2d392736, 0x0fd9640a, 0x5ca62168, 0x5b54d19b, 0x362e3a24, 0x0a67b10c, 0x57e70f93, 0xee96d2b4, 0x9b919e1b, 0xc0c54f80, 0xdc20a261, 0x774b695a, 0x121a161c, 0x93ba0ae2, 0xa02ae5c0, 0x22e0433c, 0x1b171d12, 0x090d0b0e, 0x8bc7adf2, 0xb6a8b92d, 0x1ea9c814, 0xf1198557, 0x75074caf, 0x99ddbbee, 0x7f60fda3, 0x01269ff7, 0x72f5bc5c, 0x663bc544, 0xfb7e345b, 0x4329768b, 0x23c6dccb, 0xedfc68b6, 0xe4f163b8, 0x31dccad7, 0x63851042, 0x97224013, 0xc6112084, 0x4a247d85, 0xbb3df8d2, 0xf93211ae, 0x29a16dc7, 0x9e2f4b1d, 0xb230f3dc, 0x8652ec0d, 0xc1e3d077, 0xb3166c2b, 0x70b999a9, 0x9448fa11, 0xe9642247, 0xfc8cc4a8, 0xf03f1aa0, 0x7d2cd856, 0x3390ef22, 0x494ec787, 0x38d1c1d9, 0xcaa2fe8c, 0xd40b3698, 0xf581cfa6, 0x7ade28a5, 0xb78e26da, 0xadbfa43f, 0x3a9de42c, 0x78920d50, 0x5fcc9b6a, 0x7e466254, 0x8d13c2f6, 0xd8b8e890, 0x39f75e2e, 0xc3aff582, 0x5d80be9f, 0xd0937c69, 0xd52da96f, 0x2512b3cf, 0xac993bc8, 0x187da710, 0x9c636ee8, 0x3bbb7bdb, 0x267809cd, 0x5918f46e, 0x9ab701ec, 0x4f9aa883, 0x956e65e6, 0xffe67eaa, 0xbccf0821, 0x15e8e6ef, 0xe79bd9ba, 0x6f36ce4a, 0x9f09d4ea, 0xb07cd629, 0xa4b2af31, 0x3f23312a, 0xa59430c6, 0xa266c035, 0x4ebc3774, 0x82caa6fc, 0x90d0b0e0, 0xa7d81533, 0x04984af1, 0xecdaf741, 0xcd500e7f, 0x91f62f17, 0x4dd68d76, 0xefb04d43, 0xaa4d54cc, 0x9604dfe4, 0xd1b5e39e, 0x6a881b4c, 0x2c1fb8c1, 0x65517f46, 0x5eea049d, 0x8c355d01, 0x877473fa, 0x0b412efb, 0x671d5ab3, 0xdbd25292, 0x105633e9, 0xd647136d, 0xd7618c9a, 0xa10c7a37, 0xf8148e59, 0x133c89eb, 0xa927eece, 0x61c935b7, 0x1ce5ede1, 0x47b13c7a, 0xd2df599c, 0xf2733f55, 0x14ce7918, 0xc737bf73, 0xf7cdea53, 0xfdaa5b5f, 0x3d6f14df, 0x44db8678, 0xaff381ca, 0x68c43eb9, 0x24342c38, 0xa3405fc2, 0x1dc37216, 0xe2250cbc, 0x3c498b28, 0x0d9541ff, 0xa8017139, 0x0cb3de08, 0xb4e49cd8, 0x56c19064, 0xcb84617b, 0x32b670d5, 0x6c5c7448, 0xb85742d0];\n\n // Transformations for decryption key expansion\n var U1 = [0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3];\n var U2 = [0x00000000, 0x0b0e090d, 0x161c121a, 0x1d121b17, 0x2c382434, 0x27362d39, 0x3a24362e, 0x312a3f23, 0x58704868, 0x537e4165, 0x4e6c5a72, 0x4562537f, 0x74486c5c, 0x7f466551, 0x62547e46, 0x695a774b, 0xb0e090d0, 0xbbee99dd, 0xa6fc82ca, 0xadf28bc7, 0x9cd8b4e4, 0x97d6bde9, 0x8ac4a6fe, 0x81caaff3, 0xe890d8b8, 0xe39ed1b5, 0xfe8ccaa2, 0xf582c3af, 0xc4a8fc8c, 0xcfa6f581, 0xd2b4ee96, 0xd9bae79b, 0x7bdb3bbb, 0x70d532b6, 0x6dc729a1, 0x66c920ac, 0x57e31f8f, 0x5ced1682, 0x41ff0d95, 0x4af10498, 0x23ab73d3, 0x28a57ade, 0x35b761c9, 0x3eb968c4, 0x0f9357e7, 0x049d5eea, 0x198f45fd, 0x12814cf0, 0xcb3bab6b, 0xc035a266, 0xdd27b971, 0xd629b07c, 0xe7038f5f, 0xec0d8652, 0xf11f9d45, 0xfa119448, 0x934be303, 0x9845ea0e, 0x8557f119, 0x8e59f814, 0xbf73c737, 0xb47dce3a, 0xa96fd52d, 0xa261dc20, 0xf6ad766d, 0xfda37f60, 0xe0b16477, 0xebbf6d7a, 0xda955259, 0xd19b5b54, 0xcc894043, 0xc787494e, 0xaedd3e05, 0xa5d33708, 0xb8c12c1f, 0xb3cf2512, 0x82e51a31, 0x89eb133c, 0x94f9082b, 0x9ff70126, 0x464de6bd, 0x4d43efb0, 0x5051f4a7, 0x5b5ffdaa, 0x6a75c289, 0x617bcb84, 0x7c69d093, 0x7767d99e, 0x1e3daed5, 0x1533a7d8, 0x0821bccf, 0x032fb5c2, 0x32058ae1, 0x390b83ec, 0x241998fb, 0x2f1791f6, 0x8d764dd6, 0x867844db, 0x9b6a5fcc, 0x906456c1, 0xa14e69e2, 0xaa4060ef, 0xb7527bf8, 0xbc5c72f5, 0xd50605be, 0xde080cb3, 0xc31a17a4, 0xc8141ea9, 0xf93e218a, 0xf2302887, 0xef223390, 0xe42c3a9d, 0x3d96dd06, 0x3698d40b, 0x2b8acf1c, 0x2084c611, 0x11aef932, 0x1aa0f03f, 0x07b2eb28, 0x0cbce225, 0x65e6956e, 0x6ee89c63, 0x73fa8774, 0x78f48e79, 0x49deb15a, 0x42d0b857, 0x5fc2a340, 0x54ccaa4d, 0xf741ecda, 0xfc4fe5d7, 0xe15dfec0, 0xea53f7cd, 0xdb79c8ee, 0xd077c1e3, 0xcd65daf4, 0xc66bd3f9, 0xaf31a4b2, 0xa43fadbf, 0xb92db6a8, 0xb223bfa5, 0x83098086, 0x8807898b, 0x9515929c, 0x9e1b9b91, 0x47a17c0a, 0x4caf7507, 0x51bd6e10, 0x5ab3671d, 0x6b99583e, 0x60975133, 0x7d854a24, 0x768b4329, 0x1fd13462, 0x14df3d6f, 0x09cd2678, 0x02c32f75, 0x33e91056, 0x38e7195b, 0x25f5024c, 0x2efb0b41, 0x8c9ad761, 0x8794de6c, 0x9a86c57b, 0x9188cc76, 0xa0a2f355, 0xabacfa58, 0xb6bee14f, 0xbdb0e842, 0xd4ea9f09, 0xdfe49604, 0xc2f68d13, 0xc9f8841e, 0xf8d2bb3d, 0xf3dcb230, 0xeecea927, 0xe5c0a02a, 0x3c7a47b1, 0x37744ebc, 0x2a6655ab, 0x21685ca6, 0x10426385, 0x1b4c6a88, 0x065e719f, 0x0d507892, 0x640a0fd9, 0x6f0406d4, 0x72161dc3, 0x791814ce, 0x48322bed, 0x433c22e0, 0x5e2e39f7, 0x552030fa, 0x01ec9ab7, 0x0ae293ba, 0x17f088ad, 0x1cfe81a0, 0x2dd4be83, 0x26dab78e, 0x3bc8ac99, 0x30c6a594, 0x599cd2df, 0x5292dbd2, 0x4f80c0c5, 0x448ec9c8, 0x75a4f6eb, 0x7eaaffe6, 0x63b8e4f1, 0x68b6edfc, 0xb10c0a67, 0xba02036a, 0xa710187d, 0xac1e1170, 0x9d342e53, 0x963a275e, 0x8b283c49, 0x80263544, 0xe97c420f, 0xe2724b02, 0xff605015, 0xf46e5918, 0xc544663b, 0xce4a6f36, 0xd3587421, 0xd8567d2c, 0x7a37a10c, 0x7139a801, 0x6c2bb316, 0x6725ba1b, 0x560f8538, 0x5d018c35, 0x40139722, 0x4b1d9e2f, 0x2247e964, 0x2949e069, 0x345bfb7e, 0x3f55f273, 0x0e7fcd50, 0x0571c45d, 0x1863df4a, 0x136dd647, 0xcad731dc, 0xc1d938d1, 0xdccb23c6, 0xd7c52acb, 0xe6ef15e8, 0xede11ce5, 0xf0f307f2, 0xfbfd0eff, 0x92a779b4, 0x99a970b9, 0x84bb6bae, 0x8fb562a3, 0xbe9f5d80, 0xb591548d, 0xa8834f9a, 0xa38d4697];\n var U3 = [0x00000000, 0x0d0b0e09, 0x1a161c12, 0x171d121b, 0x342c3824, 0x3927362d, 0x2e3a2436, 0x23312a3f, 0x68587048, 0x65537e41, 0x724e6c5a, 0x7f456253, 0x5c74486c, 0x517f4665, 0x4662547e, 0x4b695a77, 0xd0b0e090, 0xddbbee99, 0xcaa6fc82, 0xc7adf28b, 0xe49cd8b4, 0xe997d6bd, 0xfe8ac4a6, 0xf381caaf, 0xb8e890d8, 0xb5e39ed1, 0xa2fe8cca, 0xaff582c3, 0x8cc4a8fc, 0x81cfa6f5, 0x96d2b4ee, 0x9bd9bae7, 0xbb7bdb3b, 0xb670d532, 0xa16dc729, 0xac66c920, 0x8f57e31f, 0x825ced16, 0x9541ff0d, 0x984af104, 0xd323ab73, 0xde28a57a, 0xc935b761, 0xc43eb968, 0xe70f9357, 0xea049d5e, 0xfd198f45, 0xf012814c, 0x6bcb3bab, 0x66c035a2, 0x71dd27b9, 0x7cd629b0, 0x5fe7038f, 0x52ec0d86, 0x45f11f9d, 0x48fa1194, 0x03934be3, 0x0e9845ea, 0x198557f1, 0x148e59f8, 0x37bf73c7, 0x3ab47dce, 0x2da96fd5, 0x20a261dc, 0x6df6ad76, 0x60fda37f, 0x77e0b164, 0x7aebbf6d, 0x59da9552, 0x54d19b5b, 0x43cc8940, 0x4ec78749, 0x05aedd3e, 0x08a5d337, 0x1fb8c12c, 0x12b3cf25, 0x3182e51a, 0x3c89eb13, 0x2b94f908, 0x269ff701, 0xbd464de6, 0xb04d43ef, 0xa75051f4, 0xaa5b5ffd, 0x896a75c2, 0x84617bcb, 0x937c69d0, 0x9e7767d9, 0xd51e3dae, 0xd81533a7, 0xcf0821bc, 0xc2032fb5, 0xe132058a, 0xec390b83, 0xfb241998, 0xf62f1791, 0xd68d764d, 0xdb867844, 0xcc9b6a5f, 0xc1906456, 0xe2a14e69, 0xefaa4060, 0xf8b7527b, 0xf5bc5c72, 0xbed50605, 0xb3de080c, 0xa4c31a17, 0xa9c8141e, 0x8af93e21, 0x87f23028, 0x90ef2233, 0x9de42c3a, 0x063d96dd, 0x0b3698d4, 0x1c2b8acf, 0x112084c6, 0x3211aef9, 0x3f1aa0f0, 0x2807b2eb, 0x250cbce2, 0x6e65e695, 0x636ee89c, 0x7473fa87, 0x7978f48e, 0x5a49deb1, 0x5742d0b8, 0x405fc2a3, 0x4d54ccaa, 0xdaf741ec, 0xd7fc4fe5, 0xc0e15dfe, 0xcdea53f7, 0xeedb79c8, 0xe3d077c1, 0xf4cd65da, 0xf9c66bd3, 0xb2af31a4, 0xbfa43fad, 0xa8b92db6, 0xa5b223bf, 0x86830980, 0x8b880789, 0x9c951592, 0x919e1b9b, 0x0a47a17c, 0x074caf75, 0x1051bd6e, 0x1d5ab367, 0x3e6b9958, 0x33609751, 0x247d854a, 0x29768b43, 0x621fd134, 0x6f14df3d, 0x7809cd26, 0x7502c32f, 0x5633e910, 0x5b38e719, 0x4c25f502, 0x412efb0b, 0x618c9ad7, 0x6c8794de, 0x7b9a86c5, 0x769188cc, 0x55a0a2f3, 0x58abacfa, 0x4fb6bee1, 0x42bdb0e8, 0x09d4ea9f, 0x04dfe496, 0x13c2f68d, 0x1ec9f884, 0x3df8d2bb, 0x30f3dcb2, 0x27eecea9, 0x2ae5c0a0, 0xb13c7a47, 0xbc37744e, 0xab2a6655, 0xa621685c, 0x85104263, 0x881b4c6a, 0x9f065e71, 0x920d5078, 0xd9640a0f, 0xd46f0406, 0xc372161d, 0xce791814, 0xed48322b, 0xe0433c22, 0xf75e2e39, 0xfa552030, 0xb701ec9a, 0xba0ae293, 0xad17f088, 0xa01cfe81, 0x832dd4be, 0x8e26dab7, 0x993bc8ac, 0x9430c6a5, 0xdf599cd2, 0xd25292db, 0xc54f80c0, 0xc8448ec9, 0xeb75a4f6, 0xe67eaaff, 0xf163b8e4, 0xfc68b6ed, 0x67b10c0a, 0x6aba0203, 0x7da71018, 0x70ac1e11, 0x539d342e, 0x5e963a27, 0x498b283c, 0x44802635, 0x0fe97c42, 0x02e2724b, 0x15ff6050, 0x18f46e59, 0x3bc54466, 0x36ce4a6f, 0x21d35874, 0x2cd8567d, 0x0c7a37a1, 0x017139a8, 0x166c2bb3, 0x1b6725ba, 0x38560f85, 0x355d018c, 0x22401397, 0x2f4b1d9e, 0x642247e9, 0x692949e0, 0x7e345bfb, 0x733f55f2, 0x500e7fcd, 0x5d0571c4, 0x4a1863df, 0x47136dd6, 0xdccad731, 0xd1c1d938, 0xc6dccb23, 0xcbd7c52a, 0xe8e6ef15, 0xe5ede11c, 0xf2f0f307, 0xfffbfd0e, 0xb492a779, 0xb999a970, 0xae84bb6b, 0xa38fb562, 0x80be9f5d, 0x8db59154, 0x9aa8834f, 0x97a38d46];\n var U4 = [0x00000000, 0x090d0b0e, 0x121a161c, 0x1b171d12, 0x24342c38, 0x2d392736, 0x362e3a24, 0x3f23312a, 0x48685870, 0x4165537e, 0x5a724e6c, 0x537f4562, 0x6c5c7448, 0x65517f46, 0x7e466254, 0x774b695a, 0x90d0b0e0, 0x99ddbbee, 0x82caa6fc, 0x8bc7adf2, 0xb4e49cd8, 0xbde997d6, 0xa6fe8ac4, 0xaff381ca, 0xd8b8e890, 0xd1b5e39e, 0xcaa2fe8c, 0xc3aff582, 0xfc8cc4a8, 0xf581cfa6, 0xee96d2b4, 0xe79bd9ba, 0x3bbb7bdb, 0x32b670d5, 0x29a16dc7, 0x20ac66c9, 0x1f8f57e3, 0x16825ced, 0x0d9541ff, 0x04984af1, 0x73d323ab, 0x7ade28a5, 0x61c935b7, 0x68c43eb9, 0x57e70f93, 0x5eea049d, 0x45fd198f, 0x4cf01281, 0xab6bcb3b, 0xa266c035, 0xb971dd27, 0xb07cd629, 0x8f5fe703, 0x8652ec0d, 0x9d45f11f, 0x9448fa11, 0xe303934b, 0xea0e9845, 0xf1198557, 0xf8148e59, 0xc737bf73, 0xce3ab47d, 0xd52da96f, 0xdc20a261, 0x766df6ad, 0x7f60fda3, 0x6477e0b1, 0x6d7aebbf, 0x5259da95, 0x5b54d19b, 0x4043cc89, 0x494ec787, 0x3e05aedd, 0x3708a5d3, 0x2c1fb8c1, 0x2512b3cf, 0x1a3182e5, 0x133c89eb, 0x082b94f9, 0x01269ff7, 0xe6bd464d, 0xefb04d43, 0xf4a75051, 0xfdaa5b5f, 0xc2896a75, 0xcb84617b, 0xd0937c69, 0xd99e7767, 0xaed51e3d, 0xa7d81533, 0xbccf0821, 0xb5c2032f, 0x8ae13205, 0x83ec390b, 0x98fb2419, 0x91f62f17, 0x4dd68d76, 0x44db8678, 0x5fcc9b6a, 0x56c19064, 0x69e2a14e, 0x60efaa40, 0x7bf8b752, 0x72f5bc5c, 0x05bed506, 0x0cb3de08, 0x17a4c31a, 0x1ea9c814, 0x218af93e, 0x2887f230, 0x3390ef22, 0x3a9de42c, 0xdd063d96, 0xd40b3698, 0xcf1c2b8a, 0xc6112084, 0xf93211ae, 0xf03f1aa0, 0xeb2807b2, 0xe2250cbc, 0x956e65e6, 0x9c636ee8, 0x877473fa, 0x8e7978f4, 0xb15a49de, 0xb85742d0, 0xa3405fc2, 0xaa4d54cc, 0xecdaf741, 0xe5d7fc4f, 0xfec0e15d, 0xf7cdea53, 0xc8eedb79, 0xc1e3d077, 0xdaf4cd65, 0xd3f9c66b, 0xa4b2af31, 0xadbfa43f, 0xb6a8b92d, 0xbfa5b223, 0x80868309, 0x898b8807, 0x929c9515, 0x9b919e1b, 0x7c0a47a1, 0x75074caf, 0x6e1051bd, 0x671d5ab3, 0x583e6b99, 0x51336097, 0x4a247d85, 0x4329768b, 0x34621fd1, 0x3d6f14df, 0x267809cd, 0x2f7502c3, 0x105633e9, 0x195b38e7, 0x024c25f5, 0x0b412efb, 0xd7618c9a, 0xde6c8794, 0xc57b9a86, 0xcc769188, 0xf355a0a2, 0xfa58abac, 0xe14fb6be, 0xe842bdb0, 0x9f09d4ea, 0x9604dfe4, 0x8d13c2f6, 0x841ec9f8, 0xbb3df8d2, 0xb230f3dc, 0xa927eece, 0xa02ae5c0, 0x47b13c7a, 0x4ebc3774, 0x55ab2a66, 0x5ca62168, 0x63851042, 0x6a881b4c, 0x719f065e, 0x78920d50, 0x0fd9640a, 0x06d46f04, 0x1dc37216, 0x14ce7918, 0x2bed4832, 0x22e0433c, 0x39f75e2e, 0x30fa5520, 0x9ab701ec, 0x93ba0ae2, 0x88ad17f0, 0x81a01cfe, 0xbe832dd4, 0xb78e26da, 0xac993bc8, 0xa59430c6, 0xd2df599c, 0xdbd25292, 0xc0c54f80, 0xc9c8448e, 0xf6eb75a4, 0xffe67eaa, 0xe4f163b8, 0xedfc68b6, 0x0a67b10c, 0x036aba02, 0x187da710, 0x1170ac1e, 0x2e539d34, 0x275e963a, 0x3c498b28, 0x35448026, 0x420fe97c, 0x4b02e272, 0x5015ff60, 0x5918f46e, 0x663bc544, 0x6f36ce4a, 0x7421d358, 0x7d2cd856, 0xa10c7a37, 0xa8017139, 0xb3166c2b, 0xba1b6725, 0x8538560f, 0x8c355d01, 0x97224013, 0x9e2f4b1d, 0xe9642247, 0xe0692949, 0xfb7e345b, 0xf2733f55, 0xcd500e7f, 0xc45d0571, 0xdf4a1863, 0xd647136d, 0x31dccad7, 0x38d1c1d9, 0x23c6dccb, 0x2acbd7c5, 0x15e8e6ef, 0x1ce5ede1, 0x07f2f0f3, 0x0efffbfd, 0x79b492a7, 0x70b999a9, 0x6bae84bb, 0x62a38fb5, 0x5d80be9f, 0x548db591, 0x4f9aa883, 0x4697a38d];\n\n function convertToInt32(bytes) {\n var result = [];\n for (var i = 0; i < bytes.length; i += 4) {\n result.push(\n (bytes[i ] << 24) |\n (bytes[i + 1] << 16) |\n (bytes[i + 2] << 8) |\n bytes[i + 3]\n );\n }\n return result;\n }\n\n var AES = function(key) {\n if (!(this instanceof AES)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n Object.defineProperty(this, 'key', {\n value: coerceArray(key, true)\n });\n\n this._prepare();\n }\n\n\n AES.prototype._prepare = function() {\n\n var rounds = numberOfRounds[this.key.length];\n if (rounds == null) {\n throw new Error('invalid key size (must be 16, 24 or 32 bytes)');\n }\n\n // encryption round keys\n this._Ke = [];\n\n // decryption round keys\n this._Kd = [];\n\n for (var i = 0; i <= rounds; i++) {\n this._Ke.push([0, 0, 0, 0]);\n this._Kd.push([0, 0, 0, 0]);\n }\n\n var roundKeyCount = (rounds + 1) * 4;\n var KC = this.key.length / 4;\n\n // convert the key into ints\n var tk = convertToInt32(this.key);\n\n // copy values into round key arrays\n var index;\n for (var i = 0; i < KC; i++) {\n index = i >> 2;\n this._Ke[index][i % 4] = tk[i];\n this._Kd[rounds - index][i % 4] = tk[i];\n }\n\n // key expansion (fips-197 section 5.2)\n var rconpointer = 0;\n var t = KC, tt;\n while (t < roundKeyCount) {\n tt = tk[KC - 1];\n tk[0] ^= ((S[(tt >> 16) & 0xFF] << 24) ^\n (S[(tt >> 8) & 0xFF] << 16) ^\n (S[ tt & 0xFF] << 8) ^\n S[(tt >> 24) & 0xFF] ^\n (rcon[rconpointer] << 24));\n rconpointer += 1;\n\n // key expansion (for non-256 bit)\n if (KC != 8) {\n for (var i = 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n\n // key expansion for 256-bit keys is \"slightly different\" (fips-197)\n } else {\n for (var i = 1; i < (KC / 2); i++) {\n tk[i] ^= tk[i - 1];\n }\n tt = tk[(KC / 2) - 1];\n\n tk[KC / 2] ^= (S[ tt & 0xFF] ^\n (S[(tt >> 8) & 0xFF] << 8) ^\n (S[(tt >> 16) & 0xFF] << 16) ^\n (S[(tt >> 24) & 0xFF] << 24));\n\n for (var i = (KC / 2) + 1; i < KC; i++) {\n tk[i] ^= tk[i - 1];\n }\n }\n\n // copy values into round key arrays\n var i = 0, r, c;\n while (i < KC && t < roundKeyCount) {\n r = t >> 2;\n c = t % 4;\n this._Ke[r][c] = tk[i];\n this._Kd[rounds - r][c] = tk[i++];\n t++;\n }\n }\n\n // inverse-cipher-ify the decryption round key (fips-197 section 5.3)\n for (var r = 1; r < rounds; r++) {\n for (var c = 0; c < 4; c++) {\n tt = this._Kd[r][c];\n this._Kd[r][c] = (U1[(tt >> 24) & 0xFF] ^\n U2[(tt >> 16) & 0xFF] ^\n U3[(tt >> 8) & 0xFF] ^\n U4[ tt & 0xFF]);\n }\n }\n }\n\n AES.prototype.encrypt = function(plaintext) {\n if (plaintext.length != 16) {\n throw new Error('invalid plaintext size (must be 16 bytes)');\n }\n\n var rounds = this._Ke.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(plaintext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Ke[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T1[(t[ i ] >> 24) & 0xff] ^\n T2[(t[(i + 1) % 4] >> 16) & 0xff] ^\n T3[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T4[ t[(i + 3) % 4] & 0xff] ^\n this._Ke[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Ke[rounds][i];\n result[4 * i ] = (S[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (S[(t[(i + 1) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (S[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (S[ t[(i + 3) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n AES.prototype.decrypt = function(ciphertext) {\n if (ciphertext.length != 16) {\n throw new Error('invalid ciphertext size (must be 16 bytes)');\n }\n\n var rounds = this._Kd.length - 1;\n var a = [0, 0, 0, 0];\n\n // convert plaintext to (ints ^ key)\n var t = convertToInt32(ciphertext);\n for (var i = 0; i < 4; i++) {\n t[i] ^= this._Kd[0][i];\n }\n\n // apply round transforms\n for (var r = 1; r < rounds; r++) {\n for (var i = 0; i < 4; i++) {\n a[i] = (T5[(t[ i ] >> 24) & 0xff] ^\n T6[(t[(i + 3) % 4] >> 16) & 0xff] ^\n T7[(t[(i + 2) % 4] >> 8) & 0xff] ^\n T8[ t[(i + 1) % 4] & 0xff] ^\n this._Kd[r][i]);\n }\n t = a.slice();\n }\n\n // the last round is special\n var result = createArray(16), tt;\n for (var i = 0; i < 4; i++) {\n tt = this._Kd[rounds][i];\n result[4 * i ] = (Si[(t[ i ] >> 24) & 0xff] ^ (tt >> 24)) & 0xff;\n result[4 * i + 1] = (Si[(t[(i + 3) % 4] >> 16) & 0xff] ^ (tt >> 16)) & 0xff;\n result[4 * i + 2] = (Si[(t[(i + 2) % 4] >> 8) & 0xff] ^ (tt >> 8)) & 0xff;\n result[4 * i + 3] = (Si[ t[(i + 1) % 4] & 0xff] ^ tt ) & 0xff;\n }\n\n return result;\n }\n\n\n /**\n * Mode Of Operation - Electonic Codebook (ECB)\n */\n var ModeOfOperationECB = function(key) {\n if (!(this instanceof ModeOfOperationECB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Electronic Code Block\";\n this.name = \"ecb\";\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationECB.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n block = this._aes.encrypt(block);\n copyArray(block, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationECB.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n copyArray(block, plaintext, i);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Block Chaining (CBC)\n */\n var ModeOfOperationCBC = function(key, iv) {\n if (!(this instanceof ModeOfOperationCBC)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Block Chaining\";\n this.name = \"cbc\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastCipherblock = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCBC.prototype.encrypt = function(plaintext) {\n plaintext = coerceArray(plaintext);\n\n if ((plaintext.length % 16) !== 0) {\n throw new Error('invalid plaintext size (must be multiple of 16 bytes)');\n }\n\n var ciphertext = createArray(plaintext.length);\n var block = createArray(16);\n\n for (var i = 0; i < plaintext.length; i += 16) {\n copyArray(plaintext, block, 0, i, i + 16);\n\n for (var j = 0; j < 16; j++) {\n block[j] ^= this._lastCipherblock[j];\n }\n\n this._lastCipherblock = this._aes.encrypt(block);\n copyArray(this._lastCipherblock, ciphertext, i);\n }\n\n return ciphertext;\n }\n\n ModeOfOperationCBC.prototype.decrypt = function(ciphertext) {\n ciphertext = coerceArray(ciphertext);\n\n if ((ciphertext.length % 16) !== 0) {\n throw new Error('invalid ciphertext size (must be multiple of 16 bytes)');\n }\n\n var plaintext = createArray(ciphertext.length);\n var block = createArray(16);\n\n for (var i = 0; i < ciphertext.length; i += 16) {\n copyArray(ciphertext, block, 0, i, i + 16);\n block = this._aes.decrypt(block);\n\n for (var j = 0; j < 16; j++) {\n plaintext[i + j] = block[j] ^ this._lastCipherblock[j];\n }\n\n copyArray(ciphertext, this._lastCipherblock, 0, i, i + 16);\n }\n\n return plaintext;\n }\n\n\n /**\n * Mode Of Operation - Cipher Feedback (CFB)\n */\n var ModeOfOperationCFB = function(key, iv, segmentSize) {\n if (!(this instanceof ModeOfOperationCFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Cipher Feedback\";\n this.name = \"cfb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 size)');\n }\n\n if (!segmentSize) { segmentSize = 1; }\n\n this.segmentSize = segmentSize;\n\n this._shiftRegister = coerceArray(iv, true);\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCFB.prototype.encrypt = function(plaintext) {\n if ((plaintext.length % this.segmentSize) != 0) {\n throw new Error('invalid plaintext size (must be segmentSize bytes)');\n }\n\n var encrypted = coerceArray(plaintext, true);\n\n var xorSegment;\n for (var i = 0; i < encrypted.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n for (var j = 0; j < this.segmentSize; j++) {\n encrypted[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(encrypted, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return encrypted;\n }\n\n ModeOfOperationCFB.prototype.decrypt = function(ciphertext) {\n if ((ciphertext.length % this.segmentSize) != 0) {\n throw new Error('invalid ciphertext size (must be segmentSize bytes)');\n }\n\n var plaintext = coerceArray(ciphertext, true);\n\n var xorSegment;\n for (var i = 0; i < plaintext.length; i += this.segmentSize) {\n xorSegment = this._aes.encrypt(this._shiftRegister);\n\n for (var j = 0; j < this.segmentSize; j++) {\n plaintext[i + j] ^= xorSegment[j];\n }\n\n // Shift the register\n copyArray(this._shiftRegister, this._shiftRegister, 0, this.segmentSize);\n copyArray(ciphertext, this._shiftRegister, 16 - this.segmentSize, i, i + this.segmentSize);\n }\n\n return plaintext;\n }\n\n /**\n * Mode Of Operation - Output Feedback (OFB)\n */\n var ModeOfOperationOFB = function(key, iv) {\n if (!(this instanceof ModeOfOperationOFB)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Output Feedback\";\n this.name = \"ofb\";\n\n if (!iv) {\n iv = createArray(16);\n\n } else if (iv.length != 16) {\n throw new Error('invalid initialation vector size (must be 16 bytes)');\n }\n\n this._lastPrecipher = coerceArray(iv, true);\n this._lastPrecipherIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationOFB.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._lastPrecipherIndex === 16) {\n this._lastPrecipher = this._aes.encrypt(this._lastPrecipher);\n this._lastPrecipherIndex = 0;\n }\n encrypted[i] ^= this._lastPrecipher[this._lastPrecipherIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationOFB.prototype.decrypt = ModeOfOperationOFB.prototype.encrypt;\n\n\n /**\n * Counter object for CTR common mode of operation\n */\n var Counter = function(initialValue) {\n if (!(this instanceof Counter)) {\n throw Error('Counter must be instanitated with `new`');\n }\n\n // We allow 0, but anything false-ish uses the default 1\n if (initialValue !== 0 && !initialValue) { initialValue = 1; }\n\n if (typeof(initialValue) === 'number') {\n this._counter = createArray(16);\n this.setValue(initialValue);\n\n } else {\n this.setBytes(initialValue);\n }\n }\n\n Counter.prototype.setValue = function(value) {\n if (typeof(value) !== 'number' || parseInt(value) != value) {\n throw new Error('invalid counter value (must be an integer)');\n }\n\n // We cannot safely handle numbers beyond the safe range for integers\n if (value > Number.MAX_SAFE_INTEGER) {\n throw new Error('integer value out of safe range');\n }\n\n for (var index = 15; index >= 0; --index) {\n this._counter[index] = value % 256;\n value = parseInt(value / 256);\n }\n }\n\n Counter.prototype.setBytes = function(bytes) {\n bytes = coerceArray(bytes, true);\n\n if (bytes.length != 16) {\n throw new Error('invalid counter bytes size (must be 16 bytes)');\n }\n\n this._counter = bytes;\n };\n\n Counter.prototype.increment = function() {\n for (var i = 15; i >= 0; i--) {\n if (this._counter[i] === 255) {\n this._counter[i] = 0;\n } else {\n this._counter[i]++;\n break;\n }\n }\n }\n\n\n /**\n * Mode Of Operation - Counter (CTR)\n */\n var ModeOfOperationCTR = function(key, counter) {\n if (!(this instanceof ModeOfOperationCTR)) {\n throw Error('AES must be instanitated with `new`');\n }\n\n this.description = \"Counter\";\n this.name = \"ctr\";\n\n if (!(counter instanceof Counter)) {\n counter = new Counter(counter)\n }\n\n this._counter = counter;\n\n this._remainingCounter = null;\n this._remainingCounterIndex = 16;\n\n this._aes = new AES(key);\n }\n\n ModeOfOperationCTR.prototype.encrypt = function(plaintext) {\n var encrypted = coerceArray(plaintext, true);\n\n for (var i = 0; i < encrypted.length; i++) {\n if (this._remainingCounterIndex === 16) {\n this._remainingCounter = this._aes.encrypt(this._counter._counter);\n this._remainingCounterIndex = 0;\n this._counter.increment();\n }\n encrypted[i] ^= this._remainingCounter[this._remainingCounterIndex++];\n }\n\n return encrypted;\n }\n\n // Decryption is symetric\n ModeOfOperationCTR.prototype.decrypt = ModeOfOperationCTR.prototype.encrypt;\n\n\n ///////////////////////\n // Padding\n\n // See:https://tools.ietf.org/html/rfc2315\n function pkcs7pad(data) {\n data = coerceArray(data, true);\n var padder = 16 - (data.length % 16);\n var result = createArray(data.length + padder);\n copyArray(data, result);\n for (var i = data.length; i < result.length; i++) {\n result[i] = padder;\n }\n return result;\n }\n\n function pkcs7strip(data) {\n data = coerceArray(data, true);\n if (data.length < 16) { throw new Error('PKCS#7 invalid length'); }\n\n var padder = data[data.length - 1];\n if (padder > 16) { throw new Error('PKCS#7 padding byte out of range'); }\n\n var length = data.length - padder;\n for (var i = 0; i < padder; i++) {\n if (data[length + i] !== padder) {\n throw new Error('PKCS#7 invalid padding byte');\n }\n }\n\n var result = createArray(length);\n copyArray(data, result, 0, 0, length);\n return result;\n }\n\n ///////////////////////\n // Exporting\n\n\n // The block cipher\n var aesjs = {\n AES: AES,\n Counter: Counter,\n\n ModeOfOperation: {\n ecb: ModeOfOperationECB,\n cbc: ModeOfOperationCBC,\n cfb: ModeOfOperationCFB,\n ofb: ModeOfOperationOFB,\n ctr: ModeOfOperationCTR\n },\n\n utils: {\n hex: convertHex,\n utf8: convertUtf8\n },\n\n padding: {\n pkcs7: {\n pad: pkcs7pad,\n strip: pkcs7strip\n }\n },\n\n _arrayTest: {\n coerceArray: coerceArray,\n createArray: createArray,\n copyArray: copyArray,\n }\n };\n\n\n // node.js\n if (typeof exports !== 'undefined') {\n module.exports = aesjs\n\n // RequireJS/AMD\n // http://www.requirejs.org/docs/api.html\n // https://github.com/amdjs/amdjs-api/wiki/AMD\n } else if (typeof(define) === 'function' && define.amd) {\n define([], function() { return aesjs; });\n\n // Web Browsers\n } else {\n\n // If there was an existing library at \"aesjs\" make sure it's still available\n if (root.aesjs) {\n aesjs._aesjs = root.aesjs;\n }\n\n root.aesjs = aesjs;\n }\n\n\n})(this);\n" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "index", "request": "./src/index.ts", "reasons": [] } ] }, { "id": 2, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendor) (name: npm.jsbn)", "size": 42308, "names": [ "npm.jsbn" ], "files": [ "npm.jsbn.chunk.js" ], "hash": "b40d2239888dd11256bc", "siblings": [ 0, 1, 3, 4, 5, 7 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 33, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/jsbn/index.js", "name": "./node_modules/jsbn/index.js", "index": 25, "index2": 20, "size": 42308, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 2 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/bin_utils.ts", "issuerId": 2, "issuerName": "./src/lib/bin_utils.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/apiManager.ts", "name": "./src/lib/mtproto/apiManager.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 2, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/bin_utils.ts", "name": "./src/lib/bin_utils.ts", "profile": { "factory": 196, "building": 1089, "dependencies": 820 } } ], "profile": { "factory": 832, "building": 67 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 2, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/bin_utils.ts", "module": "./src/lib/bin_utils.ts", "moduleName": "./src/lib/bin_utils.ts", "type": "cjs require", "userRequest": "jsbn", "loc": "13:15-30" }, { "moduleId": 16, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/mtproto.ts", "module": "./src/lib/mtproto/mtproto.ts", "moduleName": "./src/lib/mtproto/mtproto.ts", "type": "cjs require", "userRequest": "jsbn", "loc": "63:15-30" }, { "moduleId": 44, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/authorizer.ts", "module": "./src/lib/mtproto/authorizer.ts", "moduleName": "./src/lib/mtproto/authorizer.ts", "type": "cjs require", "userRequest": "jsbn", "loc": "22:15-30" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "(function(){\n\n // Copyright (c) 2005 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Basic JavaScript BN library - subset useful for RSA encryption.\n\n // Bits per digit\n var dbits;\n\n // JavaScript engine analysis\n var canary = 0xdeadbeefcafe;\n var j_lm = ((canary&0xffffff)==0xefcafe);\n\n // (public) Constructor\n function BigInteger(a,b,c) {\n if(a != null)\n if(\"number\" == typeof a) this.fromNumber(a,b,c);\n else if(b == null && \"string\" != typeof a) this.fromString(a,256);\n else this.fromString(a,b);\n }\n\n // return new, unset BigInteger\n function nbi() { return new BigInteger(null); }\n\n // am: Compute w_j += (x*this_i), propagate carries,\n // c is initial carry, returns final carry.\n // c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n // We need to select the fastest one that works in this environment.\n\n // am1: use a single mult and divide to get the high bits,\n // max digit bits should be 26 because\n // max internal value = 2*dvalue^2-2*dvalue (< 2^53)\n function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this[i++]+w[j]+c;\n c = Math.floor(v/0x4000000);\n w[j++] = v&0x3ffffff;\n }\n return c;\n }\n // am2 avoids a big mult-and-extract completely.\n // Max digit bits should be <= 30 because we do bitwise ops\n // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\n function am2(i,x,w,j,c,n) {\n var xl = x&0x7fff, xh = x>>15;\n while(--n >= 0) {\n var l = this[i]&0x7fff;\n var h = this[i++]>>15;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);\n c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);\n w[j++] = l&0x3fffffff;\n }\n return c;\n }\n // Alternately, set max digit bits to 28 since some\n // browsers slow down when dealing with 32-bit numbers.\n function am3(i,x,w,j,c,n) {\n var xl = x&0x3fff, xh = x>>14;\n while(--n >= 0) {\n var l = this[i]&0x3fff;\n var h = this[i++]>>14;\n var m = xh*l+h*xl;\n l = xl*l+((m&0x3fff)<<14)+w[j]+c;\n c = (l>>28)+(m>>14)+xh*h;\n w[j++] = l&0xfffffff;\n }\n return c;\n }\n var inBrowser = typeof navigator !== \"undefined\";\n if(inBrowser && j_lm && (navigator.appName == \"Microsoft Internet Explorer\")) {\n BigInteger.prototype.am = am2;\n dbits = 30;\n }\n else if(inBrowser && j_lm && (navigator.appName != \"Netscape\")) {\n BigInteger.prototype.am = am1;\n dbits = 26;\n }\n else { // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n }\n\n BigInteger.prototype.DB = dbits;\n BigInteger.prototype.DM = ((1<= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n }\n\n // (protected) set from integer value x, -DV <= x < DV\n function bnpFromInt(x) {\n this.t = 1;\n this.s = (x<0)?-1:0;\n if(x > 0) this[0] = x;\n else if(x < -1) this[0] = x+this.DV;\n else this.t = 0;\n }\n\n // return bigint initialized to value\n function nbv(i) { var r = nbi(); r.fromInt(i); return r; }\n\n // (protected) set from string and radix\n function bnpFromString(s,b) {\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 256) k = 8; // byte array\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else { this.fromRadix(s,b); return; }\n this.t = 0;\n this.s = 0;\n var i = s.length, mi = false, sh = 0;\n while(--i >= 0) {\n var x = (k==8)?s[i]&0xff:intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\") mi = true;\n continue;\n }\n mi = false;\n if(sh == 0)\n this[this.t++] = x;\n else if(sh+k > this.DB) {\n this[this.t-1] |= (x&((1<<(this.DB-sh))-1))<>(this.DB-sh));\n }\n else\n this[this.t-1] |= x<= this.DB) sh -= this.DB;\n }\n if(k == 8 && (s[0]&0x80) != 0) {\n this.s = -1;\n if(sh > 0) this[this.t-1] |= ((1<<(this.DB-sh))-1)< 0 && this[this.t-1] == c) --this.t;\n }\n\n // (public) return string representation in given radix\n function bnToString(b) {\n if(this.s < 0) return \"-\"+this.negate().toString(b);\n var k;\n if(b == 16) k = 4;\n else if(b == 8) k = 3;\n else if(b == 2) k = 1;\n else if(b == 32) k = 5;\n else if(b == 4) k = 2;\n else return this.toRadix(b);\n var km = (1< 0) {\n if(p < this.DB && (d = this[i]>>p) > 0) { m = true; r = int2char(d); }\n while(i >= 0) {\n if(p < k) {\n d = (this[i]&((1<>(p+=this.DB-k);\n }\n else {\n d = (this[i]>>(p-=k))&km;\n if(p <= 0) { p += this.DB; --i; }\n }\n if(d > 0) m = true;\n if(m) r += int2char(d);\n }\n }\n return m?r:\"0\";\n }\n\n // (public) -this\n function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }\n\n // (public) |this|\n function bnAbs() { return (this.s<0)?this.negate():this; }\n\n // (public) return + if this > a, - if this < a, 0 if equal\n function bnCompareTo(a) {\n var r = this.s-a.s;\n if(r != 0) return r;\n var i = this.t;\n r = i-a.t;\n if(r != 0) return (this.s<0)?-r:r;\n while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;\n return 0;\n }\n\n // returns bit length of the integer x\n function nbits(x) {\n var r = 1, t;\n if((t=x>>>16) != 0) { x = t; r += 16; }\n if((t=x>>8) != 0) { x = t; r += 8; }\n if((t=x>>4) != 0) { x = t; r += 4; }\n if((t=x>>2) != 0) { x = t; r += 2; }\n if((t=x>>1) != 0) { x = t; r += 1; }\n return r;\n }\n\n // (public) return the number of bits in \"this\"\n function bnBitLength() {\n if(this.t <= 0) return 0;\n return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));\n }\n\n // (protected) r = this << n*DB\n function bnpDLShiftTo(n,r) {\n var i;\n for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];\n for(i = n-1; i >= 0; --i) r[i] = 0;\n r.t = this.t+n;\n r.s = this.s;\n }\n\n // (protected) r = this >> n*DB\n function bnpDRShiftTo(n,r) {\n for(var i = n; i < this.t; ++i) r[i-n] = this[i];\n r.t = Math.max(this.t-n,0);\n r.s = this.s;\n }\n\n // (protected) r = this << n\n function bnpLShiftTo(n,r) {\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<= 0; --i) {\n r[i+ds+1] = (this[i]>>cbs)|c;\n c = (this[i]&bm)<= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t+ds+1;\n r.s = this.s;\n r.clamp();\n }\n\n // (protected) r = this >> n\n function bnpRShiftTo(n,r) {\n r.s = this.s;\n var ds = Math.floor(n/this.DB);\n if(ds >= this.t) { r.t = 0; return; }\n var bs = n%this.DB;\n var cbs = this.DB-bs;\n var bm = (1<>bs;\n for(var i = ds+1; i < this.t; ++i) {\n r[i-ds-1] |= (this[i]&bm)<>bs;\n }\n if(bs > 0) r[this.t-ds-1] |= (this.s&bm)<>= this.DB;\n }\n if(a.t < this.t) {\n c -= a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c -= a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = (c<0)?-1:0;\n if(c < -1) r[i++] = this.DV+c;\n else if(c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n }\n\n // (protected) r = this * a, r != this,a (HAC 14.12)\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyTo(a,r) {\n var x = this.abs(), y = a.abs();\n var i = x.t;\n r.t = i+y.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);\n r.s = 0;\n r.clamp();\n if(this.s != a.s) BigInteger.ZERO.subTo(r,r);\n }\n\n // (protected) r = this^2, r != this (HAC 14.16)\n function bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2*x.t;\n while(--i >= 0) r[i] = 0;\n for(i = 0; i < x.t-1; ++i) {\n var c = x.am(i,x[i],r,2*i,0,1);\n if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {\n r[i+x.t] -= x.DV;\n r[i+x.t+1] = 1;\n }\n }\n if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);\n r.s = 0;\n r.clamp();\n }\n\n // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n // r != q, this != m. q or r may be null.\n function bnpDivRemTo(m,q,r) {\n var pm = m.abs();\n if(pm.t <= 0) return;\n var pt = this.abs();\n if(pt.t < pm.t) {\n if(q != null) q.fromInt(0);\n if(r != null) this.copyTo(r);\n return;\n }\n if(r == null) r = nbi();\n var y = nbi(), ts = this.s, ms = m.s;\n var nsh = this.DB-nbits(pm[pm.t-1]); // normalize modulus\n if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }\n else { pm.copyTo(y); pt.copyTo(r); }\n var ys = y.t;\n var y0 = y[ys-1];\n if(y0 == 0) return;\n var yt = y0*(1<1)?y[ys-2]>>this.F2:0);\n var d1 = this.FV/yt, d2 = (1<= 0) {\n r[r.t++] = 1;\n r.subTo(t,r);\n }\n BigInteger.ONE.dlShiftTo(ys,t);\n t.subTo(y,y); // \"negative\" y so we can replace sub with am later\n while(y.t < ys) y[y.t++] = 0;\n while(--j >= 0) {\n // Estimate quotient digit\n var qd = (r[--i]==y0)?this.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);\n if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out\n y.dlShiftTo(j,t);\n r.subTo(t,r);\n while(r[i] < --qd) r.subTo(t,r);\n }\n }\n if(q != null) {\n r.drShiftTo(ys,q);\n if(ts != ms) BigInteger.ZERO.subTo(q,q);\n }\n r.t = ys;\n r.clamp();\n if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder\n if(ts < 0) BigInteger.ZERO.subTo(r,r);\n }\n\n // (public) this mod a\n function bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a,null,r);\n if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);\n return r;\n }\n\n // Modular reduction using \"classic\" algorithm\n function Classic(m) { this.m = m; }\n function cConvert(x) {\n if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);\n else return x;\n }\n function cRevert(x) { return x; }\n function cReduce(x) { x.divRemTo(this.m,null,x); }\n function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n Classic.prototype.convert = cConvert;\n Classic.prototype.revert = cRevert;\n Classic.prototype.reduce = cReduce;\n Classic.prototype.mulTo = cMulTo;\n Classic.prototype.sqrTo = cSqrTo;\n\n // (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n // justification:\n // xy == 1 (mod m)\n // xy = 1+km\n // xy(2-xy) = (1+km)(1-km)\n // x[y(2-xy)] = 1-k^2m^2\n // x[y(2-xy)] == 1 (mod m^2)\n // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n // JS multiply \"overflows\" differently from C/C++, so care is needed here.\n function bnpInvDigit() {\n if(this.t < 1) return 0;\n var x = this[0];\n if((x&1) == 0) return 0;\n var y = x&3; // y == 1/x mod 2^2\n y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4\n y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8\n y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return (y>0)?this.DV-y:-y;\n }\n\n // Montgomery reduction\n function Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp&0x7fff;\n this.mph = this.mp>>15;\n this.um = (1<<(m.DB-15))-1;\n this.mt2 = 2*m.t;\n }\n\n // xR mod m\n function montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t,r);\n r.divRemTo(this.m,null,r);\n if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);\n return r;\n }\n\n // x/R mod m\n function montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n }\n\n // x = x/R mod m (HAC 14.32)\n function montReduce(x) {\n while(x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for(var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i]&0x7fff;\n var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i+this.m.t;\n x[j] += this.m.am(0,u0,x,i,0,this.m.t);\n // propagate carry\n while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t,x);\n if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = \"x^2/R mod m\"; x != r\n function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = \"xy/R mod m\"; x,y != r\n function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Montgomery.prototype.convert = montConvert;\n Montgomery.prototype.revert = montRevert;\n Montgomery.prototype.reduce = montReduce;\n Montgomery.prototype.mulTo = montMulTo;\n Montgomery.prototype.sqrTo = montSqrTo;\n\n // (protected) true iff this is even\n function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }\n\n // (protected) this^e, e < 2^32, doing sqr and mul with \"r\" (HAC 14.79)\n function bnpExp(e,z) {\n if(e > 0xffffffff || e < 1) return BigInteger.ONE;\n var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;\n g.copyTo(r);\n while(--i >= 0) {\n z.sqrTo(r,r2);\n if((e&(1< 0) z.mulTo(r2,g,r);\n else { var t = r; r = r2; r2 = t; }\n }\n return z.revert(r);\n }\n\n // (public) this^e % m, 0 <= e < 2^32\n function bnModPowInt(e,m) {\n var z;\n if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);\n return this.exp(e,z);\n }\n\n // protected\n BigInteger.prototype.copyTo = bnpCopyTo;\n BigInteger.prototype.fromInt = bnpFromInt;\n BigInteger.prototype.fromString = bnpFromString;\n BigInteger.prototype.clamp = bnpClamp;\n BigInteger.prototype.dlShiftTo = bnpDLShiftTo;\n BigInteger.prototype.drShiftTo = bnpDRShiftTo;\n BigInteger.prototype.lShiftTo = bnpLShiftTo;\n BigInteger.prototype.rShiftTo = bnpRShiftTo;\n BigInteger.prototype.subTo = bnpSubTo;\n BigInteger.prototype.multiplyTo = bnpMultiplyTo;\n BigInteger.prototype.squareTo = bnpSquareTo;\n BigInteger.prototype.divRemTo = bnpDivRemTo;\n BigInteger.prototype.invDigit = bnpInvDigit;\n BigInteger.prototype.isEven = bnpIsEven;\n BigInteger.prototype.exp = bnpExp;\n\n // public\n BigInteger.prototype.toString = bnToString;\n BigInteger.prototype.negate = bnNegate;\n BigInteger.prototype.abs = bnAbs;\n BigInteger.prototype.compareTo = bnCompareTo;\n BigInteger.prototype.bitLength = bnBitLength;\n BigInteger.prototype.mod = bnMod;\n BigInteger.prototype.modPowInt = bnModPowInt;\n\n // \"constants\"\n BigInteger.ZERO = nbv(0);\n BigInteger.ONE = nbv(1);\n\n // Copyright (c) 2005-2009 Tom Wu\n // All Rights Reserved.\n // See \"LICENSE\" for details.\n\n // Extended JavaScript BN functions, required for RSA private ops.\n\n // Version 1.1: new BigInteger(\"0\", 10) returns \"proper\" zero\n // Version 1.2: square() API, isProbablePrime fix\n\n // (public)\n function bnClone() { var r = nbi(); this.copyTo(r); return r; }\n\n // (public) return value as integer\n function bnIntValue() {\n if(this.s < 0) {\n if(this.t == 1) return this[0]-this.DV;\n else if(this.t == 0) return -1;\n }\n else if(this.t == 1) return this[0];\n else if(this.t == 0) return 0;\n // assumes 16 < DB < 32\n return ((this[1]&((1<<(32-this.DB))-1))<>24; }\n\n // (public) return value as short (assumes DB>=16)\n function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }\n\n // (protected) return x s.t. r^x < DV\n function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }\n\n // (public) 0 if this == 0, 1 if this > 0\n function bnSigNum() {\n if(this.s < 0) return -1;\n else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n else return 1;\n }\n\n // (protected) convert to radix string\n function bnpToRadix(b) {\n if(b == null) b = 10;\n if(this.signum() == 0 || b < 2 || b > 36) return \"0\";\n var cs = this.chunkSize(b);\n var a = Math.pow(b,cs);\n var d = nbv(a), y = nbi(), z = nbi(), r = \"\";\n this.divRemTo(d,y,z);\n while(y.signum() > 0) {\n r = (a+z.intValue()).toString(b).substr(1) + r;\n y.divRemTo(d,y,z);\n }\n return z.intValue().toString(b) + r;\n }\n\n // (protected) convert from radix string\n function bnpFromRadix(s,b) {\n this.fromInt(0);\n if(b == null) b = 10;\n var cs = this.chunkSize(b);\n var d = Math.pow(b,cs), mi = false, j = 0, w = 0;\n for(var i = 0; i < s.length; ++i) {\n var x = intAt(s,i);\n if(x < 0) {\n if(s.charAt(i) == \"-\" && this.signum() == 0) mi = true;\n continue;\n }\n w = b*w+x;\n if(++j >= cs) {\n this.dMultiply(d);\n this.dAddOffset(w,0);\n j = 0;\n w = 0;\n }\n }\n if(j > 0) {\n this.dMultiply(Math.pow(b,j));\n this.dAddOffset(w,0);\n }\n if(mi) BigInteger.ZERO.subTo(this,this);\n }\n\n // (protected) alternate constructor\n function bnpFromNumber(a,b,c) {\n if(\"number\" == typeof b) {\n // new BigInteger(int,int,RNG)\n if(a < 2) this.fromInt(1);\n else {\n this.fromNumber(a,c);\n if(!this.testBit(a-1)) // force MSB set\n this.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,this);\n if(this.isEven()) this.dAddOffset(1,0); // force odd\n while(!this.isProbablePrime(b)) {\n this.dAddOffset(2,0);\n if(this.bitLength() > a) this.subTo(BigInteger.ONE.shiftLeft(a-1),this);\n }\n }\n }\n else {\n // new BigInteger(int,RNG)\n var x = new Array(), t = a&7;\n x.length = (a>>3)+1;\n b.nextBytes(x);\n if(t > 0) x[0] &= ((1< 0) {\n if(p < this.DB && (d = this[i]>>p) != (this.s&this.DM)>>p)\n r[k++] = d|(this.s<<(this.DB-p));\n while(i >= 0) {\n if(p < 8) {\n d = (this[i]&((1<>(p+=this.DB-8);\n }\n else {\n d = (this[i]>>(p-=8))&0xff;\n if(p <= 0) { p += this.DB; --i; }\n }\n if((d&0x80) != 0) d |= -256;\n if(k == 0 && (this.s&0x80) != (d&0x80)) ++k;\n if(k > 0 || d != this.s) r[k++] = d;\n }\n }\n return r;\n }\n\n function bnEquals(a) { return(this.compareTo(a)==0); }\n function bnMin(a) { return(this.compareTo(a)<0)?this:a; }\n function bnMax(a) { return(this.compareTo(a)>0)?this:a; }\n\n // (protected) r = this op a (bitwise)\n function bnpBitwiseTo(a,op,r) {\n var i, f, m = Math.min(a.t,this.t);\n for(i = 0; i < m; ++i) r[i] = op(this[i],a[i]);\n if(a.t < this.t) {\n f = a.s&this.DM;\n for(i = m; i < this.t; ++i) r[i] = op(this[i],f);\n r.t = this.t;\n }\n else {\n f = this.s&this.DM;\n for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);\n r.t = a.t;\n }\n r.s = op(this.s,a.s);\n r.clamp();\n }\n\n // (public) this & a\n function op_and(x,y) { return x&y; }\n function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }\n\n // (public) this | a\n function op_or(x,y) { return x|y; }\n function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }\n\n // (public) this ^ a\n function op_xor(x,y) { return x^y; }\n function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }\n\n // (public) this & ~a\n function op_andnot(x,y) { return x&~y; }\n function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }\n\n // (public) ~this\n function bnNot() {\n var r = nbi();\n for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];\n r.t = this.t;\n r.s = ~this.s;\n return r;\n }\n\n // (public) this << n\n function bnShiftLeft(n) {\n var r = nbi();\n if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);\n return r;\n }\n\n // (public) this >> n\n function bnShiftRight(n) {\n var r = nbi();\n if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);\n return r;\n }\n\n // return index of lowest 1-bit in x, x < 2^31\n function lbit(x) {\n if(x == 0) return -1;\n var r = 0;\n if((x&0xffff) == 0) { x >>= 16; r += 16; }\n if((x&0xff) == 0) { x >>= 8; r += 8; }\n if((x&0xf) == 0) { x >>= 4; r += 4; }\n if((x&3) == 0) { x >>= 2; r += 2; }\n if((x&1) == 0) ++r;\n return r;\n }\n\n // (public) returns index of lowest 1-bit (or -1 if none)\n function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }\n\n // return number of 1 bits in x\n function cbit(x) {\n var r = 0;\n while(x != 0) { x &= x-1; ++r; }\n return r;\n }\n\n // (public) return number of set bits\n function bnBitCount() {\n var r = 0, x = this.s&this.DM;\n for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);\n return r;\n }\n\n // (public) true iff nth bit is set\n function bnTestBit(n) {\n var j = Math.floor(n/this.DB);\n if(j >= this.t) return(this.s!=0);\n return((this[j]&(1<<(n%this.DB)))!=0);\n }\n\n // (protected) this op (1<>= this.DB;\n }\n if(a.t < this.t) {\n c += a.s;\n while(i < this.t) {\n c += this[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += this.s;\n }\n else {\n c += this.s;\n while(i < a.t) {\n c += a[i];\n r[i++] = c&this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = (c<0)?-1:0;\n if(c > 0) r[i++] = c;\n else if(c < -1) r[i++] = this.DV+c;\n r.t = i;\n r.clamp();\n }\n\n // (public) this + a\n function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }\n\n // (public) this - a\n function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }\n\n // (public) this * a\n function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }\n\n // (public) this^2\n function bnSquare() { var r = nbi(); this.squareTo(r); return r; }\n\n // (public) this / a\n function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }\n\n // (public) this % a\n function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }\n\n // (public) [this/a,this%a]\n function bnDivideAndRemainder(a) {\n var q = nbi(), r = nbi();\n this.divRemTo(a,q,r);\n return new Array(q,r);\n }\n\n // (protected) this *= n, this >= 0, 1 < n < DV\n function bnpDMultiply(n) {\n this[this.t] = this.am(0,n-1,this,0,0,this.t);\n ++this.t;\n this.clamp();\n }\n\n // (protected) this += n << w words, this >= 0\n function bnpDAddOffset(n,w) {\n if(n == 0) return;\n while(this.t <= w) this[this.t++] = 0;\n this[w] += n;\n while(this[w] >= this.DV) {\n this[w] -= this.DV;\n if(++w >= this.t) this[this.t++] = 0;\n ++this[w];\n }\n }\n\n // A \"null\" reducer\n function NullExp() {}\n function nNop(x) { return x; }\n function nMulTo(x,y,r) { x.multiplyTo(y,r); }\n function nSqrTo(x,r) { x.squareTo(r); }\n\n NullExp.prototype.convert = nNop;\n NullExp.prototype.revert = nNop;\n NullExp.prototype.mulTo = nMulTo;\n NullExp.prototype.sqrTo = nSqrTo;\n\n // (public) this^e\n function bnPow(e) { return this.exp(e,new NullExp()); }\n\n // (protected) r = lower n words of \"this * a\", a.t <= n\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyLowerTo(a,n,r) {\n var i = Math.min(this.t+a.t,n);\n r.s = 0; // assumes a,this >= 0\n r.t = i;\n while(i > 0) r[--i] = 0;\n var j;\n for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);\n for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);\n r.clamp();\n }\n\n // (protected) r = \"this * a\" without lower n words, n > 0\n // \"this\" should be the larger one if appropriate.\n function bnpMultiplyUpperTo(a,n,r) {\n --n;\n var i = r.t = this.t+a.t-n;\n r.s = 0; // assumes a,this >= 0\n while(--i >= 0) r[i] = 0;\n for(i = Math.max(n-this.t,0); i < a.t; ++i)\n r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);\n r.clamp();\n r.drShiftTo(1,r);\n }\n\n // Barrett modular reduction\n function Barrett(m) {\n // setup Barrett\n this.r2 = nbi();\n this.q3 = nbi();\n BigInteger.ONE.dlShiftTo(2*m.t,this.r2);\n this.mu = this.r2.divide(m);\n this.m = m;\n }\n\n function barrettConvert(x) {\n if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);\n else if(x.compareTo(this.m) < 0) return x;\n else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }\n }\n\n function barrettRevert(x) { return x; }\n\n // x = x mod m (HAC 14.42)\n function barrettReduce(x) {\n x.drShiftTo(this.m.t-1,this.r2);\n if(x.t > this.m.t+1) { x.t = this.m.t+1; x.clamp(); }\n this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3);\n this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);\n while(x.compareTo(this.r2) < 0) x.dAddOffset(1,this.m.t+1);\n x.subTo(this.r2,x);\n while(x.compareTo(this.m) >= 0) x.subTo(this.m,x);\n }\n\n // r = x^2 mod m; x != r\n function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }\n\n // r = x*y mod m; x,y != r\n function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }\n\n Barrett.prototype.convert = barrettConvert;\n Barrett.prototype.revert = barrettRevert;\n Barrett.prototype.reduce = barrettReduce;\n Barrett.prototype.mulTo = barrettMulTo;\n Barrett.prototype.sqrTo = barrettSqrTo;\n\n // (public) this^e % m (HAC 14.85)\n function bnModPow(e,m) {\n var i = e.bitLength(), k, r = nbv(1), z;\n if(i <= 0) return r;\n else if(i < 18) k = 1;\n else if(i < 48) k = 3;\n else if(i < 144) k = 4;\n else if(i < 768) k = 5;\n else k = 6;\n if(i < 8)\n z = new Classic(m);\n else if(m.isEven())\n z = new Barrett(m);\n else\n z = new Montgomery(m);\n\n // precomputation\n var g = new Array(), n = 3, k1 = k-1, km = (1< 1) {\n var g2 = nbi();\n z.sqrTo(g[1],g2);\n while(n <= km) {\n g[n] = nbi();\n z.mulTo(g2,g[n-2],g[n]);\n n += 2;\n }\n }\n\n var j = e.t-1, w, is1 = true, r2 = nbi(), t;\n i = nbits(e[j])-1;\n while(j >= 0) {\n if(i >= k1) w = (e[j]>>(i-k1))&km;\n else {\n w = (e[j]&((1<<(i+1))-1))<<(k1-i);\n if(j > 0) w |= e[j-1]>>(this.DB+i-k1);\n }\n\n n = k;\n while((w&1) == 0) { w >>= 1; --n; }\n if((i -= n) < 0) { i += this.DB; --j; }\n if(is1) { // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n }\n else {\n while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }\n if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }\n z.mulTo(r2,g[w],r);\n }\n\n while(j >= 0 && (e[j]&(1< 0) {\n x.rShiftTo(g,x);\n y.rShiftTo(g,y);\n }\n while(x.signum() > 0) {\n if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);\n if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);\n if(x.compareTo(y) >= 0) {\n x.subTo(y,x);\n x.rShiftTo(1,x);\n }\n else {\n y.subTo(x,y);\n y.rShiftTo(1,y);\n }\n }\n if(g > 0) y.lShiftTo(g,y);\n return y;\n }\n\n // (protected) this % n, n < 2^26\n function bnpModInt(n) {\n if(n <= 0) return 0;\n var d = this.DV%n, r = (this.s<0)?n-1:0;\n if(this.t > 0)\n if(d == 0) r = this[0]%n;\n else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;\n return r;\n }\n\n // (public) 1/this % m (HAC 14.61)\n function bnModInverse(m) {\n var ac = m.isEven();\n if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;\n var u = m.clone(), v = this.clone();\n var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);\n while(u.signum() != 0) {\n while(u.isEven()) {\n u.rShiftTo(1,u);\n if(ac) {\n if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }\n a.rShiftTo(1,a);\n }\n else if(!b.isEven()) b.subTo(m,b);\n b.rShiftTo(1,b);\n }\n while(v.isEven()) {\n v.rShiftTo(1,v);\n if(ac) {\n if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }\n c.rShiftTo(1,c);\n }\n else if(!d.isEven()) d.subTo(m,d);\n d.rShiftTo(1,d);\n }\n if(u.compareTo(v) >= 0) {\n u.subTo(v,u);\n if(ac) a.subTo(c,a);\n b.subTo(d,b);\n }\n else {\n v.subTo(u,v);\n if(ac) c.subTo(a,c);\n d.subTo(b,d);\n }\n }\n if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;\n if(d.compareTo(m) >= 0) return d.subtract(m);\n if(d.signum() < 0) d.addTo(m,d); else return d;\n if(d.signum() < 0) return d.add(m); else return d;\n }\n\n var lowprimes = [2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997];\n var lplim = (1<<26)/lowprimes[lowprimes.length-1];\n\n // (public) test primality with certainty >= 1-.5^t\n function bnIsProbablePrime(t) {\n var i, x = this.abs();\n if(x.t == 1 && x[0] <= lowprimes[lowprimes.length-1]) {\n for(i = 0; i < lowprimes.length; ++i)\n if(x[0] == lowprimes[i]) return true;\n return false;\n }\n if(x.isEven()) return false;\n i = 1;\n while(i < lowprimes.length) {\n var m = lowprimes[i], j = i+1;\n while(j < lowprimes.length && m < lplim) m *= lowprimes[j++];\n m = x.modInt(m);\n while(i < j) if(m%lowprimes[i++] == 0) return false;\n }\n return x.millerRabin(t);\n }\n\n // (protected) true if probably prime (HAC 4.24, Miller-Rabin)\n function bnpMillerRabin(t) {\n var n1 = this.subtract(BigInteger.ONE);\n var k = n1.getLowestSetBit();\n if(k <= 0) return false;\n var r = n1.shiftRight(k);\n t = (t+1)>>1;\n if(t > lowprimes.length) t = lowprimes.length;\n var a = nbi();\n for(var i = 0; i < t; ++i) {\n //Pick bases at random, instead of starting at 2\n a.fromInt(lowprimes[Math.floor(Math.random()*lowprimes.length)]);\n var y = a.modPow(r,this);\n if(y.compareTo(BigInteger.ONE) != 0 && y.compareTo(n1) != 0) {\n var j = 1;\n while(j++ < k && y.compareTo(n1) != 0) {\n y = y.modPowInt(2,this);\n if(y.compareTo(BigInteger.ONE) == 0) return false;\n }\n if(y.compareTo(n1) != 0) return false;\n }\n }\n return true;\n }\n\n // protected\n BigInteger.prototype.chunkSize = bnpChunkSize;\n BigInteger.prototype.toRadix = bnpToRadix;\n BigInteger.prototype.fromRadix = bnpFromRadix;\n BigInteger.prototype.fromNumber = bnpFromNumber;\n BigInteger.prototype.bitwiseTo = bnpBitwiseTo;\n BigInteger.prototype.changeBit = bnpChangeBit;\n BigInteger.prototype.addTo = bnpAddTo;\n BigInteger.prototype.dMultiply = bnpDMultiply;\n BigInteger.prototype.dAddOffset = bnpDAddOffset;\n BigInteger.prototype.multiplyLowerTo = bnpMultiplyLowerTo;\n BigInteger.prototype.multiplyUpperTo = bnpMultiplyUpperTo;\n BigInteger.prototype.modInt = bnpModInt;\n BigInteger.prototype.millerRabin = bnpMillerRabin;\n\n // public\n BigInteger.prototype.clone = bnClone;\n BigInteger.prototype.intValue = bnIntValue;\n BigInteger.prototype.byteValue = bnByteValue;\n BigInteger.prototype.shortValue = bnShortValue;\n BigInteger.prototype.signum = bnSigNum;\n BigInteger.prototype.toByteArray = bnToByteArray;\n BigInteger.prototype.equals = bnEquals;\n BigInteger.prototype.min = bnMin;\n BigInteger.prototype.max = bnMax;\n BigInteger.prototype.and = bnAnd;\n BigInteger.prototype.or = bnOr;\n BigInteger.prototype.xor = bnXor;\n BigInteger.prototype.andNot = bnAndNot;\n BigInteger.prototype.not = bnNot;\n BigInteger.prototype.shiftLeft = bnShiftLeft;\n BigInteger.prototype.shiftRight = bnShiftRight;\n BigInteger.prototype.getLowestSetBit = bnGetLowestSetBit;\n BigInteger.prototype.bitCount = bnBitCount;\n BigInteger.prototype.testBit = bnTestBit;\n BigInteger.prototype.setBit = bnSetBit;\n BigInteger.prototype.clearBit = bnClearBit;\n BigInteger.prototype.flipBit = bnFlipBit;\n BigInteger.prototype.add = bnAdd;\n BigInteger.prototype.subtract = bnSubtract;\n BigInteger.prototype.multiply = bnMultiply;\n BigInteger.prototype.divide = bnDivide;\n BigInteger.prototype.remainder = bnRemainder;\n BigInteger.prototype.divideAndRemainder = bnDivideAndRemainder;\n BigInteger.prototype.modPow = bnModPow;\n BigInteger.prototype.modInverse = bnModInverse;\n BigInteger.prototype.pow = bnPow;\n BigInteger.prototype.gcd = bnGCD;\n BigInteger.prototype.isProbablePrime = bnIsProbablePrime;\n\n // JSBN-specific extension\n BigInteger.prototype.square = bnSquare;\n\n // Expose the Barrett function\n BigInteger.prototype.Barrett = Barrett\n\n // BigInteger interfaces not implemented in jsbn:\n\n // BigInteger(int signum, byte[] magnitude)\n // double doubleValue()\n // float floatValue()\n // int hashCode()\n // long longValue()\n // static BigInteger valueOf(long val)\n\n // Random number generator - requires a PRNG backend, e.g. prng4.js\n\n // For best results, put code like\n // \n // in your main HTML document.\n\n var rng_state;\n var rng_pool;\n var rng_pptr;\n\n // Mix in a 32-bit integer into the pool\n function rng_seed_int(x) {\n rng_pool[rng_pptr++] ^= x & 255;\n rng_pool[rng_pptr++] ^= (x >> 8) & 255;\n rng_pool[rng_pptr++] ^= (x >> 16) & 255;\n rng_pool[rng_pptr++] ^= (x >> 24) & 255;\n if(rng_pptr >= rng_psize) rng_pptr -= rng_psize;\n }\n\n // Mix in the current time (w/milliseconds) into the pool\n function rng_seed_time() {\n rng_seed_int(new Date().getTime());\n }\n\n // Initialize the pool with junk if needed.\n if(rng_pool == null) {\n rng_pool = new Array();\n rng_pptr = 0;\n var t;\n if(typeof window !== \"undefined\" && window.crypto) {\n if (window.crypto.getRandomValues) {\n // Use webcrypto if available\n var ua = new Uint8Array(32);\n window.crypto.getRandomValues(ua);\n for(t = 0; t < 32; ++t)\n rng_pool[rng_pptr++] = ua[t];\n }\n else if(navigator.appName == \"Netscape\" && navigator.appVersion < \"5\") {\n // Extract entropy (256 bits) from NS4 RNG if available\n var z = window.crypto.random(32);\n for(t = 0; t < z.length; ++t)\n rng_pool[rng_pptr++] = z.charCodeAt(t) & 255;\n }\n }\n while(rng_pptr < rng_psize) { // extract some randomness from Math.random()\n t = Math.floor(65536 * Math.random());\n rng_pool[rng_pptr++] = t >>> 8;\n rng_pool[rng_pptr++] = t & 255;\n }\n rng_pptr = 0;\n rng_seed_time();\n //rng_seed_int(window.screenX);\n //rng_seed_int(window.screenY);\n }\n\n function rng_get_byte() {\n if(rng_state == null) {\n rng_seed_time();\n rng_state = prng_newstate();\n rng_state.init(rng_pool);\n for(rng_pptr = 0; rng_pptr < rng_pool.length; ++rng_pptr)\n rng_pool[rng_pptr] = 0;\n rng_pptr = 0;\n //rng_pool = null;\n }\n // TODO: allow reseeding after first request\n return rng_state.next();\n }\n\n function rng_get_bytes(ba) {\n var i;\n for(i = 0; i < ba.length; ++i) ba[i] = rng_get_byte();\n }\n\n function SecureRandom() {}\n\n SecureRandom.prototype.nextBytes = rng_get_bytes;\n\n // prng4.js - uses Arcfour as a PRNG\n\n function Arcfour() {\n this.i = 0;\n this.j = 0;\n this.S = new Array();\n }\n\n // Initialize arcfour context from key, an array of ints, each from [0..255]\n function ARC4init(key) {\n var i, j, t;\n for(i = 0; i < 256; ++i)\n this.S[i] = i;\n j = 0;\n for(i = 0; i < 256; ++i) {\n j = (j + this.S[i] + key[i % key.length]) & 255;\n t = this.S[i];\n this.S[i] = this.S[j];\n this.S[j] = t;\n }\n this.i = 0;\n this.j = 0;\n }\n\n function ARC4next() {\n var t;\n this.i = (this.i + 1) & 255;\n this.j = (this.j + this.S[this.i]) & 255;\n t = this.S[this.i];\n this.S[this.i] = this.S[this.j];\n this.S[this.j] = t;\n return this.S[(t + this.S[this.i]) & 255];\n }\n\n Arcfour.prototype.init = ARC4init;\n Arcfour.prototype.next = ARC4next;\n\n // Plug in your RNG constructor here\n function prng_newstate() {\n return new Arcfour();\n }\n\n // Pool size must be a multiple of 4 and greater than 32.\n // An array of bytes the size of the pool will be passed to init()\n var rng_psize = 256;\n\n if (typeof exports !== 'undefined') {\n exports = module.exports = {\n default: BigInteger,\n BigInteger: BigInteger,\n SecureRandom: SecureRandom,\n };\n } else {\n this.jsbn = {\n BigInteger: BigInteger,\n SecureRandom: SecureRandom\n };\n }\n\n}).call(this);\n" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "index", "request": "./src/index.ts", "reasons": [] } ] }, { "id": 3, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendor) (name: npm.leemon)", "size": 57067, "names": [ "npm.leemon" ], "files": [ "npm.leemon.chunk.js" ], "hash": "8d2500ac81fdadd45d3d", "siblings": [ 0, 1, 2, 4, 5, 7 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 70, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/leemon/es/index.js", "name": "./node_modules/leemon/es/index.js", "index": 33, "index2": 25, "size": 57067, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 3 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "issuerId": 41, "issuerName": "./src/lib/mtproto/passwordManager.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 84, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pagePassword.ts", "name": "./src/components/pagePassword.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } }, { "id": 41, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "name": "./src/lib/mtproto/passwordManager.ts", "profile": { "factory": 1063, "building": 53, "dependencies": 1 } } ], "profile": { "factory": 1413, "building": 29 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 41, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/mtproto/passwordManager.ts", "module": "./src/lib/mtproto/passwordManager.ts", "moduleName": "./src/lib/mtproto/passwordManager.ts", "type": "cjs require", "userRequest": "leemon", "loc": "18:17-34" } ], "usedExports": true, "providedExports": [ "bpe", "one", "zero", "findPrimes", "millerRabinInt", "millerRabin", "bitSize", "expand", "randTruePrime", "randProbPrime", "randProbPrimeRounds", "mod", "addInt", "mult", "powMod", "sub", "add", "inverseMod", "multMod", "randTruePrime_", "randBigInt", "randBigInt_", "GCD", "GCD_", "inverseMod_", "inverseModInt", "eGCD_", "negative", "greaterShift", "greater", "divide_", "carry_", "modInt", "int2bigInt", "str2bigInt", "equalsInt", "equals", "isZero", "bigInt2str", "dup", "copy_", "copyInt_", "addInt_", "rightShift_", "halve_", "leftShift_", "multInt_", "divInt_", "linComb_", "linCombShift_", "addShift_", "subShift_", "sub_", "add_", "mult_", "mod_", "multMod_", "squareMod_", "trim", "powMod_", "mont_" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/lib/mtproto/passwordManager.ts (referenced with cjs require)" ], "depth": 5, "source": "'use strict';\n/** * * * * * * * * * *\n * Big Integer Library *\n * Created 2000 *\n * Leemon Baird *\n * www.leemon.com *\n * * * * * * * * * * * */\n////////////////////////////////////////////////////////////////////////////////////////\n// These functions are designed to avoid frequent dynamic memory allocation in the inner loop.\n// For most functions, if it needs a BigInt as a local variable it will actually use\n// a global, and will only allocate to it only when it's not the right size. This ensures\n// that when a function is called repeatedly with same-sized parameters, it only allocates\n// memory on the first call.\n//\n// Note that for cryptographic purposes, the calls to Math.random() must\n// be replaced with calls to a better pseudorandom number generator.\n//\n// In the following, \"bigInt\" means a bigInt with at least one leading zero element,\n// and \"integer\" means a nonnegative integer less than radix. In some cases, integer\n// can be negative. Negative bigInts are 2s complement.\n//\n// The following functions do not modify their inputs.\n// Those returning a bigInt, string, or Array will dynamically allocate memory for that value.\n// Those returning a boolean will return the integer 0 (false) or 1 (true).\n// Those returning boolean or int will not allocate memory except possibly on the first\n// time they're called with a given parameter size.\n//\n// bigInt add(x,y) //return (x+y) for bigInts x and y.\n// bigInt addInt(x,n) //return (x+n) where x is a bigInt and n is an integer.\n// string bigInt2str(x,base) //return a string form of bigInt x in a given base, with 2 <= base <= 95\n// int bitSize(x) //return how many bits long the bigInt x is, not counting leading zeros\n// bigInt dup(x) //return a copy of bigInt x\n// boolean equals(x,y) //is the bigInt x equal to the bigint y?\n// boolean equalsInt(x,y) //is bigint x equal to integer y?\n// bigInt expand(x,n) //return a copy of x with at least n elements, adding leading zeros if needed\n// Array findPrimes(n) //return array of all primes less than integer n\n// bigInt GCD(x,y) //return greatest common divisor of bigInts x and y (each with same number of elements).\n// boolean greater(x,y) //is x>y? (x and y are nonnegative bigInts)\n// boolean greaterShift(x,y,shift)//is (x <<(shift*bpe)) > y?\n// bigInt int2bigInt(t,n,m) //return a bigInt equal to integer t, with at least n bits and m array elements\n// bigInt inverseMod(x,n) //return (x**(-1) mod n) for bigInts x and n. If no inverse exists, it returns null\n// int inverseModInt(x,n) //return x**(-1) mod n, for integers x and n. Return 0 if there is no inverse\n// boolean isZero(x) //is the bigInt x equal to zero?\n// boolean millerRabin(x,b) //does one round of Miller-Rabin base integer b say that bigInt x is possibly prime? (b is bigInt, 1=1). If s=1, then the most significant of those n bits is set to 1.\n// bigInt randTruePrime(k) //return a new, random, k-bit, true prime bigInt using Maurer's algorithm.\n// bigInt randProbPrime(k) //return a new, random, k-bit, probable prime bigInt (probability it's composite less than 2^-80).\n// bigInt str2bigInt(s,b,n,m) //return a bigInt for number represented in string s in base b with at least n bits and m array elements\n// bigInt sub(x,y) //return (x-y) for bigInts x and y. Negative answers will be 2s complement\n// bigInt trim(x,k) //return a copy of x with exactly k leading zero elements\n//\n//\n// The following functions each have a non-underscored version, which most users should call instead.\n// These functions each write to a single parameter, and the caller is responsible for ensuring the array\n// passed in is large enough to hold the result.\n//\n// void addInt_(x,n) //do x=x+n where x is a bigInt and n is an integer\n// void add_(x,y) //do x=x+y for bigInts x and y\n// void copy_(x,y) //do x=y on bigInts x and y\n// void copyInt_(x,n) //do x=n on bigInt x and integer n\n// void GCD_(x,y) //set x to the greatest common divisor of bigInts x and y, (y is destroyed). (This never overflows its array).\n// boolean inverseMod_(x,n) //do x=x**(-1) mod n, for bigInts x and n. Returns 1 (0) if inverse does (doesn't) exist\n// void mod_(x,n) //do x=x mod n for bigInts x and n. (This never overflows its array).\n// void mult_(x,y) //do x=x*y for bigInts x and y.\n// void multMod_(x,y,n) //do x=x*y mod n for bigInts x,y,n.\n// void powMod_(x,y,n) //do x=x**y mod n, where x,y,n are bigInts (n is odd) and ** is exponentiation. 0**0=1.\n// void randBigInt_(b,n,s) //do b = an n-bit random BigInt. if s=1, then nth bit (most significant bit) is set to 1. n>=1.\n// void randTruePrime_(ans,k) //do ans = a random k-bit true random prime (not just probable prime) with 1 in the msb.\n// void sub_(x,y) //do x=x-y for bigInts x and y. Negative answers will be 2s complement.\n//\n// The following functions do NOT have a non-underscored version.\n// They each write a bigInt result to one or more parameters. The caller is responsible for\n// ensuring the arrays passed in are large enough to hold the results.\n//\n// void addShift_(x,y,ys) //do x=x+(y<<(ys*bpe))\n// void carry_(x) //do carries and borrows so each element of the bigInt x fits in bpe bits.\n// void divide_(x,y,q,r) //divide x by y giving quotient q and remainder r\n// int divInt_(x,n) //do x=floor(x/n) for bigInt x and integer n, and return the remainder. (This never overflows its array).\n// void eGCD_(x,y,d,a,b) //sets a,b,d to positive bigInts such that d = GCD_(x,y) = a*x-b*y\n// void halve_(x) //do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement. (This never overflows its array).\n// void leftShift_(x,n) //left shift bigInt x by n bits. n64 multiplier, but not with JavaScript's 32*32->32)\n// - speeding up mont_(x,y,n,np) when x==y by doing a non-modular, non-Montgomery square\n// followed by a Montgomery reduction. The intermediate answer will be twice as long as x, so that\n// method would be slower. This is unfortunate because the code currently spends almost all of its time\n// doing mont_(x,x,...), both for randTruePrime_() and powMod_(). A faster method for Montgomery squaring\n// would have a large impact on the speed of randTruePrime_() and powMod_(). HAC has a couple of poorly-worded\n// sentences that seem to imply it's faster to do a non-modular square followed by a single\n// Montgomery reduction, but that's obviously wrong.\n////////////////////////////////////////////////////////////////////////////////////////\n\n//globals\nexport var bpe = 0; //bits stored per array element\n\nvar mask = 0; //AND this with an array element to chop it down to bpe bits\n\nvar radix = mask + 1; //equals 2^bpe. A single 1 bit to the left of the last bit of mask.\n//the digits for converting to different bases\n\nvar digitsStr = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_=!@#$%^&*()[]{}|;:,.<>/?`~ \\\\\\'\"+-'; //initialize the global variables\n//bpe=number of bits in the mantissa on this platform\n\nfor (bpe = 0; 1 << bpe + 1 > 1 << bpe; bpe++) {\n ;\n}\n\nbpe >>= 1; //bpe=number of bits in one element of the array representing the bigInt\n\nmask = (1 << bpe) - 1; //AND the mask with an integer to get its bpe least significant bits\n\nradix = mask + 1; //2^bpe. a single 1 bit to the left of the first bit of mask\n\nexport var one = int2bigInt(1, 1, 1); //constant used in powMod_()\n\nexport var zero = int2bigInt(0, 1, 1); //the following global variables are scratchpad memory to\n//reduce dynamic memory allocation in the inner loop\n\nvar t = new Array(0);\nvar ss = t; //used in mult_()\n\nvar s0 = t; //used in multMod_(), squareMod_()\n// var s1=t; //used in powMod_(), multMod_(), squareMod_()\n// var s2=t; //used in powMod_(), multMod_()\n\nvar s3 = t; //used in powMod_()\n\nvar s4 = t,\n s5 = t; //used in mod_()\n\nvar s6 = t; //used in bigInt2str()\n\nvar s7 = t; //used in powMod_()\n\nvar T = t; //used in GCD_()\n\nvar sa = t; //used in mont_()\n\nvar mr_x1 = t,\n mr_r = t,\n mr_a = t,\n //used in millerRabin()\neg_v = t,\n eg_u = t,\n eg_A = t,\n eg_B = t,\n eg_C = t,\n eg_D = t,\n //used in eGCD_(), inverseMod_()\n//, md_q1=t, md_q2=t, md_q3=t, md_r=t, md_r1=t, md_r2=t, md_tt=t, //used in mod_()\nprimes = t,\n pows = t,\n s_i = t,\n s_i2 = t,\n s_R = t,\n s_rm = t,\n s_q = t,\n s_n1 = t,\n s_a = t,\n s_r2 = t,\n s_n = t,\n s_b = t,\n s_d = t,\n s_x1 = t,\n s_x2 = t,\n s_aa = t,\n //used in randTruePrime_()\nrpprb = t; //used in randProbPrimeRounds() (which also uses \"primes\")\n////////////////////////////////////////////////////////////////////////////////////////\n\nvar k, buff;\n/**\n * return array of all primes less than integer n\n *\n * @param {number} n\n * @returns {number[]}\n */\n\nexport function findPrimes(n) {\n var i, s, p, ans;\n s = new Array(n);\n\n for (i = 0; i < n; i++) {\n s[i] = 0;\n }\n\n s[0] = 2;\n p = 0; //first p elements of s are primes, the rest are a sieve\n\n for (; s[p] < n;) {\n //s[p] is the pth prime\n for (i = s[p] * s[p]; i < n; i += s[p] //mark multiples of s[p]\n ) {\n s[i] = 1;\n }\n\n p++;\n s[p] = s[p - 1] + 1;\n\n for (; s[p] < n && s[s[p]]; s[p]++) {\n ;\n } //find next prime (where s[p]==0)\n\n }\n\n ans = new Array(p);\n\n for (i = 0; i < p; i++) {\n ans[i] = s[i];\n }\n\n return ans;\n}\n/**\n * does a single round of Miller-Rabin base b consider x to be a possible prime?\n *\n * x is a bigInt, and b is an integer, with b 0; j--) {\n ;\n }\n\n for (z = 0, w = x[j]; w; w >>= 1, z++) {\n ;\n }\n\n z += bpe * j;\n return z;\n}\n/**\n * return a copy of x with at least n elements, adding leading zeros if needed\n *\n * @param {number[]} x\n * @param {number} n\n * @returns {number[]}\n */\n\nexport function expand(x, n) {\n var ans = int2bigInt(0, (x.length > n ? x.length : n) * bpe, 0);\n copy_(ans, x);\n return ans;\n}\n/**\n * return a k-bit true random prime using Maurer's algorithm.\n *\n * @export\n * @param {number} k\n * @returns {number[]}\n */\n\nexport function randTruePrime(k) {\n var ans = int2bigInt(0, k, 0);\n randTruePrime_(ans, k);\n return trim(ans, 1);\n}\n/**\n * return a k-bit random probable prime with probability of error < 2^-80\n *\n * @export\n * @param {number} k\n * @returns {number[]}\n */\n\nexport function randProbPrime(k) {\n if (k >= 600) return randProbPrimeRounds(k, 2); //numbers from HAC table 4.3\n\n if (k >= 550) return randProbPrimeRounds(k, 4);\n if (k >= 500) return randProbPrimeRounds(k, 5);\n if (k >= 400) return randProbPrimeRounds(k, 6);\n if (k >= 350) return randProbPrimeRounds(k, 7);\n if (k >= 300) return randProbPrimeRounds(k, 9);\n if (k >= 250) return randProbPrimeRounds(k, 12); //numbers from HAC table 4.4\n\n if (k >= 200) return randProbPrimeRounds(k, 15);\n if (k >= 150) return randProbPrimeRounds(k, 18);\n if (k >= 100) return randProbPrimeRounds(k, 27);\n return randProbPrimeRounds(k, 40); //number from HAC remark 4.26 (only an estimate)\n}\n/**\n * return a k-bit probable random prime using n rounds of Miller Rabin\n * (after trial division with small primes)\n *\n * @export\n * @param {number} k\n * @param {number} n\n * @returns {number[]}\n */\n\nexport function randProbPrimeRounds(k, n) {\n var ans, i, divisible, B;\n B = 30000; //B is largest prime to use in trial division\n\n ans = int2bigInt(0, k, 0); //optimization: try larger and smaller B to find the best limit.\n\n if (primes.length === 0) primes = findPrimes(30000); //check for divisibility by primes <=30000\n\n if (rpprb.length !== ans.length) rpprb = dup(ans);\n\n for (;;) {\n //keep trying random values for ans until one appears to be prime\n //optimization: pick a random number times L=2*3*5*...*p, plus a\n // random element of the list of all numbers in [0,L) not divisible by any prime up to p.\n // This can reduce the amount of random number generation.\n randBigInt_(ans, k, 0); //ans = a random odd number to check\n\n ans[0] |= 1;\n divisible = 0; //check ans for divisibility by small primes up to B\n\n for (i = 0; i < primes.length && primes[i] <= B; i++) {\n if (modInt(ans, primes[i]) === 0 && !equalsInt(ans, primes[i])) {\n divisible = 1;\n break;\n }\n } //optimization: change millerRabin so the base can be bigger than the number being checked, then eliminate the while here.\n //do n rounds of Miller Rabin, with random bases less than ans\n\n\n for (i = 0; i < n && !divisible; i++) {\n randBigInt_(rpprb, k, 0);\n\n while (!greater(ans, rpprb) //pick a random rpprb that's < ans\n ) {\n randBigInt_(rpprb, k, 0);\n }\n\n if (!millerRabin(ans, rpprb)) divisible = 1;\n }\n\n if (!divisible) return ans;\n }\n /*::\n declare var never: empty\n return never\n */\n\n}\n/**\n * return a new bigInt equal to (x mod n) for bigInts x and n.\n *\n * @param {number[]} x\n * @param {number[]} n\n * @returns {number[]}\n */\n\nexport function mod(x, n) {\n var ans = dup(x);\n mod_(ans, n);\n return trim(ans, 1);\n}\n/**\n * return (x+n) where x is a bigInt and n is an integer.\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n * @returns {number[]}\n */\n\nexport function addInt(x, n) {\n var ans = expand(x, x.length + 1);\n addInt_(ans, n);\n return trim(ans, 1);\n}\n/**\n * return x*y for bigInts x and y. This is faster when y y.length ? x.length + 1 : y.length + 1);\n sub_(ans, y);\n return trim(ans, 1);\n}\n/**\n * return (x+y) for bigInts x and y\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @returns {number[]}\n */\n\nexport function add(x, y) {\n var ans = expand(x, x.length > y.length ? x.length + 1 : y.length + 1);\n add_(ans, y);\n return trim(ans, 1);\n}\n/**\n * return (x**(-1) mod n) for bigInts x and n.\n *\n * If no inverse exists, it returns null\n *\n * @param {number[]} x\n * @param {number[]} n\n * @returns {(number[] | null)}\n */\n\nexport function inverseMod(x, n) {\n var ans = expand(x, n.length);\n var s = inverseMod_(ans, n);\n return s ? trim(ans, 1) : null;\n}\n/**\n * return (x*y mod n) for bigInts x,y,n.\n *\n * For greater speed, let y= 2\n\n if (s_i2.length != ans.length) {\n s_i2 = dup(ans);\n s_R = dup(ans);\n s_n1 = dup(ans);\n s_r2 = dup(ans);\n s_d = dup(ans);\n s_x1 = dup(ans); //TODO Seems like a bug in eslint, reports as unused\n\n s_x2 = dup(ans);\n s_b = dup(ans);\n s_n = dup(ans);\n s_i = dup(ans);\n s_rm = dup(ans);\n s_q = dup(ans);\n s_a = dup(ans);\n s_aa = dup(ans);\n }\n\n if (k <= recLimit) {\n //generate small random primes by trial division up to its square root\n pm = (1 << (k + 2 >> 1)) - 1; //pm is binary number with all ones, just over sqrt(2^k)\n\n copyInt_(ans, 0);\n\n for (dd = 1; dd;) {\n dd = 0;\n ans[0] = 1 | 1 << k - 1 | Math.floor(Math.random() * (1 << k)); //random, k-bit, odd integer, with msb 1\n\n for (j = 1; j < primes.length && (primes[j] & pm) == primes[j]; j++) {\n //trial division by all primes 3...sqrt(2^k)\n if (0 == ans[0] % primes[j]) {\n dd = 1;\n break;\n }\n }\n }\n\n carry_(ans);\n return;\n }\n\n B = c * k * k; //try small primes up to B (or all the primes[] array if the largest is less than B).\n\n if (k > 2 * m) //generate this k-bit number by first recursively generating a number that has between k/2 and k-m bits\n for (r = 1; k - k * r <= m;) {\n r = pows[Math.floor(Math.random() * 512)];\n } //r=Math.pow(2,Math.random()-1);\n else r = 0.5; //simulation suggests the more complex algorithm using r=.333 is only slightly faster.\n\n recSize = Math.floor(r * k) + 1;\n randTruePrime_(s_q, recSize);\n copyInt_(s_i2, 0);\n s_i2[Math.floor((k - 2) / bpe)] |= 1 << (k - 2) % bpe; //s_i2=2^(k-2)\n\n divide_(s_i2, s_q, s_i, s_rm); //s_i=floor((2^(k-1))/(2q))\n\n z = bitSize(s_i);\n\n for (;;) {\n for (;;) {\n //generate z-bit numbers until one falls in the range [0,s_i-1]\n randBigInt_(s_R, z, 0);\n if (greater(s_i, s_R)) break;\n } //now s_R is in the range [0,s_i-1]\n\n\n addInt_(s_R, 1); //now s_R is in the range [1,s_i]\n\n add_(s_R, s_i); //now s_R is in the range [s_i+1,2*s_i]\n\n copy_(s_n, s_q);\n mult_(s_n, s_R);\n multInt_(s_n, 2);\n addInt_(s_n, 1); //s_n=2*s_R*s_q+1\n\n copy_(s_r2, s_R);\n multInt_(s_r2, 2); //s_r2=2*s_R\n //check s_n for divisibility by small primes up to B\n\n for (divisible = 0, j = 0; j < primes.length && primes[j] < B; j++) {\n if (modInt(s_n, primes[j]) == 0 && !equalsInt(s_n, primes[j])) {\n divisible = 1;\n break;\n }\n }\n\n if (!divisible) if (!millerRabinInt(s_n, 2)) //if it passes small primes check, then try a single Miller-Rabin base 2\n //this line represents 75% of the total runtime for randTruePrime_\n divisible = 1;\n\n if (!divisible) {\n //if it passes that test, continue checking s_n\n addInt_(s_n, -3);\n\n for (j = s_n.length - 1; s_n[j] == 0 && j > 0; j--) {\n ;\n } //strip leading zeros\n\n\n for (zz = 0, w = s_n[j]; w; w >>= 1, zz++) {\n ;\n }\n\n zz += bpe * j; //zz=number of bits in s_n, ignoring leading zeros\n\n for (;;) {\n //generate z-bit numbers until one falls in the range [0,s_n-1]\n randBigInt_(s_a, zz, 0);\n if (greater(s_n, s_a)) break;\n } //now s_a is in the range [0,s_n-1]\n\n\n addInt_(s_n, 3); //now s_a is in the range [0,s_n-4]\n\n addInt_(s_a, 2); //now s_a is in the range [2,s_n-2]\n\n copy_(s_b, s_a);\n copy_(s_n1, s_n);\n addInt_(s_n1, -1);\n powMod_(s_b, s_n1, s_n); //s_b=s_a^(s_n-1) modulo s_n\n\n addInt_(s_b, -1);\n\n if (isZero(s_b)) {\n copy_(s_b, s_a);\n powMod_(s_b, s_r2, s_n);\n addInt_(s_b, -1);\n copy_(s_aa, s_n);\n copy_(s_d, s_b);\n GCD_(s_d, s_n); //if s_b and s_n are relatively prime, then s_n is a prime\n\n if (equalsInt(s_d, 1)) {\n copy_(ans, s_aa);\n return; //if we've made it this far, then s_n is absolutely guaranteed to be prime\n }\n }\n }\n }\n}\n/**\n * Return an n-bit random BigInt (n>=1). If s=1, then the most significant of those n bits is set to 1.\n *\n * @export\n * @param {number} n\n * @param {number} s\n * @returns {number[]}\n */\n\nexport function randBigInt(n, s) {\n var a, b;\n a = Math.floor((n - 1) / bpe) + 2; //# array elements to hold the BigInt with a leading 0 element\n\n b = int2bigInt(0, 0, a);\n randBigInt_(b, n, s);\n return b;\n}\n/**\n * Set b to an n-bit random BigInt. If s=1, then the most significant of those n bits is set to 1.\n *\n * Array b must be big enough to hold the result. Must have n>=1\n *\n * @export\n * @param {number[]} b\n * @param {number} n\n * @param {number} s\n * @return {void}\n */\n\nexport function randBigInt_(b, n, s) {\n var i, a;\n\n for (i = 0; i < b.length; i++) {\n b[i] = 0;\n }\n\n a = Math.floor((n - 1) / bpe) + 1; //# array elements to hold the BigInt\n\n for (i = 0; i < a; i++) {\n b[i] = Math.floor(Math.random() * (1 << bpe - 1));\n }\n\n b[a - 1] &= (2 << (n - 1) % bpe) - 1;\n if (s == 1) b[a - 1] |= 1 << (n - 1) % bpe;\n}\n/**\n * Return the greatest common divisor of bigInts x and y (each with same number of elements).\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @returns {number[]}\n */\n\nexport function GCD(x, y) {\n var xc, yc;\n xc = dup(x);\n yc = dup(y);\n GCD_(xc, yc);\n return xc;\n}\n/**\n * set x to the greatest common divisor of bigInts x and y (each with same number of elements).\n *\n * y is destroyed.\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n */\n\nexport function GCD_(x, y) {\n var i, xp, yp, A, B, C, D, q, sing;\n var qp;\n if (T.length !== x.length) T = dup(x);\n sing = 1;\n\n while (sing) {\n //while y has nonzero elements other than y[0]\n sing = 0;\n\n for (i = 1; i < y.length; i++ //check if y has nonzero elements other than 0\n ) {\n if (y[i]) {\n sing = 1;\n break;\n }\n }\n\n if (!sing) break; //quit when y all zero elements except possibly y[0]\n\n for (i = x.length; !x[i] && i >= 0; i--) {\n ;\n } //find most significant element of x\n\n\n xp = x[i];\n yp = y[i];\n A = 1;\n B = 0;\n C = 0;\n D = 1;\n\n while (yp + C && yp + D) {\n q = Math.floor((xp + A) / (yp + C));\n qp = Math.floor((xp + B) / (yp + D));\n if (q != qp) break;\n t = A - q * C;\n A = C;\n C = t; // do (A,B,xp, C,D,yp) = (C,D,yp, A,B,xp) - q*(0,0,0, C,D,yp)\n\n t = B - q * D;\n B = D;\n D = t;\n t = xp - q * yp;\n xp = yp;\n yp = t;\n }\n\n if (B) {\n copy_(T, x);\n linComb_(x, y, A, B); //x=A*x+B*y\n\n linComb_(y, T, D, C); //y=D*y+C*T\n } else {\n mod_(x, y);\n copy_(T, x);\n copy_(x, y);\n copy_(y, T);\n }\n }\n\n if (y[0] === 0) return;\n t = modInt(x, y[0]);\n copyInt_(x, y[0]);\n y[0] = t;\n\n while (y[0]) {\n x[0] %= y[0];\n t = x[0];\n x[0] = y[0];\n y[0] = t;\n }\n}\n/**\n * do x=x**(-1) mod n, for bigInts x and n.\n *\n * If no inverse exists, it sets x to zero and returns 0, else it returns 1.\n * The x array must be at least as large as the n array.\n *\n * @export\n * @param {number[]} x\n * @param {number[]} n\n * @returns {(0 | 1)}\n */\n\nexport function inverseMod_(x, n) {\n var k = 1 + 2 * Math.max(x.length, n.length);\n\n if (!(x[0] & 1) && !(n[0] & 1)) {\n //if both inputs are even, then inverse doesn't exist\n copyInt_(x, 0);\n return 0;\n }\n\n if (eg_u.length != k) {\n eg_u = new Array(k);\n eg_v = new Array(k);\n eg_A = new Array(k);\n eg_B = new Array(k);\n eg_C = new Array(k);\n eg_D = new Array(k);\n }\n\n copy_(eg_u, x);\n copy_(eg_v, n);\n copyInt_(eg_A, 1);\n copyInt_(eg_B, 0);\n copyInt_(eg_C, 0);\n copyInt_(eg_D, 1);\n\n for (;;) {\n while (!(eg_u[0] & 1)) {\n //while eg_u is even\n halve_(eg_u);\n\n if (!(eg_A[0] & 1) && !(eg_B[0] & 1)) {\n //if eg_A==eg_B==0 mod 2\n halve_(eg_A);\n halve_(eg_B);\n } else {\n add_(eg_A, n);\n halve_(eg_A);\n sub_(eg_B, x);\n halve_(eg_B);\n }\n }\n\n while (!(eg_v[0] & 1)) {\n //while eg_v is even\n halve_(eg_v);\n\n if (!(eg_C[0] & 1) && !(eg_D[0] & 1)) {\n //if eg_C==eg_D==0 mod 2\n halve_(eg_C);\n halve_(eg_D);\n } else {\n add_(eg_C, n);\n halve_(eg_C);\n sub_(eg_D, x);\n halve_(eg_D);\n }\n }\n\n if (!greater(eg_v, eg_u)) {\n //eg_v <= eg_u\n sub_(eg_u, eg_v);\n sub_(eg_A, eg_C);\n sub_(eg_B, eg_D);\n } else {\n //eg_v > eg_u\n sub_(eg_v, eg_u);\n sub_(eg_C, eg_A);\n sub_(eg_D, eg_B);\n }\n\n if (equalsInt(eg_u, 0)) {\n while (negative(eg_C) //make sure answer is nonnegative\n ) {\n add_(eg_C, n);\n }\n\n copy_(x, eg_C);\n\n if (!equalsInt(eg_v, 1)) {\n //if GCD_(x,n)!=1, then there is no inverse\n copyInt_(x, 0);\n return 0;\n }\n\n return 1;\n }\n }\n /*::\n declare var never: empty\n return never\n */\n\n}\n/**\n * return x**(-1) mod n, for integers x and n.\n *\n * Return 0 if there is no inverse\n *\n * @param {number} x\n * @param {number} n\n * @returns {number}\n */\n\nexport function inverseModInt(x, n) {\n var a = 1,\n b = 0,\n t;\n\n for (;;) {\n if (x === 1) return a;\n if (x === 0) return 0;\n b -= a * Math.floor(n / x); //$off\n\n n %= x;\n if (n === 1) return b; //to avoid negatives, change this b to n-b, and each -= to +=\n\n if (n === 0) return 0;\n a -= b * Math.floor(x / n); //$off\n\n x %= n;\n }\n /*::\n declare var never: empty\n return never\n */\n\n} //this deprecated function is for backward compatibility only.\n\nfunction inverseModInt_(x, n) {\n return inverseModInt(x, n);\n}\n/**\n * Given positive bigInts x and y, change the bigints v, a, and b to positive bigInts such that:\n *\n * v = GCD_(x,y) = a*x-b*y\n *\n * The bigInts v, a, b, must have exactly as many elements as the larger of x and y.\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @param {number[]} v\n * @param {number[]} a\n * @param {number[]} b\n * @return {void}\n */\n\n\nexport function eGCD_(x, y, v, a, b) {\n var g = 0;\n var k = Math.max(x.length, y.length);\n\n if (eg_u.length != k) {\n eg_u = new Array(k);\n eg_A = new Array(k);\n eg_B = new Array(k);\n eg_C = new Array(k);\n eg_D = new Array(k);\n }\n\n while (!(x[0] & 1) && !(y[0] & 1)) {\n //while x and y both even\n halve_(x);\n halve_(y);\n g++;\n }\n\n copy_(eg_u, x);\n copy_(v, y);\n copyInt_(eg_A, 1);\n copyInt_(eg_B, 0);\n copyInt_(eg_C, 0);\n copyInt_(eg_D, 1);\n\n for (;;) {\n while (!(eg_u[0] & 1)) {\n //while u is even\n halve_(eg_u);\n\n if (!(eg_A[0] & 1) && !(eg_B[0] & 1)) {\n //if A==B==0 mod 2\n halve_(eg_A);\n halve_(eg_B);\n } else {\n add_(eg_A, y);\n halve_(eg_A);\n sub_(eg_B, x);\n halve_(eg_B);\n }\n }\n\n while (!(v[0] & 1)) {\n //while v is even\n halve_(v);\n\n if (!(eg_C[0] & 1) && !(eg_D[0] & 1)) {\n //if C==D==0 mod 2\n halve_(eg_C);\n halve_(eg_D);\n } else {\n add_(eg_C, y);\n halve_(eg_C);\n sub_(eg_D, x);\n halve_(eg_D);\n }\n }\n\n if (!greater(v, eg_u)) {\n //v<=u\n sub_(eg_u, v);\n sub_(eg_A, eg_C);\n sub_(eg_B, eg_D);\n } else {\n //v>u\n sub_(v, eg_u);\n sub_(eg_C, eg_A);\n sub_(eg_D, eg_B);\n }\n\n if (equalsInt(eg_u, 0)) {\n while (negative(eg_C)) {\n //make sure a (C) is nonnegative\n add_(eg_C, y);\n sub_(eg_D, x);\n }\n\n multInt_(eg_D, -1); ///make sure b (D) is nonnegative\n\n copy_(a, eg_C);\n copy_(b, eg_D);\n leftShift_(v, g);\n return;\n }\n }\n}\n/**\n * is bigInt x negative?\n *\n * @param {number[]} x\n * @returns {(1 | 0)}\n */\n\nexport function negative(x) {\n //TODO Flow Bool type inference\n return x[x.length - 1] >> bpe - 1 & 1;\n}\n/**\n * is (x << (shift*bpe)) > y?\n *\n * x and y are nonnegative bigInts\n * shift is a nonnegative integer\n *\n * @param {number[]} x\n * @param {number[]} y\n * @param {number} shift\n * @returns {(1 | 0)}\n */\n\nexport function greaterShift(x, y, shift) {\n var i,\n kx = x.length,\n ky = y.length;\n k = kx + shift < ky ? kx + shift : ky;\n\n for (i = ky - 1 - shift; i < kx && i >= 0; i++) {\n if (x[i] > 0) return 1;\n } //if there are nonzeros in x to the left of the first column of y, then x is bigger\n\n\n for (i = kx - 1 + shift; i < ky; i++) {\n if (y[i] > 0) return 0;\n } //if there are nonzeros in y to the left of the first column of x, then x is not bigger\n\n\n for (i = k - 1; i >= shift; i--) {\n if (x[i - shift] > y[i]) return 1;else if (x[i - shift] < y[i]) return 0;\n }\n\n return 0;\n}\n/**\n * is x > y?\n *\n * x and y both nonnegative\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @returns {(1 | 0)}\n */\n\nexport function greater(x, y) {\n var i;\n var k = x.length < y.length ? x.length : y.length;\n\n for (i = x.length; i < y.length; i++) {\n if (y[i]) return 0;\n } //y has more digits\n\n\n for (i = y.length; i < x.length; i++) {\n if (x[i]) return 1;\n } //x has more digits\n\n\n for (i = k - 1; i >= 0; i--) {\n if (x[i] > y[i]) return 1;else if (x[i] < y[i]) return 0;\n }\n\n return 0;\n}\n/**\n * divide x by y giving quotient q and remainder r.\n *\n * q = floor(x/y)\n * r = x mod y\n *\n * All 4 are bigints.\n *\n * * x must have at least one leading zero element.\n * * y must be nonzero.\n * * q and r must be arrays that are exactly the same length as x. (Or q can have more).\n * * Must have x.length >= y.length >= 2.\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @param {number[]} q\n * @param {number[]} r\n * @return {void}\n */\n\nexport function divide_(x, y, q, r) {\n var kx, ky;\n var i, j, y1, y2, c, a, b;\n copy_(r, x);\n\n for (ky = y.length; y[ky - 1] === 0; ky--) {\n ;\n } //ky is number of elements in y, not including leading zeros\n //normalize: ensure the most significant element of y has its highest bit set\n\n\n b = y[ky - 1];\n\n for (a = 0; b; a++) {\n b >>= 1;\n }\n\n a = bpe - a; //a is how many bits to shift so that the high order bit of y is leftmost in its array element\n\n leftShift_(y, a); //multiply both by 1< ky; kx--) {\n ;\n } //kx is number of elements in normalized x, not including leading zeros\n\n\n copyInt_(q, 0); // q=0\n\n while (!greaterShift(y, r, kx - ky)) {\n // while (leftShift_(y,kx-ky) <= r) {\n subShift_(r, y, kx - ky); // r=r-leftShift_(y,kx-ky)\n\n q[kx - ky]++; // q[kx-ky]++;\n } // }\n\n\n for (i = kx - 1; i >= ky; i--) {\n if (r[i] == y[ky - 1]) q[i - ky] = mask;else q[i - ky] = Math.floor((r[i] * radix + r[i - 1]) / y[ky - 1]); //The following for(;;) loop is equivalent to the commented while loop,\n //except that the uncommented version avoids overflow.\n //The commented loop comes from HAC, which assumes r[-1]==y[-1]==0\n // while (q[i-ky]*(y[ky-1]*radix+y[ky-2]) > r[i]*radix*radix+r[i-1]*radix+r[i-2])\n // q[i-ky]--;\n\n for (;;) {\n y2 = (ky > 1 ? y[ky - 2] : 0) * q[i - ky];\n c = y2 >> bpe;\n y2 = y2 & mask;\n y1 = c + q[i - ky] * y[ky - 1];\n c = y1 >> bpe;\n y1 = y1 & mask;\n if (c == r[i] ? y1 == r[i - 1] ? y2 > (i > 1 ? r[i - 2] : 0) : y1 > r[i - 1] : c > r[i]) q[i - ky]--;else break;\n }\n\n linCombShift_(r, y, -q[i - ky], i - ky); //r=r-q[i-ky]*leftShift_(y,i-ky)\n\n if (negative(r)) {\n addShift_(r, y, i - ky); //r=r+leftShift_(y,i-ky)\n\n q[i - ky]--;\n }\n }\n\n rightShift_(y, a); //undo the normalization step\n\n rightShift_(r, a); //undo the normalization step\n}\n/**\n * do carries and borrows so each element of the bigInt x fits in bpe bits.\n *\n * @param {number[]} x\n */\n\nexport function carry_(x) {\n var i, k, c, b;\n k = x.length;\n c = 0;\n\n for (i = 0; i < k; i++) {\n c += x[i];\n b = 0;\n\n if (c < 0) {\n b = -(c >> bpe);\n c += b * radix;\n }\n\n x[i] = c & mask;\n c = (c >> bpe) - b;\n }\n}\n/**\n * return x mod n for bigInt x and integer n.\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n * @returns {number}\n */\n\nexport function modInt(x, n) {\n var i,\n c = 0;\n\n for (i = x.length - 1; i >= 0; i--) {\n c = (c * radix + x[i]) % n;\n }\n\n return c;\n}\n/**\n * convert the integer t into a bigInt with at least the given number of bits.\n * the returned array stores the bigInt in bpe-bit chunks, little endian (buff[0] is least significant word)\n * Pad the array with leading zeros so that it has at least minSize elements.\n *\n * There will always be at least one leading 0 element.\n *\n * @export\n * @param {number} t\n * @param {number} bits\n * @param {number} minSize\n * @returns {number[]}\n */\n\nexport function int2bigInt(t, bits, minSize) {\n var i, k;\n k = Math.ceil(bits / bpe) + 1;\n k = minSize > k ? minSize : k;\n var buff = new Array(k);\n copyInt_(buff, t);\n return buff;\n}\n/**\n * return the bigInt given a string representation in a given base.\n * Pad the array with leading zeros so that it has at least minSize elements.\n * If base=-1, then it reads in a space-separated list of array elements in decimal.\n *\n * The array will always have at least one leading zero, unless base=-1.\n *\n * @export\n * @param {string} s\n * @param {number} base\n * @param {number} [minSize]\n * @returns {number[]}\n */\n\nexport function str2bigInt(s, base, minSize) {\n var d, i, x, y, kk;\n var k = s.length;\n\n if (base === -1) {\n //comma-separated list of array elements in decimal\n x = new Array(0);\n\n for (;;) {\n y = new Array(x.length + 1);\n\n for (i = 0; i < x.length; i++) {\n y[i + 1] = x[i];\n }\n\n y[0] = parseInt(s, 10); //TODO PERF Should we replace that with ~~ (not not)? https://jsperf.com/number-vs-parseint-vs-plus/7\n\n x = y;\n d = s.indexOf(',', 0);\n if (d < 1) break; //$off\n\n s = s.substring(d + 1);\n if (s.length == 0) break;\n } //$off\n\n\n if (x.length < minSize) {\n //$off\n y = new Array(minSize);\n copy_(y, x);\n return y;\n }\n\n return x;\n }\n\n x = int2bigInt(0, base * k, 0);\n\n for (i = 0; i < k; i++) {\n d = digitsStr.indexOf(s.substring(i, i + 1), 0);\n if (base <= 36 && d >= 36) //convert lowercase to uppercase if base<=36\n d -= 26;\n\n if (d >= base || d < 0) {\n //stop at first illegal character\n break;\n }\n\n multInt_(x, base);\n addInt_(x, d);\n }\n\n for (k = x.length; k > 0 && !x[k - 1]; k--) {\n ;\n } //strip off leading zeros\n //$off\n\n\n k = minSize > k + 1 ? minSize : k + 1; //$off\n\n y = new Array(k); //$off\n\n kk = k < x.length ? k : x.length; //$off\n\n for (i = 0; i < kk; i++) {\n y[i] = x[i];\n } //$off\n\n\n for (; i < k; i++) {\n y[i] = 0;\n }\n\n return y;\n} //return the bigInt given a string representation in a given base.\n//Pad the array with leading zeros so that it has at least minSize elements.\n//If base=-1, then it reads in a space-separated list of array elements in decimal.\n//The array will always have at least one leading zero, unless base=-1.\n// function str2bigInt(s,b,minSize) {\n// var d, i, j, base, str, x, y, kk;\n// if (typeof b === 'string') {\n// base = b.length;\n// str = b;\n// } else {\n// base = b;\n// str = digitsStr;\n// }\n// var k=s.length;\n// if (base==-1) { //comma-separated list of array elements in decimal\n// x=new Array(0);\n// for (;;) {\n// y=new Array(x.length+1);\n// for (i=0;i=36) { //convert lowercase to uppercase if base<=36\n// d-=26;\n// }\n// if (d>=base || d<0) { //ignore illegal characters\n// continue;\n// }\n// multInt_(x,base);\n// addInt_(x,d);\n// }\n// for (k=x.length;k>0 && !x[k-1];k--); //strip off leading zeros\n// k=minSize>k+1 ? minSize : k+1;\n// y=new Array(k);\n// kk=k y.length) {\n for (; i < x.length; i++) {\n if (x[i]) return 0;\n }\n } else {\n for (; i < y.length; i++) {\n if (y[i]) return 0;\n }\n }\n\n return 1;\n}\n/**\n * is the bigInt x equal to zero?\n *\n * @export\n * @param {number[]} x\n * @returns {(1 | 0)}\n */\n\nexport function isZero(x) {\n var i;\n\n for (i = 0; i < x.length; i++) {\n if (x[i]) return 0;\n }\n\n return 1;\n}\n/**\n * Convert a bigInt into a string in a given base, from base 2 up to base 95.\n *\n * Base -1 prints the contents of the array representing the number.\n *\n * @export\n * @param {number[]} x\n * @param {number} base\n * @returns {string}\n */\n\nexport function bigInt2str(x, base) {\n var i,\n t,\n s = '';\n if (s6.length !== x.length) s6 = dup(x);else copy_(s6, x);\n\n if (base === -1) {\n //return the list of array contents\n for (i = x.length - 1; i > 0; i--) {\n s += x[i] + ',';\n }\n\n s += x[0];\n } else {\n //return it in the given base\n while (!isZero(s6)) {\n t = divInt_(s6, base); //t=s6 % base; s6=floor(s6/base);\n\n s = digitsStr.substring(t, t + 1) + s;\n }\n }\n\n if (s.length === 0) s = '0';\n return s;\n}\n/**\n * Returns a duplicate of bigInt x\n *\n * @export\n * @param {number[]} x\n * @returns {number[]}\n */\n\nexport function dup(x) {\n var i;\n buff = Array(x.length);\n copy_(buff, x);\n return buff;\n}\n/**\n * do x=y on bigInts x and y.\n *\n * x must be an array at least as big as y (not counting the leading zeros in y).\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @returns {void}\n */\n\nexport function copy_(x, y) {\n var i;\n var k = x.length < y.length ? x.length : y.length;\n\n for (i = 0; i < k; i++) {\n x[i] = y[i];\n }\n\n for (i = k; i < x.length; i++) {\n x[i] = 0;\n }\n}\n/**\n * do x=y on bigInt x and integer y.\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n * @returns {void}\n */\n\nexport function copyInt_(x, n) {\n var i, c;\n var len = x.length; //TODO .length in for loop have perfomance costs. Bench this\n\n for (c = n, i = 0; i < len; i++) {\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x+n where x is a bigInt and n is an integer.\n *\n * x must be large enough to hold the result.\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n * @returns {void}\n */\n\nexport function addInt_(x, n) {\n var i, k, c, b;\n x[0] += n;\n k = x.length;\n c = 0;\n\n for (i = 0; i < k; i++) {\n c += x[i];\n b = 0;\n\n if (c < 0) {\n b = -(c >> bpe);\n c += b * radix;\n }\n\n x[i] = c & mask;\n c = (c >> bpe) - b;\n if (!c) return; //stop carrying as soon as the carry is zero\n }\n}\n/**\n * right shift bigInt x by n bits.\n *\n * 0 <= n < bpe.\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n */\n\nexport function rightShift_(x, n) {\n var i;\n var k = Math.floor(n / bpe);\n\n if (k) {\n for (i = 0; i < x.length - k; i++ //right shift x by k elements\n ) {\n x[i] = x[i + k];\n }\n\n for (; i < x.length; i++) {\n x[i] = 0;\n } //$off\n\n\n n %= bpe;\n }\n\n for (i = 0; i < x.length - 1; i++) {\n x[i] = mask & (x[i + 1] << bpe - n | x[i] >> n);\n }\n\n x[i] >>= n;\n}\n/**\n * do x=floor(|x|/2)*sgn(x) for bigInt x in 2's complement\n *\n * @param {number[]} x\n * @returns {void}\n */\n\nexport function halve_(x) {\n var i;\n\n for (i = 0; i < x.length - 1; i++) {\n x[i] = mask & (x[i + 1] << bpe - 1 | x[i] >> 1);\n }\n\n x[i] = x[i] >> 1 | x[i] & radix >> 1; //most significant bit stays the same\n}\n/**\n * left shift bigInt x by n bits\n *\n * @export\n * @param {number[]} x\n * @param {number} n\n * @returns {void}\n */\n\nexport function leftShift_(x, n) {\n var i;\n var k = Math.floor(n / bpe);\n\n if (k) {\n for (i = x.length; i >= k; i-- //left shift x by k elements\n ) {\n x[i] = x[i - k];\n }\n\n for (; i >= 0; i--) {\n x[i] = 0;\n } //$off\n\n\n n %= bpe;\n }\n\n if (!n) return;\n\n for (i = x.length - 1; i > 0; i--) {\n x[i] = mask & (x[i] << n | x[i - 1] >> bpe - n);\n }\n\n x[i] = mask & x[i] << n;\n}\n/**\n * do x=x*n where x is a bigInt and n is an integer.\n *\n * x must be large enough to hold the result.\n *\n * @param {number[]} x\n * @param {number} n\n * @returns {void}\n */\n\nexport function multInt_(x, n) {\n var i, k, c, b;\n if (!n) return;\n k = x.length;\n c = 0;\n\n for (i = 0; i < k; i++) {\n c += x[i] * n;\n b = 0;\n\n if (c < 0) {\n b = -(c >> bpe);\n c += b * radix;\n }\n\n x[i] = c & mask;\n c = (c >> bpe) - b;\n }\n}\n/**\n * do x=floor(x/n) for bigInt x and integer n, and return the remainder\n *\n * @param {number[]} x\n * @param {number} n\n * @returns {number} remainder\n */\n\nexport function divInt_(x, n) {\n var i,\n r = 0,\n s;\n\n for (i = x.length - 1; i >= 0; i--) {\n s = r * radix + x[i];\n x[i] = Math.floor(s / n);\n r = s % n;\n }\n\n return r;\n}\n/**\n * do the linear combination x=a*x+b*y for bigInts x and y, and integers a and b.\n *\n * x must be large enough to hold the answer.\n *\n * @param {number[]} x\n * @param {number[]} y\n * @param {number} a\n * @param {number} b\n * @returns {void}\n */\n\nexport function linComb_(x, y, a, b) {\n var i, c, k, kk;\n k = x.length < y.length ? x.length : y.length;\n kk = x.length;\n\n for (c = 0, i = 0; i < k; i++) {\n c += a * x[i] + b * y[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; i < kk; i++) {\n c += a * x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do the linear combination x=a*x+b*(y<<(ys*bpe)) for bigInts x and y, and integers a, b and ys.\n *\n * x must be large enough to hold the answer.\n *\n * @param {number[]} x\n * @param {number[]} y\n * @param {number} b\n * @param {number} ys\n * @returns {void}\n */\n\nexport function linCombShift_(x, y, b, ys) {\n var i, c, k, kk;\n k = x.length < ys + y.length ? x.length : ys + y.length;\n kk = x.length;\n\n for (c = 0, i = ys; i < k; i++) {\n c += x[i] + b * y[i - ys];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; c && i < kk; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x+(y<<(ys*bpe)) for bigInts x and y, and integer ys.\n *\n * x must be large enough to hold the answer.\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @param {number} ys\n * @return {void}\n */\n\nexport function addShift_(x, y, ys) {\n var i, c, k, kk;\n k = x.length < ys + y.length ? x.length : ys + y.length;\n kk = x.length;\n\n for (c = 0, i = ys; i < k; i++) {\n c += x[i] + y[i - ys];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; c && i < kk; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x-(y<<(ys*bpe)) for bigInts x and y, and integer ys\n *\n * x must be large enough to hold the answer\n *\n * @param {number[]} x\n * @param {number[]} y\n * @param {number} ys\n * @return {void}\n */\n\nexport function subShift_(x, y, ys) {\n var i, c, k, kk;\n k = x.length < ys + y.length ? x.length : ys + y.length;\n kk = x.length;\n\n for (c = 0, i = ys; i < k; i++) {\n c += x[i] - y[i - ys];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; c && i < kk; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x-y for bigInts x and y\n *\n * x must be large enough to hold the answer\n *\n * negative answers will be 2s complement\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @return {void}\n */\n\nexport function sub_(x, y) {\n var i, c, k, kk;\n k = x.length < y.length ? x.length : y.length;\n\n for (c = 0, i = 0; i < k; i++) {\n c += x[i] - y[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; c && i < x.length; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x+y for bigInts x and y\n *\n * x must be large enough to hold the answer\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @return {void}\n */\n\nexport function add_(x, y) {\n var i, c, k, kk;\n k = x.length < y.length ? x.length : y.length;\n\n for (c = 0, i = 0; i < k; i++) {\n c += x[i] + y[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n\n for (i = k; c && i < x.length; i++) {\n c += x[i];\n x[i] = c & mask;\n c >>= bpe;\n }\n}\n/**\n * do x=x*y for bigInts x and y.\n *\n * This is faster when y 0 && !x[kx - 1]; kx--) {\n ;\n } //ignore leading zeros in x\n\n\n k = kx > n.length ? 2 * kx : 2 * n.length; //k=# elements in the product, which is twice the elements in the larger of x and n\n\n if (s0.length != k) s0 = new Array(k);\n copyInt_(s0, 0);\n\n for (i = 0; i < kx; i++) {\n c = s0[2 * i] + x[i] * x[i];\n s0[2 * i] = c & mask;\n c >>= bpe;\n\n for (j = i + 1; j < kx; j++) {\n c = s0[i + j] + 2 * x[i] * x[j] + c;\n s0[i + j] = c & mask;\n c >>= bpe;\n }\n\n s0[i + kx] = c;\n }\n\n mod_(s0, n);\n copy_(x, s0);\n}\n/**\n * return x with exactly k leading zero elements\n *\n * @export\n * @param {number[]} x\n * @param {number} k\n * @returns {number[]}\n */\n\nexport function trim(x, k) {\n var i, y;\n\n for (i = x.length; i > 0 && !x[i - 1]; i--) {\n ;\n }\n\n y = new Array(i + k);\n copy_(y, x);\n return y;\n}\n/**\n * do `x=x**y mod n`, where x,y,n are bigInts and `**` is exponentiation. `0**0=1`.\n *\n * this is faster when n is odd.\n *\n * x usually needs to have as many elements as n.\n *\n * @param {number[]} x\n * @param {number[]} y\n * @param {number[]} n\n * @return {void}\n */\n\nexport function powMod_(x, y, n) {\n var k1, k2, kn, np;\n if (s7.length != n.length) s7 = dup(n); //for even modulus, use a simple square-and-multiply algorithm,\n //rather than using the more complex Montgomery algorithm.\n\n if ((n[0] & 1) == 0) {\n copy_(s7, x);\n copyInt_(x, 1);\n\n while (!equalsInt(y, 0)) {\n if (y[0] & 1) multMod_(x, s7, n);\n divInt_(y, 2);\n squareMod_(s7, n);\n }\n\n return;\n } //calculate np from n for the Montgomery multiplications\n\n\n copyInt_(s7, 0);\n\n for (kn = n.length; kn > 0 && !n[kn - 1]; kn--) {\n ;\n }\n\n np = radix - inverseModInt(modInt(n, radix), radix);\n s7[kn] = 1;\n multMod_(x, s7, n); // x = x * 2**(kn*bp) mod n\n\n if (s3.length != x.length) s3 = dup(x);else copy_(s3, x); //$off\n\n for (k1 = y.length - 1; k1 > 0 & !y[k1]; k1--) {\n ;\n } //k1=first nonzero element of y\n\n\n if (y[k1] == 0) {\n //anything to the 0th power is 1\n copyInt_(x, 1);\n return;\n }\n\n for (k2 = 1 << bpe - 1; k2 && !(y[k1] & k2); k2 >>= 1) {\n ;\n } //k2=position of first 1 bit in y[k1]\n\n\n for (;;) {\n if (!(k2 >>= 1)) {\n //look at next bit of y\n k1--;\n\n if (k1 < 0) {\n mont_(x, one, n, np);\n return;\n }\n\n k2 = 1 << bpe - 1;\n }\n\n mont_(x, x, n, np);\n if (k2 & y[k1]) //if next bit is a 1\n mont_(x, s3, n, np);\n }\n}\n/**\n * do x=x*y*Ri mod n for bigInts x,y,n,\n * where Ri = 2**(-kn*bpe) mod n, and kn is the\n * number of elements in the n array, not\n * counting leading zeros.\n *\n * x array must have at least as many elemnts as the n array\n * It's OK if x and y are the same variable.\n *\n * must have:\n * * x,y < n\n * * n is odd\n * * np = -(n^(-1)) mod radix\n *\n * @export\n * @param {number[]} x\n * @param {number[]} y\n * @param {number[]} n\n * @param {number} np\n * @return {void}\n */\n\nexport function mont_(x, y, n, np) {\n var i, j, c, ui, t, ks;\n var kn = n.length;\n var ky = y.length;\n if (sa.length != kn) sa = new Array(kn);\n copyInt_(sa, 0);\n\n for (; kn > 0 && n[kn - 1] == 0; kn--) {\n ;\n } //ignore leading zeros of n\n\n\n for (; ky > 0 && y[ky - 1] == 0; ky--) {\n ;\n } //ignore leading zeros of y\n\n\n ks = sa.length - 1; //sa will never have more than this many nonzero elements.\n //the following loop consumes 95% of the runtime for randTruePrime_() and powMod_() for large numbers\n\n for (i = 0; i < kn; i++) {\n t = sa[0] + x[i] * y[0];\n ui = (t & mask) * np & mask; //the inner \"& mask\" was needed on Safari (but not MSIE) at one time\n\n c = t + ui * n[0] >> bpe;\n t = x[i]; //do sa=(sa+x[i]*y+ui*n)/b where b=2**bpe. Loop is unrolled 5-fold for speed\n\n j = 1;\n\n for (; j < ky - 4;) {\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n }\n\n for (; j < ky;) {\n c += sa[j] + ui * n[j] + t * y[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n }\n\n for (; j < kn - 4;) {\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n }\n\n for (; j < kn;) {\n c += sa[j] + ui * n[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n }\n\n for (; j < ks;) {\n c += sa[j];\n sa[j - 1] = c & mask;\n c >>= bpe;\n j++;\n }\n\n sa[j - 1] = c & mask;\n }\n\n if (!greater(n, sa)) sub_(sa, n);\n copy_(x, sa);\n}\n//# sourceMappingURL=index.js.map" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "index", "request": "./src/index.ts", "reasons": [] } ] }, { "id": 4, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendor) (name: npm.lottie-web)", "size": 202723, "names": [ "npm.lottie-web" ], "files": [ "npm.lottie-web.chunk.js" ], "hash": "9fc983abe11afca0cb08", "siblings": [ 0, 1, 2, 3, 5, 7 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 81, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/lottie-web/build/player/lottie_canvas.min.js", "name": "./node_modules/lottie-web/build/player/lottie_canvas.min.js", "index": 75, "index2": 63, "size": 202723, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 4 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/lottieLoader.ts", "issuerId": 20, "issuerName": "./src/lib/lottieLoader.ts", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 40, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageSignIn.ts", "name": "./src/components/pageSignIn.ts", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 77, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/components/pageAuthCode.ts", "name": "./src/components/pageAuthCode.ts", "profile": { "factory": 392, "building": 505, "dependencies": 2 } }, { "id": 20, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/lottieLoader.ts", "name": "./src/lib/lottieLoader.ts", "profile": { "factory": 278, "building": 994, "dependencies": 0 } } ], "profile": { "factory": 1135, "building": 629 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 20, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/lottieLoader.ts", "module": "./src/lib/lottieLoader.ts", "moduleName": "./src/lib/lottieLoader.ts", "type": "cjs require", "userRequest": "lottie-web/build/player/lottie_canvas.min.js", "loc": "17:47-102" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 4, "source": "(typeof navigator !== \"undefined\") && (function(root, factory) {\n if (typeof define === \"function\" && define.amd) {\n define(function() {\n return factory(root);\n });\n } else if (typeof module === \"object\" && module.exports) {\n module.exports = factory(root);\n } else {\n root.lottie = factory(root);\n root.bodymovin = root.lottie;\n }\n}((window || {}), function(window) {\n\t\"use strict\";var svgNS=\"http://www.w3.org/2000/svg\",locationHref=\"\",initialDefaultFrame=-999999,subframeEnabled=!0,expressionsPlugin,isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cachedColors={},bm_rounder=Math.round,bm_rnd,bm_pow=Math.pow,bm_sqrt=Math.sqrt,bm_abs=Math.abs,bm_floor=Math.floor,bm_max=Math.max,bm_min=Math.min,blitter=10,BMMath={};function ProjectInterface(){return{}}!function(){var t,e=[\"abs\",\"acos\",\"acosh\",\"asin\",\"asinh\",\"atan\",\"atanh\",\"atan2\",\"ceil\",\"cbrt\",\"expm1\",\"clz32\",\"cos\",\"cosh\",\"exp\",\"floor\",\"fround\",\"hypot\",\"imul\",\"log\",\"log1p\",\"log2\",\"log10\",\"max\",\"min\",\"pow\",\"random\",\"round\",\"sign\",\"sin\",\"sinh\",\"sqrt\",\"tan\",\"tanh\",\"trunc\",\"E\",\"LN10\",\"LN2\",\"LOG10E\",\"LOG2E\",\"PI\",\"SQRT1_2\",\"SQRT2\"],r=e.length;for(t=0;t>>=1;return(t+r)/e};return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,b(x(a.S),o),(e.pass||r||function(t,e,r,i){return i&&(i.S&&P(i,a),t.state=function(){return P(a,{})}),r?(h[c]=t,e):t})(n,s,\"global\"in e?e.global:this==h,e.state)},b(h.random(),o)}([],BMMath);var BezierFactory=function(){var t={getBezierEasing:function(t,e,r,i,s){var a=s||(\"bez_\"+t+\"_\"+e+\"_\"+r+\"_\"+i).replace(/\\./g,\"p\");if(o[a])return o[a];var n=new h([t,e,r,i]);return o[a]=n}},o={};var p=11,l=1/(p-1),e=\"function\"==typeof Float32Array;function i(t,e){return 1-3*e+3*t}function s(t,e){return 3*e-6*t}function a(t){return 3*t}function m(t,e,r){return((i(e,r)*t+s(e,r))*t+a(e))*t}function f(t,e,r){return 3*i(e,r)*t*t+2*s(e,r)*t+a(e)}function h(t){this._p=t,this._mSampleValues=e?new Float32Array(p):new Array(p),this._precomputed=!1,this.get=this.get.bind(this)}return h.prototype={get:function(t){var e=this._p[0],r=this._p[1],i=this._p[2],s=this._p[3];return this._precomputed||this._precompute(),e===r&&i===s?t:0===t?0:1===t?1:m(this._getTForX(t),r,s)},_precompute:function(){var t=this._p[0],e=this._p[1],r=this._p[2],i=this._p[3];this._precomputed=!0,t===e&&r===i||this._calcSampleValues()},_calcSampleValues:function(){for(var t=this._p[0],e=this._p[2],r=0;rn?-1:1,p=!0;p;)if(i[a]<=n&&i[a+1]>n?(o=(n-i[a])/(i[a+1]-i[a]),p=!1):a+=h,a<0||s-1<=a){if(a===s-1)return r[a];p=!1}return r[a]+(r[a+1]-r[a])*o}var M=createTypedArray(\"float32\",8);return{getSegmentsLength:function(t){var e,r=segments_length_pool.newElement(),i=t.c,s=t.v,a=t.o,n=t.i,o=t._length,h=r.lengths,p=0;for(e=0;er[0]||!(r[0]>t[0])&&(t[1]>r[1]||!(r[1]>t[1])&&(t[2]>r[2]||!(r[2]>t[2])&&void 0))}var h,r=function(){var i=[4,4,14];function s(t){var e,r,i,s=t.length;for(e=0;e=a.t-i){s.h&&(s=a),f=0;break}if(a.t-i>t){f=c;break}c=r&&r<=t||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var i=this.interpolateValue(t,this._caching);this.pv=i}return this._caching.lastFrame=t,this.pv}function d(t){var e;if(\"unidimensional\"===this.propType)e=t*this.mult,1e-5=this.p.keyframes[this.p.keyframes.length-1].t?(e=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(e=this.p.pv,this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){e=[],r=[];var s=this.px,a=this.py;s._caching.lastFrame+s.offsetTime<=s.keyframes[0].t?(e[0]=s.getValueAtTime((s.keyframes[0].t+.01)/i,0),e[1]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),r[0]=s.getValueAtTime(s.keyframes[0].t/i,0),r[1]=a.getValueAtTime(a.keyframes[0].t/i,0)):s._caching.lastFrame+s.offsetTime>=s.keyframes[s.keyframes.length-1].t?(e[0]=s.getValueAtTime(s.keyframes[s.keyframes.length-1].t/i,0),e[1]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),r[0]=s.getValueAtTime((s.keyframes[s.keyframes.length-1].t-.01)/i,0),r[1]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0)):(e=[s.pv,a.pv],r[0]=s.getValueAtTime((s._caching.lastFrame+s.offsetTime-.01)/i,s.offsetTime),r[1]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime))}else e=r=n;this.v.rotate(-Math.atan2(e[1]-r[1],e[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(!this.a.k&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}if(this.r){if(this.r.effectsSequence.length)return;this.pre.rotate(-this.r.v),this.appliedTransformations=4}else this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],i),i.prototype.addDynamicProperty=function(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0},i.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(t,e,r){return new i(t,e,r)}}}();function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(t,e){this.c=t,this.setLength(e);for(var r=0;r=this._maxLength&&this.doubleArrayLength(),r){case\"v\":a=this.v;break;case\"i\":a=this.i;break;case\"o\":a=this.o}(!a[i]||a[i]&&!s)&&(a[i]=point_pool.newElement()),a[i][0]=t,a[i][1]=e},ShapePath.prototype.setTripleAt=function(t,e,r,i,s,a,n,o){this.setXYAt(t,e,\"v\",n,o),this.setXYAt(r,i,\"o\",n,o),this.setXYAt(s,a,\"i\",n,o)},ShapePath.prototype.reverse=function(){var t=new ShapePath;t.setPathData(this.c,this._length);var e=this.v,r=this.o,i=this.i,s=0;this.c&&(t.setTripleAt(e[0][0],e[0][1],i[0][0],i[0][1],r[0][0],r[0][1],0,!1),s=1);var a,n=this._length-1,o=this._length;for(a=s;a=c[c.length-1].t-this.offsetTime)i=c[c.length-1].s?c[c.length-1].s[0]:c[c.length-2].e[0],a=!0;else{for(var d,u,y=f,g=c.length-1,v=!0;v&&(d=c[y],!((u=c[y+1]).t-this.offsetTime>t));)y=u.t-this.offsetTime)l=1;else if(ti+r);else l=o.s*s<=i?0:(o.s*s-i)/r,m=o.e*s>=i+r?1:(o.e*s-i)/r,h.push([l,m])}return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,r=t.length;for(e=0;ee.e){r.c=!1;break}e.s<=d&&e.e>=d+n.addedLength?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[s],f[i].v[s],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[s],f[i].o[s-1],f[i].i[s],(e.s-d)/n.addedLength,(e.e-d)/n.addedLength,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1),d+=n.addedLength,o+=1}if(f[i].c&&h.length){if(n=h[s-1],d<=e.e){var g=h[s-1].addedLength;e.s<=d&&e.e>=d+g?(this.addSegment(f[i].v[s-1],f[i].o[s-1],f[i].i[0],f[i].v[0],r,o,y),y=!1):(p=bez.getNewSegment(f[i].v[s-1],f[i].v[0],f[i].o[s-1],f[i].i[0],(e.s-d)/g,(e.e-d)/g,h[s-1]),this.addSegmentFromArray(p,r,o,y),y=!1,r.c=!1)}else r.c=!1;d+=n.addedLength,o+=1}if(r._length&&(r.setXYAt(r.v[l][0],r.v[l][1],\"i\",l),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],\"o\",r._length-1)),d>e.e)break;i=d.length&&(m=0,d=u[f+=1]?u[f].points:b.v.c?u[f=m=0].points:(p-=h.partialLength,null)),d&&(c=h,y=(h=d[m]).partialLength));O=A[s].an/2-A[s].add,S.translate(-O,0,0)}else O=A[s].an/2-A[s].add,S.translate(-O,0,0),S.translate(-x[0]*A[s].an/200,-x[1]*V/100,0);for(A[s].l/2,I=0;Ie));)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,r=FontManager.getCombinedCharacterCodes(),i=[],s=0,a=t.length;sthis.minimumFontSize&&M=u(o)&&(n=c(0,d(t-o<0?d(h,1)-(o-t):h-t,1))),a(n));return n*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/e,i=this.s.v/e+r,s=this.e.v/e+r;if(st-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 13:return this.createCamera(t)}return this.createNull(t)},BaseRenderer.prototype.createCamera=function(){throw new Error(\"You're using a 3d camera. Try the html renderer.\")},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;tt?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;tthis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,r,i=this.animationData.layers,s=i.length,a=t.layers,n=a.length;for(r=0;rthis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger(\"enterFrame\"),this.renderFrame()},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded)try{this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){t&&this.name!=t||!0===this.isPaused&&(this.isPaused=!1,this._idle&&(this._idle=!1,this.trigger(\"_active\")))},AnimationItem.prototype.pause=function(t){t&&this.name!=t||!1===this.isPaused&&(this.isPaused=!0,this._idle=!0,this.trigger(\"_idle\"))},AnimationItem.prototype.togglePause=function(t){t&&this.name!=t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!=t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.goToAndStop=function(t,e,r){r&&this.name!=r||(e?this.setCurrentRawFrameValue(t):this.setCurrentRawFrameValue(t*this.frameModifier),this.pause())},AnimationItem.prototype.goToAndPlay=function(t,e,r){this.goToAndStop(t,e,r),this.play()},AnimationItem.prototype.advanceTime=function(t){if(!0!==this.isPaused&&!1!==this.isLoaded){var e=this.currentRawFrame+t*this.frameModifier,r=!1;e>=this.totalFrames-1&&0=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger(\"loopComplete\"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(r=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,e=0):(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger(\"loopComplete\"):this._completedLoop=!0)):this.setCurrentRawFrameValue(e),r&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger(\"complete\"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.timeCompleted=this.totalFrames=t[1]-t[0],this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger(\"segmentStart\")},AnimationItem.prototype.setSegment=function(t,e){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(r=e-t)),this.firstFrame=t,this.timeCompleted=this.totalFrames=e-t,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),\"object\"==typeof t[0]){var r,i=t.length;for(r=0;rdata.k[e].t&&tdata.k[e+1].t-t?(r=e+2,data.k[e+1].t):(r=e+1,data.k[e].t);break}}-1===r&&(r=e+1,i=data.k[e].t)}else i=r=0;var a={};return a.index=r,a.time=i/elem.comp.globalData.frameRate,a}function key(t){var e,r,i;if(!data.k.length||\"number\"==typeof data.k[0])throw new Error(\"The property has no keyframe at index \"+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var s=data.k[t].hasOwnProperty(\"s\")?data.k[t].s:data.k[t-1].e;for(i=s.length,r=0;rp.length-1)&&(e=p.length-1),i=l-(s=p[p.length-1-e].t)),\"pingpong\"===t){if(Math.floor((h-s)/i)%2!=0)return this.getValueAtTime((i-(h-s)%i+s)/this.comp.globalData.frameRate,0)}else{if(\"offset\"===t){var m=this.getValueAtTime(s/this.comp.globalData.frameRate,0),f=this.getValueAtTime(l/this.comp.globalData.frameRate,0),c=this.getValueAtTime(((h-s)%i+s)/this.comp.globalData.frameRate,0),d=Math.floor((h-s)/i);if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;ap.length-1)&&(e=p.length-1),i=(s=p[e].t)-l),\"pingpong\"===t){if(Math.floor((l-h)/i)%2==0)return this.getValueAtTime(((l-h)%i+l)/this.comp.globalData.frameRate,0)}else{if(\"offset\"===t){var m=this.getValueAtTime(l/this.comp.globalData.frameRate,0),f=this.getValueAtTime(s/this.comp.globalData.frameRate,0),c=this.getValueAtTime((i-(l-h)%i+l)/this.comp.globalData.frameRate,0),d=Math.floor((l-h)/i)+1;if(this.pv.length){for(n=(o=new Array(m.length)).length,a=0;an){var l=o,m=r.c&&o===h-1?0:o+1,f=(n-p)/a[o].addedLength;i=bez.getPointInSegment(r.v[l],r.v[m],r.o[l],r.i[m],f,a[o]);break}p+=a[o].addedLength,o+=1}return i||(i=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),i},vectorOnPath:function(t,e,r){t=1==t?this.v.c?0:.999:t;var i=this.pointOnPath(t,e),s=this.pointOnPath(t+.001,e),a=s[0]-i[0],n=s[1]-i[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:\"tangent\"===r?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,\"tangent\")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,\"normal\")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([r],t),extendPrototype([r],e),e.prototype.getValueAtTime=function(t){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shape_pool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),t*=this.elem.globalData.frameRate,(t-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime\r\nvar SymbolPolyfill = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ?\r\n Symbol :\r\n function (description) { return \"Symbol(\" + description + \")\"; };\n\n/// \r\nfunction noop() {\r\n // do nothing\r\n}\n\n/// \r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN#Polyfill\r\nvar NumberIsNaN = Number.isNaN || function (x) {\r\n // eslint-disable-next-line no-self-compare\r\n return x !== x;\r\n};\n\nvar rethrowAssertionErrorRejection = noop;\n\nfunction typeIsObject(x) {\r\n return (typeof x === 'object' && x !== null) || typeof x === 'function';\r\n}\r\nfunction createArrayFromList(elements) {\r\n // We use arrays to represent lists, so this is basically a no-op.\r\n // Do a slice though just in case we happen to depend on the unique-ness.\r\n return elements.slice();\r\n}\r\nfunction ArrayBufferCopy(dest, destOffset, src, srcOffset, n) {\r\n new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);\r\n}\r\nfunction IsFiniteNonNegativeNumber(v) {\r\n if (IsNonNegativeNumber(v) === false) {\r\n return false;\r\n }\r\n if (v === Infinity) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction IsNonNegativeNumber(v) {\r\n if (typeof v !== 'number') {\r\n return false;\r\n }\r\n if (NumberIsNaN(v)) {\r\n return false;\r\n }\r\n if (v < 0) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction Call(F, V, args) {\r\n if (typeof F !== 'function') {\r\n throw new TypeError('Argument is not a function');\r\n }\r\n return Function.prototype.apply.call(F, V, args);\r\n}\r\nfunction CreateAlgorithmFromUnderlyingMethod(underlyingObject, methodName, algoArgCount, extraArgs) {\r\n var method = underlyingObject[methodName];\r\n if (method !== undefined) {\r\n if (typeof method !== 'function') {\r\n throw new TypeError(method + \" is not a method\");\r\n }\r\n switch (algoArgCount) {\r\n case 0: {\r\n return function () {\r\n return PromiseCall(method, underlyingObject, extraArgs);\r\n };\r\n }\r\n case 1: {\r\n return function (arg) {\r\n var fullArgs = [arg].concat(extraArgs);\r\n return PromiseCall(method, underlyingObject, fullArgs);\r\n };\r\n }\r\n }\r\n }\r\n return function () { return promiseResolvedWith(undefined); };\r\n}\r\nfunction InvokeOrNoop(O, P, args) {\r\n var method = O[P];\r\n if (method === undefined) {\r\n return undefined;\r\n }\r\n return Call(method, O, args);\r\n}\r\nfunction PromiseCall(F, V, args) {\r\n try {\r\n return promiseResolvedWith(Call(F, V, args));\r\n }\r\n catch (value) {\r\n return promiseRejectedWith(value);\r\n }\r\n}\r\n// Not implemented correctly\r\nfunction TransferArrayBuffer(O) {\r\n return O;\r\n}\r\n// Not implemented correctly\r\nfunction IsDetachedBuffer(O) {\r\n return false;\r\n}\r\nfunction ValidateAndNormalizeHighWaterMark(highWaterMark) {\r\n highWaterMark = Number(highWaterMark);\r\n if (NumberIsNaN(highWaterMark) || highWaterMark < 0) {\r\n throw new RangeError('highWaterMark property of a queuing strategy must be non-negative and non-NaN');\r\n }\r\n return highWaterMark;\r\n}\r\nfunction MakeSizeAlgorithmFromSizeFunction(size) {\r\n if (size === undefined) {\r\n return function () { return 1; };\r\n }\r\n if (typeof size !== 'function') {\r\n throw new TypeError('size property of a queuing strategy must be a function');\r\n }\r\n return function (chunk) { return size(chunk); };\r\n}\r\nvar originalPromise = Promise;\r\nvar originalPromiseThen = Promise.prototype.then;\r\nvar originalPromiseResolve = Promise.resolve.bind(originalPromise);\r\nvar originalPromiseReject = Promise.reject.bind(originalPromise);\r\nfunction newPromise(executor) {\r\n return new originalPromise(executor);\r\n}\r\nfunction promiseResolvedWith(value) {\r\n return originalPromiseResolve(value);\r\n}\r\nfunction promiseRejectedWith(reason) {\r\n return originalPromiseReject(reason);\r\n}\r\nfunction PerformPromiseThen(promise, onFulfilled, onRejected) {\r\n // There doesn't appear to be any way to correctly emulate the behaviour from JavaScript, so this is just an\r\n // approximation.\r\n return originalPromiseThen.call(promise, onFulfilled, onRejected);\r\n}\r\nfunction uponPromise(promise, onFulfilled, onRejected) {\r\n PerformPromiseThen(PerformPromiseThen(promise, onFulfilled, onRejected), undefined, rethrowAssertionErrorRejection);\r\n}\r\nfunction uponFulfillment(promise, onFulfilled) {\r\n uponPromise(promise, onFulfilled);\r\n}\r\nfunction uponRejection(promise, onRejected) {\r\n uponPromise(promise, undefined, onRejected);\r\n}\r\nfunction transformPromiseWith(promise, fulfillmentHandler, rejectionHandler) {\r\n return PerformPromiseThen(promise, fulfillmentHandler, rejectionHandler);\r\n}\r\nfunction setPromiseIsHandledToTrue(promise) {\r\n PerformPromiseThen(promise, undefined, rethrowAssertionErrorRejection);\r\n}\n\n// Original from Chromium\r\n// https://chromium.googlesource.com/chromium/src/+/0aee4434a4dba42a42abaea9bfbc0cd196a63bc1/third_party/blink/renderer/core/streams/SimpleQueue.js\r\nvar QUEUE_MAX_ARRAY_SIZE = 16384;\r\n/**\r\n * Simple queue structure.\r\n *\r\n * Avoids scalability issues with using a packed array directly by using\r\n * multiple arrays in a linked list and keeping the array size bounded.\r\n */\r\nvar SimpleQueue = /** @class */ (function () {\r\n function SimpleQueue() {\r\n this._cursor = 0;\r\n this._size = 0;\r\n // _front and _back are always defined.\r\n this._front = {\r\n _elements: [],\r\n _next: undefined\r\n };\r\n this._back = this._front;\r\n // The cursor is used to avoid calling Array.shift().\r\n // It contains the index of the front element of the array inside the\r\n // front-most node. It is always in the range [0, QUEUE_MAX_ARRAY_SIZE).\r\n this._cursor = 0;\r\n // When there is only one node, size === elements.length - cursor.\r\n this._size = 0;\r\n }\r\n Object.defineProperty(SimpleQueue.prototype, \"length\", {\r\n get: function () {\r\n return this._size;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n // For exception safety, this method is structured in order:\r\n // 1. Read state\r\n // 2. Calculate required state mutations\r\n // 3. Perform state mutations\r\n SimpleQueue.prototype.push = function (element) {\r\n var oldBack = this._back;\r\n var newBack = oldBack;\r\n if (oldBack._elements.length === QUEUE_MAX_ARRAY_SIZE - 1) {\r\n newBack = {\r\n _elements: [],\r\n _next: undefined\r\n };\r\n }\r\n // push() is the mutation most likely to throw an exception, so it\r\n // goes first.\r\n oldBack._elements.push(element);\r\n if (newBack !== oldBack) {\r\n this._back = newBack;\r\n oldBack._next = newBack;\r\n }\r\n ++this._size;\r\n };\r\n // Like push(), shift() follows the read -> calculate -> mutate pattern for\r\n // exception safety.\r\n SimpleQueue.prototype.shift = function () { // must not be called on an empty queue\r\n var oldFront = this._front;\r\n var newFront = oldFront;\r\n var oldCursor = this._cursor;\r\n var newCursor = oldCursor + 1;\r\n var elements = oldFront._elements;\r\n var element = elements[oldCursor];\r\n if (newCursor === QUEUE_MAX_ARRAY_SIZE) {\r\n newFront = oldFront._next;\r\n newCursor = 0;\r\n }\r\n // No mutations before this point.\r\n --this._size;\r\n this._cursor = newCursor;\r\n if (oldFront !== newFront) {\r\n this._front = newFront;\r\n }\r\n // Permit shifted element to be garbage collected.\r\n elements[oldCursor] = undefined;\r\n return element;\r\n };\r\n // The tricky thing about forEach() is that it can be called\r\n // re-entrantly. The queue may be mutated inside the callback. It is easy to\r\n // see that push() within the callback has no negative effects since the end\r\n // of the queue is checked for on every iteration. If shift() is called\r\n // repeatedly within the callback then the next iteration may return an\r\n // element that has been removed. In this case the callback will be called\r\n // with undefined values until we either \"catch up\" with elements that still\r\n // exist or reach the back of the queue.\r\n SimpleQueue.prototype.forEach = function (callback) {\r\n var i = this._cursor;\r\n var node = this._front;\r\n var elements = node._elements;\r\n while (i !== elements.length || node._next !== undefined) {\r\n if (i === elements.length) {\r\n node = node._next;\r\n elements = node._elements;\r\n i = 0;\r\n if (elements.length === 0) {\r\n break;\r\n }\r\n }\r\n callback(elements[i]);\r\n ++i;\r\n }\r\n };\r\n // Return the element that would be returned if shift() was called now,\r\n // without modifying the queue.\r\n SimpleQueue.prototype.peek = function () { // must not be called on an empty queue\r\n var front = this._front;\r\n var cursor = this._cursor;\r\n return front._elements[cursor];\r\n };\r\n return SimpleQueue;\r\n}());\n\nfunction ReadableStreamCreateReadResult(value, done, forAuthorCode) {\r\n var prototype = null;\r\n if (forAuthorCode === true) {\r\n prototype = Object.prototype;\r\n }\r\n var obj = Object.create(prototype);\r\n obj.value = value;\r\n obj.done = done;\r\n return obj;\r\n}\r\nfunction ReadableStreamReaderGenericInitialize(reader, stream) {\r\n reader._forAuthorCode = true;\r\n reader._ownerReadableStream = stream;\r\n stream._reader = reader;\r\n if (stream._state === 'readable') {\r\n defaultReaderClosedPromiseInitialize(reader);\r\n }\r\n else if (stream._state === 'closed') {\r\n defaultReaderClosedPromiseInitializeAsResolved(reader);\r\n }\r\n else {\r\n defaultReaderClosedPromiseInitializeAsRejected(reader, stream._storedError);\r\n }\r\n}\r\n// A client of ReadableStreamDefaultReader and ReadableStreamBYOBReader may use these functions directly to bypass state\r\n// check.\r\nfunction ReadableStreamReaderGenericCancel(reader, reason) {\r\n var stream = reader._ownerReadableStream;\r\n return ReadableStreamCancel(stream, reason);\r\n}\r\nfunction ReadableStreamReaderGenericRelease(reader) {\r\n if (reader._ownerReadableStream._state === 'readable') {\r\n defaultReaderClosedPromiseReject(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\\'s closedness'));\r\n }\r\n else {\r\n defaultReaderClosedPromiseResetToRejected(reader, new TypeError('Reader was released and can no longer be used to monitor the stream\\'s closedness'));\r\n }\r\n reader._ownerReadableStream._reader = undefined;\r\n reader._ownerReadableStream = undefined;\r\n}\r\n// Helper functions for the readers.\r\nfunction readerLockException(name) {\r\n return new TypeError('Cannot ' + name + ' a stream using a released reader');\r\n}\r\n// Helper functions for the ReadableStreamDefaultReader.\r\nfunction defaultReaderClosedPromiseInitialize(reader) {\r\n reader._closedPromise = newPromise(function (resolve, reject) {\r\n reader._closedPromise_resolve = resolve;\r\n reader._closedPromise_reject = reject;\r\n });\r\n}\r\nfunction defaultReaderClosedPromiseInitializeAsRejected(reader, reason) {\r\n defaultReaderClosedPromiseInitialize(reader);\r\n defaultReaderClosedPromiseReject(reader, reason);\r\n}\r\nfunction defaultReaderClosedPromiseInitializeAsResolved(reader) {\r\n defaultReaderClosedPromiseInitialize(reader);\r\n defaultReaderClosedPromiseResolve(reader);\r\n}\r\nfunction defaultReaderClosedPromiseReject(reader, reason) {\r\n setPromiseIsHandledToTrue(reader._closedPromise);\r\n reader._closedPromise_reject(reason);\r\n reader._closedPromise_resolve = undefined;\r\n reader._closedPromise_reject = undefined;\r\n}\r\nfunction defaultReaderClosedPromiseResetToRejected(reader, reason) {\r\n defaultReaderClosedPromiseInitializeAsRejected(reader, reason);\r\n}\r\nfunction defaultReaderClosedPromiseResolve(reader) {\r\n reader._closedPromise_resolve(undefined);\r\n reader._closedPromise_resolve = undefined;\r\n reader._closedPromise_reject = undefined;\r\n}\n\nvar CancelSteps = SymbolPolyfill('[[CancelSteps]]');\r\nvar PullSteps = SymbolPolyfill('[[PullSteps]]');\n\n// Abstract operations for the ReadableStream.\r\nfunction AcquireReadableStreamDefaultReader(stream, forAuthorCode) {\r\n if (forAuthorCode === void 0) { forAuthorCode = false; }\r\n var reader = new ReadableStreamDefaultReader(stream);\r\n reader._forAuthorCode = forAuthorCode;\r\n return reader;\r\n}\r\n// ReadableStream API exposed for controllers.\r\nfunction ReadableStreamAddReadRequest(stream) {\r\n var promise = newPromise(function (resolve, reject) {\r\n var readRequest = {\r\n _resolve: resolve,\r\n _reject: reject\r\n };\r\n stream._reader._readRequests.push(readRequest);\r\n });\r\n return promise;\r\n}\r\nfunction ReadableStreamFulfillReadRequest(stream, chunk, done) {\r\n var reader = stream._reader;\r\n var readRequest = reader._readRequests.shift();\r\n readRequest._resolve(ReadableStreamCreateReadResult(chunk, done, reader._forAuthorCode));\r\n}\r\nfunction ReadableStreamGetNumReadRequests(stream) {\r\n return stream._reader._readRequests.length;\r\n}\r\nfunction ReadableStreamHasDefaultReader(stream) {\r\n var reader = stream._reader;\r\n if (reader === undefined) {\r\n return false;\r\n }\r\n if (!IsReadableStreamDefaultReader(reader)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar ReadableStreamDefaultReader = /** @class */ (function () {\r\n function ReadableStreamDefaultReader(stream) {\r\n if (IsReadableStream(stream) === false) {\r\n throw new TypeError('ReadableStreamDefaultReader can only be constructed with a ReadableStream instance');\r\n }\r\n if (IsReadableStreamLocked(stream) === true) {\r\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\r\n }\r\n ReadableStreamReaderGenericInitialize(this, stream);\r\n this._readRequests = new SimpleQueue();\r\n }\r\n Object.defineProperty(ReadableStreamDefaultReader.prototype, \"closed\", {\r\n get: function () {\r\n if (!IsReadableStreamDefaultReader(this)) {\r\n return promiseRejectedWith(defaultReaderBrandCheckException('closed'));\r\n }\r\n return this._closedPromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableStreamDefaultReader.prototype.cancel = function (reason) {\r\n if (!IsReadableStreamDefaultReader(this)) {\r\n return promiseRejectedWith(defaultReaderBrandCheckException('cancel'));\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('cancel'));\r\n }\r\n return ReadableStreamReaderGenericCancel(this, reason);\r\n };\r\n ReadableStreamDefaultReader.prototype.read = function () {\r\n if (!IsReadableStreamDefaultReader(this)) {\r\n return promiseRejectedWith(defaultReaderBrandCheckException('read'));\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('read from'));\r\n }\r\n return ReadableStreamDefaultReaderRead(this);\r\n };\r\n ReadableStreamDefaultReader.prototype.releaseLock = function () {\r\n if (!IsReadableStreamDefaultReader(this)) {\r\n throw defaultReaderBrandCheckException('releaseLock');\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return;\r\n }\r\n if (this._readRequests.length > 0) {\r\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\r\n }\r\n ReadableStreamReaderGenericRelease(this);\r\n };\r\n return ReadableStreamDefaultReader;\r\n}());\r\n// Abstract operations for the readers.\r\nfunction IsReadableStreamDefaultReader(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_readRequests')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction ReadableStreamDefaultReaderRead(reader) {\r\n var stream = reader._ownerReadableStream;\r\n stream._disturbed = true;\r\n if (stream._state === 'closed') {\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(undefined, true, reader._forAuthorCode));\r\n }\r\n if (stream._state === 'errored') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n return stream._readableStreamController[PullSteps]();\r\n}\r\n// Helper functions for the ReadableStreamDefaultReader.\r\nfunction defaultReaderBrandCheckException(name) {\r\n return new TypeError(\"ReadableStreamDefaultReader.prototype.\" + name + \" can only be used on a ReadableStreamDefaultReader\");\r\n}\n\n/// \r\nvar _a;\r\nvar AsyncIteratorPrototype;\r\nif (typeof SymbolPolyfill.asyncIterator === 'symbol') {\r\n // We're running inside a ES2018+ environment, but we're compiling to an older syntax.\r\n // We cannot access %AsyncIteratorPrototype% without non-ES2018 syntax, but we can re-create it.\r\n AsyncIteratorPrototype = (_a = {},\r\n // 25.1.3.1 %AsyncIteratorPrototype% [ @@asyncIterator ] ( )\r\n // https://tc39.github.io/ecma262/#sec-asynciteratorprototype-asynciterator\r\n _a[SymbolPolyfill.asyncIterator] = function () {\r\n return this;\r\n },\r\n _a);\r\n Object.defineProperty(AsyncIteratorPrototype, SymbolPolyfill.asyncIterator, { enumerable: false });\r\n}\n\n/// \r\nvar ReadableStreamAsyncIteratorPrototype = {\r\n next: function () {\r\n if (IsReadableStreamAsyncIterator(this) === false) {\r\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\r\n }\r\n var reader = this._asyncIteratorReader;\r\n if (reader._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('iterate'));\r\n }\r\n return transformPromiseWith(ReadableStreamDefaultReaderRead(reader), function (result) {\r\n var done = result.done;\r\n if (done) {\r\n ReadableStreamReaderGenericRelease(reader);\r\n }\r\n var value = result.value;\r\n return ReadableStreamCreateReadResult(value, done, true);\r\n });\r\n },\r\n return: function (value) {\r\n if (IsReadableStreamAsyncIterator(this) === false) {\r\n return promiseRejectedWith(streamAsyncIteratorBrandCheckException('next'));\r\n }\r\n var reader = this._asyncIteratorReader;\r\n if (reader._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('finish iterating'));\r\n }\r\n if (reader._readRequests.length > 0) {\r\n return promiseRejectedWith(new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled'));\r\n }\r\n if (this._preventCancel === false) {\r\n var result = ReadableStreamReaderGenericCancel(reader, value);\r\n ReadableStreamReaderGenericRelease(reader);\r\n return transformPromiseWith(result, function () { return ReadableStreamCreateReadResult(value, true, true); });\r\n }\r\n ReadableStreamReaderGenericRelease(reader);\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(value, true, true));\r\n }\r\n};\r\nif (AsyncIteratorPrototype !== undefined) {\r\n Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);\r\n}\r\nObject.defineProperty(ReadableStreamAsyncIteratorPrototype, 'next', { enumerable: false });\r\nObject.defineProperty(ReadableStreamAsyncIteratorPrototype, 'return', { enumerable: false });\r\n// Abstract operations for the ReadableStream.\r\nfunction AcquireReadableStreamAsyncIterator(stream, preventCancel) {\r\n if (preventCancel === void 0) { preventCancel = false; }\r\n var reader = AcquireReadableStreamDefaultReader(stream);\r\n var iterator = Object.create(ReadableStreamAsyncIteratorPrototype);\r\n iterator._asyncIteratorReader = reader;\r\n iterator._preventCancel = Boolean(preventCancel);\r\n return iterator;\r\n}\r\nfunction IsReadableStreamAsyncIterator(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_asyncIteratorReader')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n// Helper functions for the ReadableStream.\r\nfunction streamAsyncIteratorBrandCheckException(name) {\r\n return new TypeError(\"ReadableStreamAsyncIterator.\" + name + \" can only be used on a ReadableSteamAsyncIterator\");\r\n}\n\nfunction DequeueValue(container) {\r\n var pair = container._queue.shift();\r\n container._queueTotalSize -= pair.size;\r\n if (container._queueTotalSize < 0) {\r\n container._queueTotalSize = 0;\r\n }\r\n return pair.value;\r\n}\r\nfunction EnqueueValueWithSize(container, value, size) {\r\n size = Number(size);\r\n if (!IsFiniteNonNegativeNumber(size)) {\r\n throw new RangeError('Size must be a finite, non-NaN, non-negative number.');\r\n }\r\n container._queue.push({ value: value, size: size });\r\n container._queueTotalSize += size;\r\n}\r\nfunction PeekQueueValue(container) {\r\n var pair = container._queue.peek();\r\n return pair.value;\r\n}\r\nfunction ResetQueue(container) {\r\n container._queue = new SimpleQueue();\r\n container._queueTotalSize = 0;\r\n}\n\nvar AbortSteps = SymbolPolyfill('[[AbortSteps]]');\r\nvar ErrorSteps = SymbolPolyfill('[[ErrorSteps]]');\r\nvar WritableStream = /** @class */ (function () {\r\n function WritableStream(underlyingSink, strategy) {\r\n if (underlyingSink === void 0) { underlyingSink = {}; }\r\n if (strategy === void 0) { strategy = {}; }\r\n InitializeWritableStream(this);\r\n var size = strategy.size;\r\n var highWaterMark = strategy.highWaterMark;\r\n var type = underlyingSink.type;\r\n if (type !== undefined) {\r\n throw new RangeError('Invalid type is specified');\r\n }\r\n var sizeAlgorithm = MakeSizeAlgorithmFromSizeFunction(size);\r\n if (highWaterMark === undefined) {\r\n highWaterMark = 1;\r\n }\r\n highWaterMark = ValidateAndNormalizeHighWaterMark(highWaterMark);\r\n SetUpWritableStreamDefaultControllerFromUnderlyingSink(this, underlyingSink, highWaterMark, sizeAlgorithm);\r\n }\r\n Object.defineProperty(WritableStream.prototype, \"locked\", {\r\n get: function () {\r\n if (IsWritableStream(this) === false) {\r\n throw streamBrandCheckException('locked');\r\n }\r\n return IsWritableStreamLocked(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n WritableStream.prototype.abort = function (reason) {\r\n if (IsWritableStream(this) === false) {\r\n return promiseRejectedWith(streamBrandCheckException('abort'));\r\n }\r\n if (IsWritableStreamLocked(this) === true) {\r\n return promiseRejectedWith(new TypeError('Cannot abort a stream that already has a writer'));\r\n }\r\n return WritableStreamAbort(this, reason);\r\n };\r\n WritableStream.prototype.getWriter = function () {\r\n if (IsWritableStream(this) === false) {\r\n throw streamBrandCheckException('getWriter');\r\n }\r\n return AcquireWritableStreamDefaultWriter(this);\r\n };\r\n return WritableStream;\r\n}());\r\n// Abstract operations for the WritableStream.\r\nfunction AcquireWritableStreamDefaultWriter(stream) {\r\n return new WritableStreamDefaultWriter(stream);\r\n}\r\n// Throws if and only if startAlgorithm throws.\r\nfunction CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\r\n if (highWaterMark === void 0) { highWaterMark = 1; }\r\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\r\n var stream = Object.create(WritableStream.prototype);\r\n InitializeWritableStream(stream);\r\n var controller = Object.create(WritableStreamDefaultController.prototype);\r\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\r\n return stream;\r\n}\r\nfunction InitializeWritableStream(stream) {\r\n stream._state = 'writable';\r\n // The error that will be reported by new method calls once the state becomes errored. Only set when [[state]] is\r\n // 'erroring' or 'errored'. May be set to an undefined value.\r\n stream._storedError = undefined;\r\n stream._writer = undefined;\r\n // Initialize to undefined first because the constructor of the controller checks this\r\n // variable to validate the caller.\r\n stream._writableStreamController = undefined;\r\n // This queue is placed here instead of the writer class in order to allow for passing a writer to the next data\r\n // producer without waiting for the queued writes to finish.\r\n stream._writeRequests = new SimpleQueue();\r\n // Write requests are removed from _writeRequests when write() is called on the underlying sink. This prevents\r\n // them from being erroneously rejected on error. If a write() call is in-flight, the request is stored here.\r\n stream._inFlightWriteRequest = undefined;\r\n // The promise that was returned from writer.close(). Stored here because it may be fulfilled after the writer\r\n // has been detached.\r\n stream._closeRequest = undefined;\r\n // Close request is removed from _closeRequest when close() is called on the underlying sink. This prevents it\r\n // from being erroneously rejected on error. If a close() call is in-flight, the request is stored here.\r\n stream._inFlightCloseRequest = undefined;\r\n // The promise that was returned from writer.abort(). This may also be fulfilled after the writer has detached.\r\n stream._pendingAbortRequest = undefined;\r\n // The backpressure signal set by the controller.\r\n stream._backpressure = false;\r\n}\r\nfunction IsWritableStream(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_writableStreamController')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction IsWritableStreamLocked(stream) {\r\n if (stream._writer === undefined) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction WritableStreamAbort(stream, reason) {\r\n var state = stream._state;\r\n if (state === 'closed' || state === 'errored') {\r\n return promiseResolvedWith(undefined);\r\n }\r\n if (stream._pendingAbortRequest !== undefined) {\r\n return stream._pendingAbortRequest._promise;\r\n }\r\n var wasAlreadyErroring = false;\r\n if (state === 'erroring') {\r\n wasAlreadyErroring = true;\r\n // reason will not be used, so don't keep a reference to it.\r\n reason = undefined;\r\n }\r\n var promise = newPromise(function (resolve, reject) {\r\n stream._pendingAbortRequest = {\r\n _promise: undefined,\r\n _resolve: resolve,\r\n _reject: reject,\r\n _reason: reason,\r\n _wasAlreadyErroring: wasAlreadyErroring\r\n };\r\n });\r\n stream._pendingAbortRequest._promise = promise;\r\n if (wasAlreadyErroring === false) {\r\n WritableStreamStartErroring(stream, reason);\r\n }\r\n return promise;\r\n}\r\n// WritableStream API exposed for controllers.\r\nfunction WritableStreamAddWriteRequest(stream) {\r\n var promise = newPromise(function (resolve, reject) {\r\n var writeRequest = {\r\n _resolve: resolve,\r\n _reject: reject\r\n };\r\n stream._writeRequests.push(writeRequest);\r\n });\r\n return promise;\r\n}\r\nfunction WritableStreamDealWithRejection(stream, error) {\r\n var state = stream._state;\r\n if (state === 'writable') {\r\n WritableStreamStartErroring(stream, error);\r\n return;\r\n }\r\n WritableStreamFinishErroring(stream);\r\n}\r\nfunction WritableStreamStartErroring(stream, reason) {\r\n var controller = stream._writableStreamController;\r\n stream._state = 'erroring';\r\n stream._storedError = reason;\r\n var writer = stream._writer;\r\n if (writer !== undefined) {\r\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, reason);\r\n }\r\n if (WritableStreamHasOperationMarkedInFlight(stream) === false && controller._started === true) {\r\n WritableStreamFinishErroring(stream);\r\n }\r\n}\r\nfunction WritableStreamFinishErroring(stream) {\r\n stream._state = 'errored';\r\n stream._writableStreamController[ErrorSteps]();\r\n var storedError = stream._storedError;\r\n stream._writeRequests.forEach(function (writeRequest) {\r\n writeRequest._reject(storedError);\r\n });\r\n stream._writeRequests = new SimpleQueue();\r\n if (stream._pendingAbortRequest === undefined) {\r\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\r\n return;\r\n }\r\n var abortRequest = stream._pendingAbortRequest;\r\n stream._pendingAbortRequest = undefined;\r\n if (abortRequest._wasAlreadyErroring === true) {\r\n abortRequest._reject(storedError);\r\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\r\n return;\r\n }\r\n var promise = stream._writableStreamController[AbortSteps](abortRequest._reason);\r\n uponPromise(promise, function () {\r\n abortRequest._resolve();\r\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\r\n }, function (reason) {\r\n abortRequest._reject(reason);\r\n WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);\r\n });\r\n}\r\nfunction WritableStreamFinishInFlightWrite(stream) {\r\n stream._inFlightWriteRequest._resolve(undefined);\r\n stream._inFlightWriteRequest = undefined;\r\n}\r\nfunction WritableStreamFinishInFlightWriteWithError(stream, error) {\r\n stream._inFlightWriteRequest._reject(error);\r\n stream._inFlightWriteRequest = undefined;\r\n WritableStreamDealWithRejection(stream, error);\r\n}\r\nfunction WritableStreamFinishInFlightClose(stream) {\r\n stream._inFlightCloseRequest._resolve(undefined);\r\n stream._inFlightCloseRequest = undefined;\r\n var state = stream._state;\r\n if (state === 'erroring') {\r\n // The error was too late to do anything, so it is ignored.\r\n stream._storedError = undefined;\r\n if (stream._pendingAbortRequest !== undefined) {\r\n stream._pendingAbortRequest._resolve();\r\n stream._pendingAbortRequest = undefined;\r\n }\r\n }\r\n stream._state = 'closed';\r\n var writer = stream._writer;\r\n if (writer !== undefined) {\r\n defaultWriterClosedPromiseResolve(writer);\r\n }\r\n}\r\nfunction WritableStreamFinishInFlightCloseWithError(stream, error) {\r\n stream._inFlightCloseRequest._reject(error);\r\n stream._inFlightCloseRequest = undefined;\r\n // Never execute sink abort() after sink close().\r\n if (stream._pendingAbortRequest !== undefined) {\r\n stream._pendingAbortRequest._reject(error);\r\n stream._pendingAbortRequest = undefined;\r\n }\r\n WritableStreamDealWithRejection(stream, error);\r\n}\r\n// TODO(ricea): Fix alphabetical order.\r\nfunction WritableStreamCloseQueuedOrInFlight(stream) {\r\n if (stream._closeRequest === undefined && stream._inFlightCloseRequest === undefined) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction WritableStreamHasOperationMarkedInFlight(stream) {\r\n if (stream._inFlightWriteRequest === undefined && stream._inFlightCloseRequest === undefined) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction WritableStreamMarkCloseRequestInFlight(stream) {\r\n stream._inFlightCloseRequest = stream._closeRequest;\r\n stream._closeRequest = undefined;\r\n}\r\nfunction WritableStreamMarkFirstWriteRequestInFlight(stream) {\r\n stream._inFlightWriteRequest = stream._writeRequests.shift();\r\n}\r\nfunction WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream) {\r\n if (stream._closeRequest !== undefined) {\r\n stream._closeRequest._reject(stream._storedError);\r\n stream._closeRequest = undefined;\r\n }\r\n var writer = stream._writer;\r\n if (writer !== undefined) {\r\n defaultWriterClosedPromiseReject(writer, stream._storedError);\r\n }\r\n}\r\nfunction WritableStreamUpdateBackpressure(stream, backpressure) {\r\n var writer = stream._writer;\r\n if (writer !== undefined && backpressure !== stream._backpressure) {\r\n if (backpressure === true) {\r\n defaultWriterReadyPromiseReset(writer);\r\n }\r\n else {\r\n defaultWriterReadyPromiseResolve(writer);\r\n }\r\n }\r\n stream._backpressure = backpressure;\r\n}\r\nvar WritableStreamDefaultWriter = /** @class */ (function () {\r\n function WritableStreamDefaultWriter(stream) {\r\n if (IsWritableStream(stream) === false) {\r\n throw new TypeError('WritableStreamDefaultWriter can only be constructed with a WritableStream instance');\r\n }\r\n if (IsWritableStreamLocked(stream) === true) {\r\n throw new TypeError('This stream has already been locked for exclusive writing by another writer');\r\n }\r\n this._ownerWritableStream = stream;\r\n stream._writer = this;\r\n var state = stream._state;\r\n if (state === 'writable') {\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._backpressure === true) {\r\n defaultWriterReadyPromiseInitialize(this);\r\n }\r\n else {\r\n defaultWriterReadyPromiseInitializeAsResolved(this);\r\n }\r\n defaultWriterClosedPromiseInitialize(this);\r\n }\r\n else if (state === 'erroring') {\r\n defaultWriterReadyPromiseInitializeAsRejected(this, stream._storedError);\r\n defaultWriterClosedPromiseInitialize(this);\r\n }\r\n else if (state === 'closed') {\r\n defaultWriterReadyPromiseInitializeAsResolved(this);\r\n defaultWriterClosedPromiseInitializeAsResolved(this);\r\n }\r\n else {\r\n var storedError = stream._storedError;\r\n defaultWriterReadyPromiseInitializeAsRejected(this, storedError);\r\n defaultWriterClosedPromiseInitializeAsRejected(this, storedError);\r\n }\r\n }\r\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"closed\", {\r\n get: function () {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n return promiseRejectedWith(defaultWriterBrandCheckException('closed'));\r\n }\r\n return this._closedPromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"desiredSize\", {\r\n get: function () {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n throw defaultWriterBrandCheckException('desiredSize');\r\n }\r\n if (this._ownerWritableStream === undefined) {\r\n throw defaultWriterLockException('desiredSize');\r\n }\r\n return WritableStreamDefaultWriterGetDesiredSize(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(WritableStreamDefaultWriter.prototype, \"ready\", {\r\n get: function () {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n return promiseRejectedWith(defaultWriterBrandCheckException('ready'));\r\n }\r\n return this._readyPromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n WritableStreamDefaultWriter.prototype.abort = function (reason) {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n return promiseRejectedWith(defaultWriterBrandCheckException('abort'));\r\n }\r\n if (this._ownerWritableStream === undefined) {\r\n return promiseRejectedWith(defaultWriterLockException('abort'));\r\n }\r\n return WritableStreamDefaultWriterAbort(this, reason);\r\n };\r\n WritableStreamDefaultWriter.prototype.close = function () {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n return promiseRejectedWith(defaultWriterBrandCheckException('close'));\r\n }\r\n var stream = this._ownerWritableStream;\r\n if (stream === undefined) {\r\n return promiseRejectedWith(defaultWriterLockException('close'));\r\n }\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === true) {\r\n return promiseRejectedWith(new TypeError('cannot close an already-closing stream'));\r\n }\r\n return WritableStreamDefaultWriterClose(this);\r\n };\r\n WritableStreamDefaultWriter.prototype.releaseLock = function () {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n throw defaultWriterBrandCheckException('releaseLock');\r\n }\r\n var stream = this._ownerWritableStream;\r\n if (stream === undefined) {\r\n return;\r\n }\r\n WritableStreamDefaultWriterRelease(this);\r\n };\r\n WritableStreamDefaultWriter.prototype.write = function (chunk) {\r\n if (IsWritableStreamDefaultWriter(this) === false) {\r\n return promiseRejectedWith(defaultWriterBrandCheckException('write'));\r\n }\r\n if (this._ownerWritableStream === undefined) {\r\n return promiseRejectedWith(defaultWriterLockException('write to'));\r\n }\r\n return WritableStreamDefaultWriterWrite(this, chunk);\r\n };\r\n return WritableStreamDefaultWriter;\r\n}());\r\n// Abstract operations for the WritableStreamDefaultWriter.\r\nfunction IsWritableStreamDefaultWriter(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_ownerWritableStream')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n// A client of WritableStreamDefaultWriter may use these functions directly to bypass state check.\r\nfunction WritableStreamDefaultWriterAbort(writer, reason) {\r\n var stream = writer._ownerWritableStream;\r\n return WritableStreamAbort(stream, reason);\r\n}\r\nfunction WritableStreamDefaultWriterClose(writer) {\r\n var stream = writer._ownerWritableStream;\r\n var state = stream._state;\r\n if (state === 'closed' || state === 'errored') {\r\n return promiseRejectedWith(new TypeError(\"The stream (in \" + state + \" state) is not in the writable state and cannot be closed\"));\r\n }\r\n var promise = newPromise(function (resolve, reject) {\r\n var closeRequest = {\r\n _resolve: resolve,\r\n _reject: reject\r\n };\r\n stream._closeRequest = closeRequest;\r\n });\r\n if (stream._backpressure === true && state === 'writable') {\r\n defaultWriterReadyPromiseResolve(writer);\r\n }\r\n WritableStreamDefaultControllerClose(stream._writableStreamController);\r\n return promise;\r\n}\r\nfunction WritableStreamDefaultWriterCloseWithErrorPropagation(writer) {\r\n var stream = writer._ownerWritableStream;\r\n var state = stream._state;\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') {\r\n return promiseResolvedWith(undefined);\r\n }\r\n if (state === 'errored') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n return WritableStreamDefaultWriterClose(writer);\r\n}\r\nfunction WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, error) {\r\n if (writer._closedPromiseState === 'pending') {\r\n defaultWriterClosedPromiseReject(writer, error);\r\n }\r\n else {\r\n defaultWriterClosedPromiseResetToRejected(writer, error);\r\n }\r\n}\r\nfunction WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, error) {\r\n if (writer._readyPromiseState === 'pending') {\r\n defaultWriterReadyPromiseReject(writer, error);\r\n }\r\n else {\r\n defaultWriterReadyPromiseResetToRejected(writer, error);\r\n }\r\n}\r\nfunction WritableStreamDefaultWriterGetDesiredSize(writer) {\r\n var stream = writer._ownerWritableStream;\r\n var state = stream._state;\r\n if (state === 'errored' || state === 'erroring') {\r\n return null;\r\n }\r\n if (state === 'closed') {\r\n return 0;\r\n }\r\n return WritableStreamDefaultControllerGetDesiredSize(stream._writableStreamController);\r\n}\r\nfunction WritableStreamDefaultWriterRelease(writer) {\r\n var stream = writer._ownerWritableStream;\r\n var releasedError = new TypeError('Writer was released and can no longer be used to monitor the stream\\'s closedness');\r\n WritableStreamDefaultWriterEnsureReadyPromiseRejected(writer, releasedError);\r\n // The state transitions to \"errored\" before the sink abort() method runs, but the writer.closed promise is not\r\n // rejected until afterwards. This means that simply testing state will not work.\r\n WritableStreamDefaultWriterEnsureClosedPromiseRejected(writer, releasedError);\r\n stream._writer = undefined;\r\n writer._ownerWritableStream = undefined;\r\n}\r\nfunction WritableStreamDefaultWriterWrite(writer, chunk) {\r\n var stream = writer._ownerWritableStream;\r\n var controller = stream._writableStreamController;\r\n var chunkSize = WritableStreamDefaultControllerGetChunkSize(controller, chunk);\r\n if (stream !== writer._ownerWritableStream) {\r\n return promiseRejectedWith(defaultWriterLockException('write to'));\r\n }\r\n var state = stream._state;\r\n if (state === 'errored') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === true || state === 'closed') {\r\n return promiseRejectedWith(new TypeError('The stream is closing or closed and cannot be written to'));\r\n }\r\n if (state === 'erroring') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n var promise = WritableStreamAddWriteRequest(stream);\r\n WritableStreamDefaultControllerWrite(controller, chunk, chunkSize);\r\n return promise;\r\n}\r\nvar WritableStreamDefaultController = /** @class */ (function () {\r\n /** @internal */\r\n function WritableStreamDefaultController() {\r\n throw new TypeError('WritableStreamDefaultController cannot be constructed explicitly');\r\n }\r\n WritableStreamDefaultController.prototype.error = function (e) {\r\n if (IsWritableStreamDefaultController(this) === false) {\r\n throw new TypeError('WritableStreamDefaultController.prototype.error can only be used on a WritableStreamDefaultController');\r\n }\r\n var state = this._controlledWritableStream._state;\r\n if (state !== 'writable') {\r\n // The stream is closed, errored or will be soon. The sink can't do anything useful if it gets an error here, so\r\n // just treat it as a no-op.\r\n return;\r\n }\r\n WritableStreamDefaultControllerError(this, e);\r\n };\r\n /** @internal */\r\n WritableStreamDefaultController.prototype[AbortSteps] = function (reason) {\r\n var result = this._abortAlgorithm(reason);\r\n WritableStreamDefaultControllerClearAlgorithms(this);\r\n return result;\r\n };\r\n /** @internal */\r\n WritableStreamDefaultController.prototype[ErrorSteps] = function () {\r\n ResetQueue(this);\r\n };\r\n return WritableStreamDefaultController;\r\n}());\r\n// Abstract operations implementing interface required by the WritableStream.\r\nfunction IsWritableStreamDefaultController(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledWritableStream')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm) {\r\n controller._controlledWritableStream = stream;\r\n stream._writableStreamController = controller;\r\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\r\n controller._queue = undefined;\r\n controller._queueTotalSize = undefined;\r\n ResetQueue(controller);\r\n controller._started = false;\r\n controller._strategySizeAlgorithm = sizeAlgorithm;\r\n controller._strategyHWM = highWaterMark;\r\n controller._writeAlgorithm = writeAlgorithm;\r\n controller._closeAlgorithm = closeAlgorithm;\r\n controller._abortAlgorithm = abortAlgorithm;\r\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\r\n WritableStreamUpdateBackpressure(stream, backpressure);\r\n var startResult = startAlgorithm();\r\n var startPromise = promiseResolvedWith(startResult);\r\n uponPromise(startPromise, function () {\r\n controller._started = true;\r\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\r\n }, function (r) {\r\n controller._started = true;\r\n WritableStreamDealWithRejection(stream, r);\r\n });\r\n}\r\nfunction SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {\r\n var controller = Object.create(WritableStreamDefaultController.prototype);\r\n function startAlgorithm() {\r\n return InvokeOrNoop(underlyingSink, 'start', [controller]);\r\n }\r\n var writeAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingSink, 'write', 1, [controller]);\r\n var closeAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingSink, 'close', 0, []);\r\n var abortAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingSink, 'abort', 1, []);\r\n SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);\r\n}\r\n// ClearAlgorithms may be called twice. Erroring the same stream in multiple ways will often result in redundant calls.\r\nfunction WritableStreamDefaultControllerClearAlgorithms(controller) {\r\n controller._writeAlgorithm = undefined;\r\n controller._closeAlgorithm = undefined;\r\n controller._abortAlgorithm = undefined;\r\n controller._strategySizeAlgorithm = undefined;\r\n}\r\nfunction WritableStreamDefaultControllerClose(controller) {\r\n EnqueueValueWithSize(controller, 'close', 0);\r\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\r\n}\r\nfunction WritableStreamDefaultControllerGetChunkSize(controller, chunk) {\r\n try {\r\n return controller._strategySizeAlgorithm(chunk);\r\n }\r\n catch (chunkSizeE) {\r\n WritableStreamDefaultControllerErrorIfNeeded(controller, chunkSizeE);\r\n return 1;\r\n }\r\n}\r\nfunction WritableStreamDefaultControllerGetDesiredSize(controller) {\r\n return controller._strategyHWM - controller._queueTotalSize;\r\n}\r\nfunction WritableStreamDefaultControllerWrite(controller, chunk, chunkSize) {\r\n var writeRecord = { chunk: chunk };\r\n try {\r\n EnqueueValueWithSize(controller, writeRecord, chunkSize);\r\n }\r\n catch (enqueueE) {\r\n WritableStreamDefaultControllerErrorIfNeeded(controller, enqueueE);\r\n return;\r\n }\r\n var stream = controller._controlledWritableStream;\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === false && stream._state === 'writable') {\r\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\r\n WritableStreamUpdateBackpressure(stream, backpressure);\r\n }\r\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\r\n}\r\n// Abstract operations for the WritableStreamDefaultController.\r\nfunction WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {\r\n var stream = controller._controlledWritableStream;\r\n if (controller._started === false) {\r\n return;\r\n }\r\n if (stream._inFlightWriteRequest !== undefined) {\r\n return;\r\n }\r\n var state = stream._state;\r\n if (state === 'erroring') {\r\n WritableStreamFinishErroring(stream);\r\n return;\r\n }\r\n if (controller._queue.length === 0) {\r\n return;\r\n }\r\n var writeRecord = PeekQueueValue(controller);\r\n if (writeRecord === 'close') {\r\n WritableStreamDefaultControllerProcessClose(controller);\r\n }\r\n else {\r\n WritableStreamDefaultControllerProcessWrite(controller, writeRecord.chunk);\r\n }\r\n}\r\nfunction WritableStreamDefaultControllerErrorIfNeeded(controller, error) {\r\n if (controller._controlledWritableStream._state === 'writable') {\r\n WritableStreamDefaultControllerError(controller, error);\r\n }\r\n}\r\nfunction WritableStreamDefaultControllerProcessClose(controller) {\r\n var stream = controller._controlledWritableStream;\r\n WritableStreamMarkCloseRequestInFlight(stream);\r\n DequeueValue(controller);\r\n var sinkClosePromise = controller._closeAlgorithm();\r\n WritableStreamDefaultControllerClearAlgorithms(controller);\r\n uponPromise(sinkClosePromise, function () {\r\n WritableStreamFinishInFlightClose(stream);\r\n }, function (reason) {\r\n WritableStreamFinishInFlightCloseWithError(stream, reason);\r\n });\r\n}\r\nfunction WritableStreamDefaultControllerProcessWrite(controller, chunk) {\r\n var stream = controller._controlledWritableStream;\r\n WritableStreamMarkFirstWriteRequestInFlight(stream);\r\n var sinkWritePromise = controller._writeAlgorithm(chunk);\r\n uponPromise(sinkWritePromise, function () {\r\n WritableStreamFinishInFlightWrite(stream);\r\n var state = stream._state;\r\n DequeueValue(controller);\r\n if (WritableStreamCloseQueuedOrInFlight(stream) === false && state === 'writable') {\r\n var backpressure = WritableStreamDefaultControllerGetBackpressure(controller);\r\n WritableStreamUpdateBackpressure(stream, backpressure);\r\n }\r\n WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);\r\n }, function (reason) {\r\n if (stream._state === 'writable') {\r\n WritableStreamDefaultControllerClearAlgorithms(controller);\r\n }\r\n WritableStreamFinishInFlightWriteWithError(stream, reason);\r\n });\r\n}\r\nfunction WritableStreamDefaultControllerGetBackpressure(controller) {\r\n var desiredSize = WritableStreamDefaultControllerGetDesiredSize(controller);\r\n return desiredSize <= 0;\r\n}\r\n// A client of WritableStreamDefaultController may use these functions directly to bypass state check.\r\nfunction WritableStreamDefaultControllerError(controller, error) {\r\n var stream = controller._controlledWritableStream;\r\n WritableStreamDefaultControllerClearAlgorithms(controller);\r\n WritableStreamStartErroring(stream, error);\r\n}\r\n// Helper functions for the WritableStream.\r\nfunction streamBrandCheckException(name) {\r\n return new TypeError(\"WritableStream.prototype.\" + name + \" can only be used on a WritableStream\");\r\n}\r\n// Helper functions for the WritableStreamDefaultWriter.\r\nfunction defaultWriterBrandCheckException(name) {\r\n return new TypeError(\"WritableStreamDefaultWriter.prototype.\" + name + \" can only be used on a WritableStreamDefaultWriter\");\r\n}\r\nfunction defaultWriterLockException(name) {\r\n return new TypeError('Cannot ' + name + ' a stream using a released writer');\r\n}\r\nfunction defaultWriterClosedPromiseInitialize(writer) {\r\n writer._closedPromise = newPromise(function (resolve, reject) {\r\n writer._closedPromise_resolve = resolve;\r\n writer._closedPromise_reject = reject;\r\n writer._closedPromiseState = 'pending';\r\n });\r\n}\r\nfunction defaultWriterClosedPromiseInitializeAsRejected(writer, reason) {\r\n defaultWriterClosedPromiseInitialize(writer);\r\n defaultWriterClosedPromiseReject(writer, reason);\r\n}\r\nfunction defaultWriterClosedPromiseInitializeAsResolved(writer) {\r\n defaultWriterClosedPromiseInitialize(writer);\r\n defaultWriterClosedPromiseResolve(writer);\r\n}\r\nfunction defaultWriterClosedPromiseReject(writer, reason) {\r\n setPromiseIsHandledToTrue(writer._closedPromise);\r\n writer._closedPromise_reject(reason);\r\n writer._closedPromise_resolve = undefined;\r\n writer._closedPromise_reject = undefined;\r\n writer._closedPromiseState = 'rejected';\r\n}\r\nfunction defaultWriterClosedPromiseResetToRejected(writer, reason) {\r\n defaultWriterClosedPromiseInitializeAsRejected(writer, reason);\r\n}\r\nfunction defaultWriterClosedPromiseResolve(writer) {\r\n writer._closedPromise_resolve(undefined);\r\n writer._closedPromise_resolve = undefined;\r\n writer._closedPromise_reject = undefined;\r\n writer._closedPromiseState = 'resolved';\r\n}\r\nfunction defaultWriterReadyPromiseInitialize(writer) {\r\n writer._readyPromise = newPromise(function (resolve, reject) {\r\n writer._readyPromise_resolve = resolve;\r\n writer._readyPromise_reject = reject;\r\n });\r\n writer._readyPromiseState = 'pending';\r\n}\r\nfunction defaultWriterReadyPromiseInitializeAsRejected(writer, reason) {\r\n defaultWriterReadyPromiseInitialize(writer);\r\n defaultWriterReadyPromiseReject(writer, reason);\r\n}\r\nfunction defaultWriterReadyPromiseInitializeAsResolved(writer) {\r\n defaultWriterReadyPromiseInitialize(writer);\r\n defaultWriterReadyPromiseResolve(writer);\r\n}\r\nfunction defaultWriterReadyPromiseReject(writer, reason) {\r\n setPromiseIsHandledToTrue(writer._readyPromise);\r\n writer._readyPromise_reject(reason);\r\n writer._readyPromise_resolve = undefined;\r\n writer._readyPromise_reject = undefined;\r\n writer._readyPromiseState = 'rejected';\r\n}\r\nfunction defaultWriterReadyPromiseReset(writer) {\r\n defaultWriterReadyPromiseInitialize(writer);\r\n}\r\nfunction defaultWriterReadyPromiseResetToRejected(writer, reason) {\r\n defaultWriterReadyPromiseInitializeAsRejected(writer, reason);\r\n}\r\nfunction defaultWriterReadyPromiseResolve(writer) {\r\n writer._readyPromise_resolve(undefined);\r\n writer._readyPromise_resolve = undefined;\r\n writer._readyPromise_reject = undefined;\r\n writer._readyPromiseState = 'fulfilled';\r\n}\n\nfunction isAbortSignal(value) {\r\n if (typeof value !== 'object' || value === null) {\r\n return false;\r\n }\r\n try {\r\n return typeof value.aborted === 'boolean';\r\n }\r\n catch (_a) {\r\n // AbortSignal.prototype.aborted throws if its brand check fails\r\n return false;\r\n }\r\n}\n\n/// \r\nvar NativeDOMException = typeof DOMException !== 'undefined' ? DOMException : undefined;\n\n/// \r\nfunction isDOMExceptionConstructor(ctor) {\r\n if (!(typeof ctor === 'function' || typeof ctor === 'object')) {\r\n return false;\r\n }\r\n try {\r\n new ctor();\r\n return true;\r\n }\r\n catch (_a) {\r\n return false;\r\n }\r\n}\r\nfunction createDOMExceptionPolyfill() {\r\n var ctor = function DOMException(message, name) {\r\n this.message = message || '';\r\n this.name = name || 'Error';\r\n if (Error.captureStackTrace) {\r\n Error.captureStackTrace(this, this.constructor);\r\n }\r\n };\r\n ctor.prototype = Object.create(Error.prototype);\r\n Object.defineProperty(ctor.prototype, 'constructor', { value: ctor, writable: true, configurable: true });\r\n return ctor;\r\n}\r\nvar DOMException$1 = isDOMExceptionConstructor(NativeDOMException) ? NativeDOMException : createDOMExceptionPolyfill();\n\nfunction ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {\r\n var reader = AcquireReadableStreamDefaultReader(source);\r\n var writer = AcquireWritableStreamDefaultWriter(dest);\r\n var shuttingDown = false;\r\n // This is used to keep track of the spec's requirement that we wait for ongoing writes during shutdown.\r\n var currentWrite = promiseResolvedWith(undefined);\r\n return newPromise(function (resolve, reject) {\r\n var abortAlgorithm;\r\n if (signal !== undefined) {\r\n abortAlgorithm = function () {\r\n var error = new DOMException$1('Aborted', 'AbortError');\r\n var actions = [];\r\n if (preventAbort === false) {\r\n actions.push(function () {\r\n if (dest._state === 'writable') {\r\n return WritableStreamAbort(dest, error);\r\n }\r\n return promiseResolvedWith(undefined);\r\n });\r\n }\r\n if (preventCancel === false) {\r\n actions.push(function () {\r\n if (source._state === 'readable') {\r\n return ReadableStreamCancel(source, error);\r\n }\r\n return promiseResolvedWith(undefined);\r\n });\r\n }\r\n shutdownWithAction(function () { return Promise.all(actions.map(function (action) { return action(); })); }, true, error);\r\n };\r\n if (signal.aborted === true) {\r\n abortAlgorithm();\r\n return;\r\n }\r\n signal.addEventListener('abort', abortAlgorithm);\r\n }\r\n // Using reader and writer, read all chunks from this and write them to dest\r\n // - Backpressure must be enforced\r\n // - Shutdown must stop all activity\r\n function pipeLoop() {\r\n return newPromise(function (resolveLoop, rejectLoop) {\r\n function next(done) {\r\n if (done) {\r\n resolveLoop();\r\n }\r\n else {\r\n // Use `PerformPromiseThen` instead of `uponPromise` to avoid\r\n // adding unnecessary `.catch(rethrowAssertionErrorRejection)` handlers\r\n PerformPromiseThen(pipeStep(), next, rejectLoop);\r\n }\r\n }\r\n next(false);\r\n });\r\n }\r\n function pipeStep() {\r\n if (shuttingDown === true) {\r\n return promiseResolvedWith(true);\r\n }\r\n return PerformPromiseThen(writer._readyPromise, function () {\r\n return PerformPromiseThen(ReadableStreamDefaultReaderRead(reader), function (_a) {\r\n var value = _a.value, done = _a.done;\r\n if (done === true) {\r\n return true;\r\n }\r\n currentWrite = PerformPromiseThen(WritableStreamDefaultWriterWrite(writer, value), undefined, noop);\r\n return false;\r\n });\r\n });\r\n }\r\n // Errors must be propagated forward\r\n isOrBecomesErrored(source, reader._closedPromise, function (storedError) {\r\n if (preventAbort === false) {\r\n shutdownWithAction(function () { return WritableStreamAbort(dest, storedError); }, true, storedError);\r\n }\r\n else {\r\n shutdown(true, storedError);\r\n }\r\n });\r\n // Errors must be propagated backward\r\n isOrBecomesErrored(dest, writer._closedPromise, function (storedError) {\r\n if (preventCancel === false) {\r\n shutdownWithAction(function () { return ReadableStreamCancel(source, storedError); }, true, storedError);\r\n }\r\n else {\r\n shutdown(true, storedError);\r\n }\r\n });\r\n // Closing must be propagated forward\r\n isOrBecomesClosed(source, reader._closedPromise, function () {\r\n if (preventClose === false) {\r\n shutdownWithAction(function () { return WritableStreamDefaultWriterCloseWithErrorPropagation(writer); });\r\n }\r\n else {\r\n shutdown();\r\n }\r\n });\r\n // Closing must be propagated backward\r\n if (WritableStreamCloseQueuedOrInFlight(dest) === true || dest._state === 'closed') {\r\n var destClosed_1 = new TypeError('the destination writable stream closed before all data could be piped to it');\r\n if (preventCancel === false) {\r\n shutdownWithAction(function () { return ReadableStreamCancel(source, destClosed_1); }, true, destClosed_1);\r\n }\r\n else {\r\n shutdown(true, destClosed_1);\r\n }\r\n }\r\n setPromiseIsHandledToTrue(pipeLoop());\r\n function waitForWritesToFinish() {\r\n // Another write may have started while we were waiting on this currentWrite, so we have to be sure to wait\r\n // for that too.\r\n var oldCurrentWrite = currentWrite;\r\n return PerformPromiseThen(currentWrite, function () { return oldCurrentWrite !== currentWrite ? waitForWritesToFinish() : undefined; });\r\n }\r\n function isOrBecomesErrored(stream, promise, action) {\r\n if (stream._state === 'errored') {\r\n action(stream._storedError);\r\n }\r\n else {\r\n uponRejection(promise, action);\r\n }\r\n }\r\n function isOrBecomesClosed(stream, promise, action) {\r\n if (stream._state === 'closed') {\r\n action();\r\n }\r\n else {\r\n uponFulfillment(promise, action);\r\n }\r\n }\r\n function shutdownWithAction(action, originalIsError, originalError) {\r\n if (shuttingDown === true) {\r\n return;\r\n }\r\n shuttingDown = true;\r\n if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) {\r\n uponFulfillment(waitForWritesToFinish(), doTheRest);\r\n }\r\n else {\r\n doTheRest();\r\n }\r\n function doTheRest() {\r\n uponPromise(action(), function () { return finalize(originalIsError, originalError); }, function (newError) { return finalize(true, newError); });\r\n }\r\n }\r\n function shutdown(isError, error) {\r\n if (shuttingDown === true) {\r\n return;\r\n }\r\n shuttingDown = true;\r\n if (dest._state === 'writable' && WritableStreamCloseQueuedOrInFlight(dest) === false) {\r\n uponFulfillment(waitForWritesToFinish(), function () { return finalize(isError, error); });\r\n }\r\n else {\r\n finalize(isError, error);\r\n }\r\n }\r\n function finalize(isError, error) {\r\n WritableStreamDefaultWriterRelease(writer);\r\n ReadableStreamReaderGenericRelease(reader);\r\n if (signal !== undefined) {\r\n signal.removeEventListener('abort', abortAlgorithm);\r\n }\r\n if (isError) {\r\n reject(error);\r\n }\r\n else {\r\n resolve(undefined);\r\n }\r\n }\r\n });\r\n}\n\nvar ReadableStreamDefaultController = /** @class */ (function () {\r\n /** @internal */\r\n function ReadableStreamDefaultController() {\r\n throw new TypeError();\r\n }\r\n Object.defineProperty(ReadableStreamDefaultController.prototype, \"desiredSize\", {\r\n get: function () {\r\n if (IsReadableStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException('desiredSize');\r\n }\r\n return ReadableStreamDefaultControllerGetDesiredSize(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableStreamDefaultController.prototype.close = function () {\r\n if (IsReadableStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException('close');\r\n }\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(this) === false) {\r\n throw new TypeError('The stream is not in a state that permits close');\r\n }\r\n ReadableStreamDefaultControllerClose(this);\r\n };\r\n ReadableStreamDefaultController.prototype.enqueue = function (chunk) {\r\n if (IsReadableStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException('enqueue');\r\n }\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(this) === false) {\r\n throw new TypeError('The stream is not in a state that permits enqueue');\r\n }\r\n return ReadableStreamDefaultControllerEnqueue(this, chunk);\r\n };\r\n ReadableStreamDefaultController.prototype.error = function (e) {\r\n if (IsReadableStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException('error');\r\n }\r\n ReadableStreamDefaultControllerError(this, e);\r\n };\r\n /** @internal */\r\n ReadableStreamDefaultController.prototype[CancelSteps] = function (reason) {\r\n ResetQueue(this);\r\n var result = this._cancelAlgorithm(reason);\r\n ReadableStreamDefaultControllerClearAlgorithms(this);\r\n return result;\r\n };\r\n /** @internal */\r\n ReadableStreamDefaultController.prototype[PullSteps] = function () {\r\n var stream = this._controlledReadableStream;\r\n if (this._queue.length > 0) {\r\n var chunk = DequeueValue(this);\r\n if (this._closeRequested === true && this._queue.length === 0) {\r\n ReadableStreamDefaultControllerClearAlgorithms(this);\r\n ReadableStreamClose(stream);\r\n }\r\n else {\r\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\r\n }\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(chunk, false, stream._reader._forAuthorCode));\r\n }\r\n var pendingPromise = ReadableStreamAddReadRequest(stream);\r\n ReadableStreamDefaultControllerCallPullIfNeeded(this);\r\n return pendingPromise;\r\n };\r\n return ReadableStreamDefaultController;\r\n}());\r\n// Abstract operations for the ReadableStreamDefaultController.\r\nfunction IsReadableStreamDefaultController(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableStream')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction ReadableStreamDefaultControllerCallPullIfNeeded(controller) {\r\n var shouldPull = ReadableStreamDefaultControllerShouldCallPull(controller);\r\n if (shouldPull === false) {\r\n return;\r\n }\r\n if (controller._pulling === true) {\r\n controller._pullAgain = true;\r\n return;\r\n }\r\n controller._pulling = true;\r\n var pullPromise = controller._pullAlgorithm();\r\n uponPromise(pullPromise, function () {\r\n controller._pulling = false;\r\n if (controller._pullAgain === true) {\r\n controller._pullAgain = false;\r\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\r\n }\r\n }, function (e) {\r\n ReadableStreamDefaultControllerError(controller, e);\r\n });\r\n}\r\nfunction ReadableStreamDefaultControllerShouldCallPull(controller) {\r\n var stream = controller._controlledReadableStream;\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) === false) {\r\n return false;\r\n }\r\n if (controller._started === false) {\r\n return false;\r\n }\r\n if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) {\r\n return true;\r\n }\r\n var desiredSize = ReadableStreamDefaultControllerGetDesiredSize(controller);\r\n if (desiredSize > 0) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction ReadableStreamDefaultControllerClearAlgorithms(controller) {\r\n controller._pullAlgorithm = undefined;\r\n controller._cancelAlgorithm = undefined;\r\n controller._strategySizeAlgorithm = undefined;\r\n}\r\n// A client of ReadableStreamDefaultController may use these functions directly to bypass state check.\r\nfunction ReadableStreamDefaultControllerClose(controller) {\r\n var stream = controller._controlledReadableStream;\r\n controller._closeRequested = true;\r\n if (controller._queue.length === 0) {\r\n ReadableStreamDefaultControllerClearAlgorithms(controller);\r\n ReadableStreamClose(stream);\r\n }\r\n}\r\nfunction ReadableStreamDefaultControllerEnqueue(controller, chunk) {\r\n var stream = controller._controlledReadableStream;\r\n if (IsReadableStreamLocked(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) {\r\n ReadableStreamFulfillReadRequest(stream, chunk, false);\r\n }\r\n else {\r\n var chunkSize = void 0;\r\n try {\r\n chunkSize = controller._strategySizeAlgorithm(chunk);\r\n }\r\n catch (chunkSizeE) {\r\n ReadableStreamDefaultControllerError(controller, chunkSizeE);\r\n throw chunkSizeE;\r\n }\r\n try {\r\n EnqueueValueWithSize(controller, chunk, chunkSize);\r\n }\r\n catch (enqueueE) {\r\n ReadableStreamDefaultControllerError(controller, enqueueE);\r\n throw enqueueE;\r\n }\r\n }\r\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\r\n}\r\nfunction ReadableStreamDefaultControllerError(controller, e) {\r\n var stream = controller._controlledReadableStream;\r\n if (stream._state !== 'readable') {\r\n return;\r\n }\r\n ResetQueue(controller);\r\n ReadableStreamDefaultControllerClearAlgorithms(controller);\r\n ReadableStreamError(stream, e);\r\n}\r\nfunction ReadableStreamDefaultControllerGetDesiredSize(controller) {\r\n var stream = controller._controlledReadableStream;\r\n var state = stream._state;\r\n if (state === 'errored') {\r\n return null;\r\n }\r\n if (state === 'closed') {\r\n return 0;\r\n }\r\n return controller._strategyHWM - controller._queueTotalSize;\r\n}\r\n// This is used in the implementation of TransformStream.\r\nfunction ReadableStreamDefaultControllerHasBackpressure(controller) {\r\n if (ReadableStreamDefaultControllerShouldCallPull(controller) === true) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction ReadableStreamDefaultControllerCanCloseOrEnqueue(controller) {\r\n var state = controller._controlledReadableStream._state;\r\n if (controller._closeRequested === false && state === 'readable') {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\r\n controller._controlledReadableStream = stream;\r\n controller._queue = undefined;\r\n controller._queueTotalSize = undefined;\r\n ResetQueue(controller);\r\n controller._started = false;\r\n controller._closeRequested = false;\r\n controller._pullAgain = false;\r\n controller._pulling = false;\r\n controller._strategySizeAlgorithm = sizeAlgorithm;\r\n controller._strategyHWM = highWaterMark;\r\n controller._pullAlgorithm = pullAlgorithm;\r\n controller._cancelAlgorithm = cancelAlgorithm;\r\n stream._readableStreamController = controller;\r\n var startResult = startAlgorithm();\r\n uponPromise(promiseResolvedWith(startResult), function () {\r\n controller._started = true;\r\n ReadableStreamDefaultControllerCallPullIfNeeded(controller);\r\n }, function (r) {\r\n ReadableStreamDefaultControllerError(controller, r);\r\n });\r\n}\r\nfunction SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {\r\n var controller = Object.create(ReadableStreamDefaultController.prototype);\r\n function startAlgorithm() {\r\n return InvokeOrNoop(underlyingSource, 'start', [controller]);\r\n }\r\n var pullAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingSource, 'pull', 0, [controller]);\r\n var cancelAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingSource, 'cancel', 1, []);\r\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\r\n}\r\n// Helper functions for the ReadableStreamDefaultController.\r\nfunction defaultControllerBrandCheckException(name) {\r\n return new TypeError(\"ReadableStreamDefaultController.prototype.\" + name + \" can only be used on a ReadableStreamDefaultController\");\r\n}\n\nfunction ReadableStreamTee(stream, cloneForBranch2) {\r\n var reader = AcquireReadableStreamDefaultReader(stream);\r\n var reading = false;\r\n var canceled1 = false;\r\n var canceled2 = false;\r\n var reason1;\r\n var reason2;\r\n var branch1;\r\n var branch2;\r\n var resolveCancelPromise;\r\n var cancelPromise = newPromise(function (resolve) {\r\n resolveCancelPromise = resolve;\r\n });\r\n function pullAlgorithm() {\r\n if (reading === true) {\r\n return promiseResolvedWith(undefined);\r\n }\r\n reading = true;\r\n var readPromise = transformPromiseWith(ReadableStreamDefaultReaderRead(reader), function (result) {\r\n reading = false;\r\n var done = result.done;\r\n if (done === true) {\r\n if (canceled1 === false) {\r\n ReadableStreamDefaultControllerClose(branch1._readableStreamController);\r\n }\r\n if (canceled2 === false) {\r\n ReadableStreamDefaultControllerClose(branch2._readableStreamController);\r\n }\r\n return;\r\n }\r\n var value = result.value;\r\n var value1 = value;\r\n var value2 = value;\r\n // There is no way to access the cloning code right now in the reference implementation.\r\n // If we add one then we'll need an implementation for serializable objects.\r\n // if (canceled2 === false && cloneForBranch2 === true) {\r\n // value2 = StructuredDeserialize(StructuredSerialize(value2));\r\n // }\r\n if (canceled1 === false) {\r\n ReadableStreamDefaultControllerEnqueue(branch1._readableStreamController, value1);\r\n }\r\n if (canceled2 === false) {\r\n ReadableStreamDefaultControllerEnqueue(branch2._readableStreamController, value2);\r\n }\r\n });\r\n setPromiseIsHandledToTrue(readPromise);\r\n return promiseResolvedWith(undefined);\r\n }\r\n function cancel1Algorithm(reason) {\r\n canceled1 = true;\r\n reason1 = reason;\r\n if (canceled2 === true) {\r\n var compositeReason = createArrayFromList([reason1, reason2]);\r\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\r\n resolveCancelPromise(cancelResult);\r\n }\r\n return cancelPromise;\r\n }\r\n function cancel2Algorithm(reason) {\r\n canceled2 = true;\r\n reason2 = reason;\r\n if (canceled1 === true) {\r\n var compositeReason = createArrayFromList([reason1, reason2]);\r\n var cancelResult = ReadableStreamCancel(stream, compositeReason);\r\n resolveCancelPromise(cancelResult);\r\n }\r\n return cancelPromise;\r\n }\r\n function startAlgorithm() { }\r\n branch1 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel1Algorithm);\r\n branch2 = CreateReadableStream(startAlgorithm, pullAlgorithm, cancel2Algorithm);\r\n uponRejection(reader._closedPromise, function (r) {\r\n ReadableStreamDefaultControllerError(branch1._readableStreamController, r);\r\n ReadableStreamDefaultControllerError(branch2._readableStreamController, r);\r\n });\r\n return [branch1, branch2];\r\n}\n\n/// \r\n// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger#Polyfill\r\nvar NumberIsInteger = Number.isInteger || function (value) {\r\n return typeof value === 'number' &&\r\n isFinite(value) &&\r\n Math.floor(value) === value;\r\n};\n\nvar ReadableStreamBYOBRequest = /** @class */ (function () {\r\n /** @internal */\r\n function ReadableStreamBYOBRequest() {\r\n throw new TypeError('ReadableStreamBYOBRequest cannot be used directly');\r\n }\r\n Object.defineProperty(ReadableStreamBYOBRequest.prototype, \"view\", {\r\n get: function () {\r\n if (IsReadableStreamBYOBRequest(this) === false) {\r\n throw byobRequestBrandCheckException('view');\r\n }\r\n return this._view;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableStreamBYOBRequest.prototype.respond = function (bytesWritten) {\r\n if (IsReadableStreamBYOBRequest(this) === false) {\r\n throw byobRequestBrandCheckException('respond');\r\n }\r\n if (this._associatedReadableByteStreamController === undefined) {\r\n throw new TypeError('This BYOB request has been invalidated');\r\n }\r\n if (IsDetachedBuffer(this._view.buffer) === true) ;\r\n ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);\r\n };\r\n ReadableStreamBYOBRequest.prototype.respondWithNewView = function (view) {\r\n if (IsReadableStreamBYOBRequest(this) === false) {\r\n throw byobRequestBrandCheckException('respond');\r\n }\r\n if (this._associatedReadableByteStreamController === undefined) {\r\n throw new TypeError('This BYOB request has been invalidated');\r\n }\r\n if (!ArrayBuffer.isView(view)) {\r\n throw new TypeError('You can only respond with array buffer views');\r\n }\r\n if (IsDetachedBuffer(view.buffer) === true) ;\r\n ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);\r\n };\r\n return ReadableStreamBYOBRequest;\r\n}());\r\nvar ReadableByteStreamController = /** @class */ (function () {\r\n /** @internal */\r\n function ReadableByteStreamController() {\r\n throw new TypeError('ReadableByteStreamController constructor cannot be used directly');\r\n }\r\n Object.defineProperty(ReadableByteStreamController.prototype, \"byobRequest\", {\r\n get: function () {\r\n if (IsReadableByteStreamController(this) === false) {\r\n throw byteStreamControllerBrandCheckException('byobRequest');\r\n }\r\n if (this._byobRequest === undefined && this._pendingPullIntos.length > 0) {\r\n var firstDescriptor = this._pendingPullIntos.peek();\r\n var view = new Uint8Array(firstDescriptor.buffer, firstDescriptor.byteOffset + firstDescriptor.bytesFilled, firstDescriptor.byteLength - firstDescriptor.bytesFilled);\r\n var byobRequest = Object.create(ReadableStreamBYOBRequest.prototype);\r\n SetUpReadableStreamBYOBRequest(byobRequest, this, view);\r\n this._byobRequest = byobRequest;\r\n }\r\n return this._byobRequest;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(ReadableByteStreamController.prototype, \"desiredSize\", {\r\n get: function () {\r\n if (IsReadableByteStreamController(this) === false) {\r\n throw byteStreamControllerBrandCheckException('desiredSize');\r\n }\r\n return ReadableByteStreamControllerGetDesiredSize(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableByteStreamController.prototype.close = function () {\r\n if (IsReadableByteStreamController(this) === false) {\r\n throw byteStreamControllerBrandCheckException('close');\r\n }\r\n if (this._closeRequested === true) {\r\n throw new TypeError('The stream has already been closed; do not close it again!');\r\n }\r\n var state = this._controlledReadableByteStream._state;\r\n if (state !== 'readable') {\r\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be closed\");\r\n }\r\n ReadableByteStreamControllerClose(this);\r\n };\r\n ReadableByteStreamController.prototype.enqueue = function (chunk) {\r\n if (IsReadableByteStreamController(this) === false) {\r\n throw byteStreamControllerBrandCheckException('enqueue');\r\n }\r\n if (this._closeRequested === true) {\r\n throw new TypeError('stream is closed or draining');\r\n }\r\n var state = this._controlledReadableByteStream._state;\r\n if (state !== 'readable') {\r\n throw new TypeError(\"The stream (in \" + state + \" state) is not in the readable state and cannot be enqueued to\");\r\n }\r\n if (!ArrayBuffer.isView(chunk)) {\r\n throw new TypeError('You can only enqueue array buffer views when using a ReadableByteStreamController');\r\n }\r\n if (IsDetachedBuffer(chunk.buffer) === true) ;\r\n ReadableByteStreamControllerEnqueue(this, chunk);\r\n };\r\n ReadableByteStreamController.prototype.error = function (e) {\r\n if (IsReadableByteStreamController(this) === false) {\r\n throw byteStreamControllerBrandCheckException('error');\r\n }\r\n ReadableByteStreamControllerError(this, e);\r\n };\r\n /** @internal */\r\n ReadableByteStreamController.prototype[CancelSteps] = function (reason) {\r\n if (this._pendingPullIntos.length > 0) {\r\n var firstDescriptor = this._pendingPullIntos.peek();\r\n firstDescriptor.bytesFilled = 0;\r\n }\r\n ResetQueue(this);\r\n var result = this._cancelAlgorithm(reason);\r\n ReadableByteStreamControllerClearAlgorithms(this);\r\n return result;\r\n };\r\n /** @internal */\r\n ReadableByteStreamController.prototype[PullSteps] = function () {\r\n var stream = this._controlledReadableByteStream;\r\n if (this._queueTotalSize > 0) {\r\n var entry = this._queue.shift();\r\n this._queueTotalSize -= entry.byteLength;\r\n ReadableByteStreamControllerHandleQueueDrain(this);\r\n var view = void 0;\r\n try {\r\n view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);\r\n }\r\n catch (viewE) {\r\n return promiseRejectedWith(viewE);\r\n }\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(view, false, stream._reader._forAuthorCode));\r\n }\r\n var autoAllocateChunkSize = this._autoAllocateChunkSize;\r\n if (autoAllocateChunkSize !== undefined) {\r\n var buffer = void 0;\r\n try {\r\n buffer = new ArrayBuffer(autoAllocateChunkSize);\r\n }\r\n catch (bufferE) {\r\n return promiseRejectedWith(bufferE);\r\n }\r\n var pullIntoDescriptor = {\r\n buffer: buffer,\r\n byteOffset: 0,\r\n byteLength: autoAllocateChunkSize,\r\n bytesFilled: 0,\r\n elementSize: 1,\r\n ctor: Uint8Array,\r\n readerType: 'default'\r\n };\r\n this._pendingPullIntos.push(pullIntoDescriptor);\r\n }\r\n var promise = ReadableStreamAddReadRequest(stream);\r\n ReadableByteStreamControllerCallPullIfNeeded(this);\r\n return promise;\r\n };\r\n return ReadableByteStreamController;\r\n}());\r\n// Abstract operations for the ReadableByteStreamController.\r\nfunction IsReadableByteStreamController(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledReadableByteStream')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction IsReadableStreamBYOBRequest(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_associatedReadableByteStreamController')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction ReadableByteStreamControllerCallPullIfNeeded(controller) {\r\n var shouldPull = ReadableByteStreamControllerShouldCallPull(controller);\r\n if (shouldPull === false) {\r\n return;\r\n }\r\n if (controller._pulling === true) {\r\n controller._pullAgain = true;\r\n return;\r\n }\r\n controller._pulling = true;\r\n // TODO: Test controller argument\r\n var pullPromise = controller._pullAlgorithm();\r\n uponPromise(pullPromise, function () {\r\n controller._pulling = false;\r\n if (controller._pullAgain === true) {\r\n controller._pullAgain = false;\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n }\r\n }, function (e) {\r\n ReadableByteStreamControllerError(controller, e);\r\n });\r\n}\r\nfunction ReadableByteStreamControllerClearPendingPullIntos(controller) {\r\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\r\n controller._pendingPullIntos = new SimpleQueue();\r\n}\r\nfunction ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor) {\r\n var done = false;\r\n if (stream._state === 'closed') {\r\n done = true;\r\n }\r\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\r\n if (pullIntoDescriptor.readerType === 'default') {\r\n ReadableStreamFulfillReadRequest(stream, filledView, done);\r\n }\r\n else {\r\n ReadableStreamFulfillReadIntoRequest(stream, filledView, done);\r\n }\r\n}\r\nfunction ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor) {\r\n var bytesFilled = pullIntoDescriptor.bytesFilled;\r\n var elementSize = pullIntoDescriptor.elementSize;\r\n return new pullIntoDescriptor.ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, bytesFilled / elementSize);\r\n}\r\nfunction ReadableByteStreamControllerEnqueueChunkToQueue(controller, buffer, byteOffset, byteLength) {\r\n controller._queue.push({ buffer: buffer, byteOffset: byteOffset, byteLength: byteLength });\r\n controller._queueTotalSize += byteLength;\r\n}\r\nfunction ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {\r\n var elementSize = pullIntoDescriptor.elementSize;\r\n var currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;\r\n var maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);\r\n var maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;\r\n var maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;\r\n var totalBytesToCopyRemaining = maxBytesToCopy;\r\n var ready = false;\r\n if (maxAlignedBytes > currentAlignedBytes) {\r\n totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;\r\n ready = true;\r\n }\r\n var queue = controller._queue;\r\n while (totalBytesToCopyRemaining > 0) {\r\n var headOfQueue = queue.peek();\r\n var bytesToCopy = Math.min(totalBytesToCopyRemaining, headOfQueue.byteLength);\r\n var destStart = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\r\n ArrayBufferCopy(pullIntoDescriptor.buffer, destStart, headOfQueue.buffer, headOfQueue.byteOffset, bytesToCopy);\r\n if (headOfQueue.byteLength === bytesToCopy) {\r\n queue.shift();\r\n }\r\n else {\r\n headOfQueue.byteOffset += bytesToCopy;\r\n headOfQueue.byteLength -= bytesToCopy;\r\n }\r\n controller._queueTotalSize -= bytesToCopy;\r\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesToCopy, pullIntoDescriptor);\r\n totalBytesToCopyRemaining -= bytesToCopy;\r\n }\r\n return ready;\r\n}\r\nfunction ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, size, pullIntoDescriptor) {\r\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\r\n pullIntoDescriptor.bytesFilled += size;\r\n}\r\nfunction ReadableByteStreamControllerHandleQueueDrain(controller) {\r\n if (controller._queueTotalSize === 0 && controller._closeRequested === true) {\r\n ReadableByteStreamControllerClearAlgorithms(controller);\r\n ReadableStreamClose(controller._controlledReadableByteStream);\r\n }\r\n else {\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n }\r\n}\r\nfunction ReadableByteStreamControllerInvalidateBYOBRequest(controller) {\r\n if (controller._byobRequest === undefined) {\r\n return;\r\n }\r\n controller._byobRequest._associatedReadableByteStreamController = undefined;\r\n controller._byobRequest._view = undefined;\r\n controller._byobRequest = undefined;\r\n}\r\nfunction ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller) {\r\n while (controller._pendingPullIntos.length > 0) {\r\n if (controller._queueTotalSize === 0) {\r\n return;\r\n }\r\n var pullIntoDescriptor = controller._pendingPullIntos.peek();\r\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) {\r\n ReadableByteStreamControllerShiftPendingPullInto(controller);\r\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\r\n }\r\n }\r\n}\r\nfunction ReadableByteStreamControllerPullInto(controller, view) {\r\n var stream = controller._controlledReadableByteStream;\r\n var elementSize = 1;\r\n if (view.constructor !== DataView) {\r\n elementSize = view.constructor.BYTES_PER_ELEMENT;\r\n }\r\n var ctor = view.constructor;\r\n var buffer = TransferArrayBuffer(view.buffer);\r\n var pullIntoDescriptor = {\r\n buffer: buffer,\r\n byteOffset: view.byteOffset,\r\n byteLength: view.byteLength,\r\n bytesFilled: 0,\r\n elementSize: elementSize,\r\n ctor: ctor,\r\n readerType: 'byob'\r\n };\r\n if (controller._pendingPullIntos.length > 0) {\r\n controller._pendingPullIntos.push(pullIntoDescriptor);\r\n // No ReadableByteStreamControllerCallPullIfNeeded() call since:\r\n // - No change happens on desiredSize\r\n // - The source has already been notified of that there's at least 1 pending read(view)\r\n return ReadableStreamAddReadIntoRequest(stream);\r\n }\r\n if (stream._state === 'closed') {\r\n var emptyView = new ctor(pullIntoDescriptor.buffer, pullIntoDescriptor.byteOffset, 0);\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(emptyView, true, stream._reader._forAuthorCode));\r\n }\r\n if (controller._queueTotalSize > 0) {\r\n if (ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) === true) {\r\n var filledView = ReadableByteStreamControllerConvertPullIntoDescriptor(pullIntoDescriptor);\r\n ReadableByteStreamControllerHandleQueueDrain(controller);\r\n return promiseResolvedWith(ReadableStreamCreateReadResult(filledView, false, stream._reader._forAuthorCode));\r\n }\r\n if (controller._closeRequested === true) {\r\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\r\n ReadableByteStreamControllerError(controller, e);\r\n return promiseRejectedWith(e);\r\n }\r\n }\r\n controller._pendingPullIntos.push(pullIntoDescriptor);\r\n var promise = ReadableStreamAddReadIntoRequest(stream);\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n return promise;\r\n}\r\nfunction ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {\r\n firstDescriptor.buffer = TransferArrayBuffer(firstDescriptor.buffer);\r\n var stream = controller._controlledReadableByteStream;\r\n if (ReadableStreamHasBYOBReader(stream) === true) {\r\n while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {\r\n var pullIntoDescriptor = ReadableByteStreamControllerShiftPendingPullInto(controller);\r\n ReadableByteStreamControllerCommitPullIntoDescriptor(stream, pullIntoDescriptor);\r\n }\r\n }\r\n}\r\nfunction ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {\r\n if (pullIntoDescriptor.bytesFilled + bytesWritten > pullIntoDescriptor.byteLength) {\r\n throw new RangeError('bytesWritten out of range');\r\n }\r\n ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);\r\n if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.elementSize) {\r\n // TODO: Figure out whether we should detach the buffer or not here.\r\n return;\r\n }\r\n ReadableByteStreamControllerShiftPendingPullInto(controller);\r\n var remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;\r\n if (remainderSize > 0) {\r\n var end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;\r\n var remainder = pullIntoDescriptor.buffer.slice(end - remainderSize, end);\r\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);\r\n }\r\n pullIntoDescriptor.buffer = TransferArrayBuffer(pullIntoDescriptor.buffer);\r\n pullIntoDescriptor.bytesFilled -= remainderSize;\r\n ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);\r\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\r\n}\r\nfunction ReadableByteStreamControllerRespondInternal(controller, bytesWritten) {\r\n var firstDescriptor = controller._pendingPullIntos.peek();\r\n var stream = controller._controlledReadableByteStream;\r\n if (stream._state === 'closed') {\r\n if (bytesWritten !== 0) {\r\n throw new TypeError('bytesWritten must be 0 when calling respond() on a closed stream');\r\n }\r\n ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);\r\n }\r\n else {\r\n ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);\r\n }\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n}\r\nfunction ReadableByteStreamControllerShiftPendingPullInto(controller) {\r\n var descriptor = controller._pendingPullIntos.shift();\r\n ReadableByteStreamControllerInvalidateBYOBRequest(controller);\r\n return descriptor;\r\n}\r\nfunction ReadableByteStreamControllerShouldCallPull(controller) {\r\n var stream = controller._controlledReadableByteStream;\r\n if (stream._state !== 'readable') {\r\n return false;\r\n }\r\n if (controller._closeRequested === true) {\r\n return false;\r\n }\r\n if (controller._started === false) {\r\n return false;\r\n }\r\n if (ReadableStreamHasDefaultReader(stream) === true && ReadableStreamGetNumReadRequests(stream) > 0) {\r\n return true;\r\n }\r\n if (ReadableStreamHasBYOBReader(stream) === true && ReadableStreamGetNumReadIntoRequests(stream) > 0) {\r\n return true;\r\n }\r\n var desiredSize = ReadableByteStreamControllerGetDesiredSize(controller);\r\n if (desiredSize > 0) {\r\n return true;\r\n }\r\n return false;\r\n}\r\nfunction ReadableByteStreamControllerClearAlgorithms(controller) {\r\n controller._pullAlgorithm = undefined;\r\n controller._cancelAlgorithm = undefined;\r\n}\r\n// A client of ReadableByteStreamController may use these functions directly to bypass state check.\r\nfunction ReadableByteStreamControllerClose(controller) {\r\n var stream = controller._controlledReadableByteStream;\r\n if (controller._queueTotalSize > 0) {\r\n controller._closeRequested = true;\r\n return;\r\n }\r\n if (controller._pendingPullIntos.length > 0) {\r\n var firstPendingPullInto = controller._pendingPullIntos.peek();\r\n if (firstPendingPullInto.bytesFilled > 0) {\r\n var e = new TypeError('Insufficient bytes to fill elements in the given buffer');\r\n ReadableByteStreamControllerError(controller, e);\r\n throw e;\r\n }\r\n }\r\n ReadableByteStreamControllerClearAlgorithms(controller);\r\n ReadableStreamClose(stream);\r\n}\r\nfunction ReadableByteStreamControllerEnqueue(controller, chunk) {\r\n var stream = controller._controlledReadableByteStream;\r\n var buffer = chunk.buffer;\r\n var byteOffset = chunk.byteOffset;\r\n var byteLength = chunk.byteLength;\r\n var transferredBuffer = TransferArrayBuffer(buffer);\r\n if (ReadableStreamHasDefaultReader(stream) === true) {\r\n if (ReadableStreamGetNumReadRequests(stream) === 0) {\r\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\r\n }\r\n else {\r\n var transferredView = new Uint8Array(transferredBuffer, byteOffset, byteLength);\r\n ReadableStreamFulfillReadRequest(stream, transferredView, false);\r\n }\r\n }\r\n else if (ReadableStreamHasBYOBReader(stream) === true) {\r\n // TODO: Ideally in this branch detaching should happen only if the buffer is not consumed fully.\r\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\r\n ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);\r\n }\r\n else {\r\n ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);\r\n }\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n}\r\nfunction ReadableByteStreamControllerError(controller, e) {\r\n var stream = controller._controlledReadableByteStream;\r\n if (stream._state !== 'readable') {\r\n return;\r\n }\r\n ReadableByteStreamControllerClearPendingPullIntos(controller);\r\n ResetQueue(controller);\r\n ReadableByteStreamControllerClearAlgorithms(controller);\r\n ReadableStreamError(stream, e);\r\n}\r\nfunction ReadableByteStreamControllerGetDesiredSize(controller) {\r\n var stream = controller._controlledReadableByteStream;\r\n var state = stream._state;\r\n if (state === 'errored') {\r\n return null;\r\n }\r\n if (state === 'closed') {\r\n return 0;\r\n }\r\n return controller._strategyHWM - controller._queueTotalSize;\r\n}\r\nfunction ReadableByteStreamControllerRespond(controller, bytesWritten) {\r\n bytesWritten = Number(bytesWritten);\r\n if (IsFiniteNonNegativeNumber(bytesWritten) === false) {\r\n throw new RangeError('bytesWritten must be a finite');\r\n }\r\n ReadableByteStreamControllerRespondInternal(controller, bytesWritten);\r\n}\r\nfunction ReadableByteStreamControllerRespondWithNewView(controller, view) {\r\n var firstDescriptor = controller._pendingPullIntos.peek();\r\n if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) {\r\n throw new RangeError('The region specified by view does not match byobRequest');\r\n }\r\n if (firstDescriptor.byteLength !== view.byteLength) {\r\n throw new RangeError('The buffer of view has different capacity than byobRequest');\r\n }\r\n firstDescriptor.buffer = view.buffer;\r\n ReadableByteStreamControllerRespondInternal(controller, view.byteLength);\r\n}\r\nfunction SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) {\r\n controller._controlledReadableByteStream = stream;\r\n controller._pullAgain = false;\r\n controller._pulling = false;\r\n controller._byobRequest = undefined;\r\n // Need to set the slots so that the assert doesn't fire. In the spec the slots already exist implicitly.\r\n controller._queue = controller._queueTotalSize = undefined;\r\n ResetQueue(controller);\r\n controller._closeRequested = false;\r\n controller._started = false;\r\n controller._strategyHWM = ValidateAndNormalizeHighWaterMark(highWaterMark);\r\n controller._pullAlgorithm = pullAlgorithm;\r\n controller._cancelAlgorithm = cancelAlgorithm;\r\n controller._autoAllocateChunkSize = autoAllocateChunkSize;\r\n controller._pendingPullIntos = new SimpleQueue();\r\n stream._readableStreamController = controller;\r\n var startResult = startAlgorithm();\r\n uponPromise(promiseResolvedWith(startResult), function () {\r\n controller._started = true;\r\n ReadableByteStreamControllerCallPullIfNeeded(controller);\r\n }, function (r) {\r\n ReadableByteStreamControllerError(controller, r);\r\n });\r\n}\r\nfunction SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {\r\n var controller = Object.create(ReadableByteStreamController.prototype);\r\n function startAlgorithm() {\r\n return InvokeOrNoop(underlyingByteSource, 'start', [controller]);\r\n }\r\n var pullAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingByteSource, 'pull', 0, [controller]);\r\n var cancelAlgorithm = CreateAlgorithmFromUnderlyingMethod(underlyingByteSource, 'cancel', 1, []);\r\n var autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;\r\n if (autoAllocateChunkSize !== undefined) {\r\n autoAllocateChunkSize = Number(autoAllocateChunkSize);\r\n if (NumberIsInteger(autoAllocateChunkSize) === false || autoAllocateChunkSize <= 0) {\r\n throw new RangeError('autoAllocateChunkSize must be a positive integer');\r\n }\r\n }\r\n SetUpReadableByteStreamController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize);\r\n}\r\nfunction SetUpReadableStreamBYOBRequest(request, controller, view) {\r\n request._associatedReadableByteStreamController = controller;\r\n request._view = view;\r\n}\r\n// Helper functions for the ReadableStreamBYOBRequest.\r\nfunction byobRequestBrandCheckException(name) {\r\n return new TypeError(\"ReadableStreamBYOBRequest.prototype.\" + name + \" can only be used on a ReadableStreamBYOBRequest\");\r\n}\r\n// Helper functions for the ReadableByteStreamController.\r\nfunction byteStreamControllerBrandCheckException(name) {\r\n return new TypeError(\"ReadableByteStreamController.prototype.\" + name + \" can only be used on a ReadableByteStreamController\");\r\n}\n\n// Abstract operations for the ReadableStream.\r\nfunction AcquireReadableStreamBYOBReader(stream, forAuthorCode) {\r\n if (forAuthorCode === void 0) { forAuthorCode = false; }\r\n var reader = new ReadableStreamBYOBReader(stream);\r\n reader._forAuthorCode = forAuthorCode;\r\n return reader;\r\n}\r\n// ReadableStream API exposed for controllers.\r\nfunction ReadableStreamAddReadIntoRequest(stream) {\r\n var promise = newPromise(function (resolve, reject) {\r\n var readIntoRequest = {\r\n _resolve: resolve,\r\n _reject: reject\r\n };\r\n stream._reader._readIntoRequests.push(readIntoRequest);\r\n });\r\n return promise;\r\n}\r\nfunction ReadableStreamFulfillReadIntoRequest(stream, chunk, done) {\r\n var reader = stream._reader;\r\n var readIntoRequest = reader._readIntoRequests.shift();\r\n readIntoRequest._resolve(ReadableStreamCreateReadResult(chunk, done, reader._forAuthorCode));\r\n}\r\nfunction ReadableStreamGetNumReadIntoRequests(stream) {\r\n return stream._reader._readIntoRequests.length;\r\n}\r\nfunction ReadableStreamHasBYOBReader(stream) {\r\n var reader = stream._reader;\r\n if (reader === undefined) {\r\n return false;\r\n }\r\n if (!IsReadableStreamBYOBReader(reader)) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nvar ReadableStreamBYOBReader = /** @class */ (function () {\r\n function ReadableStreamBYOBReader(stream) {\r\n if (!IsReadableStream(stream)) {\r\n throw new TypeError('ReadableStreamBYOBReader can only be constructed with a ReadableStream instance given a ' +\r\n 'byte source');\r\n }\r\n if (IsReadableByteStreamController(stream._readableStreamController) === false) {\r\n throw new TypeError('Cannot construct a ReadableStreamBYOBReader for a stream not constructed with a byte ' +\r\n 'source');\r\n }\r\n if (IsReadableStreamLocked(stream)) {\r\n throw new TypeError('This stream has already been locked for exclusive reading by another reader');\r\n }\r\n ReadableStreamReaderGenericInitialize(this, stream);\r\n this._readIntoRequests = new SimpleQueue();\r\n }\r\n Object.defineProperty(ReadableStreamBYOBReader.prototype, \"closed\", {\r\n get: function () {\r\n if (!IsReadableStreamBYOBReader(this)) {\r\n return promiseRejectedWith(byobReaderBrandCheckException('closed'));\r\n }\r\n return this._closedPromise;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableStreamBYOBReader.prototype.cancel = function (reason) {\r\n if (!IsReadableStreamBYOBReader(this)) {\r\n return promiseRejectedWith(byobReaderBrandCheckException('cancel'));\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('cancel'));\r\n }\r\n return ReadableStreamReaderGenericCancel(this, reason);\r\n };\r\n ReadableStreamBYOBReader.prototype.read = function (view) {\r\n if (!IsReadableStreamBYOBReader(this)) {\r\n return promiseRejectedWith(byobReaderBrandCheckException('read'));\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return promiseRejectedWith(readerLockException('read from'));\r\n }\r\n if (!ArrayBuffer.isView(view)) {\r\n return promiseRejectedWith(new TypeError('view must be an array buffer view'));\r\n }\r\n if (IsDetachedBuffer(view.buffer) === true) ;\r\n if (view.byteLength === 0) {\r\n return promiseRejectedWith(new TypeError('view must have non-zero byteLength'));\r\n }\r\n return ReadableStreamBYOBReaderRead(this, view);\r\n };\r\n ReadableStreamBYOBReader.prototype.releaseLock = function () {\r\n if (!IsReadableStreamBYOBReader(this)) {\r\n throw byobReaderBrandCheckException('releaseLock');\r\n }\r\n if (this._ownerReadableStream === undefined) {\r\n return;\r\n }\r\n if (this._readIntoRequests.length > 0) {\r\n throw new TypeError('Tried to release a reader lock when that reader has pending read() calls un-settled');\r\n }\r\n ReadableStreamReaderGenericRelease(this);\r\n };\r\n return ReadableStreamBYOBReader;\r\n}());\r\n// Abstract operations for the readers.\r\nfunction IsReadableStreamBYOBReader(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_readIntoRequests')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction ReadableStreamBYOBReaderRead(reader, view) {\r\n var stream = reader._ownerReadableStream;\r\n stream._disturbed = true;\r\n if (stream._state === 'errored') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n // Controllers must implement this.\r\n return ReadableByteStreamControllerPullInto(stream._readableStreamController, view);\r\n}\r\n// Helper functions for the ReadableStreamBYOBReader.\r\nfunction byobReaderBrandCheckException(name) {\r\n return new TypeError(\"ReadableStreamBYOBReader.prototype.\" + name + \" can only be used on a ReadableStreamBYOBReader\");\r\n}\n\nvar ReadableStream = /** @class */ (function () {\r\n function ReadableStream(underlyingSource, strategy) {\r\n if (underlyingSource === void 0) { underlyingSource = {}; }\r\n if (strategy === void 0) { strategy = {}; }\r\n InitializeReadableStream(this);\r\n var size = strategy.size;\r\n var highWaterMark = strategy.highWaterMark;\r\n var type = underlyingSource.type;\r\n var typeString = String(type);\r\n if (typeString === 'bytes') {\r\n if (size !== undefined) {\r\n throw new RangeError('The strategy for a byte stream cannot have a size function');\r\n }\r\n if (highWaterMark === undefined) {\r\n highWaterMark = 0;\r\n }\r\n highWaterMark = ValidateAndNormalizeHighWaterMark(highWaterMark);\r\n SetUpReadableByteStreamControllerFromUnderlyingSource(this, underlyingSource, highWaterMark);\r\n }\r\n else if (type === undefined) {\r\n var sizeAlgorithm = MakeSizeAlgorithmFromSizeFunction(size);\r\n if (highWaterMark === undefined) {\r\n highWaterMark = 1;\r\n }\r\n highWaterMark = ValidateAndNormalizeHighWaterMark(highWaterMark);\r\n SetUpReadableStreamDefaultControllerFromUnderlyingSource(this, underlyingSource, highWaterMark, sizeAlgorithm);\r\n }\r\n else {\r\n throw new RangeError('Invalid type is specified');\r\n }\r\n }\r\n Object.defineProperty(ReadableStream.prototype, \"locked\", {\r\n get: function () {\r\n if (IsReadableStream(this) === false) {\r\n throw streamBrandCheckException$1('locked');\r\n }\r\n return IsReadableStreamLocked(this);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n ReadableStream.prototype.cancel = function (reason) {\r\n if (IsReadableStream(this) === false) {\r\n return promiseRejectedWith(streamBrandCheckException$1('cancel'));\r\n }\r\n if (IsReadableStreamLocked(this) === true) {\r\n return promiseRejectedWith(new TypeError('Cannot cancel a stream that already has a reader'));\r\n }\r\n return ReadableStreamCancel(this, reason);\r\n };\r\n ReadableStream.prototype.getReader = function (_a) {\r\n var mode = (_a === void 0 ? {} : _a).mode;\r\n if (IsReadableStream(this) === false) {\r\n throw streamBrandCheckException$1('getReader');\r\n }\r\n if (mode === undefined) {\r\n return AcquireReadableStreamDefaultReader(this, true);\r\n }\r\n mode = String(mode);\r\n if (mode === 'byob') {\r\n return AcquireReadableStreamBYOBReader(this, true);\r\n }\r\n throw new RangeError('Invalid mode is specified');\r\n };\r\n ReadableStream.prototype.pipeThrough = function (_a, _b) {\r\n var writable = _a.writable, readable = _a.readable;\r\n var _c = _b === void 0 ? {} : _b, preventClose = _c.preventClose, preventAbort = _c.preventAbort, preventCancel = _c.preventCancel, signal = _c.signal;\r\n if (IsReadableStream(this) === false) {\r\n throw streamBrandCheckException$1('pipeThrough');\r\n }\r\n if (IsWritableStream(writable) === false) {\r\n throw new TypeError('writable argument to pipeThrough must be a WritableStream');\r\n }\r\n if (IsReadableStream(readable) === false) {\r\n throw new TypeError('readable argument to pipeThrough must be a ReadableStream');\r\n }\r\n preventClose = Boolean(preventClose);\r\n preventAbort = Boolean(preventAbort);\r\n preventCancel = Boolean(preventCancel);\r\n if (signal !== undefined && !isAbortSignal(signal)) {\r\n throw new TypeError('ReadableStream.prototype.pipeThrough\\'s signal option must be an AbortSignal');\r\n }\r\n if (IsReadableStreamLocked(this) === true) {\r\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked ReadableStream');\r\n }\r\n if (IsWritableStreamLocked(writable) === true) {\r\n throw new TypeError('ReadableStream.prototype.pipeThrough cannot be used on a locked WritableStream');\r\n }\r\n var promise = ReadableStreamPipeTo(this, writable, preventClose, preventAbort, preventCancel, signal);\r\n setPromiseIsHandledToTrue(promise);\r\n return readable;\r\n };\r\n ReadableStream.prototype.pipeTo = function (dest, _a) {\r\n var _b = _a === void 0 ? {} : _a, preventClose = _b.preventClose, preventAbort = _b.preventAbort, preventCancel = _b.preventCancel, signal = _b.signal;\r\n if (IsReadableStream(this) === false) {\r\n return promiseRejectedWith(streamBrandCheckException$1('pipeTo'));\r\n }\r\n if (IsWritableStream(dest) === false) {\r\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo\\'s first argument must be a WritableStream'));\r\n }\r\n preventClose = Boolean(preventClose);\r\n preventAbort = Boolean(preventAbort);\r\n preventCancel = Boolean(preventCancel);\r\n if (signal !== undefined && !isAbortSignal(signal)) {\r\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo\\'s signal option must be an AbortSignal'));\r\n }\r\n if (IsReadableStreamLocked(this) === true) {\r\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked ReadableStream'));\r\n }\r\n if (IsWritableStreamLocked(dest) === true) {\r\n return promiseRejectedWith(new TypeError('ReadableStream.prototype.pipeTo cannot be used on a locked WritableStream'));\r\n }\r\n return ReadableStreamPipeTo(this, dest, preventClose, preventAbort, preventCancel, signal);\r\n };\r\n ReadableStream.prototype.tee = function () {\r\n if (IsReadableStream(this) === false) {\r\n throw streamBrandCheckException$1('tee');\r\n }\r\n var branches = ReadableStreamTee(this);\r\n return createArrayFromList(branches);\r\n };\r\n ReadableStream.prototype.getIterator = function (_a) {\r\n var _b = (_a === void 0 ? {} : _a).preventCancel, preventCancel = _b === void 0 ? false : _b;\r\n if (IsReadableStream(this) === false) {\r\n throw streamBrandCheckException$1('getIterator');\r\n }\r\n return AcquireReadableStreamAsyncIterator(this, preventCancel);\r\n };\r\n return ReadableStream;\r\n}());\r\nif (typeof SymbolPolyfill.asyncIterator === 'symbol') {\r\n Object.defineProperty(ReadableStream.prototype, SymbolPolyfill.asyncIterator, {\r\n value: ReadableStream.prototype.getIterator,\r\n enumerable: false,\r\n writable: true,\r\n configurable: true\r\n });\r\n}\r\n// Abstract operations for the ReadableStream.\r\n// Throws if and only if startAlgorithm throws.\r\nfunction CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm) {\r\n if (highWaterMark === void 0) { highWaterMark = 1; }\r\n if (sizeAlgorithm === void 0) { sizeAlgorithm = function () { return 1; }; }\r\n var stream = Object.create(ReadableStream.prototype);\r\n InitializeReadableStream(stream);\r\n var controller = Object.create(ReadableStreamDefaultController.prototype);\r\n SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);\r\n return stream;\r\n}\r\nfunction InitializeReadableStream(stream) {\r\n stream._state = 'readable';\r\n stream._reader = undefined;\r\n stream._storedError = undefined;\r\n stream._disturbed = false;\r\n}\r\nfunction IsReadableStream(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_readableStreamController')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction IsReadableStreamLocked(stream) {\r\n if (stream._reader === undefined) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n// ReadableStream API exposed for controllers.\r\nfunction ReadableStreamCancel(stream, reason) {\r\n stream._disturbed = true;\r\n if (stream._state === 'closed') {\r\n return promiseResolvedWith(undefined);\r\n }\r\n if (stream._state === 'errored') {\r\n return promiseRejectedWith(stream._storedError);\r\n }\r\n ReadableStreamClose(stream);\r\n var sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);\r\n return transformPromiseWith(sourceCancelPromise, noop);\r\n}\r\nfunction ReadableStreamClose(stream) {\r\n stream._state = 'closed';\r\n var reader = stream._reader;\r\n if (reader === undefined) {\r\n return;\r\n }\r\n if (IsReadableStreamDefaultReader(reader)) {\r\n reader._readRequests.forEach(function (readRequest) {\r\n readRequest._resolve(ReadableStreamCreateReadResult(undefined, true, reader._forAuthorCode));\r\n });\r\n reader._readRequests = new SimpleQueue();\r\n }\r\n defaultReaderClosedPromiseResolve(reader);\r\n}\r\nfunction ReadableStreamError(stream, e) {\r\n stream._state = 'errored';\r\n stream._storedError = e;\r\n var reader = stream._reader;\r\n if (reader === undefined) {\r\n return;\r\n }\r\n if (IsReadableStreamDefaultReader(reader)) {\r\n reader._readRequests.forEach(function (readRequest) {\r\n readRequest._reject(e);\r\n });\r\n reader._readRequests = new SimpleQueue();\r\n }\r\n else {\r\n reader._readIntoRequests.forEach(function (readIntoRequest) {\r\n readIntoRequest._reject(e);\r\n });\r\n reader._readIntoRequests = new SimpleQueue();\r\n }\r\n defaultReaderClosedPromiseReject(reader, e);\r\n}\r\n// Helper functions for the ReadableStream.\r\nfunction streamBrandCheckException$1(name) {\r\n return new TypeError(\"ReadableStream.prototype.\" + name + \" can only be used on a ReadableStream\");\r\n}\n\nvar ByteLengthQueuingStrategy = /** @class */ (function () {\r\n function ByteLengthQueuingStrategy(_a) {\r\n var highWaterMark = _a.highWaterMark;\r\n this.highWaterMark = highWaterMark;\r\n }\r\n ByteLengthQueuingStrategy.prototype.size = function (chunk) {\r\n return chunk.byteLength;\r\n };\r\n return ByteLengthQueuingStrategy;\r\n}());\n\nvar CountQueuingStrategy = /** @class */ (function () {\r\n function CountQueuingStrategy(_a) {\r\n var highWaterMark = _a.highWaterMark;\r\n this.highWaterMark = highWaterMark;\r\n }\r\n CountQueuingStrategy.prototype.size = function () {\r\n return 1;\r\n };\r\n return CountQueuingStrategy;\r\n}());\n\n// Class TransformStream\r\nvar TransformStream = /** @class */ (function () {\r\n function TransformStream(transformer, writableStrategy, readableStrategy) {\r\n if (transformer === void 0) { transformer = {}; }\r\n if (writableStrategy === void 0) { writableStrategy = {}; }\r\n if (readableStrategy === void 0) { readableStrategy = {}; }\r\n var writableSizeFunction = writableStrategy.size;\r\n var writableHighWaterMark = writableStrategy.highWaterMark;\r\n var readableSizeFunction = readableStrategy.size;\r\n var readableHighWaterMark = readableStrategy.highWaterMark;\r\n var writableType = transformer.writableType;\r\n if (writableType !== undefined) {\r\n throw new RangeError('Invalid writable type specified');\r\n }\r\n var writableSizeAlgorithm = MakeSizeAlgorithmFromSizeFunction(writableSizeFunction);\r\n if (writableHighWaterMark === undefined) {\r\n writableHighWaterMark = 1;\r\n }\r\n writableHighWaterMark = ValidateAndNormalizeHighWaterMark(writableHighWaterMark);\r\n var readableType = transformer.readableType;\r\n if (readableType !== undefined) {\r\n throw new RangeError('Invalid readable type specified');\r\n }\r\n var readableSizeAlgorithm = MakeSizeAlgorithmFromSizeFunction(readableSizeFunction);\r\n if (readableHighWaterMark === undefined) {\r\n readableHighWaterMark = 0;\r\n }\r\n readableHighWaterMark = ValidateAndNormalizeHighWaterMark(readableHighWaterMark);\r\n var startPromise_resolve;\r\n var startPromise = newPromise(function (resolve) {\r\n startPromise_resolve = resolve;\r\n });\r\n InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\r\n SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);\r\n var startResult = InvokeOrNoop(transformer, 'start', [this._transformStreamController]);\r\n startPromise_resolve(startResult);\r\n }\r\n Object.defineProperty(TransformStream.prototype, \"readable\", {\r\n get: function () {\r\n if (IsTransformStream(this) === false) {\r\n throw streamBrandCheckException$2('readable');\r\n }\r\n return this._readable;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(TransformStream.prototype, \"writable\", {\r\n get: function () {\r\n if (IsTransformStream(this) === false) {\r\n throw streamBrandCheckException$2('writable');\r\n }\r\n return this._writable;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n return TransformStream;\r\n}());\r\nfunction InitializeTransformStream(stream, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm) {\r\n function startAlgorithm() {\r\n return startPromise;\r\n }\r\n function writeAlgorithm(chunk) {\r\n return TransformStreamDefaultSinkWriteAlgorithm(stream, chunk);\r\n }\r\n function abortAlgorithm(reason) {\r\n return TransformStreamDefaultSinkAbortAlgorithm(stream, reason);\r\n }\r\n function closeAlgorithm() {\r\n return TransformStreamDefaultSinkCloseAlgorithm(stream);\r\n }\r\n stream._writable = CreateWritableStream(startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, writableHighWaterMark, writableSizeAlgorithm);\r\n function pullAlgorithm() {\r\n return TransformStreamDefaultSourcePullAlgorithm(stream);\r\n }\r\n function cancelAlgorithm(reason) {\r\n TransformStreamErrorWritableAndUnblockWrite(stream, reason);\r\n return promiseResolvedWith(undefined);\r\n }\r\n stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);\r\n // The [[backpressure]] slot is set to undefined so that it can be initialised by TransformStreamSetBackpressure.\r\n stream._backpressure = undefined;\r\n stream._backpressureChangePromise = undefined;\r\n stream._backpressureChangePromise_resolve = undefined;\r\n TransformStreamSetBackpressure(stream, true);\r\n // Used by IsWritableStream() which is called by SetUpTransformStreamDefaultController().\r\n stream._transformStreamController = undefined;\r\n}\r\nfunction IsTransformStream(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_transformStreamController')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\n// This is a no-op if both sides are already errored.\r\nfunction TransformStreamError(stream, e) {\r\n ReadableStreamDefaultControllerError(stream._readable._readableStreamController, e);\r\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\r\n}\r\nfunction TransformStreamErrorWritableAndUnblockWrite(stream, e) {\r\n TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);\r\n WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);\r\n if (stream._backpressure === true) {\r\n // Pretend that pull() was called to permit any pending write() calls to complete. TransformStreamSetBackpressure()\r\n // cannot be called from enqueue() or pull() once the ReadableStream is errored, so this will will be the final time\r\n // _backpressure is set.\r\n TransformStreamSetBackpressure(stream, false);\r\n }\r\n}\r\nfunction TransformStreamSetBackpressure(stream, backpressure) {\r\n // Passes also when called during construction.\r\n if (stream._backpressureChangePromise !== undefined) {\r\n stream._backpressureChangePromise_resolve();\r\n }\r\n stream._backpressureChangePromise = newPromise(function (resolve) {\r\n stream._backpressureChangePromise_resolve = resolve;\r\n });\r\n stream._backpressure = backpressure;\r\n}\r\nvar TransformStreamDefaultController = /** @class */ (function () {\r\n /** @internal */\r\n function TransformStreamDefaultController() {\r\n throw new TypeError('TransformStreamDefaultController instances cannot be created directly');\r\n }\r\n Object.defineProperty(TransformStreamDefaultController.prototype, \"desiredSize\", {\r\n get: function () {\r\n if (IsTransformStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException$1('desiredSize');\r\n }\r\n var readableController = this._controlledTransformStream._readable._readableStreamController;\r\n return ReadableStreamDefaultControllerGetDesiredSize(readableController);\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n TransformStreamDefaultController.prototype.enqueue = function (chunk) {\r\n if (IsTransformStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException$1('enqueue');\r\n }\r\n TransformStreamDefaultControllerEnqueue(this, chunk);\r\n };\r\n TransformStreamDefaultController.prototype.error = function (reason) {\r\n if (IsTransformStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException$1('error');\r\n }\r\n TransformStreamDefaultControllerError(this, reason);\r\n };\r\n TransformStreamDefaultController.prototype.terminate = function () {\r\n if (IsTransformStreamDefaultController(this) === false) {\r\n throw defaultControllerBrandCheckException$1('terminate');\r\n }\r\n TransformStreamDefaultControllerTerminate(this);\r\n };\r\n return TransformStreamDefaultController;\r\n}());\r\n// Transform Stream Default Controller Abstract Operations\r\nfunction IsTransformStreamDefaultController(x) {\r\n if (!typeIsObject(x)) {\r\n return false;\r\n }\r\n if (!Object.prototype.hasOwnProperty.call(x, '_controlledTransformStream')) {\r\n return false;\r\n }\r\n return true;\r\n}\r\nfunction SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {\r\n controller._controlledTransformStream = stream;\r\n stream._transformStreamController = controller;\r\n controller._transformAlgorithm = transformAlgorithm;\r\n controller._flushAlgorithm = flushAlgorithm;\r\n}\r\nfunction SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {\r\n var controller = Object.create(TransformStreamDefaultController.prototype);\r\n var transformAlgorithm = function (chunk) {\r\n try {\r\n TransformStreamDefaultControllerEnqueue(controller, chunk);\r\n return promiseResolvedWith(undefined);\r\n }\r\n catch (transformResultE) {\r\n return promiseRejectedWith(transformResultE);\r\n }\r\n };\r\n var transformMethod = transformer.transform;\r\n if (transformMethod !== undefined) {\r\n if (typeof transformMethod !== 'function') {\r\n throw new TypeError('transform is not a method');\r\n }\r\n transformAlgorithm = function (chunk) { return PromiseCall(transformMethod, transformer, [chunk, controller]); };\r\n }\r\n var flushAlgorithm = CreateAlgorithmFromUnderlyingMethod(transformer, 'flush', 0, [controller]);\r\n SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);\r\n}\r\nfunction TransformStreamDefaultControllerClearAlgorithms(controller) {\r\n controller._transformAlgorithm = undefined;\r\n controller._flushAlgorithm = undefined;\r\n}\r\nfunction TransformStreamDefaultControllerEnqueue(controller, chunk) {\r\n var stream = controller._controlledTransformStream;\r\n var readableController = stream._readable._readableStreamController;\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController) === false) {\r\n throw new TypeError('Readable side is not in a state that permits enqueue');\r\n }\r\n // We throttle transform invocations based on the backpressure of the ReadableStream, but we still\r\n // accept TransformStreamDefaultControllerEnqueue() calls.\r\n try {\r\n ReadableStreamDefaultControllerEnqueue(readableController, chunk);\r\n }\r\n catch (e) {\r\n // This happens when readableStrategy.size() throws.\r\n TransformStreamErrorWritableAndUnblockWrite(stream, e);\r\n throw stream._readable._storedError;\r\n }\r\n var backpressure = ReadableStreamDefaultControllerHasBackpressure(readableController);\r\n if (backpressure !== stream._backpressure) {\r\n TransformStreamSetBackpressure(stream, true);\r\n }\r\n}\r\nfunction TransformStreamDefaultControllerError(controller, e) {\r\n TransformStreamError(controller._controlledTransformStream, e);\r\n}\r\nfunction TransformStreamDefaultControllerPerformTransform(controller, chunk) {\r\n var transformPromise = controller._transformAlgorithm(chunk);\r\n return transformPromiseWith(transformPromise, undefined, function (r) {\r\n TransformStreamError(controller._controlledTransformStream, r);\r\n throw r;\r\n });\r\n}\r\nfunction TransformStreamDefaultControllerTerminate(controller) {\r\n var stream = controller._controlledTransformStream;\r\n var readableController = stream._readable._readableStreamController;\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController) === true) {\r\n ReadableStreamDefaultControllerClose(readableController);\r\n }\r\n var error = new TypeError('TransformStream terminated');\r\n TransformStreamErrorWritableAndUnblockWrite(stream, error);\r\n}\r\n// TransformStreamDefaultSink Algorithms\r\nfunction TransformStreamDefaultSinkWriteAlgorithm(stream, chunk) {\r\n var controller = stream._transformStreamController;\r\n if (stream._backpressure === true) {\r\n var backpressureChangePromise = stream._backpressureChangePromise;\r\n return transformPromiseWith(backpressureChangePromise, function () {\r\n var writable = stream._writable;\r\n var state = writable._state;\r\n if (state === 'erroring') {\r\n throw writable._storedError;\r\n }\r\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\r\n });\r\n }\r\n return TransformStreamDefaultControllerPerformTransform(controller, chunk);\r\n}\r\nfunction TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {\r\n // abort() is not called synchronously, so it is possible for abort() to be called when the stream is already\r\n // errored.\r\n TransformStreamError(stream, reason);\r\n return promiseResolvedWith(undefined);\r\n}\r\nfunction TransformStreamDefaultSinkCloseAlgorithm(stream) {\r\n // stream._readable cannot change after construction, so caching it across a call to user code is safe.\r\n var readable = stream._readable;\r\n var controller = stream._transformStreamController;\r\n var flushPromise = controller._flushAlgorithm();\r\n TransformStreamDefaultControllerClearAlgorithms(controller);\r\n // Return a promise that is fulfilled with undefined on success.\r\n return transformPromiseWith(flushPromise, function () {\r\n if (readable._state === 'errored') {\r\n throw readable._storedError;\r\n }\r\n var readableController = readable._readableStreamController;\r\n if (ReadableStreamDefaultControllerCanCloseOrEnqueue(readableController) === true) {\r\n ReadableStreamDefaultControllerClose(readableController);\r\n }\r\n }, function (r) {\r\n TransformStreamError(stream, r);\r\n throw readable._storedError;\r\n });\r\n}\r\n// TransformStreamDefaultSource Algorithms\r\nfunction TransformStreamDefaultSourcePullAlgorithm(stream) {\r\n // Invariant. Enforced by the promises returned by start() and pull().\r\n TransformStreamSetBackpressure(stream, false);\r\n // Prevent the next pull() call until there is backpressure.\r\n return stream._backpressureChangePromise;\r\n}\r\n// Helper functions for the TransformStreamDefaultController.\r\nfunction defaultControllerBrandCheckException$1(name) {\r\n return new TypeError(\"TransformStreamDefaultController.prototype.\" + name + \" can only be used on a TransformStreamDefaultController\");\r\n}\r\n// Helper functions for the TransformStream.\r\nfunction streamBrandCheckException$2(name) {\r\n return new TypeError(\"TransformStream.prototype.\" + name + \" can only be used on a TransformStream\");\r\n}\n\nexport { ByteLengthQueuingStrategy, CountQueuingStrategy, ReadableStream, TransformStream, WritableStream };\n//# sourceMappingURL=ponyfill.mjs.map\n" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "index", "request": "./src/index.ts", "reasons": [] } ] }, { "id": 6, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendor) (name: npm.webp-hero)", "size": 374147, "names": [ "npm.webp-hero" ], "files": [ "npm.webp-hero.chunk.js" ], "hash": "65dcf549a7e9f147f27f", "siblings": [ 8 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 86, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/webp-hero/libwebp/dist/webp.js", "name": "./node_modules/webp-hero/libwebp/dist/webp.js", "index": 85, "index2": 88, "size": 373418, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 6 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "issuerId": 85, "issuerName": "./src/lib/webp.ts", "issuerPath": [ { "id": 85, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "name": "./src/lib/webp.ts", "profile": { "factory": 273, "building": 1362 } } ], "profile": { "factory": 45, "building": 593 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 85, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "module": "./src/lib/webp.ts", "moduleName": "./src/lib/webp.ts", "type": "cjs require", "userRequest": "webp-hero/libwebp/dist/webp.js", "loc": "12:18-59" } ], "usedExports": true, "providedExports": [ "Webp" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module uses injected variables (setImmediate)" ], "depth": 1, "source": "\nfunction Webp() {\nvar Module=typeof Module!==\"undefined\"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}Module[\"arguments\"]=[];Module[\"thisProgram\"]=\"./this.program\";Module[\"quit\"]=function(status,toThrow){throw toThrow};Module[\"preRun\"]=[];Module[\"postRun\"]=[];var ENVIRONMENT_IS_WEB=true;var ENVIRONMENT_IS_WORKER=true;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;var scriptDirectory=\"\";function locateFile(path){if(Module[\"locateFile\"]){return Module[\"locateFile\"](path,scriptDirectory)}else{return scriptDirectory+path}}if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf(\"blob:\")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf(\"/\")+1)}else{scriptDirectory=\"\"}Module[\"read\"]=function shell_read(url){try{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.send(null);return xhr.responseText}catch(err){var data=tryParseAsDataURI(url);if(data){return intArrayToString(data)}throw err}};if(ENVIRONMENT_IS_WORKER){Module[\"readBinary\"]=function readBinary(url){try{var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,false);xhr.responseType=\"arraybuffer\";xhr.send(null);return new Uint8Array(xhr.response)}catch(err){var data=tryParseAsDataURI(url);if(data){return data}throw err}}}Module[\"readAsync\"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open(\"GET\",url,true);xhr.responseType=\"arraybuffer\";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}var data=tryParseAsDataURI(url);if(data){onload(data.buffer);return}onerror()};xhr.onerror=onerror;xhr.send(null)};Module[\"setWindowTitle\"]=function(title){document.title=title}}else{}var out=Module[\"print\"]||(typeof console!==\"undefined\"?console.log.bind(console):typeof print!==\"undefined\"?print:null);var err=Module[\"printErr\"]||(typeof printErr!==\"undefined\"?printErr:typeof console!==\"undefined\"&&console.warn.bind(console)||out);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var STACK_ALIGN=16;function dynamicAlloc(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=ret+size+15&-16;if(end<=_emscripten_get_heap_size()){HEAP32[DYNAMICTOP_PTR>>2]=end}else{var success=_emscripten_resize_heap(end);if(!success)return 0}return ret}function getNativeTypeSize(type){switch(type){case\"i1\":case\"i8\":return 1;case\"i16\":return 2;case\"i32\":return 4;case\"i64\":return 8;case\"float\":return 4;case\"double\":return 8;default:{if(type[type.length-1]===\"*\"){return 4}else if(type[0]===\"i\"){var bits=parseInt(type.substr(1));assert(bits%8===0,\"getNativeTypeSize invalid bits \"+bits+\", type \"+type);return bits/8}else{return 0}}}}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var jsCallStartIndex=1;var functionPointers=new Array(0);var funcWrappers={};function dynCall(sig,ptr,args){if(args&&args.length){return Module[\"dynCall_\"+sig].apply(null,[ptr].concat(args))}else{return Module[\"dynCall_\"+sig].call(null,ptr)}}var tempRet0=0;var setTempRet0=function(value){tempRet0=value};var getTempRet0=function(){return tempRet0};var GLOBAL_BASE=8;var ABORT=false;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort(\"Assertion failed: \"+text)}}function getCFunc(ident){var func=Module[\"_\"+ident];assert(func,\"Cannot call unknown function \"+ident+\", make sure it is exported\");return func}function ccall(ident,returnType,argTypes,args,opts){var toC={\"string\":function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=stackAlloc(len);stringToUTF8(str,ret,len)}return ret},\"array\":function(arr){var ret=stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}};function convertReturnValue(ret){if(returnType===\"string\")return UTF8ToString(ret);if(returnType===\"boolean\")return Boolean(ret);return ret}var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i>0]=value;break;case\"i8\":HEAP8[ptr>>0]=value;break;case\"i16\":HEAP16[ptr>>1]=value;break;case\"i32\":HEAP32[ptr>>2]=value;break;case\"i64\":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case\"float\":HEAPF32[ptr>>2]=value;break;case\"double\":HEAPF64[ptr>>3]=value;break;default:abort(\"invalid type for setValue: \"+type)}}var ALLOC_NONE=3;var UTF8Decoder=typeof TextDecoder!==\"undefined\"?new TextDecoder(\"utf8\"):undefined;function UTF8ArrayToString(u8Array,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var endPtr=idx;while(u8Array[endPtr]&&!(endPtr>=endIdx))++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var str=\"\";while(idx>10,56320|ch&1023)}}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):\"\"}function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}var UTF16Decoder=typeof TextDecoder!==\"undefined\"?new TextDecoder(\"utf-16le\"):undefined;function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}function demangle(func){return func}function demangleAll(text){var regex=/__Z[\\w\\d_]+/g;return text.replace(regex,function(x){var y=demangle(x);return x===y?x:y+\" [\"+x+\"]\"})}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return\"(no stack trace available)\"}}return err.stack.toString()}function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBufferViews(){Module[\"HEAP8\"]=HEAP8=new Int8Array(buffer);Module[\"HEAP16\"]=HEAP16=new Int16Array(buffer);Module[\"HEAP32\"]=HEAP32=new Int32Array(buffer);Module[\"HEAPU8\"]=HEAPU8=new Uint8Array(buffer);Module[\"HEAPU16\"]=HEAPU16=new Uint16Array(buffer);Module[\"HEAPU32\"]=HEAPU32=new Uint32Array(buffer);Module[\"HEAPF32\"]=HEAPF32=new Float32Array(buffer);Module[\"HEAPF64\"]=HEAPF64=new Float64Array(buffer)}var STACK_BASE=11056,DYNAMIC_BASE=5253936,DYNAMICTOP_PTR=10800;var TOTAL_STACK=5242880;var INITIAL_TOTAL_MEMORY=Module[\"TOTAL_MEMORY\"]||67108864;if(INITIAL_TOTAL_MEMORY>2]=DYNAMIC_BASE;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback==\"function\"){callback();continue}var func=callback.func;if(typeof func===\"number\"){if(callback.arg===undefined){Module[\"dynCall_v\"](func)}else{Module[\"dynCall_vi\"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module[\"preRun\"]){if(typeof Module[\"preRun\"]==\"function\")Module[\"preRun\"]=[Module[\"preRun\"]];while(Module[\"preRun\"].length){addOnPreRun(Module[\"preRun\"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){runtimeExited=true}function postRun(){if(Module[\"postRun\"]){if(typeof Module[\"postRun\"]==\"function\")Module[\"postRun\"]=[Module[\"postRun\"]];while(Module[\"postRun\"].length){addOnPostRun(Module[\"postRun\"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}if(!Math.imul||Math.imul(4294967295,5)!==-5)Math.imul=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};if(!Math.clz32)Math.clz32=function(x){var n=32;var y=x>>16;if(y){n-=16;x=y}y=x>>8;if(y){n-=8;x=y}y=x>>4;if(y){n-=4;x=y}y=x>>2;if(y){n-=2;x=y}y=x>>1;if(y)return n-2;return n-x};if(!Math.trunc)Math.trunc=function(x){return x<0?Math.ceil(x):Math.floor(x)};var Math_abs=Math.abs;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_min=Math.min;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){runDependencies++;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module[\"monitorRunDependencies\"]){Module[\"monitorRunDependencies\"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module[\"preloadedImages\"]={};Module[\"preloadedAudios\"]={};var memoryInitializer=null;var dataURIPrefix=\"data:application/octet-stream;base64,\";function isDataURI(filename){return String.prototype.startsWith?filename.startsWith(dataURIPrefix):filename.indexOf(dataURIPrefix)===0}memoryInitializer=\"data:application/octet-stream;base64,AAAAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8DBwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5ufo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8AAQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f39/f38AAAAAAAAAAPDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDx8vP09fb3+Pn6+/z9/v8AAQIDBAUGBwgJCgsMDQ4PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PDw8PAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8DBwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5ufo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////8AAP/+/fz7+vn49/b19PPy8fDv7u3s6+rp6Ofm5eTj4uHg397d3Nva2djX1tXU09LR0M/OzczLysnIx8bFxMPCwcC/vr28u7q5uLe2tbSzsrGwr66trKuqqainpqWko6KhoJ+enZybmpmYl5aVlJOSkZCPjo2Mi4qJiIeGhYSDgoGAf359fHt6eXh3dnV0c3JxcG9ubWxramloZ2ZlZGNiYWBfXl1cW1pZWFdWVVRTUlFQT05NTEtKSUhHRkVEQ0JBQD8+PTw7Ojk4NzY1NDMyMTAvLi0sKyopKCcmJSQjIiEgHx4dHBsaGRgXFhUUExIREA8ODQwLCgkIBwYFBAMCAQABAgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8DBwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5ufo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8AGAcXGSgGJykWGiYqOAU3ORUbNjolK0gER0kUHDU7RkokLFhFSzQ8A1dZEx1WWiMtRExVWzM9aAJnaRIeZmoiLlRcQ01lazI+eAF3eVNdER9kbEJOdnohL3V7MT9jbVJeAHR8QU8QIGJuMHN9UV9Acn5hb1Bxf2BwAAAAAAAAAAAAAAAAAQAAAAMAAAAHAAAADwAAAB8AAAA/AAAAfwAAAP8AAAD/AQAA/wMAAP8HAAD/DwAA/x8AAP8/AAD/fwAA//8AAP//AQD//wMA//8HAP//DwD//x8A//8/AP//fwD///8AAAAAAAAAAAAAAAAAiguMC44LkguaC6oLygsKDIwMjA2MD4wTAAAAAAAAAAAREgABAgMEBRAGBwgJCgsMDQ4PAAAAAAAAAAAAAAAAADBS4Q2GGLMDy6xfd2piiBxVXDhoKLizFPj+hUpLuN1Jl/P8ZIkCVVwAAClK2sF+Dau3QFl9V5JUcsoZTmmM0zhl7gEMX3WhMlL2N1QyLLtasVeqD+cz9XPa7l9o4sxjdYMOmW7tpzBHxtnATzwVa0n6AxRPDPsaVDILmXMcy9cmBjfMb9h3uywqL3Z13cwlZGFUsyQVh30KqBQEIme/HhSDFbRW4wLlc2+xykRCTSYo+666c+3rUAr7tmodC9Q6DWg72zWDHggrlWvOd/DlgVG8O4V4lJSfADzt5ScAAAAAAAAEAAgADACAAIQAiACMAAABBAEIAQwBgAGEAYgBjAHneDBZc3F4mHCYs0B+qnYuRl+vRY9QVVJIm2c4Ogqr2r0RDZhyGhGjLMMVCq15GFDDGj4sQFWQRwomq9WQIhqqLjcTiKAhzkc/FAhyctAMCeJRKAtgtlQdECSGt1mJYmVqpZRIu2SCnW8gS1BCZqdjSj4o6oApNQmy8Y0aCGtKKxqSSaYxF51BJmmgMzQfc4BoTwwb2f9XEQdXREcscjMPuhcvKQ5utrcVEcJCLRlmxb0XEhZYWJOWKi4txM0rYbd1VSYjsz0nNchXGhUr6Ks4IjNocmYdXU0nHFWrOqVaYkAiFnTOFyIrpklrNiAaMwFRKx9EGWoWQKsk4XIiExVmhLwQTHw+Ek5fVTkyMDPBZSOf129ZLm88lB+s2+QVEm9wcU1Vs/8meHIoKgHE9dEKGW1YKx2MptUlK5o9Px6bQy1EAdFkUAgrmgEzGkeOTk4Q/4AixaspKAVm07cEAd0zMhGo0cAXGVKKHySrG6YmLOVDVzqpUnMaO7M/O1q0O6ZdSZooKBV0j9EiJ68vDxC3It8xLbcuESG3BmIPILc5LhYYgAE2ESVBIElzHIAXgM0oAwlzM8ASBt9XJQlzO01AFS9oNyzaCTY1guJAWkbNKCkXGjk2OXC4BSkmptUeIhqFmHQKIIYnEzXdGnIgSf8fCUHqAg8BdklLIAwzwP+gKzNYHyNDZlU3ulU4FRdvO80tJcA3JkZ8SWYBImJ9YipYaFV1r1JfVDVZgGRxZS1LT3svM4BRqwE5EQVHZjk1KTEmIQ15OUkaAVUpCkOKTW5aL3JzFQIKZv+mFwZlHRAKVYBlxBo5EgpmZtUiFCt1FA8ko4BEARpmPUclIjUf88BFPEcmSXcc3iVELYAiAS8L9as+ERNGklU3PkYlKyWaZKNVoAE/CVyIHEAgyVVLDwkJQP+4dxBWBhwFQP8Z+AE4CBGEif83dIA6DxRShzkaeSikMh+JmoUZI9ozZyyDg3sfBp5WKECHlOAtt4AWGhGD8JoOAdEtEBVbQN4HAcU4FSebPIoXZtVTDA02wP9ELxxVGlVVgIAgkqsSCwc/kKsEBPYjGwqSrqsMGoC+UCNjtFB+Ni1Vfi9XsDMpFCBlS4CLdpJ0gFU4KQ+w7FUlCT5HHhF3dv8REoplJjyKN0YrGo6SJBMeq/9hGxSKLT0+2wFRvEAgKRR1l44UFaNwEww9w4AwBBgAAAAAAAAAAAAAAAAAAf8C/gMEBv0F/Pv6B/kI+PcAAAAAAAAAAAAAAAAAAP///////////////////////////////////////////7D2////////////3/H8///////////5/f3////////////0/P//////////6v7+///////////9///////////////2/v//////////7/3+///////////+//7////////////4/v//////////+//+///////////////////////////9/v//////////+/7+///////////+//7////////////+/f/+////////+v/+//7////////+/////////////////////////////////////////////////////////9n/////////////4fzx/f///v/////q+vH6/f/9/v/////+////////////3/7+///////////u/f7+///////////4/v//////////+f7////////////////////////////9////////////9/7////////////////////////////9/v///////////P/////////////////////////////+/v///////////f/////////////////////////////+/f//////////+v/////////////+/////////////////////////////////////////////////////////7r7+v//////////6vv0/v/////////7+/P9/v/+///////9/v//////////7P3+///////////7/f3+/v/////////+/v///////////v7+///////////////////////////+/////////////v7////////////+/////////////////////////////v////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////j/////////////+v78/v/////////4/vn9///////////9/f//////////9v39///////////8/vv+/v/////////+/P//////////+P79///////////9//7+///////////7/v//////////9fv+///////////9/f7////////////7/f///////////P3+/////////////v/////////////8////////////+f/+//////////////7//////////////f//////////+v///////////////////////////////////////////v///////////////////////////4CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgP2I/v/k24CAgICAvYHy/+PV/9uAgIBqfuP81tH//4CAgAFi+P/s4v//gICAtYXu/t3q/5qAgIBOhsr3xrT/24CAgAG5+f/z/4CAgICAuJb3/+zggICAgIBNbtj/7OaAgICAgAFl+//x/4CAgICAqovx/OzR//+AgIAldMTz5P///4CAgAHM/v/1/4CAgICAz6D6/+6AgICAgIBmZ+f/06uAgICAgAGY/P/w/4CAgICAsYfz/+rhgICAgIBQgdP/wuCAgICAgAEB/4CAgICAgICA9gH/gICAgICAgID/gICAgICAgICAgMYj7d/Bu6KgkZs+gy3G3ayw3J383QFEL5LQlafdov/fgAGV8f/d4P//gICAuI3q/d7c/8eAgIBRY7XysL75yv//gAGB6P3WxfLE//+AY3nS+snG/8qAgIAXW6Pyqrv30v//gAHI9v/q/4CAgICAbbLx/+f1//+AgIAsgsn9zcD//4CAgAGE7/vb0f+lgICAXojh+9q+//+AgIAWZK71uqH/x4CAgAG2+f/o64CAgICAfI/x/+PqgICAgIAjTbX7wdP/zYCAgAGd9//s5///gICAeY3r/+Hj//+AgIAtY7z7w9n/4ICAgAEB+//V/4CAgICAywH4//+AgICAgICJAbH/4P+AgICAgP0J+PvP0P/AgICArw3g88G5+cb//4BJEavdobPsp//qgAFf9/3Ut///gICA71r0+tPR//+AgICbTcP4vMP//4CAgAEY7/va2//NgICAyTPb/8S6gICAgIBFLr7vydr/5ICAgAG/+///gICAgICA36X5/9X/gICAgICNfPj//4CAgICAgAEQ+P//gICAgICAviTm/+z/gICAgICVAf+AgICAgICAgAHi/4CAgICAgICA98D/gICAgICAgIDwgP+AgICAgICAgAGG/P//gICAgICA1T76//+AgICAgIA3Xf+AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMoY1eu6v9yg8K//fia26Km45K7/u4A9Lorbl7Lwqv/YgAFw5vrHv/ef//+Apm3k/NPX/66AgIAnTaLorLT1sv//gAE03PbGx/nc//+AfEq/87fB+t3//4AYR4Lbmqrztv//gAG24fnb8P/ggICAlZbi/NjN/6uAgIAcbKryt8L+3///gAFR5vzMy//AgICAe2bR97zE/+mAgIAUX5nzpK3/y4CAgAHe+P/Y1YCAgICAqK/2/OvN//+AgIAvdNf/09T//4CAgAF57P3U1v//gICAjVTV/MnK/9uAgIAqUKDworn/zYCAgAEB/4CAgICAgICA9AH/gICAgICAgIDuAf+AgICAgICAgAQFBgcICQoKCwwNDg8QERESExQUFRUWFhcXGBkZGhscHR4fICEiIyQlJSYnKCkqKywtLi4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xMTU5PUFFSU1RVVldYWVtdX2BiZGVmaGpsbnBydHZ6fH6AgoSGiIqMj5GUl5qdBAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgAGQAaABsAHAAdAB4AHwAgACEAIgAjACQAJQAmACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAOgA8AD4AQABCAEQARgBIAEoATABOAFAAUgBUAFYAWABaAFwAXgBgAGIAZABmAGgAagBsAG4AcAByAHQAdwB6AH0AgACDAIYAiQCMAI8AkgCVAJgAmwCeAKEApACnAKoArQCxALUAuQC9AMEAxQDJAM0A0QDVANkA3QDhAOUA6gDvAPUA+QD+AAMBCAENARIBFwEcAQABBAgFAgMGCQwNCgcLDg+pIwAArSMAALIjAAC4IwAAEQAKABEREQAAAAAFAAAAAAAACQAAAAALAAAAAAAAAAARAA8KERERAwoHAAETCQsLAAAJBgsAAAsABhEAAAAREREAAAAAAAAAAAAAAAAAAAAACwAAAAAAAAAAEQAKChEREQAKAAACAAkLAAAACQALAAALAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAwAAAAADAAAAAAJDAAAAAAADAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAANAAAABA0AAAAACQ4AAAAAAA4AAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAADwAAAAAPAAAAAAkQAAAAAAAQAAAQAAASAAAAEhISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABIAAAASEhIAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALAAAAAAAAAAAAAAAKAAAAAAoAAAAACQsAAAAAAAsAAAsAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAAAAAAAAAAAAAAADAAAAAAMAAAAAAkMAAAAAAAMAAAMAAAwMTIzNDU2Nzg5QUJDREVGDAQAAIAIAAD/CQAA/wwAALAfAAC0HwAAuB8AALwfAADAHwAAxB8AAMgfAAABAAAAAQAAAAIAAAACAAAAAwAAAAQAAADkHwAA6B8AAPAfAAAFAAAAAAAAAAAAAAADAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAgAAABQqAAAAAAAAAAAAAAAAAAACAAAAAAAAAAAAAAAAAAD//////wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD0KQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAExpYnJhcnkgdmVyc2lvbiBtaXNtYXRjaCEKAFVuYWJsZSB0byBzZXQgdmlkZW8gbW9kZSAoMzJicHAgJWR4JWQpIQoAVW5hYmxlIHRvIGNyZWF0ZSAlZHglZCBSR0JBIHN1cmZhY2UhCgBFcnJvciBkZWNvZGluZyBpbWFnZSAoJWQpCgACAwcDAwsDBAMEBAICBAQEAgEBCAcGBAQCAgIBAQEBAAIIQ291bGQgbm90IGRlY29kZSBhbHBoYSBkYXRhLgBGcmFtZSBzZXR1cCBmYWlsZWQAdGhyZWFkIGluaXRpYWxpemF0aW9uIGZhaWxlZC4Abm8gbWVtb3J5IGR1cmluZyBmcmFtZSBpbml0aWFsaXphdGlvbi4AUklGRgBXRUJQAFZQOFgAQUxQSABWUDggAFZQOEwAT0sAbnVsbCBWUDhJbyBwYXNzZWQgdG8gVlA4R2V0SGVhZGVycygpAFRydW5jYXRlZCBoZWFkZXIuAEluY29ycmVjdCBrZXlmcmFtZSBwYXJhbWV0ZXJzLgBGcmFtZSBub3QgZGlzcGxheWFibGUuAGNhbm5vdCBwYXJzZSBwaWN0dXJlIGhlYWRlcgBCYWQgY29kZSB3b3JkAGJhZCBwYXJ0aXRpb24gbGVuZ3RoAGNhbm5vdCBwYXJzZSBzZWdtZW50IGhlYWRlcgBjYW5ub3QgcGFyc2UgZmlsdGVyIGhlYWRlcgBjYW5ub3QgcGFyc2UgcGFydGl0aW9ucwBOb3QgYSBrZXkgZnJhbWUuAK2UjACwm4yHALSdjYaCAP7+8+bEsZmMhYKBAE5VTEwgVlA4SW8gcGFyYW1ldGVyIGluIFZQOERlY29kZSgpLgBQcmVtYXR1cmUgZW5kLW9mLXBhcnRpdGlvbjAgZW5jb3VudGVyZWQuAFByZW1hdHVyZSBlbmQtb2YtZmlsZSBlbmNvdW50ZXJlZC4AT3V0cHV0IGFib3J0ZWQuAC0rICAgMFgweAAobnVsbCkALTBYKzBYIDBYLTB4KzB4IDB4AGluZgBJTkYAbmFuAE5BTgAu\";var tempDoublePtr=11040;var PATH={splitPath:function(filename){var splitPathRe=/^(\\/?|)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?|)(\\.[^.\\/]*|))(?:[\\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last===\".\"){parts.splice(i,1)}else if(last===\"..\"){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift(\"..\")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)===\"/\",trailingSlash=path.substr(-1)===\"/\";path=PATH.normalizeArray(path.split(\"/\").filter(function(p){return!!p}),!isAbsolute).join(\"/\");if(!path&&!isAbsolute){path=\".\"}if(path&&trailingSlash){path+=\"/\"}return(isAbsolute?\"/\":\"\")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return\".\"}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path===\"/\")return\"/\";var lastSlash=path.lastIndexOf(\"/\");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join(\"/\"))},join2:function(l,r){return PATH.normalize(l+\"/\"+r)},resolve:function(){var resolvedPath=\"\",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!==\"string\"){throw new TypeError(\"Arguments to path.resolve must be strings\")}else if(!path){return\"\"}resolvedPath=path+\"/\"+resolvedPath;resolvedAbsolute=path.charAt(0)===\"/\"}resolvedPath=PATH.normalizeArray(resolvedPath.split(\"/\").filter(function(p){return!!p}),!resolvedAbsolute).join(\"/\");return(resolvedAbsolute?\"/\":\"\")+resolvedPath||\".\"},relative:function(from,to){from=PATH.resolve(from).substr(1);to=PATH.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!==\"\")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split(\"/\"));var toParts=trim(to.split(\"/\"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){var start=Date.now();var blocker=Browser.mainLoop.queue.shift();blocker.func(blocker.arg);if(Browser.mainLoop.remainingBlockers){var remaining=Browser.mainLoop.remainingBlockers;var next=remaining%1==0?remaining-1:Math.floor(remaining);if(blocker.counted){Browser.mainLoop.remainingBlockers=next}else{next=next+.5;Browser.mainLoop.remainingBlockers=(8*remaining+next)/9}}console.log('main loop blocker \"'+blocker.name+'\" took '+(Date.now()-start)+\" ms\");Browser.mainLoop.updateStatus();if(thisMainLoopId1&&Browser.mainLoop.currentFrameNumber%Browser.mainLoop.timingValue!=0){Browser.mainLoop.scheduler();return}else if(Browser.mainLoop.timingMode==0){Browser.mainLoop.tickStartTime=_emscripten_get_now()}if(Browser.mainLoop.method===\"timeout\"&&Module.ctx){err(\"Looks like you are rendering without using requestAnimationFrame for the main loop. You should use 0 for the frame rate in emscripten_set_main_loop in order to use requestAnimationFrame, as that can greatly improve your frame rates!\");Browser.mainLoop.method=\"\"}Browser.mainLoop.runIter(browserIterationFunc);if(thisMainLoopId0)_emscripten_set_main_loop_timing(0,1e3/fps);else _emscripten_set_main_loop_timing(1,1);Browser.mainLoop.scheduler()}if(simulateInfiniteLoop){throw\"SimulateInfiniteLoop\"}}var Browser={mainLoop:{scheduler:null,method:\"\",currentlyRunningMainloop:0,func:null,arg:0,timingMode:0,timingValue:0,currentFrameNumber:0,queue:[],pause:function(){Browser.mainLoop.scheduler=null;Browser.mainLoop.currentlyRunningMainloop++},resume:function(){Browser.mainLoop.currentlyRunningMainloop++;var timingMode=Browser.mainLoop.timingMode;var timingValue=Browser.mainLoop.timingValue;var func=Browser.mainLoop.func;Browser.mainLoop.func=null;_emscripten_set_main_loop(func,0,false,Browser.mainLoop.arg,true);_emscripten_set_main_loop_timing(timingMode,timingValue);Browser.mainLoop.scheduler()},updateStatus:function(){if(Module[\"setStatus\"]){var message=Module[\"statusMessage\"]||\"Please wait...\";var remaining=Browser.mainLoop.remainingBlockers;var expected=Browser.mainLoop.expectedBlockers;if(remaining){if(remaining=6){var curr=leftchar>>leftbits-6&63;leftbits-=6;ret+=BASE[curr]}}if(leftbits==2){ret+=BASE[(leftchar&3)<<4];ret+=PAD+PAD}else if(leftbits==4){ret+=BASE[(leftchar&15)<<2];ret+=PAD}return ret}audio.src=\"data:audio/x-\"+name.substr(-3)+\";base64,\"+encode64(byteArray);finish(audio)};audio.src=url;Browser.safeSetTimeout(function(){finish(audio)},1e4)}else{return fail()}};Module[\"preloadPlugins\"].push(audioPlugin);function pointerLockChange(){Browser.pointerLock=document[\"pointerLockElement\"]===Module[\"canvas\"]||document[\"mozPointerLockElement\"]===Module[\"canvas\"]||document[\"webkitPointerLockElement\"]===Module[\"canvas\"]||document[\"msPointerLockElement\"]===Module[\"canvas\"]}var canvas=Module[\"canvas\"];if(canvas){canvas.requestPointerLock=canvas[\"requestPointerLock\"]||canvas[\"mozRequestPointerLock\"]||canvas[\"webkitRequestPointerLock\"]||canvas[\"msRequestPointerLock\"]||function(){};canvas.exitPointerLock=document[\"exitPointerLock\"]||document[\"mozExitPointerLock\"]||document[\"webkitExitPointerLock\"]||document[\"msExitPointerLock\"]||function(){};canvas.exitPointerLock=canvas.exitPointerLock.bind(document);document.addEventListener(\"pointerlockchange\",pointerLockChange,false);document.addEventListener(\"mozpointerlockchange\",pointerLockChange,false);document.addEventListener(\"webkitpointerlockchange\",pointerLockChange,false);document.addEventListener(\"mspointerlockchange\",pointerLockChange,false);if(Module[\"elementPointerLock\"]){canvas.addEventListener(\"click\",function(ev){if(!Browser.pointerLock&&Module[\"canvas\"].requestPointerLock){Module[\"canvas\"].requestPointerLock();ev.preventDefault()}},false)}}},createContext:function(canvas,useWebGL,setInModule,webGLContextAttributes){if(useWebGL&&Module.ctx&&canvas==Module.canvas)return Module.ctx;var ctx;var contextHandle;if(useWebGL){var contextAttributes={antialias:false,alpha:false,majorVersion:1};if(webGLContextAttributes){for(var attribute in webGLContextAttributes){contextAttributes[attribute]=webGLContextAttributes[attribute]}}if(typeof GL!==\"undefined\"){contextHandle=GL.createContext(canvas,contextAttributes);if(contextHandle){ctx=GL.getContext(contextHandle).GLctx}}}else{ctx=canvas.getContext(\"2d\")}if(!ctx)return null;if(setInModule){if(!useWebGL)assert(typeof GLctx===\"undefined\",\"cannot set in module if GLctx is used, but we are a non-GL context that would replace it\");Module.ctx=ctx;if(useWebGL)GL.makeContextCurrent(contextHandle);Module.useWebGL=useWebGL;Browser.moduleContextCreatedCallbacks.forEach(function(callback){callback()});Browser.init()}return ctx},destroyContext:function(canvas,useWebGL,setInModule){},fullscreenHandlersInstalled:false,lockPointer:undefined,resizeCanvas:undefined,requestFullscreen:function(lockPointer,resizeCanvas,vrDevice){Browser.lockPointer=lockPointer;Browser.resizeCanvas=resizeCanvas;Browser.vrDevice=vrDevice;if(typeof Browser.lockPointer===\"undefined\")Browser.lockPointer=true;if(typeof Browser.resizeCanvas===\"undefined\")Browser.resizeCanvas=false;if(typeof Browser.vrDevice===\"undefined\")Browser.vrDevice=null;var canvas=Module[\"canvas\"];function fullscreenChange(){Browser.isFullscreen=false;var canvasContainer=canvas.parentNode;if((document[\"fullscreenElement\"]||document[\"mozFullScreenElement\"]||document[\"msFullscreenElement\"]||document[\"webkitFullscreenElement\"]||document[\"webkitCurrentFullScreenElement\"])===canvasContainer){canvas.exitFullscreen=Browser.exitFullscreen;if(Browser.lockPointer)canvas.requestPointerLock();Browser.isFullscreen=true;if(Browser.resizeCanvas){Browser.setFullscreenCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}else{canvasContainer.parentNode.insertBefore(canvas,canvasContainer);canvasContainer.parentNode.removeChild(canvasContainer);if(Browser.resizeCanvas){Browser.setWindowedCanvasSize()}else{Browser.updateCanvasDimensions(canvas)}}if(Module[\"onFullScreen\"])Module[\"onFullScreen\"](Browser.isFullscreen);if(Module[\"onFullscreen\"])Module[\"onFullscreen\"](Browser.isFullscreen)}if(!Browser.fullscreenHandlersInstalled){Browser.fullscreenHandlersInstalled=true;document.addEventListener(\"fullscreenchange\",fullscreenChange,false);document.addEventListener(\"mozfullscreenchange\",fullscreenChange,false);document.addEventListener(\"webkitfullscreenchange\",fullscreenChange,false);document.addEventListener(\"MSFullscreenChange\",fullscreenChange,false)}var canvasContainer=document.createElement(\"div\");canvas.parentNode.insertBefore(canvasContainer,canvas);canvasContainer.appendChild(canvas);canvasContainer.requestFullscreen=canvasContainer[\"requestFullscreen\"]||canvasContainer[\"mozRequestFullScreen\"]||canvasContainer[\"msRequestFullscreen\"]||(canvasContainer[\"webkitRequestFullscreen\"]?function(){canvasContainer[\"webkitRequestFullscreen\"](Element[\"ALLOW_KEYBOARD_INPUT\"])}:null)||(canvasContainer[\"webkitRequestFullScreen\"]?function(){canvasContainer[\"webkitRequestFullScreen\"](Element[\"ALLOW_KEYBOARD_INPUT\"])}:null);if(vrDevice){canvasContainer.requestFullscreen({vrDisplay:vrDevice})}else{canvasContainer.requestFullscreen()}},requestFullScreen:function(lockPointer,resizeCanvas,vrDevice){err(\"Browser.requestFullScreen() is deprecated. Please call Browser.requestFullscreen instead.\");Browser.requestFullScreen=function(lockPointer,resizeCanvas,vrDevice){return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)};return Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)},exitFullscreen:function(){if(!Browser.isFullscreen){return false}var CFS=document[\"exitFullscreen\"]||document[\"cancelFullScreen\"]||document[\"mozCancelFullScreen\"]||document[\"msExitFullscreen\"]||document[\"webkitCancelFullScreen\"]||function(){};CFS.apply(document,[]);return true},nextRAF:0,fakeRequestAnimationFrame:function(func){var now=Date.now();if(Browser.nextRAF===0){Browser.nextRAF=now+1e3/60}else{while(now+2>=Browser.nextRAF){Browser.nextRAF+=1e3/60}}var delay=Math.max(Browser.nextRAF-now,0);setTimeout(func,delay)},requestAnimationFrame:function requestAnimationFrame(func){if(typeof window===\"undefined\"){Browser.fakeRequestAnimationFrame(func)}else{if(!window.requestAnimationFrame){window.requestAnimationFrame=window[\"requestAnimationFrame\"]||window[\"mozRequestAnimationFrame\"]||window[\"webkitRequestAnimationFrame\"]||window[\"msRequestAnimationFrame\"]||window[\"oRequestAnimationFrame\"]||Browser.fakeRequestAnimationFrame}window.requestAnimationFrame(func)}},safeCallback:function(func){return function(){if(!ABORT)return func.apply(null,arguments)}},allowAsyncCallbacks:true,queuedAsyncCallbacks:[],pauseAsyncCallbacks:function(){Browser.allowAsyncCallbacks=false},resumeAsyncCallbacks:function(){Browser.allowAsyncCallbacks=true;if(Browser.queuedAsyncCallbacks.length>0){var callbacks=Browser.queuedAsyncCallbacks;Browser.queuedAsyncCallbacks=[];callbacks.forEach(function(func){func()})}},safeRequestAnimationFrame:function(func){return Browser.requestAnimationFrame(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}})},safeSetTimeout:function(func,timeout){Module[\"noExitRuntime\"]=true;return setTimeout(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}else{Browser.queuedAsyncCallbacks.push(func)}},timeout)},safeSetInterval:function(func,timeout){Module[\"noExitRuntime\"]=true;return setInterval(function(){if(ABORT)return;if(Browser.allowAsyncCallbacks){func()}},timeout)},getMimetype:function(name){return{\"jpg\":\"image/jpeg\",\"jpeg\":\"image/jpeg\",\"png\":\"image/png\",\"bmp\":\"image/bmp\",\"ogg\":\"audio/ogg\",\"wav\":\"audio/wav\",\"mp3\":\"audio/mpeg\"}[name.substr(name.lastIndexOf(\".\")+1)]},getUserMedia:function(func){if(!window.getUserMedia){window.getUserMedia=navigator[\"getUserMedia\"]||navigator[\"mozGetUserMedia\"]}window.getUserMedia(func)},getMovementX:function(event){return event[\"movementX\"]||event[\"mozMovementX\"]||event[\"webkitMovementX\"]||0},getMovementY:function(event){return event[\"movementY\"]||event[\"mozMovementY\"]||event[\"webkitMovementY\"]||0},getMouseWheelDelta:function(event){var delta=0;switch(event.type){case\"DOMMouseScroll\":delta=event.detail/3;break;case\"mousewheel\":delta=event.wheelDelta/120;break;case\"wheel\":delta=event.deltaY;switch(event.deltaMode){case 0:delta/=100;break;case 1:delta/=3;break;case 2:delta*=80;break;default:throw\"unrecognized mouse wheel delta mode: \"+event.deltaMode}break;default:throw\"unrecognized mouse wheel event: \"+event.type}return delta},mouseX:0,mouseY:0,mouseMovementX:0,mouseMovementY:0,touches:{},lastTouches:{},calculateMouseEvent:function(event){if(Browser.pointerLock){if(event.type!=\"mousemove\"&&\"mozMovementX\"in event){Browser.mouseMovementX=Browser.mouseMovementY=0}else{Browser.mouseMovementX=Browser.getMovementX(event);Browser.mouseMovementY=Browser.getMovementY(event)}if(typeof SDL!=\"undefined\"){Browser.mouseX=SDL.mouseX+Browser.mouseMovementX;Browser.mouseY=SDL.mouseY+Browser.mouseMovementY}else{Browser.mouseX+=Browser.mouseMovementX;Browser.mouseY+=Browser.mouseMovementY}}else{var rect=Module[\"canvas\"].getBoundingClientRect();var cw=Module[\"canvas\"].width;var ch=Module[\"canvas\"].height;var scrollX=typeof window.scrollX!==\"undefined\"?window.scrollX:window.pageXOffset;var scrollY=typeof window.scrollY!==\"undefined\"?window.scrollY:window.pageYOffset;if(event.type===\"touchstart\"||event.type===\"touchend\"||event.type===\"touchmove\"){var touch=event.touch;if(touch===undefined){return}var adjustedX=touch.pageX-(scrollX+rect.left);var adjustedY=touch.pageY-(scrollY+rect.top);adjustedX=adjustedX*(cw/rect.width);adjustedY=adjustedY*(ch/rect.height);var coords={x:adjustedX,y:adjustedY};if(event.type===\"touchstart\"){Browser.lastTouches[touch.identifier]=coords;Browser.touches[touch.identifier]=coords}else if(event.type===\"touchend\"||event.type===\"touchmove\"){var last=Browser.touches[touch.identifier];if(!last)last=coords;Browser.lastTouches[touch.identifier]=last;Browser.touches[touch.identifier]=coords}return}var x=event.pageX-(scrollX+rect.left);var y=event.pageY-(scrollY+rect.top);x=x*(cw/rect.width);y=y*(ch/rect.height);Browser.mouseMovementX=x-Browser.mouseX;Browser.mouseMovementY=y-Browser.mouseY;Browser.mouseX=x;Browser.mouseY=y}},asyncLoad:function(url,onload,onerror,noRunDep){var dep=!noRunDep?getUniqueRunDependency(\"al \"+url):\"\";Module[\"readAsync\"](url,function(arrayBuffer){assert(arrayBuffer,'Loading data file \"'+url+'\" failed (no arrayBuffer).');onload(new Uint8Array(arrayBuffer));if(dep)removeRunDependency(dep)},function(event){if(onerror){onerror()}else{throw'Loading data file \"'+url+'\" failed.'}});if(dep)addRunDependency(dep)},resizeListeners:[],updateResizeListeners:function(){var canvas=Module[\"canvas\"];Browser.resizeListeners.forEach(function(listener){listener(canvas.width,canvas.height)})},setCanvasSize:function(width,height,noUpdates){var canvas=Module[\"canvas\"];Browser.updateCanvasDimensions(canvas,width,height);if(!noUpdates)Browser.updateResizeListeners()},windowedWidth:0,windowedHeight:0,setFullscreenCanvasSize:function(){if(typeof SDL!=\"undefined\"){var flags=HEAPU32[SDL.screen>>2];flags=flags|8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module[\"canvas\"]);Browser.updateResizeListeners()},setWindowedCanvasSize:function(){if(typeof SDL!=\"undefined\"){var flags=HEAPU32[SDL.screen>>2];flags=flags&~8388608;HEAP32[SDL.screen>>2]=flags}Browser.updateCanvasDimensions(Module[\"canvas\"]);Browser.updateResizeListeners()},updateCanvasDimensions:function(canvas,wNative,hNative){if(wNative&&hNative){canvas.widthNative=wNative;canvas.heightNative=hNative}else{wNative=canvas.widthNative;hNative=canvas.heightNative}var w=wNative;var h=hNative;if(Module[\"forcedAspectRatio\"]&&Module[\"forcedAspectRatio\"]>0){if(w/h1)return 0;if(!surfData.buffer){surfData.buffer=_malloc(surfData.width*surfData.height*4);HEAP32[surf+20>>2]=surfData.buffer}HEAP32[surf+20>>2]=surfData.buffer;if(surf==SDL.screen&&Module.screenIsReadOnly&&surfData.image)return 0;if(SDL.defaults.discardOnLock){if(!surfData.image){surfData.image=surfData.ctx.createImageData(surfData.width,surfData.height)}if(!SDL.defaults.opaqueFrontBuffer)return}else{surfData.image=surfData.ctx.getImageData(0,0,surfData.width,surfData.height)}if(surf==SDL.screen&&SDL.defaults.opaqueFrontBuffer){var data=surfData.image.data;var num=data.length;for(var i=0;i>2],y:HEAP32[rect+4>>2],w:HEAP32[rect+8>>2],h:HEAP32[rect+12>>2]}},updateRect:function(rect,r){HEAP32[rect>>2]=r.x;HEAP32[rect+4>>2]=r.y;HEAP32[rect+8>>2]=r.w;HEAP32[rect+12>>2]=r.h},intersectionOfRects:function(first,second){var leftX=Math.max(first.x,second.x);var leftY=Math.max(first.y,second.y);var rightX=Math.min(first.x+first.w,second.x+second.w);var rightY=Math.min(first.y+first.h,second.y+second.h);return{x:leftX,y:leftY,w:Math.max(leftX,rightX)-leftX,h:Math.max(leftY,rightY)-leftY}},checkPixelFormat:function(fmt){},loadColorToCSSRGB:function(color){var rgba=HEAP32[color>>2];return\"rgb(\"+(rgba&255)+\",\"+(rgba>>8&255)+\",\"+(rgba>>16&255)+\")\"},loadColorToCSSRGBA:function(color){var rgba=HEAP32[color>>2];return\"rgba(\"+(rgba&255)+\",\"+(rgba>>8&255)+\",\"+(rgba>>16&255)+\",\"+(rgba>>24&255)/255+\")\"},translateColorToCSSRGBA:function(rgba){return\"rgba(\"+(rgba&255)+\",\"+(rgba>>8&255)+\",\"+(rgba>>16&255)+\",\"+(rgba>>>24)/255+\")\"},translateRGBAToCSSRGBA:function(r,g,b,a){return\"rgba(\"+(r&255)+\",\"+(g&255)+\",\"+(b&255)+\",\"+(a&255)/255+\")\"},translateRGBAToColor:function(r,g,b,a){return r|g<<8|b<<16|a<<24},makeSurface:function(width,height,flags,usePageCanvas,source,rmask,gmask,bmask,amask){flags=flags||0;var is_SDL_HWSURFACE=flags&1;var is_SDL_HWPALETTE=flags&2097152;var is_SDL_OPENGL=flags&67108864;var surf=_malloc(60);var pixelFormat=_malloc(44);var bpp=is_SDL_HWPALETTE?1:4;var buffer=0;if(!is_SDL_HWSURFACE&&!is_SDL_OPENGL){buffer=_malloc(width*height*4)}HEAP32[surf>>2]=flags;HEAP32[surf+4>>2]=pixelFormat;HEAP32[surf+8>>2]=width;HEAP32[surf+12>>2]=height;HEAP32[surf+16>>2]=width*bpp;HEAP32[surf+20>>2]=buffer;HEAP32[surf+36>>2]=0;HEAP32[surf+40>>2]=0;HEAP32[surf+44>>2]=Module[\"canvas\"].width;HEAP32[surf+48>>2]=Module[\"canvas\"].height;HEAP32[surf+56>>2]=1;HEAP32[pixelFormat>>2]=-2042224636;HEAP32[pixelFormat+4>>2]=0;HEAP8[pixelFormat+8>>0]=bpp*8;HEAP8[pixelFormat+9>>0]=bpp;HEAP32[pixelFormat+12>>2]=rmask||255;HEAP32[pixelFormat+16>>2]=gmask||65280;HEAP32[pixelFormat+20>>2]=bmask||16711680;HEAP32[pixelFormat+24>>2]=amask||4278190080;SDL.GL=SDL.GL||is_SDL_OPENGL;var canvas;if(!usePageCanvas){if(SDL.canvasPool.length>0){canvas=SDL.canvasPool.pop()}else{canvas=document.createElement(\"canvas\")}canvas.width=width;canvas.height=height}else{canvas=Module[\"canvas\"]}var webGLContextAttributes={antialias:SDL.glAttributes[13]!=0&&SDL.glAttributes[14]>1,depth:SDL.glAttributes[6]>0,stencil:SDL.glAttributes[7]>0,alpha:SDL.glAttributes[3]>0};var ctx=Browser.createContext(canvas,is_SDL_OPENGL,usePageCanvas,webGLContextAttributes);SDL.surfaces[surf]={width:width,height:height,canvas:canvas,ctx:ctx,surf:surf,buffer:buffer,pixelFormat:pixelFormat,alpha:255,flags:flags,locked:0,usePageCanvas:usePageCanvas,source:source,isFlagSet:function(flag){return flags&flag}};return surf},copyIndexedColorData:function(surfData,rX,rY,rW,rH){if(!surfData.colors){return}var fullWidth=Module[\"canvas\"].width;var fullHeight=Module[\"canvas\"].height;var startX=rX||0;var startY=rY||0;var endX=(rW||fullWidth-startX)+startX;var endY=(rH||fullHeight-startY)+startY;var buffer=surfData.buffer;if(!surfData.image.data32){surfData.image.data32=new Uint32Array(surfData.image.data.buffer)}var data32=surfData.image.data32;var colors32=surfData.colors32;for(var y=startY;y>0]]}}},freeSurface:function(surf){var refcountPointer=surf+56;var refcount=HEAP32[refcountPointer>>2];if(refcount>1){HEAP32[refcountPointer>>2]=refcount-1;return}var info=SDL.surfaces[surf];if(!info.usePageCanvas&&info.canvas)SDL.canvasPool.push(info.canvas);if(info.buffer)_free(info.buffer);_free(info.pixelFormat);_free(surf);SDL.surfaces[surf]=null;if(surf===SDL.screen){SDL.screen=null}},blitSurface:function(src,srcrect,dst,dstrect,scale){var srcData=SDL.surfaces[src];var dstData=SDL.surfaces[dst];var sr,dr;if(srcrect){sr=SDL.loadRect(srcrect)}else{sr={x:0,y:0,w:srcData.width,h:srcData.height}}if(dstrect){dr=SDL.loadRect(dstrect)}else{dr={x:0,y:0,w:srcData.width,h:srcData.height}}if(dstData.clipRect){var widthScale=!scale||sr.w===0?1:sr.w/dr.w;var heightScale=!scale||sr.h===0?1:sr.h/dr.h;dr=SDL.intersectionOfRects(dstData.clipRect,dr);sr.w=dr.w*widthScale;sr.h=dr.h*heightScale;if(dstrect){SDL.updateRect(dstrect,dr)}}var blitw,blith;if(scale){blitw=dr.w;blith=dr.h}else{blitw=sr.w;blith=sr.h}if(sr.w===0||sr.h===0||blitw===0||blith===0){return 0}var oldAlpha=dstData.ctx.globalAlpha;dstData.ctx.globalAlpha=srcData.alpha/255;dstData.ctx.drawImage(srcData.canvas,sr.x,sr.y,sr.w,sr.h,dr.x,dr.y,blitw,blith);dstData.ctx.globalAlpha=oldAlpha;if(dst!=SDL.screen){warnOnce(\"WARNING: copying canvas data to memory for compatibility\");_SDL_LockSurface(dst);dstData.locked--}return 0},downFingers:{},savedKeydown:null,receiveEvent:function(event){function unpressAllPressedKeys(){for(var code in SDL.keyboardMap){SDL.events.push({type:\"keyup\",keyCode:SDL.keyboardMap[code]})}}switch(event.type){case\"touchstart\":case\"touchmove\":{event.preventDefault();var touches=[];if(event.type===\"touchstart\"){for(var i=0;i0?Math.max(delta,1):Math.min(delta,-1);var button=delta>0?3:4;SDL.events.push({type:\"mousedown\",button:button,pageX:event.pageX,pageY:event.pageY});SDL.events.push({type:\"mouseup\",button:button,pageX:event.pageX,pageY:event.pageY});SDL.events.push({type:\"wheel\",deltaX:0,deltaY:delta});event.preventDefault();break;case\"mousemove\":if(SDL.DOMButtons[0]===1){SDL.events.push({type:\"touchmove\",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}})}if(Browser.pointerLock){if(\"mozMovementX\"in event){event[\"movementX\"]=event[\"mozMovementX\"];event[\"movementY\"]=event[\"mozMovementY\"]}if(event[\"movementX\"]==0&&event[\"movementY\"]==0){event.preventDefault();return}}case\"keydown\":case\"keyup\":case\"keypress\":case\"mousedown\":case\"mouseup\":if(event.type!==\"keydown\"||!SDL.unicode&&!SDL.textInput||(event.keyCode===8||event.keyCode===9)){event.preventDefault()}if(event.type==\"mousedown\"){SDL.DOMButtons[event.button]=1;SDL.events.push({type:\"touchstart\",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}})}else if(event.type==\"mouseup\"){if(!SDL.DOMButtons[event.button]){return}SDL.events.push({type:\"touchend\",touch:{identifier:0,deviceID:-1,pageX:event.pageX,pageY:event.pageY}});SDL.DOMButtons[event.button]=0}if(event.type===\"keydown\"||event.type===\"mousedown\"){SDL.canRequestFullscreen=true}else if(event.type===\"keyup\"||event.type===\"mouseup\"){if(SDL.isRequestingFullscreen){Module[\"requestFullscreen\"](true,true);SDL.isRequestingFullscreen=false}SDL.canRequestFullscreen=false}if(event.type===\"keypress\"&&SDL.savedKeydown){SDL.savedKeydown.keypressCharCode=event.charCode;SDL.savedKeydown=null}else if(event.type===\"keydown\"){SDL.savedKeydown=event}if(event.type!==\"keypress\"||SDL.textInput){SDL.events.push(event)}break;case\"mouseout\":for(var i=0;i<3;i++){if(SDL.DOMButtons[i]){SDL.events.push({type:\"mouseup\",button:i,pageX:event.pageX,pageY:event.pageY});SDL.DOMButtons[i]=0}}event.preventDefault();break;case\"focus\":SDL.events.push(event);event.preventDefault();break;case\"blur\":SDL.events.push(event);unpressAllPressedKeys();event.preventDefault();break;case\"visibilitychange\":SDL.events.push({type:\"visibilitychange\",visible:!document.hidden});unpressAllPressedKeys();event.preventDefault();break;case\"unload\":if(Browser.mainLoop.runner){SDL.events.push(event);Browser.mainLoop.runner()}return;case\"resize\":SDL.events.push(event);if(event.preventDefault){event.preventDefault()}break}if(SDL.events.length>=1e4){err(\"SDL event queue full, dropping events\");SDL.events=SDL.events.slice(0,1e4)}SDL.flushEventsToHandler();return},lookupKeyCodeForEvent:function(event){var code=event.keyCode;if(code>=65&&code<=90){code+=32}else{code=SDL.keyCodes[event.keyCode]||event.keyCode;if(event.location===KeyboardEvent.DOM_KEY_LOCATION_RIGHT&&code>=(224|1<<10)&&code<=(227|1<<10)){code+=4}}return code},handleEvent:function(event){if(event.handled)return;event.handled=true;switch(event.type){case\"touchstart\":case\"touchend\":case\"touchmove\":{Browser.calculateMouseEvent(event);break}case\"keydown\":case\"keyup\":{var down=event.type===\"keydown\";var code=SDL.lookupKeyCodeForEvent(event);HEAP8[SDL.keyboardState+code>>0]=down;SDL.modState=(HEAP8[SDL.keyboardState+1248>>0]?64:0)|(HEAP8[SDL.keyboardState+1249>>0]?1:0)|(HEAP8[SDL.keyboardState+1250>>0]?256:0)|(HEAP8[SDL.keyboardState+1252>>0]?128:0)|(HEAP8[SDL.keyboardState+1253>>0]?2:0)|(HEAP8[SDL.keyboardState+1254>>0]?512:0);if(down){SDL.keyboardMap[code]=event.keyCode}else{delete SDL.keyboardMap[code]}break}case\"mousedown\":case\"mouseup\":if(event.type==\"mousedown\"){SDL.buttonState|=1<0){if(SDL.makeCEvent(SDL.events.shift(),ptr)!==false)return 1}return 0}else{return SDL.events.length>0}},makeCEvent:function(event,ptr){if(typeof event===\"number\"){_memcpy(ptr,event,28);_free(event);return}SDL.handleEvent(event);switch(event.type){case\"keydown\":case\"keyup\":{var down=event.type===\"keydown\";var key=SDL.lookupKeyCodeForEvent(event);var scan;if(key>=1024){scan=key-1024}else{scan=SDL.scanCodes[key]||key}HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+8>>0]=down?1:0;HEAP8[ptr+9>>0]=0;HEAP32[ptr+12>>2]=scan;HEAP32[ptr+16>>2]=key;HEAP16[ptr+20>>1]=SDL.modState;HEAP32[ptr+24>>2]=event.keypressCharCode||key;break}case\"keypress\":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];var cStr=intArrayFromString(String.fromCharCode(event.charCode));for(var i=0;i>0]=cStr[i]}break}case\"mousedown\":case\"mouseup\":case\"mousemove\":{if(event.type!=\"mousemove\"){var down=event.type===\"mousedown\";HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP32[ptr+8>>2]=0;HEAP32[ptr+12>>2]=0;HEAP8[ptr+16>>0]=event.button+1;HEAP8[ptr+17>>0]=down?1:0;HEAP32[ptr+20>>2]=Browser.mouseX;HEAP32[ptr+24>>2]=Browser.mouseY}else{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP32[ptr+8>>2]=0;HEAP32[ptr+12>>2]=0;HEAP32[ptr+16>>2]=SDL.buttonState;HEAP32[ptr+20>>2]=Browser.mouseX;HEAP32[ptr+24>>2]=Browser.mouseY;HEAP32[ptr+28>>2]=Browser.mouseMovementX;HEAP32[ptr+32>>2]=Browser.mouseMovementY}break}case\"wheel\":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+16>>2]=event.deltaX;HEAP32[ptr+20>>2]=event.deltaY;break}case\"touchstart\":case\"touchend\":case\"touchmove\":{var touch=event.touch;if(!Browser.touches[touch.identifier])break;var w=Module[\"canvas\"].width;var h=Module[\"canvas\"].height;var x=Browser.touches[touch.identifier].x/w;var y=Browser.touches[touch.identifier].y/h;var lx=Browser.lastTouches[touch.identifier].x/w;var ly=Browser.lastTouches[touch.identifier].y/h;var dx=x-lx;var dy=y-ly;if(touch[\"deviceID\"]===undefined)touch.deviceID=SDL.TOUCH_DEFAULT_ID;if(dx===0&&dy===0&&event.type===\"touchmove\")return false;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=_SDL_GetTicks();tempI64=[touch.deviceID>>>0,(tempDouble=touch.deviceID,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr+8>>2]=tempI64[0],HEAP32[ptr+12>>2]=tempI64[1];tempI64=[touch.identifier>>>0,(tempDouble=touch.identifier,+Math_abs(tempDouble)>=+1?tempDouble>+0?(Math_min(+Math_floor(tempDouble/+4294967296),+4294967295)|0)>>>0:~~+Math_ceil((tempDouble-+(~~tempDouble>>>0))/+4294967296)>>>0:0)],HEAP32[ptr+16>>2]=tempI64[0],HEAP32[ptr+20>>2]=tempI64[1];HEAPF32[ptr+24>>2]=x;HEAPF32[ptr+28>>2]=y;HEAPF32[ptr+32>>2]=dx;HEAPF32[ptr+36>>2]=dy;if(touch.force!==undefined){HEAPF32[ptr+40>>2]=touch.force}else{HEAPF32[ptr+40>>2]=event.type==\"touchend\"?0:1}break}case\"unload\":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];break}case\"resize\":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=event.w;HEAP32[ptr+8>>2]=event.h;break}case\"joystick_button_up\":case\"joystick_button_down\":{var state=event.type===\"joystick_button_up\"?0:1;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+4>>0]=event.index;HEAP8[ptr+5>>0]=event.button;HEAP8[ptr+6>>0]=state;break}case\"joystick_axis_motion\":{HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP8[ptr+4>>0]=event.index;HEAP8[ptr+5>>0]=event.axis;HEAP32[ptr+8>>2]=SDL.joystickAxisValueConversion(event.value);break}case\"focus\":{var SDL_WINDOWEVENT_FOCUS_GAINED=12;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=SDL_WINDOWEVENT_FOCUS_GAINED;break}case\"blur\":{var SDL_WINDOWEVENT_FOCUS_LOST=13;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=SDL_WINDOWEVENT_FOCUS_LOST;break}case\"visibilitychange\":{var SDL_WINDOWEVENT_SHOWN=1;var SDL_WINDOWEVENT_HIDDEN=2;var visibilityEventID=event.visible?SDL_WINDOWEVENT_SHOWN:SDL_WINDOWEVENT_HIDDEN;HEAP32[ptr>>2]=SDL.DOMEventToSDLEvent[event.type];HEAP32[ptr+4>>2]=0;HEAP8[ptr+8>>0]=visibilityEventID;break}default:throw\"Unhandled SDL event: \"+event.type}},makeFontString:function(height,fontName){if(fontName.charAt(0)!=\"'\"&&fontName.charAt(0)!='\"'){fontName='\"'+fontName+'\"'}return height+\"px \"+fontName+\", serif\"},estimateTextWidth:function(fontData,text){var h=fontData.size;var fontString=SDL.makeFontString(h,fontData.name);var tempCtx=SDL.ttfContext;tempCtx.save();tempCtx.font=fontString;var ret=tempCtx.measureText(text).width|0;tempCtx.restore();return ret},allocateChannels:function(num){if(SDL.numChannels&&SDL.numChannels>=num&&num!=0)return;SDL.numChannels=num;SDL.channels=[];for(var i=0;i>1]/32768}}else if(SDL.audio.format==8){for(var j=0;j>0];channelData[j]=(v>=0?v-128:v+128)/128}}else if(SDL.audio.format==33056){for(var j=0;j>2]}}else{throw\"Invalid SDL audio format \"+SDL.audio.format+\"!\"}}},debugSurface:function(surfData){console.log(\"dumping surface \"+[surfData.surf,surfData.source,surfData.width,surfData.height]);var image=surfData.ctx.getImageData(0,0,surfData.width,surfData.height);var data=image.data;var num=Math.min(surfData.width,surfData.height);for(var i=0;i0}},queryJoysticks:function(){for(var joystick in SDL.lastJoystickState){var state=SDL.getGamepad(joystick-1);var prevState=SDL.lastJoystickState[joystick];if(typeof state===\"undefined\")return;if(state===null)return;if(typeof state.timestamp!==\"number\"||state.timestamp!==prevState.timestamp||!state.timestamp){var i;for(i=0;ideviceIndex&&deviceIndex>=0){return gamepads[deviceIndex]}return null}};function _SDL_CreateRGBSurface(flags,width,height,depth,rmask,gmask,bmask,amask){return SDL.makeSurface(width,height,flags,false,\"CreateRGBSurface\",rmask,gmask,bmask,amask)}function _SDL_Flip(surf){}function _SDL_FreeSurface(surf){if(surf)SDL.freeSurface(surf)}function _SDL_Init(initFlags){SDL.startTime=Date.now();SDL.initFlags=initFlags;if(!Module[\"doNotCaptureKeyboard\"]){var keyboardListeningElement=Module[\"keyboardListeningElement\"]||document;keyboardListeningElement.addEventListener(\"keydown\",SDL.receiveEvent);keyboardListeningElement.addEventListener(\"keyup\",SDL.receiveEvent);keyboardListeningElement.addEventListener(\"keypress\",SDL.receiveEvent);window.addEventListener(\"focus\",SDL.receiveEvent);window.addEventListener(\"blur\",SDL.receiveEvent);document.addEventListener(\"visibilitychange\",SDL.receiveEvent)}window.addEventListener(\"unload\",SDL.receiveEvent);SDL.keyboardState=_malloc(65536);_memset(SDL.keyboardState,0,65536);SDL.DOMEventToSDLEvent[\"keydown\"]=768;SDL.DOMEventToSDLEvent[\"keyup\"]=769;SDL.DOMEventToSDLEvent[\"keypress\"]=771;SDL.DOMEventToSDLEvent[\"mousedown\"]=1025;SDL.DOMEventToSDLEvent[\"mouseup\"]=1026;SDL.DOMEventToSDLEvent[\"mousemove\"]=1024;SDL.DOMEventToSDLEvent[\"wheel\"]=1027;SDL.DOMEventToSDLEvent[\"touchstart\"]=1792;SDL.DOMEventToSDLEvent[\"touchend\"]=1793;SDL.DOMEventToSDLEvent[\"touchmove\"]=1794;SDL.DOMEventToSDLEvent[\"unload\"]=256;SDL.DOMEventToSDLEvent[\"resize\"]=28673;SDL.DOMEventToSDLEvent[\"visibilitychange\"]=512;SDL.DOMEventToSDLEvent[\"focus\"]=512;SDL.DOMEventToSDLEvent[\"blur\"]=512;SDL.DOMEventToSDLEvent[\"joystick_axis_motion\"]=1536;SDL.DOMEventToSDLEvent[\"joystick_button_down\"]=1539;SDL.DOMEventToSDLEvent[\"joystick_button_up\"]=1540;return 0}var GL={counter:1,lastError:0,buffers:[],mappedBuffers:{},programs:[],framebuffers:[],renderbuffers:[],textures:[],uniforms:[],shaders:[],vaos:[],contexts:{},currentContext:null,offscreenCanvases:{},timerQueriesEXT:[],programInfos:{},stringCache:{},unpackAlignment:4,init:function(){GL.miniTempBuffer=new Float32Array(GL.MINI_TEMP_BUFFER_SIZE);for(var i=0;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){var ctx=canvas.getContext(\"webgl\",webGLContextAttributes)||canvas.getContext(\"experimental-webgl\",webGLContextAttributes);return ctx&&GL.registerContext(ctx,webGLContextAttributes)},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};context.cannotHandleOffsetsInUniformArrayViews=function(g){function b(c,t){var s=g.createShader(t);g.shaderSource(s,c);g.compileShader(s);return s}try{var p=g.createProgram();g.attachShader(p,b(\"attribute vec4 p;void main(){gl_Position=p;}\",g.VERTEX_SHADER));g.attachShader(p,b(\"precision lowp float;uniform vec4 u;void main(){gl_FragColor=u;}\",g.FRAGMENT_SHADER));g.linkProgram(p);var h=new Float32Array(8);h[4]=1;g.useProgram(p);var l=g.getUniformLocation(p,\"u\");g.uniform4fv(l,h.subarray(4,8));return!g.getUniform(p,l)[0]}catch(e){return false}}();if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault===\"undefined\"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents===\"object\")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle]);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;if(context.version<2){var instancedArraysExt=GLctx.getExtension(\"ANGLE_instanced_arrays\");if(instancedArraysExt){GLctx[\"vertexAttribDivisor\"]=function(index,divisor){instancedArraysExt[\"vertexAttribDivisorANGLE\"](index,divisor)};GLctx[\"drawArraysInstanced\"]=function(mode,first,count,primcount){instancedArraysExt[\"drawArraysInstancedANGLE\"](mode,first,count,primcount)};GLctx[\"drawElementsInstanced\"]=function(mode,count,type,indices,primcount){instancedArraysExt[\"drawElementsInstancedANGLE\"](mode,count,type,indices,primcount)}}var vaoExt=GLctx.getExtension(\"OES_vertex_array_object\");if(vaoExt){GLctx[\"createVertexArray\"]=function(){return vaoExt[\"createVertexArrayOES\"]()};GLctx[\"deleteVertexArray\"]=function(vao){vaoExt[\"deleteVertexArrayOES\"](vao)};GLctx[\"bindVertexArray\"]=function(vao){vaoExt[\"bindVertexArrayOES\"](vao)};GLctx[\"isVertexArray\"]=function(vao){return vaoExt[\"isVertexArrayOES\"](vao)}}var drawBuffersExt=GLctx.getExtension(\"WEBGL_draw_buffers\");if(drawBuffersExt){GLctx[\"drawBuffers\"]=function(n,bufs){drawBuffersExt[\"drawBuffersWEBGL\"](n,bufs)}}}GLctx.disjointTimerQueryExt=GLctx.getExtension(\"EXT_disjoint_timer_query\");var automaticallyEnabledExtensions=[\"OES_texture_float\",\"OES_texture_half_float\",\"OES_standard_derivatives\",\"OES_vertex_array_object\",\"WEBGL_compressed_texture_s3tc\",\"WEBGL_depth_texture\",\"OES_element_index_uint\",\"EXT_texture_filter_anisotropic\",\"EXT_frag_depth\",\"WEBGL_draw_buffers\",\"ANGLE_instanced_arrays\",\"OES_texture_float_linear\",\"OES_texture_half_float_linear\",\"EXT_blend_minmax\",\"EXT_shader_texture_lod\",\"WEBGL_compressed_texture_pvrtc\",\"EXT_color_buffer_half_float\",\"WEBGL_color_buffer_float\",\"EXT_sRGB\",\"WEBGL_compressed_texture_etc1\",\"EXT_disjoint_timer_query\",\"WEBGL_compressed_texture_etc\",\"WEBGL_compressed_texture_astc\",\"EXT_color_buffer_float\",\"WEBGL_compressed_texture_s3tc_srgb\",\"EXT_disjoint_timer_query_webgl2\"];var exts=GLctx.getSupportedExtensions();if(exts&&exts.length>0){GLctx.getSupportedExtensions().forEach(function(ext){if(automaticallyEnabledExtensions.indexOf(ext)!=-1){GLctx.getExtension(ext)}})}},populateUniformTable:function(program){var p=GL.programs[program];var ptable=GL.programInfos[program]={uniforms:{},maxUniformLength:0,maxAttributeLength:-1,maxUniformBlockNameLength:-1};var utable=ptable.uniforms;var numUniforms=GLctx.getProgramParameter(p,35718);for(var i=0;i0){return}if(surfData.isFlagSet(2097152)){SDL.copyIndexedColorData(surfData)}else if(!surfData.colors){var data=surfData.image.data;var buffer=surfData.buffer;assert(buffer%4==0,\"Invalid buffer offset: \"+buffer);var src=buffer>>2;var dst=0;var isScreen=surf==SDL.screen;var num;if(typeof CanvasPixelArray!==\"undefined\"&&data instanceof CanvasPixelArray){num=data.length;while(dst>8&255;data[dst+2]=val>>16&255;data[dst+3]=isScreen?255:val>>24&255;src++;dst+=4}}else{var data32=new Uint32Array(data.buffer);if(isScreen&&SDL.defaults.opaqueFrontBuffer){num=data32.length;data32.set(HEAP32.subarray(src,src+num));var data8=new Uint8Array(data.buffer);var i=3;var j=i+4*num;if(num%8==0){while(i>0]*4;var start=base+x*4;data[start]=colors[val];data[start+1]=colors[val+1];data[start+2]=colors[val+2]}s+=width*3}}surfData.ctx.putImageData(surfData.image,0,0)}function _SDL_UpperBlit(src,srcrect,dst,dstrect){return SDL.blitSurface(src,srcrect,dst,dstrect,false)}var SYSCALLS={buffers:[null,[],[]],printChar:function(stream,curr){var buffer=SYSCALLS.buffers[stream];if(curr===0||curr===10){(stream===1?out:err)(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}},varargs:0,get:function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(){var ret=UTF8ToString(SYSCALLS.get());return ret},get64:function(){var low=SYSCALLS.get(),high=SYSCALLS.get();return low},getZero:function(){SYSCALLS.get()}};function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS===\"undefined\"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function flush_NO_FILESYSTEM(){var fflush=Module[\"_fflush\"];if(fflush)fflush(0);var buffers=SYSCALLS.buffers;if(buffers[1].length)SYSCALLS.printChar(1,10);if(buffers[2].length)SYSCALLS.printChar(2,10)}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;jLIMIT){return false}var MIN_TOTAL_MEMORY=16777216;var newSize=Math.max(oldSize,MIN_TOTAL_MEMORY);while(newSize>2]=value;return value}Module[\"requestFullScreen\"]=function Module_requestFullScreen(lockPointer,resizeCanvas,vrDevice){err(\"Module.requestFullScreen is deprecated. Please call Module.requestFullscreen instead.\");Module[\"requestFullScreen\"]=Module[\"requestFullscreen\"];Browser.requestFullScreen(lockPointer,resizeCanvas,vrDevice)};Module[\"requestFullscreen\"]=function Module_requestFullscreen(lockPointer,resizeCanvas,vrDevice){Browser.requestFullscreen(lockPointer,resizeCanvas,vrDevice)};Module[\"requestAnimationFrame\"]=function Module_requestAnimationFrame(func){Browser.requestAnimationFrame(func)};Module[\"setCanvasSize\"]=function Module_setCanvasSize(width,height,noUpdates){Browser.setCanvasSize(width,height,noUpdates)};Module[\"pauseMainLoop\"]=function Module_pauseMainLoop(){Browser.mainLoop.pause()};Module[\"resumeMainLoop\"]=function Module_resumeMainLoop(){Browser.mainLoop.resume()};Module[\"getUserMedia\"]=function Module_getUserMedia(){Browser.getUserMedia()};Module[\"createContext\"]=function Module_createContext(canvas,useWebGL,setInModule,webGLContextAttributes){return Browser.createContext(canvas,useWebGL,setInModule,webGLContextAttributes)};if(typeof dateNow!==\"undefined\"){_emscripten_get_now=dateNow}else if(typeof performance===\"object\"&&performance&&typeof performance[\"now\"]===\"function\"){_emscripten_get_now=function(){return performance[\"now\"]()}}else{_emscripten_get_now=Date.now}var GLctx;GL.init();var ASSERTIONS=false;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}function intArrayToString(array){var ret=[];for(var i=0;i255){if(ASSERTIONS){assert(false,\"Character code \"+chr+\" (\"+String.fromCharCode(chr)+\") at offset \"+i+\" not in 0x00-0xFF.\")}chr&=255}ret.push(String.fromCharCode(chr))}return ret.join(\"\")}var decodeBase64=typeof atob===\"function\"?atob:function(input){var keyStr=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";var output=\"\";var chr1,chr2,chr3;var enc1,enc2,enc3,enc4;var i=0;input=input.replace(/[^A-Za-z0-9\\+\\/\\=]/g,\"\");do{enc1=keyStr.indexOf(input.charAt(i++));enc2=keyStr.indexOf(input.charAt(i++));enc3=keyStr.indexOf(input.charAt(i++));enc4=keyStr.indexOf(input.charAt(i++));chr1=enc1<<2|enc2>>4;chr2=(enc2&15)<<4|enc3>>2;chr3=(enc3&3)<<6|enc4;output=output+String.fromCharCode(chr1);if(enc3!==64){output=output+String.fromCharCode(chr2)}if(enc4!==64){output=output+String.fromCharCode(chr3)}}while(i>2]|0,c[k>>2]|0,32,0)|0;if(!l){m=c[2043]|0;n=c[k>>2]|0;c[g>>2]=c[h>>2];c[g+4>>2]=n;Af(m,8571,g)|0;o=0;p=0;q=0;break}m=w(0,c[h>>2]|0,c[k>>2]|0,32,255,65280,16711680,-16777216)|0;if(!m){n=c[2043]|0;s=c[k>>2]|0;c[f>>2]=c[h>>2];c[f+4>>2]=s;Af(n,8612,f)|0;o=0;p=l;q=0;break}B(m|0)|0;c[i>>2]=1;c[h+44>>2]=c[m+8>>2];n=m+12|0;c[h+48>>2]=c[n>>2];c[h+56>>2]=c[m+20>>2];s=m+16|0;c[h+60>>2]=c[s>>2];k=r(c[n>>2]|0,c[s>>2]|0)|0;c[h+64>>2]=k;c[h+52>>2]=1;k=Oe(a,b,h)|0;if(k|0){s=c[2043]|0;c[e>>2]=k;Af(s,8650,e)|0;o=m;p=l;q=0;break}D(m|0);if(!(E(m|0,0,l|0,0)|0)){o=m;p=l;q=(x(l|0)|0)==0&1}else{o=m;p=l;q=0}}else{o=0;p=0;q=0}while(0);y(o|0);y(p|0);Xc(i);j=q;Y=d;return j|0}function oa(a){a=a|0;var b=0,d=0;b=a+2360|0;pa(c[b>>2]|0);c[b>>2]=0;c[a+2364>>2]=0;b=a+2344|0;a=c[b>>2]|0;if(!a){c[b>>2]=0;return}d=a+20|0;qa(c[d>>2]|0);c[d>>2]=0;pa(a);c[b>>2]=0;return}function pa(a){a=a|0;Qe(a);return}function qa(a){a=a|0;if(!a)return;ra(a);pa(a);return}function ra(a){a=a|0;var b=0,d=0,e=0;if(!a)return;pa(c[a+160>>2]|0);pa(c[a+172>>2]|0);sa(c[a+168>>2]|0);ta(a+124|0);ta(a+136|0);b=a+120|0;d=b+56|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(d|0));b=a+16|0;pa(c[b>>2]|0);c[b>>2]=0;b=a+176|0;if((c[b>>2]|0)>0){d=0;do{e=a+180+(d*20|0)+16|0;pa(c[e>>2]|0);c[e>>2]=0;d=d+1|0}while((d|0)<(c[b>>2]|0))}c[b>>2]=0;c[a+260>>2]=0;b=a+264|0;pa(c[b>>2]|0);c[b>>2]=0;c[a+12>>2]=0;return}function sa(a){a=a|0;if(!a)return;pa(a);return}function ta(a){a=a|0;if(!a)return;pa(c[a>>2]|0);c[a>>2]=0;return}function ua(b,e,f,g){b=b|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;h=c[e>>2]|0;i=e+88|0;j=c[i>>2]|0;if((f|0)<0|(g|0)<1|(g+f|0)>(j|0)){k=0;return k|0}l=b+2356|0;a:do if(!(c[l>>2]|0)){m=b+2344|0;n=c[m>>2]|0;do if(!n){o=va(1,0,144)|0;c[m>>2]=o;if(!o){k=0;return k|0}o=c[e>>2]|0;p=c[i>>2]|0;q=Cf(p|0,((p|0)<0)<<31>>31|0,o|0,((o|0)<0)<<31>>31|0)|0;o=wa(q,v()|0,1)|0;c[b+2360>>2]=o;if(((o|0?(c[b+2364>>2]=o,c[b+2368>>2]=0,q=c[m>>2]|0,p=c[b+2348>>2]|0,s=c[b+2352>>2]|0,t=p+1|0,u=s+-1|0,w=q+24|0,xa(),c[q+136>>2]=o,c[q>>2]=c[e>>2],o=e+4|0,x=q+4|0,c[x>>2]=c[o>>2],s>>>0>=2):0)?(s=a[p>>0]&3,y=q+8|0,c[y>>2]=s&255,z=d[p>>0]|0,c[q+12>>2]=(2?z>>>2:z)&3,z=d[p>>0]|0,A=(4?z>>>4:z)&3,c[q+16>>2]=A,(s&255)<=1):0)?!(A>>>0>1|(d[p>>0]|0)>63):0){ya(w,520)|0;za(0,w);c[q+64>>2]=q;c[w>>2]=c[e>>2];c[q+28>>2]=c[o>>2];c[q+96>>2]=c[e+72>>2];c[q+100>>2]=c[e+76>>2];c[q+104>>2]=c[e+80>>2];c[q+108>>2]=c[e+84>>2];c[q+112>>2]=c[i>>2];if(!(c[y>>2]|0))B=u>>>0>=(r(c[x>>2]|0,c[q>>2]|0)|0)>>>0&1;else B=Aa(q,t,u)|0;if(B|0){u=c[m>>2]|0;if((c[u+16>>2]|0)==1){C=j-f|0;D=u;E=16;break}else{c[b+2372>>2]=0;C=g;D=u;E=16;break}}}}else{C=g;D=n;E=16}while(0);do if((E|0)==16){n=c[D>>2]|0;u=c[D+112>>2]|0;if(c[D+8>>2]|0){t=C+f|0;if(!(Ba(D,t)|0))break;else F=t}else{t=b+2368|0;q=c[t>>2]|0;x=r(n,f)|0;y=(c[b+2348>>2]|0)+1+x|0;o=c[b+2364>>2]|0;w=o+x|0;x=D+12|0;p=c[x>>2]|0;A=(C|0)>0;if(!p)if(A){s=C+f+-1|0;z=y;G=0;H=w;while(1){Lf(H|0,z|0,n|0)|0;G=G+1|0;if((G|0)==(C|0))break;else{z=z+n|0;H=H+n|0}}I=o+(r(n,s)|0)|0}else I=q;else if(A){H=r(n,C+f+-1|0)|0;ga[c[9472+(p<<2)>>2]&31](q,y,w,n);if((C|0)!=1){z=y;G=w;J=1;do{z=z+n|0;K=G;G=G+n|0;ga[c[9472+(c[x>>2]<<2)>>2]&31](K,z,G,n);J=J+1|0}while((J|0)!=(C|0))}I=o+H|0}else I=q;c[t>>2]=I;F=C+f|0}if((F|0)<(u|0)){if(!(c[l>>2]|0))break a}else c[l>>2]=1;J=c[m>>2]|0;if(J|0){n=J+20|0;qa(c[n>>2]|0);c[n>>2]=0;pa(J)}c[m>>2]=0;J=c[b+2372>>2]|0;if((J|0)<=0)break a;n=c[e+84>>2]|0;G=(c[b+2364>>2]|0)+(r(n,h)|0)|0;z=c[e+76>>2]|0;if(Ca(G+z|0,(c[e+80>>2]|0)-z|0,(c[i>>2]|0)-n|0,h,J)|0)break a}while(0);J=b+2360|0;pa(c[J>>2]|0);c[J>>2]=0;c[b+2364>>2]=0;J=c[m>>2]|0;if(J|0){n=J+20|0;qa(c[n>>2]|0);c[n>>2]=0;pa(J)}c[m>>2]=0;k=0;return k|0}while(0);k=(c[b+2364>>2]|0)+(r(h,f)|0)|0;return k|0}function va(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=Cf(c|0,0,a|0,b|0)|0;e=v()|0;if(!((a|0)==0&(b|0)==0)?(f=Hf(2147418112,0,a|0,b|0)|0,b=v()|0,(d|0)!=(d|0)|(e|0)!=0|(b>>>0<0|(b|0)==0&f>>>0>>0)):0){g=0;return g|0}g=Re(a,c)|0;return g|0}function wa(a,b,c){a=a|0;b=b|0;c=c|0;var d=0,e=0,f=0,g=0;d=Cf(c|0,0,a|0,b|0)|0;e=v()|0;if(!((a|0)==0&(b|0)==0)?(f=Hf(2147418112,0,a|0,b|0)|0,b=v()|0,(d|0)!=(d|0)|(e|0)!=0|(b>>>0<0|(b|0)==0&f>>>0>>0)):0){g=0;return g|0}g=Pe(r(a,c)|0)|0;return g|0}function xa(){if(Te(10112)|0)return;if(c[2034]|0){c[2368]=0;c[2369]=1;c[2370]=2;c[2371]=3;c[2364]=0;c[2365]=1;c[2366]=2;c[2367]=3}c[2034]=0;Ue(10112)|0;return}function ya(a,b){a=a|0;b=b|0;var d=0;if((b&-256|0)!=512){d=0;return d|0}if(!a){d=1;return d|0}b=a;a=b+108|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));d=1;return d|0}function za(a,b){a=a|0;b=b|0;c[b+44>>2]=4;c[b+48>>2]=5;c[b+52>>2]=5;c[b+40>>2]=a;return}function Aa(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;f=va(1,0,272)|0;if(!f){g=0;return g|0}c[f>>2]=0;c[f+4>>2]=2;_a();h=c[b>>2]|0;i=f+100|0;c[i>>2]=h;j=b+4|0;k=c[j>>2]|0;l=f+104|0;c[l>>2]=k;m=b+24|0;c[f+8>>2]=m;c[b+64>>2]=b;c[m>>2]=h;c[b+28>>2]=k;c[f>>2]=0;$a(f+24|0,d,e);if(!(ab(c[b>>2]|0,c[j>>2]|0,1,f,0)|0)){ra(f);pa(f);g=0;return g|0}a:do if(((c[f+176>>2]|0)==1?(c[f+180>>2]|0)==3:0)?(c[f+120>>2]|0)<=0:0){j=c[f+164>>2]|0;if((j|0)>0){e=c[f+168>>2]|0;d=0;do{if(a[c[e+(d*548|0)+4>>2]>>0]|0){n=14;break a}if(a[c[e+(d*548|0)+8>>2]>>0]|0){n=14;break a}if(a[c[e+(d*548|0)+12>>2]>>0]|0){n=14;break a}d=d+1|0}while((d|0)<(j|0))}c[b+132>>2]=1;j=c[i>>2]|0;d=c[l>>2]|0;e=Cf(d|0,((d|0)<0)<<31>>31|0,j|0,((j|0)<0)<<31>>31|0)|0;j=v()|0;c[f+20>>2]=0;d=wa(e,j,1)|0;c[f+16>>2]=d;if(!d){c[f>>2]=1;n=19}else n=17}else n=14;while(0);do if((n|0)==14){c[b+132>>2]=0;d=c[b>>2]|0;j=c[i>>2]|0;e=c[l>>2]|0;k=Cf(e|0,((e|0)<0)<<31>>31|0,j|0,((j|0)<0)<<31>>31|0)|0;j=v()|0;e=d&65535;h=Jf(d|0,((d|0)<0)<<31>>31|0,4)|0;d=Df(h|0,v()|0,e|0,0)|0;h=Df(d|0,v()|0,k|0,j|0)|0;j=wa(h,v()|0,4)|0;c[f+16>>2]=j;if(!j){c[f>>2]=1;c[f+20>>2]=0;n=19;break}else{c[f+20>>2]=j+(k<<2)+(e<<2);n=17;break}}while(0);if((n|0)==17){c[b+20>>2]=f;g=1;return g|0}else if((n|0)==19){ra(f);pa(f);g=0;return g|0}return 0}function Ba(f,g){f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Ha=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0;h=c[f+20>>2]|0;if((c[h+108>>2]|0)>=(g|0)){i=1;return i|0}j=f+132|0;if(!(c[j>>2]|0)){Da();f=c[h+16>>2]|0;if(!(c[j>>2]|0)){i=Ia(h,f,c[h+100>>2]|0,c[h+104>>2]|0,g,1)|0;return i|0}else k=f}else k=c[h+16>>2]|0;f=c[h+100>>2]|0;j=h+112|0;l=c[j>>2]|0;m=(l|0)/(f|0)|0;n=l-(r(m,f)|0)|0;o=h+24|0;p=r(c[h+104>>2]|0,f)|0;q=r(f,g)|0;s=c[h+148>>2]|0;a:do if((l|0)<(q|0)){t=h+152|0;u=c[t>>2]|0;if(!u)w=0;else{x=r(c[h+156>>2]|0,u?m>>u:m)|0;w=c[(c[h+160>>2]|0)+(x+(u?n>>u:n)<<2)>>2]|0}u=h+48|0;if(!(c[u>>2]|0)){x=h+168|0;y=h+44|0;z=h+160|0;A=h+156|0;B=h+40|0;C=h+36|0;D=m;E=n;F=l;G=(c[x>>2]|0)+(w*548|0)|0;while(1){if(!(E&s)){H=c[t>>2]|0;if(!H)I=0;else{J=r(c[A>>2]|0,H?D>>H:D)|0;I=c[(c[z>>2]|0)+(J+(H?E>>H:E)<<2)>>2]|0}K=(c[x>>2]|0)+(I*548|0)|0}else K=G;H=c[y>>2]|0;if((H|0)>31){Ea(o);L=c[y>>2]|0}else L=H;H=c[K>>2]|0;J=o;M=c[J>>2]|0;N=c[J+4>>2]|0;J=If(M|0,N|0,L&63|0)|0;v()|0;O=J&255;J=H+(O<<2)|0;P=a[J>>0]|0;if((P&255)>8){Q=L+8|0;c[y>>2]=Q;R=If(M|0,N|0,Q&63|0)|0;v()|0;S=J+((e[H+(O<<2)+2>>1]|0)<<2)+(((1<<(P&255)+-8)+-1&R)<<2)|0;T=S;U=a[S>>0]|0;V=Q}else{T=J;U=P;V=L}P=V+(U&255)|0;c[y>>2]=P;J=b[T+2>>1]|0;Q=J&65535;do if((J&65535)<256){a[k+F>>0]=J;S=F+1|0;R=E+1|0;if((R|0)>=(f|0)){O=D+1|0;if((D|0)<(g|0)&(O&15|0)==0){Fa(h,O);W=S;X=O;Y=0;Z=K}else{W=S;X=O;Y=0;Z=K}}else{W=S;X=D;Y=R;Z=K}}else{if((J&65535)>=280){_=F;$=0;aa=u;break a}R=Q+-258|0;S=1?R>>1:R;if((J&65535)<260){ba=Q+-256|0;ca=P;da=M;ea=N}else{R=(Ga(o,S)|0)+(((J&1|2)&65535)<>2]|0;da=c[S>>2]|0;ea=c[S+4>>2]|0}S=ba+1|0;R=c[K+16>>2]|0;O=If(da|0,ea|0,ca&63|0)|0;v()|0;H=O&255;O=R+(H<<2)|0;fa=a[O>>0]|0;if((fa&255)>8){ga=ca+8|0;c[y>>2]=ga;ha=If(da|0,ea|0,ga&63|0)|0;v()|0;ia=O+((e[R+(H<<2)+2>>1]|0)<<2)+(((1<<(fa&255)+-8)+-1&ha)<<2)|0;ja=ia;ka=a[ia>>0]|0;la=ga}else{ja=O;ka=fa;la=ca}fa=la+(ka&255)|0;c[y>>2]=fa;O=b[ja+2>>1]|0;ga=O&65535;if((fa|0)>31)Ea(o);fa=ga+-2|0;ia=1?fa>>1:fa;if((O&65535)<4)ma=ga;else ma=(Ga(o,ia)|0)+((ga&1|2)<120)na=ma+-119|0;else{ia=d[3584+ma>>0]|0;ga=(r(4?ia>>>4:ia,f)|0)+(8-(ia&15))|0;na=(ga|0)>1?ga:1}if((p-F|0)<(S|0)|(F|0)<(na|0)){_=F;$=0;aa=u;break a}ga=k+F|0;ia=ga+(0-na)|0;b:do if((S|0)>7){switch(na|0){case 1:{O=a[ia>>0]|0;oa=r(O&255,16843009)|0;pa=O;break}case 2:{O=d[ia>>0]|d[ia+1>>0]<<8;oa=(O&65535)*65537|0;pa=O&255;break}case 4:{O=d[ia>>0]|d[ia+1>>0]<<8|d[ia+2>>0]<<16|d[ia+3>>0]<<24;oa=O;pa=O&255;break}default:{qa=54;break b}}do if(ga&3){O=ia+1|0;fa=ga+1|0;a[ga>>0]=pa;ha=oa<<24|(8?oa>>>8:oa);if(!(fa&3)){ra=ha;sa=ba;ta=fa;ua=O;va=2?ba>>>2:ba;qa=48;break}H=O;O=fa;fa=ha;ha=ba;while(1){R=H;H=H+1|0;wa=O;O=O+1|0;a[wa>>0]=a[R>>0]|0;fa=fa<<24|(8?fa>>>8:fa);xa=ha+-1|0;if(!(O&3))break;else ha=xa}if((ha|0)>4){ra=fa;sa=xa;ta=O;ua=H;va=2?xa>>2:xa;qa=48}else{ya=0;za=xa;Aa=O;Ba=H}}else{ra=oa;sa=S;ta=ga;ua=ia;va=2?S>>>2:S;qa=48}while(0);if((qa|0)==48){qa=0;R=0;do{c[ta+(R<<2)>>2]=ra;R=R+1|0}while((R|0)<(va|0));ya=R<<2;za=sa;Aa=ta;Ba=ua}if((ya|0)>=(za|0))break;wa=ya;do{a[Aa+wa>>0]=a[Ba+wa>>0]|0;wa=wa+1|0}while((wa|0)!=(za|0))}else qa=54;while(0);do if((qa|0)==54){qa=0;if((na|0)>=(S|0)){Lf(ga|0,ia|0,S|0)|0;break}if((S|0)<=0)break;wa=0;do{a[ga+wa>>0]=a[ia+wa>>0]|0;wa=wa+1|0}while((wa|0)!=(S|0))}while(0);ia=S+F|0;ga=S+E|0;if((ga|0)<(f|0)){Ca=D;Ha=ga}else{wa=D;R=ga;while(1){ga=R-f|0;Ja=wa+1|0;if((wa|0)<(g|0)&(Ja&15|0)==0)Fa(h,Ja);if((ga|0)<(f|0)){Ca=Ja;Ha=ga;break}else{wa=Ja;R=ga}}}if((ia|0)>=(q|0)|(Ha&s|0)==0){W=ia;X=Ca;Y=Ha;Z=K;break}R=c[t>>2]|0;if(!R)Ka=0;else{wa=r(c[A>>2]|0,R?Ca>>R:Ca)|0;Ka=c[(c[z>>2]|0)+(wa+(R?Ha>>R:Ha)<<2)>>2]|0}W=ia;X=Ca;Y=Ha;Z=(c[x>>2]|0)+(Ka*548|0)|0}while(0);if(c[u>>2]|0)break;if((c[B>>2]|0)==(c[C>>2]|0))La=(c[y>>2]|0)>64&1;else La=0;c[u>>2]=La;if((W|0)<(q|0)&(La|0)==0){D=X;E=Y;F=W;G=Z}else{Ma=X;Na=W;Oa=u;qa=73;break a}}c[u>>2]=1;Ma=X;Na=W;Oa=u;qa=73}else{Ma=m;Na=l;Oa=u;qa=73}}else{Ma=m;Na=l;Oa=h+48|0;qa=73}while(0);if((qa|0)==73){Fa(h,(Ma|0)>(g|0)?g:Ma);_=Na;$=1;aa=Oa}if(!(c[aa>>2]|0))if((c[h+40>>2]|0)==(c[h+36>>2]|0))Pa=(c[h+44>>2]|0)>64&1;else Pa=0;else Pa=1;c[aa>>2]=Pa;if($|0?!((p|0)>(_|0)&(Pa|0)!=0):0){c[j>>2]=_;i=1;return i|0}c[h>>2]=(Pa|0)==0?3:5;i=0;return i|0}function Ca(c,f,g,h,i){c=c|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0;j=Y;Y=Y+256|0;k=j;l=(i|0)/25|0;if(i>>>0>100){m=0;Y=j;return m|0}if((c|0)==0|(f|0)<1|(g|0)<1){m=0;Y=j;return m|0}i=f+-1|0;n=(l<<1|1|0)>(f|0)?(1?i>>1:i):l;l=g+-1|0;o=(n<<1|1|0)>(g|0)?(1?l>>1:l):n;n=0-o|0;if((o|0)<=0){m=1;Y=j;return m|0}p=o<<1|1;q=f<<1;s=r(p+1|0,q)|0;t=wa(1,0,q+4094+s|0)|0;if(!t){m=0;Y=j;return m|0}u=t+((r(p,f)|0)<<1)|0;v=u+(0-f<<1)|0;Nf(v|0,0,q|0)|0;w=t+s|0;s=r(p,p)|0;Nf(k|0,0,256)|0;p=0;x=c;y=255;z=0;A=0;B=255;while(1){C=0;D=y;E=z;F=B;G=A;do{H=d[x+C>>0]|0;I=(F|0)>(H|0);D=I?H:D;F=I?H:F;I=(G|0)<(H|0);E=I?H:E;G=I?H:G;a[k+H>>0]=1;C=C+1|0}while((C|0)!=(f|0));p=p+1|0;if((p|0)==(g|0))break;else{x=x+h|0;y=D;z=E;A=G;B=F}}B=t;A=w+q|0;z=262144/(s>>>0)|0;s=-1;y=0;x=0;p=G-F|0;while(1){if(a[k+y>>0]|0){F=x+1|0;if((s|0)>-1){G=y-s|0;J=y;K=F;L=(G|0)<(p|0)?G:p}else{J=y;K=F;L=p}}else{J=s;K=x;L=p}y=y+1|0;if((y|0)==256)break;else{s=J;x=K;p=L}}p=A+2046|0;A=L<<2;x=L*12|0;L=2?x>>2:x;x=A-L|0;J=1;do{if((J|0)>(L|0))if((A|0)>(J|0))M=(r(A-J|0,L)|0)/(x|0)|0;else M=0;else M=J;s=2?M>>2:M;b[p+(J<<1)>>1]=s;b[p+(0-J<<1)>>1]=0-s;J=J+1|0}while((J|0)!=1024);b[p>>1]=0;if((K|0)>2&(n|0)<(g|0)){K=(f|0)>0;J=(o|0)<0;M=f-o|0;x=o+-1|0;L=o+1|0;A=~o;s=u+(i<<1)|0;i=q+-2-o|0;q=n;n=c;y=c;c=B;k=v;while(1){v=k;k=c;if(K){F=0;G=0;do{G=(G&65535)+(d[n+F>>0]|0)|0;C=G+(e[v+(F<<1)>>1]|0)|0;H=k+(F<<1)|0;b[u+(F<<1)>>1]=C-(e[H>>1]|0);b[H>>1]=C;F=F+1|0}while((F|0)!=(f|0))}F=k+(f<<1)|0;c=(F|0)==(u|0)?B:F;n=(q|0)>-1&(q|0)<(l|0)?n+h|0:n;if((q|0)<(o|0))N=y;else{if(J)O=0;else{F=0;do{v=r((e[u+(o-F<<1)>>1]|0)+(e[u+(x+F<<1)>>1]|0)&65535,z)|0;b[w+(F<<1)>>1]=16?v>>>16:v;F=F+1|0}while((F|0)!=(L|0));O=L}if((O|0)<(M|0)){F=O;do{v=r((e[u+(F+o<<1)>>1]|0)-(e[u+(F+A<<1)>>1]|0)&65535,z)|0;b[w+(F<<1)>>1]=16?v>>>16:v;F=F+1|0}while((F|0)!=(M|0));P=M}else P=O;if((P|0)<(f|0)){F=P;do{v=r((e[s>>1]<<1)-(e[u+(i-F<<1)>>1]|0)-(e[u+(F+A<<1)>>1]|0)&65535,z)|0;b[w+(F<<1)>>1]=16?v>>>16:v;F=F+1|0}while((F|0)!=(f|0))}if(K){F=0;do{v=y+F|0;G=d[v>>0]|0;if((E|0)>(G|0)&(D|0)<(G|0)){C=(b[p+((e[w+(F<<1)>>1]|0)-(G<<2)<<1)>>1]|0)+G|0;if(C>>>0>255)Q=((31?C>>31:C)&-255)+255|0;else Q=C&255;a[v>>0]=Q}F=F+1|0}while((F|0)!=(f|0))}N=y+h|0}q=q+1|0;if((q|0)==(g|0))break;else y=N}}pa(t);m=1;Y=j;return m|0}function Da(){if(Te(9944)|0)return;c[2028]=0;Ue(9944)|0;return}function Ea(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;b=a+16|0;e=a+20|0;f=c[e>>2]|0;a:do if((f|0)>7){g=a+8|0;h=c[a+12>>2]|0;i=f;j=c[b>>2]|0;while(1){if(j>>>0>=h>>>0){k=i;break a}l=a;m=If(c[l>>2]|0,c[l+4>>2]|0,8)|0;l=v()|0;n=a;c[n>>2]=m;c[n+4>>2]=l;n=Jf(d[(c[g>>2]|0)+j>>0]|0|0,0,56)|0;o=v()|0|l;l=a;c[l>>2]=n|m;c[l+4>>2]=o;j=j+1|0;c[b>>2]=j;o=i+-8|0;c[e>>2]=o;if((i|0)<=15){k=o;break}else i=o}}else k=f;while(0);f=a+24|0;if((c[f>>2]|0)==0?((k|0)<65?1:(c[b>>2]|0)!=(c[a+12>>2]|0)):0)return;c[f>>2]=1;c[e>>2]=0;return}function Fa(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=c[a+8>>2]|0;e=c[d+40>>2]|0;f=e+12|0;g=a+108|0;h=c[((c[f>>2]|0)>>>0<2?d+84|0:g)>>2]|0;i=c[g>>2]|0;j=(i|0)<(h|0)?h:i;if((j|0)>=(b|0)){k=a+116|0;c[k>>2]=b;c[g>>2]=b;return}i=c[d>>2]|0;d=(c[e+136>>2]|0)+(r(i,j)|0)|0;Sa(a+180|0,j,b,(c[a+16>>2]|0)+(r(c[a+100>>2]|0,j)|0)|0,d);h=c[f>>2]|0;if(!h){k=a+116|0;c[k>>2]=b;c[g>>2]=b;return}l=e+140|0;e=r(i,b+-1-j|0)|0;ga[c[9472+(h<<2)>>2]&31](c[l>>2]|0,d,d,i);h=j+1|0;if((h|0)!=(b|0)){j=d;m=h;do{h=j;j=j+i|0;ga[c[9472+(c[f>>2]<<2)>>2]&31](h,j,j,i);m=m+1|0}while((m|0)!=(b|0))}c[l>>2]=d+e;k=a+116|0;c[k>>2]=b;c[g>>2]=b;return}function Ga(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0;e=a+24|0;if(!((b|0)<25&(c[e>>2]|0)==0)){c[e>>2]=1;c[a+20>>2]=0;f=0;return f|0}g=a;h=c[g>>2]|0;i=c[g+4>>2]|0;g=a+20|0;j=c[g>>2]|0;k=If(h|0,i|0,j&63|0)|0;v()|0;l=c[3712+(b<<2)>>2]&k;k=j+b|0;c[g>>2]=k;b=a+16|0;if((k|0)<=7){f=l;return f|0}j=a+8|0;m=c[a+12>>2]|0;n=c[b>>2]|0;o=h;h=i;i=k;while(1){if(n>>>0>=m>>>0){p=i;break}k=If(o|0,h|0,8)|0;q=v()|0;r=a;c[r>>2]=k;c[r+4>>2]=q;r=Jf(d[(c[j>>2]|0)+n>>0]|0|0,0,56)|0;o=r|k;h=v()|0|q;q=a;c[q>>2]=o;c[q+4>>2]=h;n=n+1|0;c[b>>2]=n;q=i+-8|0;c[g>>2]=q;if((i|0)<=15){p=q;break}else i=q}if((p|0)<65?1:(c[b>>2]|0)!=(c[a+12>>2]|0)){f=l;return f|0}c[e>>2]=1;c[g>>2]=0;f=l;return f|0}function Ha(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;d=a+108|0;e=c[d>>2]|0;f=b-e|0;g=a+100|0;if((f|0)<=0){h=a+116|0;c[h>>2]=b;c[d>>2]=b;return}i=c[g>>2]|0;j=a+8|0;k=a+20|0;l=a+176|0;m=f;f=(c[a+16>>2]|0)+((r(i,e)|0)<<2)|0;n=e;o=e;e=i;while(1){i=(m|0)<16?m:16;p=c[j>>2]|0;q=c[p+40>>2]|0;s=c[p>>2]|0;p=r(s,i)|0;t=(c[q+136>>2]|0)+(r(s,n)|0)|0;u=c[k>>2]|0;v=c[l>>2]|0;w=o+i|0;if((v|0)>0){x=v+-1|0;La(a+180+(x*20|0)|0,o,w,f,u);if((v|0)!=1){v=x;do{x=v;v=v+-1|0;La(a+180+(v*20|0)|0,o,w,u,u)}while((x|0)>1)}}else if((u|0)!=(f|0))Lf(u|0,f|0,r(i<<2,e)|0)|0;Za(u,t,p);w=i+n|0;v=q+12|0;x=c[v>>2]|0;if(x|0){y=q+140|0;z=c[y>>2]|0;if((m|0)>0){A=r(s,i+-1|0)|0;ga[c[9472+(x<<2)>>2]&31](z,t,t,s);x=n+1|0;if((x|0)!=(w|0)){B=t;C=x;do{x=B;B=B+s|0;ga[c[9472+(c[v>>2]<<2)>>2]&31](x,B,B,s);C=C+1|0}while((C|0)!=(w|0))}D=t+A|0}else D=z;c[y>>2]=D}C=m-i|0;s=c[g>>2]|0;if((C|0)<=0)break;B=f+((r(s,i)|0)<<2)|0;m=C;f=B;n=w;o=c[d>>2]|0;e=s}h=a+116|0;c[h>>2]=b;c[d>>2]=b;return}function Ia(f,g,h,i,j,k){f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Fa=0,Ha=0,Ia=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0;l=f+112|0;m=c[l>>2]|0;n=(m|0)/(h|0)|0;o=m-(r(n,h)|0)|0;p=f+24|0;q=g+(m<<2)|0;s=g+((r(i,h)|0)<<2)|0;i=r(j,h)|0;t=g+(i<<2)|0;u=f+120|0;w=c[u>>2]|0;x=w+280|0;y=f+56|0;z=(c[y>>2]|0)==0?16777216:n;A=(w|0)>0;w=f+124|0;B=A?w:0;C=c[f+148>>2]|0;a:do if((m|0)<(i|0)){D=c[f+152>>2]|0;if(!D)E=0;else{F=r(c[f+156>>2]|0,D?n>>D:n)|0;E=c[(c[f+160>>2]|0)+(F+(D?o>>D:o)<<2)>>2]|0}D=g;F=f+64|0;G=f+96|0;H=f+152|0;I=f+136|0;J=f+168|0;K=f+160|0;L=f+156|0;M=f+44|0;N=(k|0)!=0;O=f+48|0;P=f+40|0;Q=f+36|0;R=B+4|0;S=s;T=(k|0)==0;U=n;V=o;W=q;X=q;Y=z;Z=(c[f+168>>2]|0)+(E*548|0)|0;while(1){_=X;if((U|0)<(Y|0))$=Y;else{aa=W-D|0;c[F>>2]=c[p>>2];c[F+4>>2]=c[p+4>>2];c[F+8>>2]=c[p+8>>2];c[F+12>>2]=c[p+12>>2];c[F+16>>2]=c[p+16>>2];c[F+20>>2]=c[p+20>>2];c[F+24>>2]=c[p+24>>2];c[F+28>>2]=c[p+28>>2];c[G>>2]=2?aa>>2:aa;if((c[u>>2]|0)>0)Ja(w,I);$=U+8|0}if(!(V&C)){aa=c[H>>2]|0;if(!aa)ba=0;else{ca=r(c[L>>2]|0,aa?U>>aa:U)|0;ba=c[(c[K>>2]|0)+(ca+(aa?V>>aa:V)<<2)>>2]|0}da=(c[J>>2]|0)+(ba*548|0)|0}else da=Z;do if(!(c[da+28>>2]|0)){if((c[M>>2]|0)>31)Ea(p);if(!(c[da+32>>2]|0)){aa=c[da>>2]|0;ca=p;ea=c[ca>>2]|0;ga=c[ca+4>>2]|0;ca=c[M>>2]|0;ha=If(ea|0,ga|0,ca&63|0)|0;v()|0;ia=ha&255;ha=aa+(ia<<2)|0;ja=a[ha>>0]|0;if((ja&255)>8){ka=ca+8|0;c[M>>2]=ka;la=If(ea|0,ga|0,ka&63|0)|0;v()|0;ma=ha+((e[aa+(ia<<2)+2>>1]|0)<<2)+(((1<<(ja&255)+-8)+-1&la)<<2)|0;na=ma;oa=a[ma>>0]|0;pa=ka}else{na=ha;oa=ja;pa=ca}c[M>>2]=pa+(oa&255);if(!(c[O>>2]|0)){qa=e[na+2>>1]|0;ra=ea;sa=ga}else{ta=U;ua=W;va=O;wa=1;xa=111;break a}}else{ga=p;ea=c[ga>>2]|0;ca=c[ga+4>>2]|0;ga=c[M>>2]|0;ja=If(ea|0,ca|0,ga&63|0)|0;v()|0;ha=ja&63;ja=c[da+36+(ha<<3)>>2]|0;ka=c[da+36+(ha<<3)+4>>2]|0;ha=ja+ga|0;if((ja|0)<256){c[M>>2]=ha;c[W>>2]=ka;ya=0}else{c[M>>2]=ha+-256;ya=ka}if(c[O>>2]|0){ta=U;ua=W;va=O;wa=1;xa=111;break a}if((c[P>>2]|0)==(c[Q>>2]|0)?(c[M>>2]|0)>=65:0){za=U;Aa=W;Ba=O;xa=108;break a}if(!ya){Ca=X;Da=_;xa=46;break}else{qa=ya;ra=ea;sa=ca}}if((c[P>>2]|0)==(c[Q>>2]|0)?(c[M>>2]|0)>=65:0){za=U;Aa=W;Ba=O;xa=108;break a}if((qa|0)<256){if(c[da+20>>2]|0){Fa=X;Ha=_;Ia=c[da+24>>2]|qa<<8;xa=45;break}ca=c[da+4>>2]|0;ea=c[M>>2]|0;ka=If(ra|0,sa|0,ea&63|0)|0;v()|0;ha=ka&255;ka=ca+(ha<<2)|0;ja=a[ka>>0]|0;if((ja&255)>8){ga=ea+8|0;c[M>>2]=ga;ma=If(ra|0,sa|0,ga&63|0)|0;v()|0;la=ka+((e[ca+(ha<<2)+2>>1]|0)<<2)+(((1<<(ja&255)+-8)+-1&ma)<<2)|0;Ka=la;La=a[la>>0]|0;Ma=ga}else{Ka=ka;La=ja;Ma=ea}ea=Ma+(La&255)|0;c[M>>2]=ea;ja=e[Ka+2>>1]|0;if((ea|0)>31){Ea(p);ka=p;Na=c[M>>2]|0;Oa=c[ka>>2]|0;Pa=c[ka+4>>2]|0}else{Na=ea;Oa=ra;Pa=sa}ea=c[da+8>>2]|0;ka=If(Oa|0,Pa|0,Na&63|0)|0;v()|0;ga=ka&255;ka=ea+(ga<<2)|0;la=a[ka>>0]|0;if((la&255)>8){ma=Na+8|0;c[M>>2]=ma;ha=If(Oa|0,Pa|0,ma&63|0)|0;v()|0;ca=ka+((e[ea+(ga<<2)+2>>1]|0)<<2)+(((1<<(la&255)+-8)+-1&ha)<<2)|0;Qa=ca;Ra=a[ca>>0]|0;Sa=ma}else{Qa=ka;Ra=la;Sa=Na}la=Sa+(Ra&255)|0;c[M>>2]=la;ka=e[Qa+2>>1]|0;ma=c[da+12>>2]|0;ca=If(Oa|0,Pa|0,la&63|0)|0;v()|0;ha=ca&255;ca=ma+(ha<<2)|0;ga=a[ca>>0]|0;if((ga&255)>8){ea=la+8|0;c[M>>2]=ea;ia=If(Oa|0,Pa|0,ea&63|0)|0;v()|0;aa=ca+((e[ma+(ha<<2)+2>>1]|0)<<2)+(((1<<(ga&255)+-8)+-1&ia)<<2)|0;Ta=aa;Ua=a[aa>>0]|0;Va=ea}else{Ta=ca;Ua=ga;Va=la}la=Va+(Ua&255)|0;c[M>>2]=la;if(c[O>>2]|0){ta=U;ua=W;va=O;wa=1;xa=111;break a}if(!((la|0)<65?1:(c[P>>2]|0)!=(c[Q>>2]|0))){za=U;Aa=W;Ba=O;xa=108;break a}Fa=X;Ha=_;Ia=ja<<16|qa<<8|ka|(e[Ta+2>>1]|0)<<24;xa=45;break}if((qa|0)>=280){if((qa|0)>=(x|0))break a;ka=qa+-280|0;ja=c[B>>2]|0;if(X>>>0>>0){la=W+-1+(0-_)|0;ga=2?la>>>2:la;la=X;do{ca=c[la>>2]|0;la=la+4|0;ea=c[R>>2]|0;aa=r(ca,506832829)|0;c[ja+((ea?aa>>>ea:aa)<<2)>>2]=ca}while(la>>>0>>0);la=X+4+(ga<<2)|0;Wa=la;Xa=la}else{Wa=X;Xa=_}Fa=Wa;Ha=Xa;Ia=c[ja+(ka<<2)>>2]|0;xa=45;break}la=qa+-256|0;ca=qa+-258|0;aa=1?ca>>1:ca;if((qa|0)<260){Ya=la;Za=ra;_a=sa}else{ca=(Ga(p,aa)|0)+((la&1|2)<>2]|0;_a=c[aa+4>>2]|0}aa=Ya+1|0;ca=c[da+16>>2]|0;la=c[M>>2]|0;ea=If(Za|0,_a|0,la&63|0)|0;v()|0;ia=ea&255;ea=ca+(ia<<2)|0;ha=a[ea>>0]|0;if((ha&255)>8){ma=la+8|0;c[M>>2]=ma;$a=If(Za|0,_a|0,ma&63|0)|0;v()|0;ab=ea+((e[ca+(ia<<2)+2>>1]|0)<<2)+(((1<<(ha&255)+-8)+-1&$a)<<2)|0;bb=ab;cb=a[ab>>0]|0;db=ma}else{bb=ea;cb=ha;db=la}la=db+(cb&255)|0;c[M>>2]=la;ha=b[bb+2>>1]|0;ea=ha&65535;if((la|0)>31)Ea(p);la=ea+-2|0;ma=1?la>>1:la;if((ha&65535)<4)eb=ea;else eb=(Ga(p,ma)|0)+((ea&1|2)<120)fb=eb+-119|0;else{ma=d[3584+eb>>0]|0;ea=(r(4?ma>>>4:ma,h)|0)+(8-(ma&15))|0;fb=(ea|0)>1?ea:1}if(c[O>>2]|0){ta=U;ua=W;va=O;wa=1;xa=111;break a}if((c[P>>2]|0)==(c[Q>>2]|0)?(c[M>>2]|0)>=65:0){za=U;Aa=W;Ba=O;xa=108;break a}ea=W;ma=ea-D|0;if(((2?ma>>2:ma)|0)<(fb|0))break a;ma=S-ea|0;if(((2?ma>>2:ma)|0)<(aa|0))break a;ma=W+(0-fb<<2)|0;do if((ea&3|0)==0&((aa|0)>3&(fb|0)<3)){if((fb|0)==1){ha=c[ma>>2]|0;gb=ha;hb=ha;ib=ha}else{ha=ma;la=c[ha>>2]|0;gb=la;hb=la;ib=c[ha+4>>2]|0}if(!(ea&4)){jb=aa;kb=W;lb=ma;mb=hb;nb=ib}else{c[W>>2]=gb;jb=Ya;kb=W+4|0;lb=ma+4|0;mb=ib;nb=hb}ha=1?jb>>>1:jb;la=0;do{ab=kb+(la<<3)|0;c[ab>>2]=mb;c[ab+4>>2]=nb;la=la+1|0}while(la>>>0>>0);ha=la<<1;if(!(jb&1))break;c[kb+(ha<<2)>>2]=c[lb+(ha<<2)>>2]}else{if((fb|0)>=(aa|0)){Lf(W|0,ma|0,aa<<2|0)|0;break}if((aa|0)<=0)break;ha=0;do{c[W+(ha<<2)>>2]=c[ma+(ha<<2)>>2];ha=ha+1|0}while((ha|0)!=(aa|0))}while(0);ma=W+(aa<<2)|0;ea=aa+V|0;b:do if((ea|0)<(h|0)){ob=U;pb=ea}else{if(T){ka=ea;ja=U;while(1){ga=ka-h|0;ha=ja+1|0;if((ga|0)<(h|0)){ob=ha;pb=ga;break b}else{ka=ga;ja=ha}}}ja=ea;ka=U;while(1){ha=ja-h|0;ga=ka+1|0;if((ka|0)<(j|0)&(ga&15|0)==0)fa[k&3](f,ga);if((ha|0)<(h|0)){ob=ga;pb=ha;break}else{ja=ha;ka=ga}}}while(0);if(!(pb&C))qb=da;else{ea=c[H>>2]|0;if(!ea)rb=0;else{aa=r(c[L>>2]|0,ea?ob>>ea:ob)|0;rb=c[(c[K>>2]|0)+(aa+(ea?pb>>ea:pb)<<2)>>2]|0}qb=(c[J>>2]|0)+(rb*548|0)|0}if(!(A&X>>>0>>0)){sb=ma;tb=ob;ub=pb;vb=qb;wb=X;break}ea=c[B>>2]|0;aa=W+3+((Ya<<2)-_)|0;ka=2?aa>>>2:aa;aa=X;do{ja=c[aa>>2]|0;aa=aa+4|0;ga=c[R>>2]|0;ha=r(ja,506832829)|0;c[ea+((ga?ha>>>ga:ha)<<2)>>2]=ja}while(aa>>>0>>0);sb=ma;tb=ob;ub=pb;vb=qb;wb=X+4+(ka<<2)|0}else{Fa=X;Ha=_;Ia=c[da+24>>2]|0;xa=45}while(0);if((xa|0)==45){xa=0;c[W>>2]=Ia;Ca=Fa;Da=Ha;xa=46}if((xa|0)==46){xa=0;_=W+4|0;aa=V+1|0;if((aa|0)>=(h|0)){ea=U+1|0;if(N&(U|0)<(j|0)&(ea&15|0)==0)fa[k&3](f,ea);if(A&Ca>>>0<_>>>0){ja=c[B>>2]|0;ha=(Ca>>>0>W>>>0?Ca:W)+3+(0-Da)|0;ga=2?ha>>>2:ha;ha=Ca;while(1){la=c[ha>>2]|0;ab=c[R>>2]|0;$a=r(la,506832829)|0;c[ja+((ab?$a>>>ab:$a)<<2)>>2]=la;if(ha>>>0>>0)ha=ha+4|0;else break}sb=_;tb=ea;ub=0;vb=da;wb=Ca+4+(ga<<2)|0}else{sb=_;tb=ea;ub=0;vb=da;wb=Ca}}else{sb=_;tb=U;ub=aa;vb=da;wb=Ca}}if(sb>>>0>>0){U=tb;V=ub;W=sb;X=wb;Y=$;Z=vb}else{za=tb;Aa=sb;Ba=O;xa=108;break}}}else{za=n;Aa=q;Ba=f+48|0;xa=108}while(0);if((xa|0)==108)if(!(c[Ba>>2]|0))if((c[f+40>>2]|0)==(c[f+36>>2]|0)){ta=za;ua=Aa;va=Ba;wa=(c[f+44>>2]|0)>64&1;xa=111}else{ta=za;ua=Aa;va=Ba;wa=0;xa=111}else{ta=za;ua=Aa;va=Ba;wa=1;xa=111}if((xa|0)==111){c[va>>2]=wa;va=(wa|0)==0;if(ua>>>0>>0&((va|(c[y>>2]|0)==0)^1)){c[f>>2]=5;y=f+64|0;c[p>>2]=c[y>>2];c[p+4>>2]=c[y+4>>2];c[p+8>>2]=c[y+8>>2];c[p+12>>2]=c[y+12>>2];c[p+16>>2]=c[y+16>>2];c[p+20>>2]=c[y+20>>2];c[p+24>>2]=c[y+24>>2];c[p+28>>2]=c[y+28>>2];c[l>>2]=c[f+96>>2];if((c[u>>2]|0)<=0){xb=1;return xb|0}Ja(f+136|0,w);xb=1;return xb|0}if(va){if(k|0)fa[k&3](f,(ta|0)>(j|0)?j:ta);c[f>>2]=0;ta=ua-g|0;c[l>>2]=2?ta>>2:ta;xb=1;return xb|0}}c[f>>2]=3;xb=0;return xb|0}function Ja(a,b){a=a|0;b=b|0;Lf(c[b>>2]|0,c[a>>2]|0,4<>2]|0)|0;return}function Ka(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;d=a+108|0;e=c[d>>2]|0;f=b-e|0;if((f|0)<=0){c[d>>2]=b;return}g=c[a+100>>2]|0;h=(c[a+16>>2]|0)+((r(g,e)|0)<<2)|0;i=c[a+8>>2]|0;j=c[a+20>>2]|0;k=c[i>>2]<<2;l=c[a+176>>2]|0;m=j;if((l|0)>0){n=l+-1|0;La(a+180+(n*20|0)|0,e,b,h,m);if((l|0)!=1){l=n;do{n=l;l=l+-1|0;La(a+180+(l*20|0)|0,e,b,m,m)}while((n|0)>1)}}else if((h|0)!=(m|0))Lf(j|0,h|0,r(f<<2,g)|0)|0;g=c[d>>2]|0;f=c[i+88>>2]|0;h=(f|0)<(b|0)?f:b;f=c[i+84>>2]|0;m=(f|0)>(g|0);e=m?f:g;if((h|0)<=(e|0)){c[d>>2]=b;return}l=j+(r(f-g|0,k)|0)|0;g=c[i+76>>2]|0;n=(m?l:j)+(g<<2)|0;c[i+8>>2]=e-f;f=(c[i+80>>2]|0)-g|0;c[i+12>>2]=f;g=h-e|0;c[i+16>>2]=g;e=a+12|0;h=c[e>>2]|0;j=c[h>>2]|0;if(j>>>0<=10){l=a+116|0;m=c[h+20>>2]|0;o=(c[h+16>>2]|0)+(r(m,c[l>>2]|0)|0)|0;p=(g|0)>0;if(!(c[i+92>>2]|0))if(p){q=g;s=n;t=o;while(1){Qa(s,f,j,t);if((q|0)>1){q=q+-1|0;s=s+k|0;t=t+m|0}else{u=g;break}}}else u=g;else if(p){p=a+268|0;t=0;s=0;while(1){q=n+(r(s,k)|0)|0;v=o+(r(t,m)|0)|0;w=g-s|0;x=Ma(c[p>>2]|0,w)|0;Na(q,k,c[(c[p>>2]|0)+44>>2]|0,x,0);s=(Oa(c[p>>2]|0,w,q,k)|0)+s|0;q=c[p>>2]|0;w=c[q+68>>2]|0;x=c[q+52>>2]|0;y=q+24|0;z=q+56|0;A=q+64|0;a:do if((c[A>>2]|0)<(c[z>>2]|0)){B=0;while(1){if((c[y>>2]|0)>0){C=B;break a}D=v+(r(B,m)|0)|0;Pa(q);Ta(w,x,1);Qa(w,x,j,D);D=B+1|0;if((c[A>>2]|0)<(c[z>>2]|0))B=D;else{C=D;break}}}else C=0;while(0);z=C+t|0;if((s|0)>=(g|0)){u=z;break}else t=z}}else u=0;c[l>>2]=(c[l>>2]|0)+u;c[d>>2]=b;return}u=a+116|0;l=c[u>>2]|0;t=(g|0)>0;b:do if(!(c[i+92>>2]|0))if(t){s=g;C=n;j=l;m=h;while(1){Ae(C,(c[m+16>>2]|0)+(r(c[m+32>>2]|0,j)|0)|0,f);p=1?j>>1:j;o=(c[m+20>>2]|0)+(r(c[m+36>>2]|0,p)|0)|0;Be(C,o,(c[m+24>>2]|0)+(r(c[m+40>>2]|0,p)|0)|0,f,j&1^1);p=c[m+28>>2]|0;if(p|0)Ya(C+3|0,0,f,1,p+(r(c[m+44>>2]|0,j)|0)|0,0)|0;p=j+1|0;if((s|0)<=1){E=p;break b}s=s+-1|0;C=C+k|0;j=p;m=c[e>>2]|0}}else E=l;else if(t){m=a+268|0;j=0;C=l;s=n;while(1){p=g-j|0;o=Ma(c[m>>2]|0,p)|0;Na(s,k,c[(c[m>>2]|0)+44>>2]|0,o,0);j=(Oa(c[m>>2]|0,p,s,k)|0)+j|0;s=s+(r(o,k)|0)|0;o=c[m>>2]|0;p=c[o+68>>2]|0;z=c[o+52>>2]|0;A=o+24|0;x=o+56|0;w=o+64|0;c:do if((c[w>>2]|0)<(c[x>>2]|0)){q=p+3|0;v=C;y=0;while(1){if((c[A>>2]|0)>0){F=y;break c}Pa(o);Ta(p,z,1);B=c[e>>2]|0;Ae(p,(c[B+16>>2]|0)+(r(c[B+32>>2]|0,v)|0)|0,z);D=1?v>>1:v;G=(c[B+20>>2]|0)+(r(c[B+36>>2]|0,D)|0)|0;Be(p,G,(c[B+24>>2]|0)+(r(c[B+40>>2]|0,D)|0)|0,z,v&1^1);D=c[B+28>>2]|0;if(D|0)Ya(q,0,z,1,D+(r(c[B+44>>2]|0,v)|0)|0,0)|0;B=y+1|0;if((c[w>>2]|0)<(c[x>>2]|0)){v=v+1|0;y=B}else{F=B;break}}}else F=0;while(0);x=F+C|0;if((j|0)>=(g|0)){E=x;break}else C=x}}else E=l;while(0);c[u>>2]=E;c[d>>2]=b;return}function La(b,d,e,f,g){b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;h=Y;Y=Y+16|0;i=h;j=b+8|0;k=c[j>>2]|0;switch(c[b>>2]|0){case 2:{Ib(f,r(k,e-d|0)|0,g);Y=h;return}case 0:{if(!d){l=c[f>>2]|0;m=l+-16777216&-16711936|l&16711935;c[g>>2]=m;l=f+4|0;n=k+-1|0;o=g+4|0;if((k|0)>1){p=0;q=m;do{m=c[l+(p<<2)>>2]|0;q=(m&-16711936)+(q&-16711936)&-16711936|(m&16711935)+(q&16711935)&16711935;c[o+(p<<2)>>2]=q;p=p+1|0}while((p|0)!=(n|0))}s=1;t=f+(k<<2)|0;u=g+(k<<2)|0;v=n}else{s=d;t=f;u=g;v=k+-1|0}n=c[b+4>>2]|0;p=1<>>n:o;a:do if((s|0)<(e|0)){o=0-k|0;l=0-p|0;if((k|0)<=1){m=s;w=t;x=u;while(1){y=c[x+(o<<2)>>2]|0;z=c[w>>2]|0;c[x>>2]=(z&-16711936)+(y&-16711936)&-16711936|(z&16711935)+(y&16711935)&16711935;m=m+1|0;if((m|0)==(e|0))break a;else{w=w+(k<<2)|0;x=x+(k<<2)|0}}}x=(c[b+16>>2]|0)+((r(v,n?s>>n:s)|0)<<2)|0;w=s;m=t;y=u;while(1){z=c[y+(o<<2)>>2]|0;A=c[m>>2]|0;c[y>>2]=(A&-16711936)+(z&-16711936)&-16711936|(A&16711935)+(z&16711935)&16711935;z=1;A=x;while(1){B=c[A>>2]|0;C=(z&l)+p|0;D=z;z=(C|0)>(k|0)?k:C;E=y+(D<<2)|0;ga[c[9488+(((8?B>>>8:B)&15)<<2)>>2]&31](m+(D<<2)|0,E+(o<<2)|0,z-D|0,E);if((k|0)<=(C|0))break;else A=A+4|0}A=w+1|0;if((A|0)==(e|0))break;else{x=(A&q|0)==0?x+(v<<2)|0:x;w=A;m=m+(k<<2)|0;y=y+(k<<2)|0}}}while(0);if((c[b+12>>2]|0)==(e|0)){Y=h;return}Lf(g+(0-k<<2)|0,g+((r(k,~d+e|0)|0)<<2)|0,k<<2|0)|0;Y=h;return}case 1:{v=c[b+4>>2]|0;q=1<>>v:s;if((e|0)<=(d|0)){Y=h;return}s=(c[b+16>>2]|0)+((r(n,v?d>>v:d)|0)<<2)|0;v=i+1|0;y=i+2|0;if((u|0)<=0){m=(k|0)>0;w=g;x=s;o=d;l=f;while(1){a[i>>0]=0;a[i+1>>0]=0;a[i+2>>0]=0;if(m){A=c[x>>2]|0;a[i>>0]=A;a[v>>0]=8?A>>>8:A;a[y>>0]=16?A>>>16:A;Jb(i,l,t,w);F=l+(t<<2)|0;G=w+(t<<2)|0}else{F=l;G=w}A=o+1|0;if((A|0)==(e|0))break;else{w=G;x=(A&p|0)==0?x+(n<<2)|0:x;o=A;l=F}}Y=h;return}F=g;l=s;s=d;o=f;while(1){a[i>>0]=0;a[i+1>>0]=0;a[i+2>>0]=0;x=o+(u<<2)|0;G=l;w=o;m=F;do{A=G;G=G+4|0;z=c[A>>2]|0;a[i>>0]=z;a[v>>0]=8?z>>>8:z;a[y>>0]=16?z>>>16:z;Jb(i,w,q,m);w=w+(q<<2)|0;m=m+(q<<2)|0}while(w>>>0>>0);if(w>>>0<(o+(k<<2)|0)>>>0){x=c[G>>2]|0;a[i>>0]=x;a[v>>0]=8?x>>>8:x;a[y>>0]=16?x>>>16:x;Jb(i,w,t,m);H=w+(t<<2)|0;I=m+(t<<2)|0}else{H=w;I=m}x=s+1|0;if((x|0)==(e|0))break;else{F=I;l=(x&p|0)==0?l+(n<<2)|0:l;s=x;o=H}}Y=h;return}case 3:{H=b+4|0;o=c[H>>2]|0;if((f|0)==(g|0)&(o|0)>0){s=e-d|0;l=r(k,s)|0;n=k+-1+(1<>>o:n,s)|0;s=f+(l<<2)+(0-p<<2)|0;Mf(s|0,f|0,p<<2|0)|0;p=c[H>>2]|0;H=c[j>>2]|0;j=c[b+16>>2]|0;l=p?8>>>p:8;if((l|0)>=8){Pb(s,j,f,d,e,H);Y=h;return}n=(1<(d|0)&(H|0)>0)){Y=h;return}I=s;s=f;F=d;while(1){t=0;i=0;y=I;v=s;while(1){if(!(t&n)){q=c[y>>2]|0;J=(8?q>>>8:q)&255;K=y+4|0}else{J=i;K=y}c[v>>2]=c[j+((J&p)<<2)>>2];t=t+1|0;if((t|0)==(H|0))break;else{i=l?J>>>l:J;y=K;v=v+4|0}}F=F+1|0;if((F|0)==(e|0))break;else{I=K;s=s+(H<<2)|0}}Y=h;return}else{H=c[b+16>>2]|0;b=o?8>>>o:8;if((b|0)>=8){Pb(f,H,g,d,e,k);Y=h;return}s=(1<(d|0)&(k|0)>0)){Y=h;return}K=f;f=g;g=d;while(1){d=0;I=0;F=K;J=f;while(1){if(!(d&s)){l=c[F>>2]|0;L=(8?l>>>8:l)&255;M=F+4|0}else{L=I;M=F}c[J>>2]=c[H+((L&o)<<2)>>2];d=d+1|0;if((d|0)==(k|0))break;else{I=b?L>>>b:L;F=M;J=J+4|0}}g=g+1|0;if((g|0)==(e|0))break;else{K=M;f=f+(k<<2)|0}}Y=h;return}break}default:{Y=h;return}}}function Ma(a,b){a=a|0;b=b|0;var d=0,e=0;d=c[a+32>>2]|0;e=((c[a+24>>2]|0)+-1+d|0)/(d|0)|0;return ((e|0)>(b|0)?b:e)|0}function Na(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;if((d|0)<=0)return;f=0;g=a;while(1){Ta(g,c,e);f=f+1|0;if((f|0)==(d|0))break;else g=g+b|0}return}function Oa(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0;f=a+24|0;if((b|0)<=0){g=0;return g|0}h=a+56|0;i=a+64|0;j=a+4|0;k=a+76|0;l=a+80|0;m=a+8|0;n=a+52|0;o=a+60|0;p=a+32|0;q=d;d=0;while(1){if((c[i>>2]|0)<(c[h>>2]|0)?(c[f>>2]|0)<=0:0){g=d;s=12;break}if(c[j>>2]|0){t=c[k>>2]|0;c[k>>2]=c[l>>2];c[l>>2]=t}Ra(a,q);if((c[j>>2]|0)==0?(r(c[n>>2]|0,c[m>>2]|0)|0)>0:0){t=c[l>>2]|0;u=c[k>>2]|0;v=0;do{w=u+(v<<2)|0;c[w>>2]=(c[w>>2]|0)+(c[t+(v<<2)>>2]|0);v=v+1|0}while((v|0)<(r(c[n>>2]|0,c[m>>2]|0)|0))}c[o>>2]=(c[o>>2]|0)+1;v=d+1|0;c[f>>2]=(c[f>>2]|0)-(c[p>>2]|0);if((v|0)<(b|0)){q=q+e|0;d=v}else{g=v;s=12;break}}if((s|0)==12)return g|0;return 0}function Pa(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0;d=b+24|0;if((c[d>>2]|0)>=1)return;do if(!(c[b+4>>2]|0)){if(c[b+20>>2]|0){Cc(b);break}e=b+8|0;f=b+52|0;if((r(c[f>>2]|0,c[e>>2]|0)|0)>0){g=b+76|0;h=b+68|0;i=0;j=c[g>>2]|0;do{a[(c[h>>2]|0)+i>>0]=c[j+(i<<2)>>2];j=c[g>>2]|0;c[j+(i<<2)>>2]=0;i=i+1|0}while((i|0)<(r(c[f>>2]|0,c[e>>2]|0)|0))}}else Bc(b);while(0);c[d>>2]=(c[d>>2]|0)+(c[b+28>>2]|0);d=b+68|0;c[d>>2]=(c[d>>2]|0)+(c[b+72>>2]|0);d=b+64|0;c[d>>2]=(c[d>>2]|0)+1;return}function Qa(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0;do switch(e|0){case 0:{Lb(b,d,f);return}case 1:{Kb(b,d,f);return}case 7:{Kb(b,d,f);Wa(f,0,d,1,0);return}case 2:{Mb(b,d,f);return}case 3:{Lf(f|0,b|0,d<<2|0)|0;return}case 8:{Lf(f|0,b|0,d<<2|0)|0;Wa(f,0,d,1,0);return}case 4:{g=b+(d<<2)|0;if((d|0)<=0)return;h=f;i=b;while(1){j=Kf(c[i>>2]|0)|0;i=i+4|0;a[h>>0]=j;a[h+1>>0]=j>>8;a[h+2>>0]=j>>16;a[h+3>>0]=j>>24;if(i>>>0>=g>>>0)break;else h=h+4|0}return}case 9:{h=b+(d<<2)|0;if((d|0)>0){g=f;i=b;while(1){j=Kf(c[i>>2]|0)|0;i=i+4|0;a[g>>0]=j;a[g+1>>0]=j>>8;a[g+2>>0]=j>>16;a[g+3>>0]=j>>24;if(i>>>0>=h>>>0)break;else g=g+4|0}}Wa(f,1,d,1,0);return}case 5:{Nb(b,d,f);return}case 10:{Nb(b,d,f);Va(f,d,1,0);return}case 6:{Ob(b,d,f);return}default:return}while(0)}function Ra(a,b){a=a|0;b=b|0;if(!(c[a>>2]|0)){Ec(a,b);return}else{Dc(a,b);return}}function Sa(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;i=c[b+4>>2]|0;j=i?8>>>i:8;k=c[b+8>>2]|0;l=c[b+16>>2]|0;if((j|0)>=8){Qb(g,l,h,e,f,k);return}b=(1<0))return;m=g;g=h;h=e;while(1){e=0;n=0;o=m;p=g;while(1){if(!(n&b)){q=d[o>>0]|0;r=o+1|0}else{q=e;r=o}s=c[l+((q&i)<<2)>>2]|0;a[p>>0]=8?s>>>8:s;n=n+1|0;if((n|0)==(k|0))break;else{e=j?q>>>j:q;o=r;p=p+1|0}}h=h+1|0;if((h|0)==(f|0))break;else{m=r;g=g+k|0}}return}function Ta(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((b|0)<=0)return;if(!d){d=0;do{e=a+(d<<2)|0;f=c[e>>2]|0;if(f>>>0<4278190080){if(f>>>0<16777216)g=0;else{h=(24?f>>>24:f)*65793|0;i=(r(h,f&255)|0)+8388608|0;j=(r(h,(8?f>>>8:f)&255)|0)+8388608|0;k=(r(h,(16?f>>>16:f)&255)|0)+8388608|0;g=(24?i>>>24:i)|f&-16777216|(24?j>>>24:j)<<8|(24?k>>>24:k)<<16}c[e>>2]=g}d=d+1|0}while((d|0)!=(b|0));return}else{d=0;do{g=a+(d<<2)|0;e=c[g>>2]|0;if(e>>>0<4278190080){if(e>>>0<16777216)l=0;else{k=4278190080/((24?e>>>24:e)>>>0)|0;j=(r(k,e&255)|0)+8388608|0;f=(r(k,(8?e>>>8:e)&255)|0)+8388608|0;i=(r(k,(16?e>>>16:e)&255)|0)+8388608|0;l=(24?j>>>24:j)|e&-16777216|(24?f>>>24:f)<<8|(24?i>>>24:i)<<16}c[g>>2]=l}d=d+1|0}while((d|0)!=(b|0));return}}function Ua(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0;if((e|0)<=0)return;if(!f){f=0;do{g=a[c+f>>0]|0;switch(g<<24>>24){case -1:break;case 0:{a[b+f>>0]=0;break}default:{h=b+f|0;i=(r((g&255)*65793|0,d[h>>0]|0)|0)+8388608|0;a[h>>0]=24?i>>>24:i}}f=f+1|0}while((f|0)!=(e|0));return}else{f=0;do{i=a[c+f>>0]|0;switch(i<<24>>24){case -1:break;case 0:{a[b+f>>0]=0;break}default:{h=b+f|0;g=(r(4278190080/((i&255)>>>0)|0,d[h>>0]|0)|0)+8388608|0;a[h>>0]=24?g>>>24:g}}f=f+1|0}while((f|0)!=(e|0));return}}function Va(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;if(!((c|0)>0&(e|0)>0))return;g=b;b=e;while(1){e=0;do{h=e<<1;i=g+h|0;j=g+(h|1)|0;h=a[j>>0]|0;k=h&15;l=(k&255)*4369|0;m=d[i>>0]|0;n=r(l,m&240|(4?m>>>4:m))|0;o=r(m<<4&240|m&15,l)|0;m=h&255;h=r(m&240|(4?m>>>4:m),l)|0;a[i>>0]=(20?o>>>20:o)&15|(16?n>>>16:n)&240;a[j>>0]=(16?h>>>16:h)&255&-16|k;e=e+1|0}while((e|0)!=(c|0));if((b|0)>1){g=g+f|0;b=b+-1|0}else break}return}function Wa(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if((f|0)<=0)return;h=(c|0)!=0;c=h&1;i=h?0:3;if((e|0)<=0)return;h=b;b=f;while(1){f=b;b=b+-1|0;j=h+c|0;k=h+i|0;l=0;do{m=l<<2;n=a[k+m>>0]|0;if(n<<24>>24!=-1){o=(n&255)*32897|0;n=j+m|0;p=r(o,d[n>>0]|0)|0;a[n>>0]=23?p>>>23:p;p=j+(m|1)|0;n=r(o,d[p>>0]|0)|0;a[p>>0]=23?n>>>23:n;n=j+(m|2)|0;m=r(o,d[n>>0]|0)|0;a[n>>0]=23?m>>>23:m}l=l+1|0}while((l|0)!=(e|0));if((f|0)<=1)break;else h=h+g|0}return}function Xa(b,c,d,e,f,g){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;if(!((e|0)>0&(d|0)>0)){h=0;return h|0}i=0;j=255;k=f;f=b;while(1){b=0;l=j;do{m=a[f+b>>0]|0;a[k+(b<<2)>>0]=m;l=l&(m&255);b=b+1|0}while((b|0)!=(d|0));i=i+1|0;if((i|0)==(e|0))break;else{j=l;k=k+g|0;f=f+c|0}}h=(l|0)!=255&1;return h|0}function Ya(b,c,d,e,f,g){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;if(!((e|0)>0&(d|0)>0)){h=1;return h|0}i=0;j=-1;k=f;f=b;while(1){b=0;l=j;do{m=a[f+(b<<2)>>0]|0;a[k+b>>0]=m;l=m&l;b=b+1|0}while((b|0)!=(d|0));i=i+1|0;if((i|0)==(e|0))break;else{j=l;k=k+g|0;f=f+c|0}}h=l<<24>>24==-1&1;return h|0}function Za(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0;if((e|0)<=0)return;f=0;do{g=c[b+(f<<2)>>2]|0;a[d+f>>0]=8?g>>>8:g;f=f+1|0}while((f|0)!=(e|0));return}function _a(){if(Te(9972)|0)return;if(c[2029]|0){c[2388]=1;c[2389]=2;c[2390]=3;c[2391]=4;c[2392]=5;c[2393]=6;c[2394]=7;c[2395]=8;c[2396]=9;c[2397]=10;c[2398]=11;c[2399]=12;c[2400]=13;c[2401]=14;c[2402]=1;c[2403]=1;c[2420]=1;c[2421]=2;c[2422]=3;c[2423]=4;c[2424]=5;c[2425]=6;c[2426]=7;c[2427]=8;c[2428]=9;c[2429]=10;c[2430]=11;c[2431]=12;c[2432]=13;c[2433]=14;c[2434]=1;c[2435]=1;c[2372]=4;c[2373]=5;c[2374]=6;c[2375]=7;c[2376]=8;c[2377]=9;c[2378]=10;c[2379]=11;c[2380]=12;c[2381]=13;c[2382]=14;c[2383]=15;c[2384]=16;c[2385]=17;c[2386]=4;c[2387]=4;c[2404]=4;c[2405]=5;c[2406]=6;c[2407]=7;c[2408]=8;c[2409]=9;c[2410]=10;c[2411]=11;c[2412]=12;c[2413]=13;c[2414]=14;c[2415]=15;c[2416]=16;c[2417]=17;c[2418]=4;c[2419]=4}c[2029]=0;Ue(9972)|0;return}function $a(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;c[a+12>>2]=e;f=a;c[f>>2]=0;c[f+4>>2]=0;c[a+20>>2]=0;c[a+24>>2]=0;f=e>>>0<8?e:8;if(!f){g=0;h=0}else{e=0;i=0;j=0;while(1){k=Jf(d[b+e>>0]|0|0,0,e<<3|0)|0;l=k|i;k=v()|0|j;e=e+1|0;if(e>>>0>=f>>>0){g=l;h=k;break}else{i=l;j=k}}}j=a;c[j>>2]=g;c[j+4>>2]=h;c[a+16>>2]=f;c[a+8>>2]=b;return}function ab(f,g,h,i,j){f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,qa=0,ra=0,ua=0,xa=0,ya=0,za=0,Aa=0,Ba=0;k=Y;Y=Y+16|0;l=k;m=i+24|0;n=i+120|0;o=(h|0)!=0;a:do if(o){p=i+176|0;q=i+260|0;s=f;while(1){if(!(Ga(m,1)|0)){t=s;u=18;break a}w=c[p>>2]|0;x=Ga(m,2)|0;y=c[q>>2]|0;z=1<>2]=y|z;c[i+180+(w*20|0)>>2]=x;z=i+180+(w*20|0)+8|0;c[z>>2]=s;y=i+180+(w*20|0)+12|0;c[y>>2]=g;A=i+180+(w*20|0)+16|0;c[A>>2]=0;c[p>>2]=(c[p>>2]|0)+1;switch(x|0){case 1:case 0:{x=(Ga(m,3)|0)+2|0;c[i+180+(w*20|0)+4>>2]=x;B=(1<>2]|0)|0;D=B+(c[y>>2]|0)|0;E=ab(x?C>>>x:C,x?D>>>x:D,0,i,A)|0;F=s;break}case 3:{D=(Ga(m,8)|0)+1|0;if((D|0)>16)G=0;else G=(D|0)>4?1:(D|0)>2?2:3;x=(c[z>>2]|0)+-1+(1<>>G:x;x=i+180+(w*20|0)+4|0;c[x>>2]=G;if(!(ab(D,1,0,i,A)|0)){u=73;break a}w=c[x>>2]|0;x=1<<(w?8>>>w:8);w=wa(x,((x|0)<0)<<31>>31,4)|0;if(!w){u=73;break a}C=c[A>>2]|0;c[w>>2]=c[C>>2];y=D<<2;if((D|0)>1){D=4;while(1){a[w+D>>0]=(d[w+(D+-4)>>0]|0)+(d[C+D>>0]|0);B=D+1|0;if((B|0)<(y|0))D=B;else{H=B;break}}}else H=4;D=x<<2;if((D|0)>(H|0))Nf(w+H|0,0,D-H|0)|0;pa(c[A>>2]|0);c[A>>2]=w;E=1;F=z;break}default:{E=1;F=s}}if(!E){u=73;break a}else s=F}}else{t=f;u=18}while(0);do if((u|0)==18){if(Ga(m,1)|0){f=Ga(m,4)|0;if((f+-1|0)>>>0<11)I=f;else{c[i>>2]=3;J=0;break}}else I=0;c[l>>2]=0;f=e[3824+(I<<1)>>1]|0;do if((h|0)!=0?(Ga(m,1)|0)!=0:0){F=(Ga(m,3)|0)+2|0;E=(1<>>F:H;H=E+g|0;E=F?H>>>F:H;H=r(G,E)|0;if(ab(G,E,0,i,l)|0){c[i+152>>2]=F;F=(H|0)>0;if(F){E=c[l>>2]|0;G=0;s=1;while(1){p=E+(G<<2)|0;q=c[p>>2]|0;D=(8?q>>>8:q)&65535;c[p>>2]=D;p=(D|0)<(s|0)?s:D+1|0;G=G+1|0;if((G|0)==(H|0)){K=p;break}else s=p}}else K=1;if((K|0)>1e3|(K|0)>(r(t,g)|0)){s=wa(K,((K|0)<0)<<31>>31,4)|0;if(!s){c[i>>2]=1;L=0;M=0;N=1;O=0;P=0;break}Nf(s|0,-1,K<<2|0)|0;if(F){G=c[l>>2]|0;E=0;z=0;while(1){w=G+(z<<2)|0;A=s+(c[w>>2]<<2)|0;x=c[A>>2]|0;if((x|0)==-1){c[A>>2]=E;Q=E+1|0;R=E}else{Q=E;R=x}c[w>>2]=R;z=z+1|0;if((z|0)==(H|0)){S=s;T=K;U=Q;V=s;u=35;break}else E=Q}}else{S=s;T=K;U=0;V=s;u=35}}else{S=0;T=K;U=K;V=0;u=35}}else{L=0;M=0;N=1;O=0;P=0}}else{S=0;T=1;U=1;V=0;u=35}while(0);b:do if((u|0)==35)if(!(c[i+48>>2]|0)){E=(I|0)>0;H=1<-24?H+280|0:256;W=(z|0)>40?z:40;X=0}else{W=280;X=0}z=va(W,X,4)|0;G=r(U,f)|0;F=wa(G,((G|0)<0)<<31>>31,4)|0;G=bb(U)|0;if((F|0)==0|((z|0)==0|(G|0)==0)){c[i>>2]=1;L=G;M=F;N=1;O=z;P=V;break}if((T|0)>0){w=(S|0)==0;x=H+280|0;A=(H|0)>-279;p=H+280|0;H=F;D=0;while(1){do if(!w){q=c[S+(D<<2)>>2]|0;if((q|0)==-1)if(E){if(!(cb(p,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(40,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}else{Z=H;break}}else{if(!(cb(280,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(256,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}if(!(cb(40,i,z,0)|0)){L=G;M=F;N=1;O=z;P=V;break b}else{Z=H;break}}else{_=q;u=49}}else{_=D;u=49}while(0);do if((u|0)==49){u=0;q=G+(_*548|0)|0;c[q>>2]=H;if(E){y=cb(x,i,z,H)|0;if(!y){L=G;M=F;N=1;O=z;P=V;break b}C=d[H>>0]|0;B=H+(y<<2)|0;y=c[z>>2]|0;if(A){$=1;aa=y;while(1){ba=c[z+($<<2)>>2]|0;ca=(ba|0)>(aa|0)?ba:aa;$=$+1|0;if(($|0)==(x|0)){da=ca;break}else aa=ca}}else da=y;c[G+(_*548|0)+4>>2]=B;aa=cb(256,i,z,B)|0;if(!aa){L=G;M=F;N=1;O=z;P=V;break b}$=a[B>>0]|0;ca=C+($&255)|0;ba=B+(aa<<2)|0;aa=1;ea=c[z>>2]|0;do{fa=c[z+(aa<<2)>>2]|0;ea=(fa|0)>(ea|0)?fa:ea;aa=aa+1|0}while((aa|0)!=256);aa=ea+da|0;c[G+(_*548|0)+8>>2]=ba;B=cb(256,i,z,ba)|0;if(!B){L=G;M=F;N=1;O=z;P=V;break b}C=a[ba>>0]|0;y=$|C;fa=ca+(C&255)|0;C=ba+(B<<2)|0;B=1;ga=c[z>>2]|0;do{ha=c[z+(B<<2)>>2]|0;ga=(ha|0)>(ga|0)?ha:ga;B=B+1|0}while((B|0)!=256);B=ga+aa|0;c[G+(_*548|0)+12>>2]=C;ba=cb(256,i,z,C)|0;if(!ba){L=G;M=F;N=1;O=z;P=V;break b}ca=a[C>>0]|0;$=y|ca;ea=fa+(ca&255)|0;ca=C+(ba<<2)|0;ba=1;ha=c[z>>2]|0;do{ia=c[z+(ba<<2)>>2]|0;ha=(ia|0)>(ha|0)?ia:ha;ba=ba+1|0}while((ba|0)!=256);c[G+(_*548|0)+16>>2]=ca;ba=cb(40,i,z,ca)|0;if(!ba){L=G;M=F;N=1;O=z;P=V;break b}ja=ha+B|0;ka=$;la=ea+(d[ca>>0]|0)|0;ma=ca+(ba<<2)|0}else{ba=cb(280,i,z,H)|0;if(!ba){L=G;M=F;N=1;O=z;P=V;break b}C=d[H>>0]|0;fa=H+(ba<<2)|0;ba=1;y=c[z>>2]|0;do{aa=c[z+(ba<<2)>>2]|0;y=(aa|0)>(y|0)?aa:y;ba=ba+1|0}while(ba>>>0<280);c[G+(_*548|0)+4>>2]=fa;ba=cb(256,i,z,fa)|0;if(!ba){L=G;M=F;N=1;O=z;P=V;break b}ca=a[fa>>0]|0;ea=C+(ca&255)|0;$=fa+(ba<<2)|0;ba=1;B=c[z>>2]|0;do{ha=c[z+(ba<<2)>>2]|0;B=(ha|0)>(B|0)?ha:B;ba=ba+1|0}while(ba>>>0<256);ba=B+y|0;c[G+(_*548|0)+8>>2]=$;fa=cb(256,i,z,$)|0;if(!fa){L=G;M=F;N=1;O=z;P=V;break b}C=a[$>>0]|0;ha=ca|C;aa=ea+(C&255)|0;C=$+(fa<<2)|0;fa=1;ga=c[z>>2]|0;do{ia=c[z+(fa<<2)>>2]|0;ga=(ia|0)>(ga|0)?ia:ga;fa=fa+1|0}while(fa>>>0<256);fa=ga+ba|0;c[G+(_*548|0)+12>>2]=C;$=cb(256,i,z,C)|0;if(!$){L=G;M=F;N=1;O=z;P=V;break b}ea=a[C>>0]|0;ca=ha|ea;y=aa+(ea&255)|0;ea=C+($<<2)|0;$=1;B=c[z>>2]|0;do{ia=c[z+($<<2)>>2]|0;B=(ia|0)>(B|0)?ia:B;$=$+1|0}while($>>>0<256);c[G+(_*548|0)+16>>2]=ea;$=cb(40,i,z,ea)|0;if(!$){L=G;M=F;N=1;O=z;P=V;break b}ja=B+fa|0;ka=ca;la=y+(d[ea>>0]|0)|0;ma=ea+($<<2)|0}$=ka<<24>>24==0;c[G+(_*548|0)+20>>2]=$&1;C=G+(_*548|0)+28|0;c[C>>2]=0;if(($?($=(e[(c[G+(_*548|0)+4>>2]|0)+2>>1]|0)<<16|(e[(c[G+(_*548|0)+8>>2]|0)+2>>1]|0)|(e[(c[G+(_*548|0)+12>>2]|0)+2>>1]|0)<<24,aa=G+(_*548|0)+24|0,c[aa>>2]=$,(la|0)==0):0)?(ha=b[(c[q>>2]|0)+2>>1]|0,(ha&65535)<256):0){c[C>>2]=1;c[aa>>2]=(ha&65535)<<8|$;c[G+(_*548|0)+32>>2]=0;Z=ma;break}$=(ja|0)<6;c[G+(_*548|0)+32>>2]=$&1;if($){$=G+(_*548|0)+4|0;ha=G+(_*548|0)+8|0;aa=G+(_*548|0)+12|0;C=c[q>>2]|0;ba=0;do{ga=G+(_*548|0)+36+(ba<<3)|0;ia=C+(ba<<2)|0;na=e[ia>>1]|e[ia+2>>1]<<16;ia=16?na>>>16:na;if((ia&65535)>255){c[ga>>2]=na&255|256;c[G+(_*548|0)+36+(ba<<3)+4>>2]=ia}else{oa=G+(_*548|0)+36+(ba<<3)+4|0;qa=na&255;c[ga>>2]=qa;na=ia<<8;c[oa>>2]=na;ia=qa?ba>>>qa:ba;ra=c[$>>2]|0;ua=b[ra+(ia<<2)+2>>1]|0;xa=d[ra+(ia<<2)>>0]|0;ra=qa+xa|0;c[ga>>2]=ra;qa=(ua&65535)<<16|na;c[oa>>2]=qa;na=xa?ia>>>xa:ia;ia=c[ha>>2]|0;xa=b[ia+(na<<2)+2>>1]|0;ua=d[ia+(na<<2)>>0]|0;ia=ra+ua|0;c[ga>>2]=ia;ra=qa|xa&65535;c[oa>>2]=ra;xa=ua?na>>>ua:na;na=c[aa>>2]|0;ua=b[na+(xa<<2)+2>>1]|0;c[ga>>2]=ia+(d[na+(xa<<2)>>0]|0);c[oa>>2]=(ua&65535)<<24|ra}ba=ba+1|0}while((ba|0)!=64);Z=ma}else Z=ma}while(0);D=D+1|0;if((D|0)>=(T|0))break;else H=Z}}c[i+160>>2]=c[l>>2];c[i+164>>2]=U;c[i+168>>2]=G;c[i+172>>2]=F;L=G;M=F;N=0;O=z;P=V}else{L=0;M=0;N=1;O=0;P=V}while(0);pa(O);pa(P);if(N){pa(c[l>>2]|0);pa(M);sa(L);u=73;break}if((I|0)>0){c[n>>2]=1<>2]=1;J=0;break}}else c[n>>2]=0;f=c[i+152>>2]|0;c[i+100>>2]=t;c[i+104>>2]=g;H=(1<>2]=f?D>>>f:D;c[i+148>>2]=(f|0)==0?-1:H;if(!o){H=Cf(t|0,((t|0)<0)<<31>>31|0,g|0,((g|0)<0)<<31>>31|0)|0;f=wa(H,v()|0,4)|0;if(!f){c[i>>2]=1;J=0;break}if(!(Ia(i,f,t,g,g,0)|0)){J=f;break}if(!(c[i+48>>2]|0))ya=f;else{J=f;break}}else{c[i+4>>2]=1;ya=0}if(j|0)c[j>>2]=ya;c[i+112>>2]=0;if(o){za=1;Y=k;return za|0}pa(c[i+160>>2]|0);pa(c[i+172>>2]|0);sa(c[i+168>>2]|0);ta(i+124|0);ta(i+136|0);Aa=n;Ba=Aa+56|0;do{c[Aa>>2]=0;Aa=Aa+4|0}while((Aa|0)<(Ba|0));za=1;Y=k;return za|0}while(0);if((u|0)==73){c[i>>2]=3;J=0}pa(J);pa(c[i+160>>2]|0);pa(c[i+172>>2]|0);sa(c[i+168>>2]|0);ta(i+124|0);ta(i+136|0);Aa=n;Ba=Aa+56|0;do{c[Aa>>2]=0;Aa=Aa+4|0}while((Aa|0)<(Ba|0));za=0;Y=k;return za|0}function bb(a){a=a|0;return wa(a,((a|0)<0)<<31>>31,548)|0}function cb(a,e,f,g){a=a|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0;h=Y;Y=Y+592|0;i=h+80|0;j=h;k=e+24|0;l=Ga(k,1)|0;Nf(f|0,0,a<<2|0)|0;a:do if(l){m=Ga(k,1)|0;n=(Ga(k,1)|0)==0;o=f+((Ga(k,n?1:8)|0)<<2)|0;c[o>>2]=1;if((m|0)==1){m=f+((Ga(k,8)|0)<<2)|0;c[m>>2]=1;p=26}else p=26}else{m=j;o=m+76|0;do{c[m>>2]=0;m=m+4|0}while((m|0)<(o|0));m=(Ga(k,4)|0)+4|0;if((m|0)>19){c[e>>2]=3;q=0;Y=h;return q|0}if((m|0)>0){o=0;do{n=Ga(k,3)|0;c[j+((d[3856+o>>0]|0)<<2)>>2]=n;o=o+1|0}while((o|0)!=(m|0))}b:do if(eb(i,7,j,19)|0){if(Ga(k,1)|0){m=(Ga(k,((Ga(k,3)|0)<<1)+2|0)|0)+2|0;if((m|0)>(a|0))break;else r=m}else r=a;c:do if((a|0)>0){m=e+44|0;o=0;n=8;s=r;while(1){if(!s)break c;s=s+-1|0;t=c[m>>2]|0;if((t|0)>31){Ea(k);u=c[m>>2]|0}else u=t;t=k;w=If(c[t>>2]|0,c[t+4>>2]|0,u&63|0)|0;v()|0;t=w&127;c[m>>2]=u+(d[i+(t<<2)>>0]|0);w=b[i+(t<<2)+2>>1]|0;t=w&65535;if((w&65535)>=16){x=t+-16|0;y=d[8680+x>>0]|0;z=(Ga(k,d[8677+x>>0]|0)|0)+y|0;if((z+o|0)>(a|0))break b;y=w<<16>>16==16?n:0;if((z|0)>0){x=z;z=o;while(1){A=z+1|0;c[f+(z<<2)>>2]=y;if((x|0)>1){x=x+-1|0;z=A}else{B=n;C=A;break}}}else{B=n;C=o}}else{c[f+(o<<2)>>2]=t;B=w<<16>>16==0?n:t;C=o+1|0}if((C|0)>=(a|0))break;else{o=C;n=B}}}while(0);p=26;break a}while(0);c[e>>2]=3}while(0);if(((p|0)==26?(c[e+48>>2]|0)==0:0)?(p=eb(g,8,f,a)|0,p|0):0){q=p;Y=h;return q|0}c[e>>2]=3;q=0;Y=h;return q|0}function db(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=1<>31,4)|0;c[a>>2]=e;if(!e){f=0;return f|0}c[a+4>>2]=32-b;c[a+8>>2]=b;f=1;return f|0}function eb(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0;e=Y;Y=Y+1024|0;f=e;do if(a){if((d|0)<513){g=fb(a,b,c,d,f)|0;break}h=wa(d,((d|0)<0)<<31>>31,2)|0;if(!h)g=0;else{i=fb(a,b,c,d,h)|0;pa(h);g=i}}else g=fb(0,b,c,d,0)|0;while(0);Y=e;return g|0}function fb(d,f,g,h,i){d=d|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0;j=Y;Y=Y+128|0;k=j+64|0;l=j;m=1<>2]=0;n=n+4|0}while((n|0)<(o|0));n=(h|0)>0;do if(n){o=0;while(1){p=c[g+(o<<2)>>2]|0;if((p|0)>15){q=0;r=69;break}s=k+(p<<2)|0;c[s>>2]=(c[s>>2]|0)+1;o=o+1|0;if((o|0)>=(h|0)){r=5;break}}if((r|0)==5){t=c[k>>2]|0;break}else if((r|0)==69){Y=j;return q|0}}else t=0;while(0);if((t|0)==(h|0)){q=0;Y=j;return q|0}c[l+4>>2]=0;t=c[k+4>>2]|0;if((t|0)>2){q=0;Y=j;return q|0}c[l+8>>2]=t;o=c[k+8>>2]|0;if((o|0)>4){q=0;Y=j;return q|0}s=t+o|0;c[l+12>>2]=s;o=c[k+12>>2]|0;if((o|0)>8){q=0;Y=j;return q|0}p=s+o|0;c[l+16>>2]=p;o=c[k+16>>2]|0;if((o|0)>16){q=0;Y=j;return q|0}s=p+o|0;c[l+20>>2]=s;o=c[k+20>>2]|0;if((o|0)>32){q=0;Y=j;return q|0}p=s+o|0;c[l+24>>2]=p;o=c[k+24>>2]|0;if((o|0)>64){q=0;Y=j;return q|0}s=p+o|0;c[l+28>>2]=s;o=c[k+28>>2]|0;if((o|0)>128){q=0;Y=j;return q|0}p=s+o|0;c[l+32>>2]=p;o=c[k+32>>2]|0;if((o|0)>256){q=0;Y=j;return q|0}s=p+o|0;c[l+36>>2]=s;o=c[k+36>>2]|0;if((o|0)>512){q=0;Y=j;return q|0}p=s+o|0;c[l+40>>2]=p;o=c[k+40>>2]|0;if((o|0)>1024){q=0;Y=j;return q|0}s=p+o|0;c[l+44>>2]=s;o=c[k+44>>2]|0;if((o|0)>2048){q=0;Y=j;return q|0}p=s+o|0;c[l+48>>2]=p;o=c[k+48>>2]|0;if((o|0)>4096){q=0;Y=j;return q|0}s=p+o|0;c[l+52>>2]=s;o=c[k+52>>2]|0;if((o|0)>8192){q=0;Y=j;return q|0}p=s+o|0;c[l+56>>2]=p;o=c[k+56>>2]|0;if((o|0)>16384){q=0;Y=j;return q|0}s=p+o|0;o=l+60|0;c[o>>2]=s;if(n){if(!i){n=0;do{p=c[g+(n<<2)>>2]|0;if((p|0)>0){u=l+(p<<2)|0;c[u>>2]=(c[u>>2]|0)+1}n=n+1|0}while((n|0)!=(h|0))}else{n=0;do{u=c[g+(n<<2)>>2]|0;if((u|0)>0){p=l+(u<<2)|0;u=c[p>>2]|0;c[p>>2]=u+1;b[i+(u<<1)>>1]=n}n=n+1|0}while((n|0)!=(h|0))}v=c[o>>2]|0}else v=s;if((v|0)==1){if(!i){q=m;Y=j;return q|0}s=(e[i>>1]|0)<<16;h=m;do{n=h;h=h+-1|0;l=d+(h<<2)|0;b[l>>1]=s;b[l+2>>1]=s>>>16}while((n|0)>1);q=m;Y=j;return q|0}s=m+-1|0;if((f|0)>=1){h=2-t|0;n=(h|0)<0;a:do if(!d){if(n){q=0;Y=j;return q|0}l=1;g=h;u=3;while(1){if((l|0)>=(f|0)){w=g;x=u;y=0;z=0;break a}l=l+1|0;p=g<<1;g=p-(c[k+(l<<2)>>2]|0)|0;if((g|0)<0){q=0;break}else u=p+u|0}Y=j;return q|0}else{if(n){q=0;Y=j;return q|0}u=0;g=2;l=1;p=0;A=t;B=k+4|0;C=h;D=3;while(1){if((A|0)>0){E=l&255;F=1<>1]|0)<<16|E;L=m;do{L=L-g|0;M=J+(L<<2)|0;b[M>>1]=K;b[M+2>>1]=K>>>16}while((L|0)>0);L=F;while(1)if(!(L&G))break;else L=1?L>>>1:L;H=H+1|0;G=(L|0)==0?G:(L+-1&G)+L|0;K=I;I=I+-1|0}while((K|0)>1);c[B>>2]=I;N=G;O=H}else{N=u;O=p}F=l+1|0;if((l|0)>=(f|0)){w=C;x=D;y=N;z=O;break a}A=c[k+(F<<2)>>2]|0;E=C<<1;C=E-A|0;if((C|0)<0){q=0;break}else{u=N;g=g<<1;l=F;p=O;B=k+(F<<2)|0;D=E+D|0}}Y=j;return q|0}while(0);if((f|0)<15){P=w;Q=x;R=y;S=z;r=42}else{T=m;U=x;V=v}}else{P=1;Q=1;R=0;S=0;r=42}do if((r|0)==42){v=(d|0)!=0;x=d;z=-1;y=d;w=m;O=m;N=P;h=Q;t=2;n=f;D=R;B=S;while(1){p=n;n=n+1|0;l=N<<1;h=l+h|0;g=k+(n<<2)|0;u=c[g>>2]|0;N=l-u|0;if((N|0)<0){q=0;r=69;break}b:do if(v&(u|0)>0){l=n-f|0;C=l&255;A=1<=14){E=n&255;F=z;K=y;J=w;M=O;W=D;X=B;while(1){Z=W&s;if((Z|0)==(F|0)){_=M;$=F;aa=K;ba=J}else{ca=K+(M<<2)|0;a[d+(Z<<2)>>0]=E;da=ca-x|0;b[d+(Z<<2)+2>>1]=(2?da>>>2:da)-Z;_=A;$=Z;aa=ca;ba=A+J|0}ca=aa+((f?W>>>f:W)<<2)|0;Z=(e[i+(X<<1)>>1]|0)<<16|C;da=_;do{da=da-t|0;ea=ca+(da<<2)|0;b[ea>>1]=Z;b[ea+2>>1]=Z>>>16}while((da|0)>0);da=l;while(1)if(!(da&W))break;else da=1?da>>>1:da;Z=X+1|0;ca=(da|0)==0?W:(da+-1&W)+da|0;ea=c[g>>2]|0;c[g>>2]=ea+-1;if((ea|0)>1){F=$;K=aa;J=ba;M=_;W=ca;X=Z}else{fa=_;ga=$;ha=aa;ia=ba;ja=ca;ka=Z;break b}}}X=z;W=y;M=w;J=O;K=D;F=B;E=u;while(1){L=K&s;if((L|0)==(X|0)){la=J;ma=X;na=W;oa=M}else{Z=W+(J<<2)|0;ca=A-E|0;c:do if((ca|0)<1)pa=n;else{ea=n;qa=ca;while(1){ra=ea+1|0;if((ea|0)>=14){pa=ra;break c}qa=(qa<<1)-(c[k+(ra<<2)>>2]|0)|0;if((qa|0)<1){pa=ra;break}else ea=ra}}while(0);ca=1<>0]=pa;da=Z-x|0;b[d+(L<<2)+2>>1]=(2?da>>>2:da)-L;la=ca;ma=L;na=Z;oa=ca+M|0}ca=na+((f?K>>>f:K)<<2)|0;da=(e[i+(F<<1)>>1]|0)<<16|C;ea=la;do{ea=ea-t|0;qa=ca+(ea<<2)|0;b[qa>>1]=da;b[qa+2>>1]=da>>>16}while((ea|0)>0);ea=l;while(1)if(!(ea&K))break;else ea=1?ea>>>1:ea;da=F+1|0;ca=(ea|0)==0?K:(ea+-1&K)+ea|0;Z=c[g>>2]|0;E=Z+-1|0;c[g>>2]=E;if((Z|0)<=1){fa=la;ga=ma;ha=na;ia=oa;ja=ca;ka=da;break}else{X=ma;W=na;M=oa;J=la;K=ca;F=da}}}else{fa=O;ga=z;ha=y;ia=w;ja=D;ka=B}while(0);if((p|0)>=14){r=67;break}else{z=ga;y=ha;w=ia;O=fa;t=t<<1;D=ja;B=ka}}if((r|0)==67){T=ia;U=h;V=c[o>>2]|0;break}else if((r|0)==69){Y=j;return q|0}}while(0);q=(U|0)==((V<<1)+-1|0)?T:0;Y=j;return q|0}function gb(a,b){a=a|0;b=b|0;return -16777216}function hb(a,b){a=a|0;b=b|0;return a|0}function ib(a,b){a=a|0;b=b|0;return c[b>>2]|0}function jb(a,b){a=a|0;b=b|0;return c[b+4>>2]|0}function kb(a,b){a=a|0;b=b|0;return c[b+-4>>2]|0}function lb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[b>>2]|0;e=c[b+4>>2]|0;b=e^a;f=((1?b>>>1:b)&2139062143)+(e&a)|0;a=f^d;return ((1?a>>>1:a)&2139062143)+(f&d)|0}function mb(a,b){a=a|0;b=b|0;var d=0;d=c[b+-4>>2]|0;b=d^a;return ((1?b>>>1:b)&2139062143)+(d&a)|0}function nb(a,b){a=a|0;b=b|0;var d=0;d=c[b>>2]|0;b=d^a;return ((1?b>>>1:b)&2139062143)+(d&a)|0}function ob(a,b){a=a|0;b=b|0;var d=0;a=c[b+-4>>2]|0;d=c[b>>2]|0;b=d^a;return ((1?b>>>1:b)&2139062143)+(d&a)|0}function pb(a,b){a=a|0;b=b|0;var d=0;a=c[b>>2]|0;d=c[b+4>>2]|0;b=d^a;return ((1?b>>>1:b)&2139062143)+(d&a)|0}function qb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=c[b+-4>>2]|0;e=c[b>>2]|0;f=c[b+4>>2]|0;b=d^a;g=((1?b>>>1:b)&2139062143)+(d&a)|0;a=f^e;d=((1?a>>>1:a)&2139062143)+(f&e)|0;e=d^g;return ((1?e>>>1:e)&2139062143)+(d&g)|0}function rb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=c[b>>2]|0;e=c[b+-4>>2]|0;b=24?e>>>24:e;f=(24?a>>>24:a)-b|0;g=(24?d>>>24:d)-b|0;b=(16?e>>>16:e)&255;h=((16?a>>>16:a)&255)-b|0;i=((16?d>>>16:d)&255)-b|0;b=(8?e>>>8:e)&255;j=((8?a>>>8:a)&255)-b|0;k=((8?d>>>8:d)&255)-b|0;b=e&255;e=(a&255)-b|0;l=(d&255)-b|0;return ((((e|0)>-1?e:0-e|0)-((l|0)>-1?l:0-l|0)-((g|0)>-1?g:0-g|0)+((f|0)>-1?f:0-f|0)-((k|0)>-1?k:0-k|0)+((j|0)>-1?j:0-j|0)-((i|0)>-1?i:0-i|0)+((h|0)>-1?h:0-h|0)|0)<1?d:a)|0}function sb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0;d=c[b>>2]|0;e=c[b+-4>>2]|0;b=(24?d>>>24:d)+(24?a>>>24:a)-(24?e>>>24:e)|0;f=((16?d>>>16:d)&255)+((16?a>>>16:a)&255)-((16?e>>>16:e)&255)|0;g=((8?d>>>8:d)&255)+((8?a>>>8:a)&255)-((8?e>>>8:e)&255)|0;h=(d&255)+(a&255)-(e&255)|0;return (b>>>0<256?b:(24?b>>>24:b)^255)<<24|(h>>>0<256?h:(24?h>>>24:h)^255)|(f>>>0<256?f:(24?f>>>24:f)^255)<<16|(g>>>0<256?g:(24?g>>>24:g)^255)<<8|0}function tb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;d=c[b>>2]|0;e=c[b+-4>>2]|0;b=d^a;f=((1?b>>>1:b)&2139062143)+(d&a)|0;a=24?f>>>24:f;d=((a-(24?e>>>24:e)|0)/2|0)+a|0;a=(16?f>>>16:f)&255;b=((a-((16?e>>>16:e)&255)|0)/2|0)+a|0;a=(8?f>>>8:f)&255;g=((a-((8?e>>>8:e)&255)|0)/2|0)+a|0;a=f&255;f=((a-(e&255)|0)/2|0)+a|0;return (d>>>0<256?d:(24?d>>>24:d)^255)<<24|(f>>>0<256?f:(24?f>>>24:f)^255)|(b>>>0<256?b:(24?b>>>24:b)^255)<<16|(g>>>0<256?g:(24?g>>>24:g)^255)<<8|0}function ub(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0;if((d|0)<=0)return;b=0;do{f=c[a+(b<<2)>>2]|0;c[e+(b<<2)>>2]=f+-16777216&-16711936|f&16711935;b=b+1|0}while((b|0)!=(d|0));return}function vb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;if((d|0)<=0)return;b=0;f=c[e+-4>>2]|0;do{g=c[a+(b<<2)>>2]|0;f=(g&-16711936)+(f&-16711936)&-16711936|(g&16711935)+(f&16711935)&16711935;c[e+(b<<2)>>2]=f;b=b+1|0}while((b|0)!=(d|0));return}function wb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((d|0)<=0)return;f=0;do{g=c[b+(f<<2)>>2]|0;h=c[a+(f<<2)>>2]|0;c[e+(f<<2)>>2]=(h&-16711936)+(g&-16711936)&-16711936|(h&16711935)+(g&16711935)&16711935;f=f+1|0}while((f|0)!=(d|0));return}function xb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((d|0)<=0)return;f=0;do{g=c[b+(f<<2)+4>>2]|0;h=c[a+(f<<2)>>2]|0;c[e+(f<<2)>>2]=(h&-16711936)+(g&-16711936)&-16711936|(h&16711935)+(g&16711935)&16711935;f=f+1|0}while((f|0)!=(d|0));return}function yb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((d|0)<=0)return;f=0;do{g=c[b+(f<<2)+-4>>2]|0;h=c[a+(f<<2)>>2]|0;c[e+(f<<2)>>2]=(h&-16711936)+(g&-16711936)&-16711936|(h&16711935)+(g&16711935)&16711935;f=f+1|0}while((f|0)!=(d|0));return}function zb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=b+(f<<2)|0;i=c[h>>2]|0;j=c[h+4>>2]|0;h=j^g;k=((1?h>>>1:h)&2139062143)+(j&g)|0;j=k^i;h=((1?j>>>1:j)&2139062143)+(k&i)|0;i=c[a+(f<<2)>>2]|0;g=(h&-16711936)+(i&-16711936)&-16711936|(h&16711935)+(i&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Ab(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=c[b+(f<<2)+-4>>2]|0;i=h^g;j=((1?i>>>1:i)&2139062143)+(h&g)|0;h=c[a+(f<<2)>>2]|0;g=(j&-16711936)+(h&-16711936)&-16711936|(j&16711935)+(h&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Bb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=c[b+(f<<2)>>2]|0;i=h^g;j=((1?i>>>1:i)&2139062143)+(h&g)|0;h=c[a+(f<<2)>>2]|0;g=(j&-16711936)+(h&-16711936)&-16711936|(j&16711935)+(h&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Cb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if((d|0)<=0)return;f=0;do{g=b+(f<<2)|0;h=c[g+-4>>2]|0;i=c[g>>2]|0;g=i^h;j=((1?g>>>1:g)&2139062143)+(i&h)|0;h=c[a+(f<<2)>>2]|0;c[e+(f<<2)>>2]=(j&-16711936)+(h&-16711936)&-16711936|(j&16711935)+(h&16711935)&16711935;f=f+1|0}while((f|0)!=(d|0));return}function Db(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;if((d|0)<=0)return;f=0;do{g=b+(f<<2)|0;h=c[g>>2]|0;i=c[g+4>>2]|0;g=i^h;j=((1?g>>>1:g)&2139062143)+(i&h)|0;h=c[a+(f<<2)>>2]|0;c[e+(f<<2)>>2]=(j&-16711936)+(h&-16711936)&-16711936|(j&16711935)+(h&16711935)&16711935;f=f+1|0}while((f|0)!=(d|0));return}function Eb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=b+(f<<2)|0;i=c[h+-4>>2]|0;j=c[h>>2]|0;k=c[h+4>>2]|0;h=i^g;l=((1?h>>>1:h)&2139062143)+(i&g)|0;i=k^j;h=((1?i>>>1:i)&2139062143)+(k&j)|0;j=h^l;k=((1?j>>>1:j)&2139062143)+(h&l)|0;l=c[a+(f<<2)>>2]|0;g=(k&-16711936)+(l&-16711936)&-16711936|(k&16711935)+(l&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Fb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=b+(f<<2)|0;i=c[h>>2]|0;j=c[h+-4>>2]|0;h=24?j>>>24:j;k=(24?g>>>24:g)-h|0;l=(24?i>>>24:i)-h|0;h=(16?j>>>16:j)&255;m=((16?g>>>16:g)&255)-h|0;n=((16?i>>>16:i)&255)-h|0;h=(8?j>>>8:j)&255;o=((8?g>>>8:g)&255)-h|0;p=((8?i>>>8:i)&255)-h|0;h=j&255;j=(g&255)-h|0;q=(i&255)-h|0;h=(((j|0)>-1?j:0-j|0)-((q|0)>-1?q:0-q|0)-((l|0)>-1?l:0-l|0)+((k|0)>-1?k:0-k|0)-((p|0)>-1?p:0-p|0)+((o|0)>-1?o:0-o|0)-((n|0)>-1?n:0-n|0)+((m|0)>-1?m:0-m|0)|0)<1?i:g;i=c[a+(f<<2)>>2]|0;g=(h&-16711936)+(i&-16711936)&-16711936|(h&16711935)+(i&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Gb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=b+(f<<2)|0;i=c[h>>2]|0;j=c[h+-4>>2]|0;h=(24?i>>>24:i)+(24?g>>>24:g)-(24?j>>>24:j)|0;k=((16?i>>>16:i)&255)+((16?g>>>16:g)&255)-((16?j>>>16:j)&255)|0;l=((8?i>>>8:i)&255)+((8?g>>>8:g)&255)-((8?j>>>8:j)&255)|0;m=(i&255)+(g&255)-(j&255)|0;j=(h>>>0<256?h:(24?h>>>24:h)^255)<<24|(m>>>0<256?m:(24?m>>>24:m)^255)|(k>>>0<256?k:(24?k>>>24:k)^255)<<16|(l>>>0<256?l:(24?l>>>24:l)^255)<<8;l=c[a+(f<<2)>>2]|0;g=(j&-16711936)+(l&-16711936)&-16711936|(j&16711935)+(l&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Hb(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if((d|0)<=0)return;f=0;g=c[e+-4>>2]|0;do{h=b+(f<<2)|0;i=c[h>>2]|0;j=c[h+-4>>2]|0;h=i^g;k=((1?h>>>1:h)&2139062143)+(i&g)|0;i=24?k>>>24:k;h=((i-(24?j>>>24:j)|0)/2|0)+i|0;i=(16?k>>>16:k)&255;l=((i-((16?j>>>16:j)&255)|0)/2|0)+i|0;i=(8?k>>>8:k)&255;m=((i-((8?j>>>8:j)&255)|0)/2|0)+i|0;i=k&255;k=((i-(j&255)|0)/2|0)+i|0;i=(h>>>0<256?h:(24?h>>>24:h)^255)<<24|(k>>>0<256?k:(24?k>>>24:k)^255)|(l>>>0<256?l:(24?l>>>24:l)^255)<<16|(m>>>0<256?m:(24?m>>>24:m)^255)<<8;m=c[a+(f<<2)>>2]|0;g=(i&-16711936)+(m&-16711936)&-16711936|(i&16711935)+(m&16711935)&16711935;c[e+(f<<2)>>2]=g;f=f+1|0}while((f|0)!=(d|0));return}function Ib(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0;if((b|0)<=0)return;e=0;do{f=c[a+(e<<2)>>2]|0;g=(8?f>>>8:f)&255;c[d+(e<<2)>>2]=(g<<16|g)+(f&16711935)&16711935|f&-16711936;e=e+1|0}while((e|0)!=(b|0));return}function Jb(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;if((e|0)<=0)return;g=a[b>>0]|0;h=a[b+1>>0]|0;i=a[b+2>>0]|0;b=0;do{j=c[d+(b<<2)>>2]|0;k=j<<16;l=24?k>>24:k;k=r(l,g)|0;m=(5?k>>5:k)+(16?j>>>16:j)|0;k=r(l,h)|0;l=m<<24;n=r(24?l>>24:l,i)|0;c[f+(b<<2)>>2]=m<<16&16711680|j&-16711936|(5?k>>>5:k)+j+(5?n>>>5:n)&255;b=b+1|0}while((b|0)!=(e|0));return}function Kb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+(d<<2)|0;if((d|0)<=0)return;d=e;e=b;while(1){b=c[e>>2]|0;e=e+4|0;a[d>>0]=16?b>>>16:b;a[d+1>>0]=8?b>>>8:b;a[d+2>>0]=b;a[d+3>>0]=24?b>>>24:b;if(e>>>0>=f>>>0)break;else d=d+4|0}return}function Lb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+(d<<2)|0;if((d|0)<=0)return;d=e;e=b;while(1){b=c[e>>2]|0;e=e+4|0;a[d>>0]=16?b>>>16:b;a[d+1>>0]=8?b>>>8:b;a[d+2>>0]=b;if(e>>>0>=f>>>0)break;else d=d+3|0}return}function Mb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+(d<<2)|0;if((d|0)<=0)return;d=e;e=b;while(1){b=c[e>>2]|0;e=e+4|0;a[d>>0]=b;a[d+1>>0]=8?b>>>8:b;a[d+2>>0]=16?b>>>16:b;if(e>>>0>=f>>>0)break;else d=d+3|0}return}function Nb(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+(d<<2)|0;if((d|0)<=0)return;d=e;e=b;while(1){b=c[e>>2]|0;e=e+4|0;a[d>>0]=(16?b>>>16:b)&240|(12?b>>>12:b)&15;a[d+1>>0]=b&240|(28?b>>>28:b);if(e>>>0>=f>>>0)break;else d=d+2|0}return}function Ob(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;f=b+(d<<2)|0;if((d|0)<=0)return;d=e;e=b;while(1){b=c[e>>2]|0;e=e+4|0;a[d>>0]=(16?b>>>16:b)&248|(13?b>>>13:b)&7;a[d+1>>0]=(5?b>>>5:b)&224|(3?b>>>3:b)&31;if(e>>>0>=f>>>0)break;else d=d+2|0}return}function Pb(a,b,d,e,f,g){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;if(!((e|0)<(f|0)&(g|0)>0))return;h=e;e=a;a=d;while(1){d=0;i=a;j=e;e=e+(g<<2)|0;while(1){k=c[j>>2]|0;c[i>>2]=c[b+(((8?k>>>8:k)&255)<<2)>>2];d=d+1|0;if((d|0)==(g|0))break;else{i=i+4|0;j=j+4|0}}h=h+1|0;if((h|0)==(f|0))break;else a=a+(g<<2)|0}return}function Qb(b,e,f,g,h,i){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0;if(!((g|0)<(h|0)&(i|0)>0))return;j=g;g=b;b=f;while(1){f=0;k=b;l=g;g=g+i|0;while(1){m=c[e+((d[l>>0]|0)<<2)>>2]|0;a[k>>0]=8?m>>>8:m;f=f+1|0;if((f|0)==(i|0))break;else{k=k+1|0;l=l+1|0}}j=j+1|0;if((j|0)==(h|0))break;else b=b+i|0}return}function Rb(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a+40>>2]|0;if((c[a+12>>2]|0)<1?1:(c[a+16>>2]|0)<1){d=0;return d|0}e=ba[c[b+44>>2]&31](a,b)|0;f=c[b+48>>2]|0;if(f|0)ca[f&15](a,b,e)|0;a=b+16|0;c[a>>2]=(c[a>>2]|0)+e;d=1;return d|0}function Sb(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;b=c[a+40>>2]|0;d=c[c[b>>2]>>2]|0;e=d>>>0<11;f=d+-1|0;if(f>>>0<12?(g=f&65535,((g?2077>>>g:2077)&1)!=0):0)h=1;else h=(d+-7|0)>>>0<4;g=b+40|0;f=b+44|0;i=b+48|0;j=b+52|0;c[g>>2]=0;c[g+4>>2]=0;c[g+8>>2]=0;c[g+12>>2]=0;if(!(Ub(c[b+20>>2]|0,a,h?11:12)|0)){k=0;return k|0}if(!((d+-7|0)>>>0>3|h^1))Vb();if(!(c[a+92>>2]|0)){do if(e){cc();c[f>>2]=17;if(c[a+56>>2]|0){l=a+12|0;m=c[l>>2]|0;n=m+1|0;o=wa(1,0,(n&-2)+m|0)|0;c[g>>2]=o;if(!o){k=0;return k|0}else{c[b+4>>2]=o;m=o+(c[l>>2]|0)|0;c[b+8>>2]=m;c[b+12>>2]=m+(1?n>>1:n);c[f>>2]=18;Vb();break}}}else c[f>>2]=19;while(0);if(!h){k=1;return k|0}switch(d|0){case 5:case 10:{p=9;break}default:p=e?6:5}c[i>>2]=p;if(!e){k=1;return k|0}Da();k=1;return k|0}p=c[b>>2]|0;d=c[p>>2]|0;h=d+-1|0;n=h>>>0<12;if(!e){if(n?(e=h&65535,((e?2077>>>e:2077)&1)!=0):0)q=1;else q=(d+-7|0)>>>0<4;e=c[a+96>>2]|0;m=c[a+100>>2]|0;l=e+1|0;o=1?l>>1:l;s=m+1|0;t=1?s>>1:s;s=a+12|0;u=(c[s>>2]|0)+1|0;v=1?u>>1:u;u=a+16|0;w=(c[u>>2]|0)+1|0;x=1?w>>1:w;w=e<<1;y=l&-2;l=y<<1;z=(l+w<<2)+(q?e<<3:0)|0;A=wa(1,0,z+(q?367:283)|0)|0;c[g>>2]=A;if(!A){k=0;return k|0}B=A+z+31&-32;c[b+24>>2]=B;z=b+28|0;c[z>>2]=B+84;C=b+32|0;c[C>>2]=B+168;D=b+36|0;c[D>>2]=q?B+252|0:0;Wb(B,c[s>>2]|0,c[u>>2]|0,c[p+16>>2]|0,e,m,c[p+32>>2]|0,1,A);B=A+(w<<2)|0;Wb(c[z>>2]|0,v,x,c[p+20>>2]|0,o,t,c[p+36>>2]|0,1,B);Wb(c[C>>2]|0,v,x,c[p+24>>2]|0,o,t,c[p+40>>2]|0,1,B+(y<<2)|0);c[f>>2]=16;if(!q){k=1;return k|0}Wb(c[D>>2]|0,c[s>>2]|0,c[u>>2]|0,c[p+28>>2]|0,e,m,c[p+44>>2]|0,1,B+(l<<2)|0);c[i>>2]=4;Da();k=1;return k|0}if(n?(n=h&65535,((n?2077>>>n:2077)&1)!=0):0)E=1;else E=(d+-7|0)>>>0<4;d=c[a+96>>2]|0;n=c[a+100>>2]|0;h=a+12|0;l=(c[h>>2]|0)+1|0;B=1?l>>1:l;l=a+16|0;a=(c[l>>2]|0)+1|0;p=1?a>>1:a;a=d<<1;m=d*6|0;e=r(d,E?36:27)|0;u=wa(1,0,e+(E?367:283)|0)|0;c[g>>2]=u;if(!u){k=0;return k|0}g=u+((E?d<<3:m)<<2)|0;s=u+e+31&-32;c[b+24>>2]=s;e=b+28|0;c[e>>2]=s+84;D=b+32|0;c[D>>2]=s+168;q=b+36|0;c[q>>2]=E?s+252|0:0;Wb(s,c[h>>2]|0,c[l>>2]|0,g,d,n,0,1,u);Wb(c[e>>2]|0,B,p,g+d|0,d,n,0,1,u+(a<<2)|0);Wb(c[D>>2]|0,B,p,g+a|0,d,n,0,1,u+(d<<2<<2)|0);c[f>>2]=15;Yb();if(!E){k=1;return k|0}Wb(c[q>>2]|0,c[h>>2]|0,c[l>>2]|0,g+(d*3|0)|0,d,n,0,1,u+(m<<2)|0);c[i>>2]=3;switch(c[c[b>>2]>>2]|0){case 10:case 5:{F=7;break}default:F=8}c[j>>2]=F;Da();k=1;return k|0}function Tb(a){a=a|0;var b=0;b=(c[a+40>>2]|0)+40|0;pa(c[b>>2]|0);c[b>>2]=0;return}function Ub(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=Y;Y=Y+16|0;f=e+4|0;g=e;h=c[b>>2]|0;i=c[b+4>>2]|0;j=(a|0)!=0;if(j){k=(c[a+8>>2]|0)>0;c[b+72>>2]=k&1;if(k){k=c[a+20>>2]|0;l=c[a+24>>2]|0;m=c[a+12>>2]|0;n=c[a+16>>2]|0;o=d>>>0>10;d=o?m&-2:m;m=o?n&-2:n;if((m+l|0)>(i|0)|((d+k|0)>(h|0)|((l|0)<1|((k|0)<1|(m|d|0)<0)))){p=0;Y=e;return p|0}else{q=l;r=k;s=m;t=d}}else{q=i;r=h;s=0;t=0}}else{c[b+72>>2]=0;q=i;r=h;s=0;t=0}c[b+76>>2]=t;c[b+84>>2]=s;c[b+80>>2]=r+t;c[b+88>>2]=q+s;c[b+12>>2]=r;c[b+16>>2]=q;if(!j){c[b+92>>2]=0;c[b+68>>2]=0;c[b+56>>2]=1;p=1;Y=e;return p|0}j=(c[a+28>>2]|0)>0;s=b+92|0;c[s>>2]=j&1;do if(j){c[f>>2]=c[a+32>>2];c[g>>2]=c[a+36>>2];if(Mc(r,q,f,g)|0){c[b+96>>2]=c[f>>2];c[b+100>>2]=c[g>>2];u=(c[s>>2]|0)==0;break}p=0;Y=e;return p|0}else u=1;while(0);s=b+68|0;c[s>>2]=(c[a>>2]|0)!=0&1;g=b+56|0;c[g>>2]=(c[a+4>>2]|0)==0&1;if(u){p=1;Y=e;return p|0}if((c[b+96>>2]|0)<((h*3|0)/4|0|0))v=(c[b+100>>2]|0)<((i*3|0)/4|0|0)&1;else v=0;c[s>>2]=v;c[g>>2]=0;p=1;Y=e;return p|0}function Vb(){if(Te(10084)|0)return;if(c[2033]|0){c[2437]=1;c[2439]=2;c[2443]=1;c[2444]=2;c[2436]=3;c[2438]=4;c[2440]=5;c[2441]=6;c[2442]=7;c[2445]=5;c[2446]=6}c[2033]=0;Ue(10084)|0;return}function Wb(a,b,d,e,f,g,h,i,j){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0;k=(b|0)<(f|0);c[a>>2]=k&1;l=(d|0)<(g|0);c[a+4>>2]=l&1;c[a+44>>2]=b;c[a+48>>2]=d;c[a+52>>2]=f;c[a+56>>2]=g;c[a+60>>2]=0;c[a+64>>2]=0;c[a+68>>2]=e;c[a+72>>2]=h;c[a+8>>2]=i;h=k?f+-1|0:b;c[a+36>>2]=h;e=k?b+-1|0:f;c[a+40>>2]=e;if(!k){k=Hf(0,1,e|0,((e|0)<0)<<31>>31|0)|0;v()|0;c[a+12>>2]=k}k=l<<31>>31;e=k+d|0;c[a+28>>2]=e;d=k+g|0;c[a+32>>2]=d;k=a+24|0;if(l){c[k>>2]=d;m=h}else{c[k>>2]=e;k=r(e,h)|0;h=Hf(0,g|0,k|0,((k|0)<0)<<31>>31|0)|0;k=(h|0)==(h|0)&(v()|0)==0;c[a+20>>2]=k?h:0;m=d}d=Hf(0,1,m|0,((m|0)<0)<<31>>31|0)|0;v()|0;c[a+16>>2]=d;c[a+76>>2]=j;d=j+((r(i,f)|0)<<2)|0;c[a+80>>2]=d;Nf(j|0,0,r(f<<3,i)|0)|0;Ac();return}function Xb(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;d=c[a+16>>2]|0;e=d+1|0;f=1?e>>1:e;if((d|0)<=0){g=0;return g|0}e=b+24|0;h=a+20|0;i=a+32|0;j=b+28|0;k=a+24|0;l=a+36|0;m=b+32|0;n=a+28|0;a=b+16|0;o=0;p=0;q=0;s=c[e>>2]|0;while(1){t=c[i>>2]|0;q=(Oa(s,d-q|0,(c[h>>2]|0)+(r(t,q)|0)|0,t)|0)+q|0;t=f-o|0;if(!(Ma(c[j>>2]|0,t)|0))u=o;else{v=c[l>>2]|0;w=Oa(c[j>>2]|0,t,(c[k>>2]|0)+(r(v,o)|0)|0,v)|0;v=c[l>>2]|0;Oa(c[m>>2]|0,t,(c[n>>2]|0)+(r(v,o)|0)|0,v)|0;u=w+o|0}w=c[b>>2]|0;v=c[9808+(c[w>>2]<<2)>>2]|0;t=w+20|0;x=c[e>>2]|0;a:do if((c[x+64>>2]|0)<(c[x+56>>2]|0)){y=(c[w+16>>2]|0)+(r(c[t>>2]|0,(c[a>>2]|0)+p|0)|0)|0;z=0;A=x;while(1){if((c[A+24>>2]|0)>0){B=z;C=A;break a}D=c[j>>2]|0;if((c[D+64>>2]|0)>=(c[D+56>>2]|0)){B=z;C=A;break a}if((c[D+24>>2]|0)>0){B=z;C=A;break a}Pa(A);Pa(c[j>>2]|0);Pa(c[m>>2]|0);D=c[e>>2]|0;ha[v&31](c[D+68>>2]|0,c[(c[j>>2]|0)+68>>2]|0,c[(c[m>>2]|0)+68>>2]|0,y,c[D+52>>2]|0);D=z+1|0;E=c[e>>2]|0;if((c[E+64>>2]|0)<(c[E+56>>2]|0)){y=y+(c[t>>2]|0)|0;z=D;A=E}else{B=D;C=E;break}}}else{B=0;C=x}while(0);x=B+p|0;if((d|0)<=(q|0)){g=x;break}else{o=u;p=x;s=C}}return g|0}function Yb(){if(Te(10028)|0)return;if(c[2031]|0){c[2453]=4;c[2455]=5;c[2452]=6;c[2454]=7;c[2456]=8;c[2457]=9;c[2458]=10;c[2459]=4;c[2460]=5;c[2461]=8;c[2462]=9}c[2031]=0;Ue(10028)|0;return}function Zb(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;e=a+104|0;f=c[e>>2]|0;if(!f)return 0;g=c[b+36>>2]|0;h=(c[b+16>>2]|0)+d|0;if((d|0)<=0)return 0;i=g+60|0;j=a+8|0;k=a+16|0;l=b+52|0;m=d;d=f;while(1){f=c[i>>2]|0;n=c[j>>2]|0;o=c[a>>2]|0;Oa(g,n-f+(c[k>>2]|0)|0,d+(r(o,f-n|0)|0)|0,o)|0;o=m-(ca[c[l>>2]&15](b,h-m|0,m)|0)|0;if((o|0)<=0)break;m=o;d=c[e>>2]|0}return 0}function _b(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0;e=c[a>>2]|0;f=e+20|0;g=c[f>>2]|0;h=(c[e+16>>2]|0)+(r(g,b)|0)|0;b=c[e>>2]|0;e=(b|0)==4|(b|0)==9;i=e&1;j=(b+-7|0)>>>0<4;b=a+36|0;a=c[b>>2]|0;k=c[a+52>>2]|0;if((c[a+64>>2]|0)>=(c[a+56>>2]|0)){l=0;return l|0}m=0;n=0;o=h+(e?0:3)|0;e=a;a=g;while(1){if(!((n|0)<(d|0)?(c[e+24>>2]|0)<1:0)){p=m;q=n;s=a;break}Pa(e);g=Xa(c[(c[b>>2]|0)+68>>2]|0,0,k,1,o,0)|0|m;t=c[f>>2]|0;u=n+1|0;e=c[b>>2]|0;if((c[e+64>>2]|0)>=(c[e+56>>2]|0)){p=g;q=u;s=t;break}else{m=g;n=u;o=o+t|0;a=t}}if(!(j&(p|0)!=0)){l=q;return l|0}Wa(h,i,k,q,s);l=q;return l|0}function $b(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0;g=c[b>>2]|0;h=g+20|0;i=(c[g+16>>2]|0)+(r(c[h>>2]|0,e)|0)|0;e=b+36|0;b=c[e>>2]|0;j=c[b+52>>2]|0;k=((c[g>>2]|0)+-7|0)>>>0<4;if((c[b+64>>2]|0)>=(c[b+56>>2]|0)){l=0;return l|0}if((j|0)<=0){g=0;m=b;while(1){if(!((g|0)<(f|0)?(c[m+24>>2]|0)<1:0)){l=g;n=13;break}Pa(m);o=g+1|0;m=c[e>>2]|0;if((c[m+64>>2]|0)>=(c[m+56>>2]|0)){l=o;n=13;break}else g=o}if((n|0)==13)return l|0}n=15;g=0;m=i+1|0;o=b;while(1){if(!((g|0)<(f|0)?(c[o+24>>2]|0)<1:0)){p=n;q=g;break}Pa(o);b=0;s=n;do{t=d[(c[(c[e>>2]|0)+68>>2]|0)+b>>0]|0;u=4?t>>>4:t;t=m+(b<<1)|0;a[t>>0]=u|a[t>>0]&-16&255;s=u&s;b=b+1|0}while((b|0)!=(j|0));b=g+1|0;o=c[e>>2]|0;if((c[o+64>>2]|0)>=(c[o+56>>2]|0)){p=s;q=b;break}else{n=s;g=b;m=m+(c[h>>2]|0)|0}}if(!(k&(p|0)!=15)){l=q;return l|0}Va(i,j,q,c[h>>2]|0);l=q;return l|0}function ac(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;d=c[a+16>>2]|0;e=d+1|0;f=1?e>>1:e;e=c[b+24>>2]|0;g=c[c[b>>2]>>2]|0;switch(g|0){case 1:case 3:case 4:case 5:case 12:{h=3;break}default:if((g+-7|0)>>>0<=3)h=3}if((h|0)==3?(h=c[a+104>>2]|0,h|0):0)sc(c[a+20>>2]|0,c[a+32>>2]|0,h,c[a>>2]|0,c[a+12>>2]|0,d,0);h=c[a+32>>2]|0;g=(d|0)>0;if(!g){i=0;return i|0}j=0;k=d;d=c[a+20>>2]|0;do{l=Oa(e,k,d,h)|0;d=d+(r(l,h)|0)|0;k=k-l|0;j=(rc(e)|0)+j|0}while((k|0)>0);k=a+36|0;e=c[k>>2]|0;h=c[b+28>>2]|0;if(!g){i=j;return i|0}g=f;d=c[a+24>>2]|0;do{l=Oa(h,g,d,e)|0;d=d+(r(l,e)|0)|0;g=g-l|0;rc(h)|0}while((g|0)>0);g=c[k>>2]|0;k=c[b+32>>2]|0;b=f;f=c[a+28>>2]|0;do{a=Oa(k,b,f,g)|0;f=f+(r(a,g)|0)|0;b=b-a|0;rc(k)|0}while((b|0)>0);i=j;return i|0}function bc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=c[b>>2]|0;f=c[e+28>>2]|0;g=c[b+16>>2]|0;h=e+44|0;i=c[h>>2]|0;j=f+(r(i,g)|0)|0;k=c[a+104>>2]|0;if(!k){if(!f)return 0;f=c[a+96>>2]|0;if((d|0)<=0)return 0;l=j;m=0;while(1){Nf(l|0,-1,f|0)|0;m=m+1|0;if((m|0)==(d|0))break;else l=l+i|0}return 0}i=c[e+16>>2]|0;l=e+32|0;e=c[l>>2]|0;d=c[a>>2]|0;m=c[a+16>>2]|0;a=b+36|0;b=c[a>>2]|0;if((m|0)<=0)return 0;f=0;n=m;m=k;do{k=Oa(b,n,m,d)|0;m=m+(r(k,d)|0)|0;n=n-k|0;f=(rc(b)|0)+f|0}while((n|0)>0);if((f|0)<=0)return 0;n=i+(r(e,g)|0)|0;sc(n,c[l>>2]|0,j,c[h>>2]|0,c[(c[a>>2]|0)+52>>2]|0,f,1);return 0}function cc(){if(Te(1e4)|0)return;if(c[2030]|0){c[2468]=11;c[2469]=12;c[2470]=13;c[2471]=14;c[2472]=15;c[2473]=16;c[2474]=17;c[2475]=12;c[2476]=14;c[2477]=15;c[2478]=16}c[2030]=0;Ue(1e4)|0;return}function dc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0;d=c[b>>2]|0;b=c[d+20>>2]|0;e=(c[d+16>>2]|0)+(r(b,c[a+8>>2]|0)|0)|0;f=a+16|0;jc(c[a+20>>2]|0,c[a+32>>2]|0,c[a+24>>2]|0,c[a+28>>2]|0,c[a+36>>2]|0,e,b,c[a+12>>2]|0,c[f>>2]|0,c[9872+(c[d>>2]<<2)>>2]|0);return c[f>>2]|0}function ec(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;d=c[a+16>>2]|0;e=c[b>>2]|0;f=c[a+8>>2]|0;g=e+20|0;h=c[g>>2]|0;i=(c[e+16>>2]|0)+(r(h,f)|0)|0;j=c[9744+(c[e>>2]<<2)>>2]|0;e=c[a+20>>2]|0;k=c[a+24>>2]|0;l=c[a+28>>2]|0;m=b+8|0;n=b+12|0;o=f+d|0;p=c[a+12>>2]|0;q=(p+1|0)/2|0;if(!f){ia[j&7](e,0,k,l,k,l,i,0,p);s=d}else{ia[j&7](c[b+4>>2]|0,e,c[m>>2]|0,c[n>>2]|0,k,l,i+(0-h)|0,i,p);s=d+1|0}d=f+2|0;if((d|0)<(o|0)){f=a+36|0;h=a+32|0;t=i;u=e;v=l;w=k;x=d;while(1){d=c[f>>2]|0;y=w+d|0;z=v+d|0;d=c[g>>2]|0;A=t+(d<<1)|0;B=c[h>>2]|0;C=u+(B<<1)|0;ia[j&7](C+(0-B)|0,C,w,v,y,z,A+(0-d)|0,A,p);x=x+2|0;if((x|0)>=(o|0)){D=A;E=C;F=z;G=y;H=h;break}else{t=A;u=C;v=z;w=y}}}else{D=i;E=e;F=l;G=k;H=a+32|0}k=E+(c[H>>2]|0)|0;if(((c[a+84>>2]|0)+o|0)<(c[a+88>>2]|0)){Lf(c[b+4>>2]|0,k|0,p|0)|0;Lf(c[m>>2]|0,G|0,q|0)|0;Lf(c[n>>2]|0,F|0,q|0)|0;I=s+-1|0;return I|0}if(o&1|0){I=s;return I|0}ia[j&7](k,0,G,F,G,F,D+(c[g>>2]|0)|0,0,p);I=s;return I|0}function fc(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;d=c[b>>2]|0;b=c[a+8>>2]|0;e=d+32|0;f=(c[d+16>>2]|0)+(r(c[e>>2]|0,b)|0)|0;g=1?b>>1:b;b=d+36|0;h=(c[d+20>>2]|0)+(r(c[b>>2]|0,g)|0)|0;i=d+40|0;j=(c[d+24>>2]|0)+(r(c[i>>2]|0,g)|0)|0;g=c[a+12>>2]|0;d=a+16|0;k=c[d>>2]|0;l=(g+1|0)/2|0;m=(k+1|0)/2|0;n=(k|0)>0;if(!n){o=c[d>>2]|0;return o|0}p=a+20|0;q=a+32|0;Lf(f|0,c[p>>2]|0,g|0)|0;if((k|0)!=1){s=1;do{t=f+(r(c[e>>2]|0,s)|0)|0;Lf(t|0,(c[p>>2]|0)+(r(c[q>>2]|0,s)|0)|0,g|0)|0;s=s+1|0}while((s|0)!=(k|0))}if(!n){o=c[d>>2]|0;return o|0}n=a+24|0;k=a+36|0;s=a+28|0;a=0;do{g=h+(r(c[b>>2]|0,a)|0)|0;Lf(g|0,(c[n>>2]|0)+(r(c[k>>2]|0,a)|0)|0,l|0)|0;g=j+(r(c[i>>2]|0,a)|0)|0;Lf(g|0,(c[s>>2]|0)+(r(c[k>>2]|0,a)|0)|0,l|0)|0;a=a+1|0}while((a|0)<(m|0));o=c[d>>2]|0;return o|0}function gc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;d=c[a+104>>2]|0;if(!d)return 0;e=c[a+12>>2]|0;f=c[b>>2]|0;b=c[f>>2]|0;g=(b|0)==4|(b|0)==9;h=g&1;i=c[a+8>>2]|0;j=c[a+16>>2]|0;if(!(c[a+56>>2]|0)){k=j;l=i;m=d}else{if(!i){n=j+-1|0;o=0;p=d}else{n=j;o=i+-1|0;p=d+(0-(c[a>>2]|0))|0}d=c[a+84>>2]|0;q=j+i+d|0;k=(q|0)==(c[a+88>>2]|0)?q-(d+o)|0:n;l=o;m=p}p=f+20|0;o=c[p>>2]|0;n=(c[f+16>>2]|0)+(r(o,l)|0)|0;if((b+-7|0)>>>0>3|(Xa(m,c[a>>2]|0,e,k,n+(g?0:3)|0,o)|0)==0)return 0;Wa(n,h,e,k,c[p>>2]|0);return 0}function hc(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;d=c[a+104>>2]|0;e=c[b>>2]|0;b=c[a+12>>2]|0;f=c[a+16>>2]|0;g=c[e+28>>2]|0;h=e+44|0;e=c[h>>2]|0;i=g+(r(e,c[a+8>>2]|0)|0)|0;if(!d){if(!((f|0)>0&(g|0)!=0))return 0;g=i;j=0;while(1){Nf(g|0,-1,b|0)|0;j=j+1|0;if((j|0)==(f|0))break;else g=g+e|0}return 0}else{if((f|0)<=0)return 0;e=i;i=d;d=0;while(1){Lf(e|0,i|0,b|0)|0;d=d+1|0;if((d|0)==(f|0))break;else{e=e+(c[h>>2]|0)|0;i=i+(c[a>>2]|0)|0}}return 0}return 0}function ic(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;f=c[b+104>>2]|0;if(!f)return 0;g=c[b+12>>2]|0;h=c[e>>2]|0;e=c[h>>2]|0;i=c[b+8>>2]|0;j=c[b+16>>2]|0;if(!(c[b+56>>2]|0)){k=i;l=j;m=f}else{if(!i){n=0;o=j+-1|0;p=f}else{n=i+-1|0;o=j;p=f+(0-(c[b>>2]|0))|0}f=c[b+84>>2]|0;q=j+i+f|0;k=n;l=(q|0)==(c[b+88>>2]|0)?q-(f+n)|0:o;m=p}p=h+20|0;o=(c[h+16>>2]|0)+(r(c[p>>2]|0,k)|0)|0;if((l|0)<=0)return 0;if((g|0)<=0)return 0;k=0;h=15;n=o+1|0;f=m;while(1){m=0;s=h;do{q=d[f+m>>0]|0;i=4?q>>>4:q;q=n+(m<<1)|0;a[q>>0]=i|a[q>>0]&-16&255;s=i&s;m=m+1|0}while((m|0)!=(g|0));t=c[p>>2]|0;k=k+1|0;if((k|0)==(l|0))break;else{h=s;n=n+t|0;f=f+(c[b>>2]|0)|0}}if((e+-7|0)>>>0>3|(s|0)==15)return 0;Va(o,g,l,t);return 0}function jc(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0;if((i|0)<=0)return;k=a;a=c;c=d;d=f;f=0;while(1){ha[j&31](k,a,c,d,h);l=(f&1|0)==0;f=f+1|0;if((f|0)==(i|0))break;else{k=k+b|0;a=l?a:a+e|0;c=l?c:c+e|0;d=d+g|0}}return}function kc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;h=g&-2;i=f+(h*3|0)|0;if(!h){j=b;k=c;l=f;m=e}else{h=c;c=f;f=e;e=b;while(1){b=d[h>>0]|0;n=d[f>>0]|0;o=(d[e>>0]|0)*19077|0;p=8?o>>>8:o;o=n*26149|0;q=p+-14234+(8?o>>>8:o)|0;if(q>>>0<16384)r=6?q>>>6:q;else r=((31?q>>31:q)&-255)+255|0;a[c>>0]=r;q=b*6419|0;o=n*13320|0;n=p+8708-(8?q>>>8:q)-(8?o>>>8:o)|0;if(n>>>0<16384)s=6?n>>>6:n;else s=((31?n>>31:n)&-255)+255|0;a[c+1>>0]=s;n=b*33050|0;b=p+-17685+(8?n>>>8:n)|0;if(b>>>0<16384)t=6?b>>>6:b;else t=((31?b>>31:b)&-255)+255|0;a[c+2>>0]=t;b=d[h>>0]|0;n=d[f>>0]|0;p=(d[e+1>>0]|0)*19077|0;o=8?p>>>8:p;p=n*26149|0;q=o+-14234+(8?p>>>8:p)|0;if(q>>>0<16384)u=6?q>>>6:q;else u=((31?q>>31:q)&-255)+255|0;a[c+3>>0]=u;q=b*6419|0;p=n*13320|0;n=o+8708-(8?q>>>8:q)-(8?p>>>8:p)|0;if(n>>>0<16384)v=6?n>>>6:n;else v=((31?n>>31:n)&-255)+255|0;a[c+4>>0]=v;n=b*33050|0;b=o+-17685+(8?n>>>8:n)|0;if(b>>>0<16384)w=6?b>>>6:b;else w=((31?b>>31:b)&-255)+255|0;a[c+5>>0]=w;b=e+2|0;n=h+1|0;o=f+1|0;c=c+6|0;if((c|0)==(i|0)){j=b;k=n;l=i;m=o;break}else{h=n;f=o;e=b}}}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=k*26149|0;e=j+-14234+(8?m>>>8:m)|0;if(e>>>0<16384)x=6?e>>>6:e;else x=((31?e>>31:e)&-255)+255|0;a[l>>0]=x;x=g*6419|0;e=k*13320|0;k=j+8708-(8?x>>>8:x)-(8?e>>>8:e)|0;if(k>>>0<16384)y=6?k>>>6:k;else y=((31?k>>31:k)&-255)+255|0;a[l+1>>0]=y;y=g*33050|0;g=j+-17685+(8?y>>>8:y)|0;if(g>>>0<16384)z=6?g>>>6:g;else z=((31?g>>31:g)&-255)+255|0;a[l+2>>0]=z;return}function lc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;h=g<<2&-8;i=f+h|0;if(!h){j=b;k=c;l=f;m=e}else{n=h+-8|0;o=(2?n>>>2:n)+2|0;p=(3?n>>>3:n)+1|0;n=c+p|0;q=c;c=f;r=e;s=b;while(1){t=d[q>>0]|0;u=d[r>>0]|0;v=(d[s>>0]|0)*19077|0;w=8?v>>>8:v;v=u*26149|0;x=w+-14234+(8?v>>>8:v)|0;if(x>>>0<16384)y=6?x>>>6:x;else y=((31?x>>31:x)&-255)+255|0;a[c>>0]=y;x=t*6419|0;v=u*13320|0;u=w+8708-(8?x>>>8:x)-(8?v>>>8:v)|0;if(u>>>0<16384)z=6?u>>>6:u;else z=((31?u>>31:u)&-255)+255|0;a[c+1>>0]=z;u=t*33050|0;t=w+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)A=6?t>>>6:t;else A=((31?t>>31:t)&-255)+255|0;a[c+2>>0]=A;a[c+3>>0]=-1;t=d[q>>0]|0;u=d[r>>0]|0;w=(d[s+1>>0]|0)*19077|0;v=8?w>>>8:w;w=u*26149|0;x=v+-14234+(8?w>>>8:w)|0;if(x>>>0<16384)B=6?x>>>6:x;else B=((31?x>>31:x)&-255)+255|0;a[c+4>>0]=B;x=t*6419|0;w=u*13320|0;u=v+8708-(8?x>>>8:x)-(8?w>>>8:w)|0;if(u>>>0<16384)C=6?u>>>6:u;else C=((31?u>>31:u)&-255)+255|0;a[c+5>>0]=C;u=t*33050|0;t=v+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)D=6?t>>>6:t;else D=((31?t>>31:t)&-255)+255|0;a[c+6>>0]=D;a[c+7>>0]=-1;c=c+8|0;if((c|0)==(i|0))break;else{q=q+1|0;r=r+1|0;s=s+2|0}}j=b+o|0;k=n;l=f+h|0;m=e+p|0}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=k*26149|0;p=j+-14234+(8?m>>>8:m)|0;if(p>>>0<16384)E=6?p>>>6:p;else E=((31?p>>31:p)&-255)+255|0;a[l>>0]=E;E=g*6419|0;p=k*13320|0;k=j+8708-(8?E>>>8:E)-(8?p>>>8:p)|0;if(k>>>0<16384)F=6?k>>>6:k;else F=((31?k>>31:k)&-255)+255|0;a[l+1>>0]=F;F=g*33050|0;g=j+-17685+(8?F>>>8:F)|0;if(g>>>0<16384)G=6?g>>>6:g;else G=((31?g>>31:g)&-255)+255|0;a[l+2>>0]=G;a[l+3>>0]=-1;return}function mc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;h=g&-2;i=f+(h*3|0)|0;if(!h){j=b;k=c;l=f;m=e}else{h=c;c=f;f=e;e=b;while(1){b=d[h>>0]|0;n=d[f>>0]|0;o=(d[e>>0]|0)*19077|0;p=8?o>>>8:o;o=b*33050|0;q=p+-17685+(8?o>>>8:o)|0;if(q>>>0<16384)r=6?q>>>6:q;else r=((31?q>>31:q)&-255)+255|0;a[c>>0]=r;q=b*6419|0;b=n*13320|0;o=p+8708-(8?q>>>8:q)-(8?b>>>8:b)|0;if(o>>>0<16384)s=6?o>>>6:o;else s=((31?o>>31:o)&-255)+255|0;a[c+1>>0]=s;o=n*26149|0;n=p+-14234+(8?o>>>8:o)|0;if(n>>>0<16384)t=6?n>>>6:n;else t=((31?n>>31:n)&-255)+255|0;a[c+2>>0]=t;n=d[h>>0]|0;o=d[f>>0]|0;p=(d[e+1>>0]|0)*19077|0;b=8?p>>>8:p;p=n*33050|0;q=b+-17685+(8?p>>>8:p)|0;if(q>>>0<16384)u=6?q>>>6:q;else u=((31?q>>31:q)&-255)+255|0;a[c+3>>0]=u;q=n*6419|0;n=o*13320|0;p=b+8708-(8?q>>>8:q)-(8?n>>>8:n)|0;if(p>>>0<16384)v=6?p>>>6:p;else v=((31?p>>31:p)&-255)+255|0;a[c+4>>0]=v;p=o*26149|0;o=b+-14234+(8?p>>>8:p)|0;if(o>>>0<16384)w=6?o>>>6:o;else w=((31?o>>31:o)&-255)+255|0;a[c+5>>0]=w;o=e+2|0;p=h+1|0;b=f+1|0;c=c+6|0;if((c|0)==(i|0)){j=o;k=p;l=i;m=b;break}else{h=p;f=b;e=o}}}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=g*33050|0;e=j+-17685+(8?m>>>8:m)|0;if(e>>>0<16384)x=6?e>>>6:e;else x=((31?e>>31:e)&-255)+255|0;a[l>>0]=x;x=g*6419|0;g=k*13320|0;e=j+8708-(8?x>>>8:x)-(8?g>>>8:g)|0;if(e>>>0<16384)y=6?e>>>6:e;else y=((31?e>>31:e)&-255)+255|0;a[l+1>>0]=y;y=k*26149|0;k=j+-14234+(8?y>>>8:y)|0;if(k>>>0<16384)z=6?k>>>6:k;else z=((31?k>>31:k)&-255)+255|0;a[l+2>>0]=z;return}function nc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;h=g<<2&-8;i=f+h|0;if(!h){j=b;k=c;l=f;m=e}else{n=h+-8|0;o=(2?n>>>2:n)+2|0;p=(3?n>>>3:n)+1|0;n=c+p|0;q=c;c=f;r=e;s=b;while(1){t=d[q>>0]|0;u=d[r>>0]|0;v=(d[s>>0]|0)*19077|0;w=8?v>>>8:v;v=t*33050|0;x=w+-17685+(8?v>>>8:v)|0;if(x>>>0<16384)y=6?x>>>6:x;else y=((31?x>>31:x)&-255)+255|0;a[c>>0]=y;x=t*6419|0;t=u*13320|0;v=w+8708-(8?x>>>8:x)-(8?t>>>8:t)|0;if(v>>>0<16384)z=6?v>>>6:v;else z=((31?v>>31:v)&-255)+255|0;a[c+1>>0]=z;v=u*26149|0;u=w+-14234+(8?v>>>8:v)|0;if(u>>>0<16384)A=6?u>>>6:u;else A=((31?u>>31:u)&-255)+255|0;a[c+2>>0]=A;a[c+3>>0]=-1;u=d[q>>0]|0;v=d[r>>0]|0;w=(d[s+1>>0]|0)*19077|0;t=8?w>>>8:w;w=u*33050|0;x=t+-17685+(8?w>>>8:w)|0;if(x>>>0<16384)B=6?x>>>6:x;else B=((31?x>>31:x)&-255)+255|0;a[c+4>>0]=B;x=u*6419|0;u=v*13320|0;w=t+8708-(8?x>>>8:x)-(8?u>>>8:u)|0;if(w>>>0<16384)C=6?w>>>6:w;else C=((31?w>>31:w)&-255)+255|0;a[c+5>>0]=C;w=v*26149|0;v=t+-14234+(8?w>>>8:w)|0;if(v>>>0<16384)D=6?v>>>6:v;else D=((31?v>>31:v)&-255)+255|0;a[c+6>>0]=D;a[c+7>>0]=-1;c=c+8|0;if((c|0)==(i|0))break;else{q=q+1|0;r=r+1|0;s=s+2|0}}j=b+o|0;k=n;l=f+h|0;m=e+p|0}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=g*33050|0;p=j+-17685+(8?m>>>8:m)|0;if(p>>>0<16384)E=6?p>>>6:p;else E=((31?p>>31:p)&-255)+255|0;a[l>>0]=E;E=g*6419|0;g=k*13320|0;p=j+8708-(8?E>>>8:E)-(8?g>>>8:g)|0;if(p>>>0<16384)F=6?p>>>6:p;else F=((31?p>>31:p)&-255)+255|0;a[l+1>>0]=F;F=k*26149|0;k=j+-14234+(8?F>>>8:F)|0;if(k>>>0<16384)G=6?k>>>6:k;else G=((31?k>>31:k)&-255)+255|0;a[l+2>>0]=G;a[l+3>>0]=-1;return}function oc(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0;g=f<<2&-8;h=e+g|0;if(!g){i=b;j=c;k=e;l=d}else{m=g+-8|0;n=(2?m>>>2:m)+2|0;o=(3?m>>>3:m)+1|0;m=c+o|0;p=c;c=e;q=d;r=b;while(1){s=a[r>>0]|0;t=a[p>>0]|0;u=a[q>>0]|0;a[c>>0]=-1;v=t&255;t=u&255;u=(s&255)*19077|0;s=8?u>>>8:u;u=t*26149|0;w=s+-14234+(8?u>>>8:u)|0;if(w>>>0<16384)x=6?w>>>6:w;else x=((31?w>>31:w)&-255)+255|0;a[c+1>>0]=x;w=v*6419|0;u=t*13320|0;t=s+8708-(8?w>>>8:w)-(8?u>>>8:u)|0;if(t>>>0<16384)y=6?t>>>6:t;else y=((31?t>>31:t)&-255)+255|0;a[c+2>>0]=y;t=v*33050|0;v=s+-17685+(8?t>>>8:t)|0;if(v>>>0<16384)z=6?v>>>6:v;else z=((31?v>>31:v)&-255)+255|0;a[c+3>>0]=z;v=a[r+1>>0]|0;t=a[p>>0]|0;s=a[q>>0]|0;a[c+4>>0]=-1;u=t&255;t=s&255;s=(v&255)*19077|0;v=8?s>>>8:s;s=t*26149|0;w=v+-14234+(8?s>>>8:s)|0;if(w>>>0<16384)A=6?w>>>6:w;else A=((31?w>>31:w)&-255)+255|0;a[c+5>>0]=A;w=u*6419|0;s=t*13320|0;t=v+8708-(8?w>>>8:w)-(8?s>>>8:s)|0;if(t>>>0<16384)B=6?t>>>6:t;else B=((31?t>>31:t)&-255)+255|0;a[c+6>>0]=B;t=u*33050|0;u=v+-17685+(8?t>>>8:t)|0;if(u>>>0<16384)C=6?u>>>6:u;else C=((31?u>>31:u)&-255)+255|0;a[c+7>>0]=C;c=c+8|0;if((c|0)==(h|0))break;else{p=p+1|0;q=q+1|0;r=r+2|0}}i=b+n|0;j=m;k=e+g|0;l=d+o|0}if(!(f&1))return;f=a[i>>0]|0;i=a[j>>0]|0;j=a[l>>0]|0;a[k>>0]=-1;l=i&255;i=j&255;j=(f&255)*19077|0;f=8?j>>>8:j;j=i*26149|0;o=f+-14234+(8?j>>>8:j)|0;if(o>>>0<16384)D=6?o>>>6:o;else D=((31?o>>31:o)&-255)+255|0;a[k+1>>0]=D;D=l*6419|0;o=i*13320|0;i=f+8708-(8?D>>>8:D)-(8?o>>>8:o)|0;if(i>>>0<16384)E=6?i>>>6:i;else E=((31?i>>31:i)&-255)+255|0;a[k+2>>0]=E;E=l*33050|0;l=f+-17685+(8?E>>>8:E)|0;if(l>>>0<16384)F=6?l>>>6:l;else F=((31?l>>31:l)&-255)+255|0;a[k+3>>0]=F;return}function pc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;h=g<<1&-4;i=f+h|0;if(!h){j=b;k=c;l=f;m=e}else{n=h+-4|0;o=(1?n>>>1:n)+2|0;p=(2?n>>>2:n)+1|0;n=c+p|0;q=c;c=f;r=e;s=b;while(1){t=d[q>>0]|0;u=d[r>>0]|0;v=(d[s>>0]|0)*19077|0;w=8?v>>>8:v;v=u*26149|0;x=w+-14234+(8?v>>>8:v)|0;if(x>>>0<16384)y=6?x>>>6:x;else y=((31?x>>31:x)&-255)+255|0;x=t*6419|0;v=u*13320|0;u=w+8708-(8?x>>>8:x)-(8?v>>>8:v)|0;if(u>>>0<16384)z=6?u>>>6:u;else z=((31?u>>31:u)&-255)+255|0;u=t*33050|0;t=w+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)A=6?t>>>6:t;else A=((31?t>>31:t)&-255)+255|0;a[c>>0]=(4?z>>>4:z)|y&240;a[c+1>>0]=A|15;t=d[q>>0]|0;u=d[r>>0]|0;w=(d[s+1>>0]|0)*19077|0;v=8?w>>>8:w;w=u*26149|0;x=v+-14234+(8?w>>>8:w)|0;if(x>>>0<16384)B=6?x>>>6:x;else B=((31?x>>31:x)&-255)+255|0;x=t*6419|0;w=u*13320|0;u=v+8708-(8?x>>>8:x)-(8?w>>>8:w)|0;if(u>>>0<16384)C=6?u>>>6:u;else C=((31?u>>31:u)&-255)+255|0;u=t*33050|0;t=v+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)D=6?t>>>6:t;else D=((31?t>>31:t)&-255)+255|0;a[c+2>>0]=(4?C>>>4:C)|B&240;a[c+3>>0]=D|15;c=c+4|0;if((c|0)==(i|0))break;else{q=q+1|0;r=r+1|0;s=s+2|0}}j=b+o|0;k=n;l=f+h|0;m=e+p|0}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=k*26149|0;p=j+-14234+(8?m>>>8:m)|0;if(p>>>0<16384)E=6?p>>>6:p;else E=((31?p>>31:p)&-255)+255|0;p=g*6419|0;m=k*13320|0;k=j+8708-(8?p>>>8:p)-(8?m>>>8:m)|0;if(k>>>0<16384)F=6?k>>>6:k;else F=((31?k>>31:k)&-255)+255|0;k=g*33050|0;g=j+-17685+(8?k>>>8:k)|0;if(g>>>0<16384)G=6?g>>>6:g;else G=((31?g>>31:g)&-255)+255|0;a[l>>0]=(4?F>>>4:F)|E&240;a[l+1>>0]=G|15;return}function qc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0;h=g<<1&-4;i=f+h|0;if(!h){j=b;k=c;l=f;m=e}else{n=h+-4|0;o=(1?n>>>1:n)+2|0;p=(2?n>>>2:n)+1|0;n=c+p|0;q=c;c=f;r=e;s=b;while(1){t=d[q>>0]|0;u=d[r>>0]|0;v=(d[s>>0]|0)*19077|0;w=8?v>>>8:v;v=u*26149|0;x=w+-14234+(8?v>>>8:v)|0;if(x>>>0<16384)y=6?x>>>6:x;else y=((31?x>>31:x)&-255)+255|0;x=t*6419|0;v=u*13320|0;u=w+8708-(8?x>>>8:x)-(8?v>>>8:v)|0;if(u>>>0<16384)z=6?u>>>6:u;else z=((31?u>>31:u)&-255)+255|0;u=t*33050|0;t=w+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)A=6?t>>>6:t;else A=((31?t>>31:t)&-255)+255|0;a[c>>0]=(5?z>>>5:z)|y&248;a[c+1>>0]=(3?A>>>3:A)|z<<3&224;t=d[q>>0]|0;u=d[r>>0]|0;w=(d[s+1>>0]|0)*19077|0;v=8?w>>>8:w;w=u*26149|0;x=v+-14234+(8?w>>>8:w)|0;if(x>>>0<16384)B=6?x>>>6:x;else B=((31?x>>31:x)&-255)+255|0;x=t*6419|0;w=u*13320|0;u=v+8708-(8?x>>>8:x)-(8?w>>>8:w)|0;if(u>>>0<16384)C=6?u>>>6:u;else C=((31?u>>31:u)&-255)+255|0;u=t*33050|0;t=v+-17685+(8?u>>>8:u)|0;if(t>>>0<16384)D=6?t>>>6:t;else D=((31?t>>31:t)&-255)+255|0;a[c+2>>0]=(5?C>>>5:C)|B&248;a[c+3>>0]=(3?D>>>3:D)|C<<3&224;c=c+4|0;if((c|0)==(i|0))break;else{q=q+1|0;r=r+1|0;s=s+2|0}}j=b+o|0;k=n;l=f+h|0;m=e+p|0}if(!(g&1))return;g=d[k>>0]|0;k=d[m>>0]|0;m=(d[j>>0]|0)*19077|0;j=8?m>>>8:m;m=k*26149|0;p=j+-14234+(8?m>>>8:m)|0;if(p>>>0<16384)E=6?p>>>6:p;else E=((31?p>>31:p)&-255)+255|0;p=g*6419|0;m=k*13320|0;k=j+8708-(8?p>>>8:p)-(8?m>>>8:m)|0;if(k>>>0<16384)F=6?k>>>6:k;else F=((31?k>>31:k)&-255)+255|0;k=g*33050|0;g=j+-17685+(8?k>>>8:k)|0;if(g>>>0<16384)G=6?g>>>6:g;else G=((31?g>>31:g)&-255)+255|0;a[l>>0]=(5?F>>>5:F)|E&248;a[l+1>>0]=(3?G>>>3:G)|F<<3&224;return}function rc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;b=a+24|0;d=a+56|0;e=a+64|0;if((c[e>>2]|0)>=(c[d>>2]|0)){f=0;return f|0}g=0;while(1){if((c[b>>2]|0)>0){f=g;h=5;break}Pa(a);i=g+1|0;if((c[e>>2]|0)<(c[d>>2]|0))g=i;else{f=i;h=5;break}}if((h|0)==5)return f|0;return 0}function sc(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;var h=0;if((f|0)<=0)return;h=a;a=c;c=0;while(1){Ua(h,a,e,g);c=c+1|0;if((c|0)==(f|0))break;else{h=h+b|0;a=a+d|0}}return}function tc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=f+(h<<2)|0;j=d[c+h>>0]|0;k=d[e+h>>0]|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=k*26149|0;n=m+-14234+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;a[i>>0]=o;n=j*6419|0;l=k*13320|0;k=m+8708-(8?n>>>8:n)-(8?l>>>8:l)|0;if(k>>>0<16384)p=6?k>>>6:k;else p=((31?k>>31:k)&-255)+255|0;a[i+1>>0]=p;k=j*33050|0;j=m+-17685+(8?k>>>8:k)|0;if(j>>>0<16384)q=6?j>>>6:j;else q=((31?j>>31:j)&-255)+255|0;a[i+2>>0]=q;a[i+3>>0]=-1;h=h+1|0}while((h|0)!=(g|0));return}function uc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=f+(h<<2)|0;j=d[c+h>>0]|0;k=d[e+h>>0]|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=j*33050|0;n=m+-17685+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;a[i>>0]=o;n=j*6419|0;j=k*13320|0;l=m+8708-(8?n>>>8:n)-(8?j>>>8:j)|0;if(l>>>0<16384)p=6?l>>>6:l;else p=((31?l>>31:l)&-255)+255|0;a[i+1>>0]=p;l=k*26149|0;k=m+-14234+(8?l>>>8:l)|0;if(k>>>0<16384)q=6?k>>>6:k;else q=((31?k>>31:k)&-255)+255|0;a[i+2>>0]=q;a[i+3>>0]=-1;h=h+1|0}while((h|0)!=(g|0));return}function vc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=d[c+h>>0]|0;j=d[e+h>>0]|0;k=f+(h*3|0)|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=j*26149|0;n=m+-14234+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;a[k>>0]=o;n=i*6419|0;l=j*13320|0;j=m+8708-(8?n>>>8:n)-(8?l>>>8:l)|0;if(j>>>0<16384)p=6?j>>>6:j;else p=((31?j>>31:j)&-255)+255|0;a[k+1>>0]=p;j=i*33050|0;i=m+-17685+(8?j>>>8:j)|0;if(i>>>0<16384)q=6?i>>>6:i;else q=((31?i>>31:i)&-255)+255|0;a[k+2>>0]=q;h=h+1|0}while((h|0)!=(g|0));return}function wc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=d[c+h>>0]|0;j=d[e+h>>0]|0;k=f+(h*3|0)|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=i*33050|0;n=m+-17685+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;a[k>>0]=o;n=i*6419|0;i=j*13320|0;l=m+8708-(8?n>>>8:n)-(8?i>>>8:i)|0;if(l>>>0<16384)p=6?l>>>6:l;else p=((31?l>>31:l)&-255)+255|0;a[k+1>>0]=p;l=j*26149|0;j=m+-14234+(8?l>>>8:l)|0;if(j>>>0<16384)q=6?j>>>6:j;else q=((31?j>>31:j)&-255)+255|0;a[k+2>>0]=q;h=h+1|0}while((h|0)!=(g|0));return}function xc(b,c,d,e,f){b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;if((f|0)<=0)return;g=0;do{h=a[b+g>>0]|0;i=a[c+g>>0]|0;j=a[d+g>>0]|0;k=e+(g<<2)|0;a[k>>0]=-1;l=i&255;i=j&255;j=(h&255)*19077|0;h=8?j>>>8:j;j=i*26149|0;m=h+-14234+(8?j>>>8:j)|0;if(m>>>0<16384)n=6?m>>>6:m;else n=((31?m>>31:m)&-255)+255|0;a[k+1>>0]=n;m=l*6419|0;j=i*13320|0;i=h+8708-(8?m>>>8:m)-(8?j>>>8:j)|0;if(i>>>0<16384)o=6?i>>>6:i;else o=((31?i>>31:i)&-255)+255|0;a[k+2>>0]=o;i=l*33050|0;l=h+-17685+(8?i>>>8:i)|0;if(l>>>0<16384)p=6?l>>>6:l;else p=((31?l>>31:l)&-255)+255|0;a[k+3>>0]=p;g=g+1|0}while((g|0)!=(f|0));return}function yc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=d[c+h>>0]|0;j=d[e+h>>0]|0;k=f+(h<<1)|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=j*26149|0;n=m+-14234+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;n=i*6419|0;l=j*13320|0;j=m+8708-(8?n>>>8:n)-(8?l>>>8:l)|0;if(j>>>0<16384)p=6?j>>>6:j;else p=((31?j>>31:j)&-255)+255|0;j=i*33050|0;i=m+-17685+(8?j>>>8:j)|0;if(i>>>0<16384)q=6?i>>>6:i;else q=((31?i>>31:i)&-255)+255|0;a[k>>0]=(4?p>>>4:p)|o&240;a[k+1>>0]=q|15;h=h+1|0}while((h|0)!=(g|0));return}function zc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;if((g|0)<=0)return;h=0;do{i=d[c+h>>0]|0;j=d[e+h>>0]|0;k=f+(h<<1)|0;l=(d[b+h>>0]|0)*19077|0;m=8?l>>>8:l;l=j*26149|0;n=m+-14234+(8?l>>>8:l)|0;if(n>>>0<16384)o=6?n>>>6:n;else o=((31?n>>31:n)&-255)+255|0;n=i*6419|0;l=j*13320|0;j=m+8708-(8?n>>>8:n)-(8?l>>>8:l)|0;if(j>>>0<16384)p=6?j>>>6:j;else p=((31?j>>31:j)&-255)+255|0;j=i*33050|0;i=m+-17685+(8?j>>>8:j)|0;if(i>>>0<16384)q=6?i>>>6:i;else q=((31?i>>31:i)&-255)+255|0;a[k>>0]=(5?p>>>5:p)|o&248;a[k+1>>0]=(3?q>>>3:q)|p<<3&224;h=h+1|0}while((h|0)!=(g|0));return}function Ac(){if(Te(10056)|0)return;c[2032]=0;Ue(10056)|0;return}function Bc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0;d=c[b+68>>2]|0;e=c[b+76>>2]|0;f=r(c[b+8>>2]|0,c[b+52>>2]|0)|0;g=c[b+80>>2]|0;h=c[b+24>>2]|0;if(!h){if((f|0)<=0)return;i=b+16|0;j=0;do{k=Cf(c[i>>2]|0,0,c[g+(j<<2)>>2]|0,0)|0;Df(k|0,v()|0,-2147483648,0)|0;k=v()|0;a[d+j>>0]=(k|0)>255?-1:k&255;j=j+1|0}while((j|0)!=(f|0));return}else{j=c[b+32>>2]|0;i=Hf(0,0-h|0,j|0,((j|0)<0)<<31>>31|0)|0;v()|0;if((f|0)<=0)return;j=0-i|0;h=b+16|0;b=0;do{k=Cf(c[g+(b<<2)>>2]|0,0,j|0,0)|0;l=v()|0;m=Cf(i|0,0,c[e+(b<<2)>>2]|0,0)|0;n=v()|0;o=Df(k|0,l|0,-2147483648,0)|0;Df(o|0,v()|0,m|0,n|0)|0;n=v()|0;m=Cf(n|0,0,c[h>>2]|0,0)|0;Df(m|0,v()|0,-2147483648,0)|0;m=v()|0;a[d+b>>0]=(m|0)>255?-1:m&255;b=b+1|0}while((b|0)!=(f|0));return}}function Cc(b){b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;d=c[b+68>>2]|0;e=c[b+76>>2]|0;f=r(c[b+8>>2]|0,c[b+52>>2]|0)|0;g=c[b+80>>2]|0;h=r(c[b+24>>2]|0,0-(c[b+16>>2]|0)|0)|0;i=(f|0)>0;if(!h){if(!i)return;j=b+20|0;k=0;do{l=e+(k<<2)|0;m=Cf(c[j>>2]|0,0,c[l>>2]|0,0)|0;Df(m|0,v()|0,-2147483648,0)|0;m=v()|0;a[d+k>>0]=(m|0)>255?-1:m&255;c[l>>2]=0;k=k+1|0}while((k|0)!=(f|0));return}else{if(!i)return;i=b+20|0;b=0;do{Cf(c[g+(b<<2)>>2]|0,0,h|0,0)|0;k=v()|0;j=e+(b<<2)|0;l=Cf((c[j>>2]|0)-k|0,0,c[i>>2]|0,0)|0;Df(l|0,v()|0,-2147483648,0)|0;l=v()|0;a[d+b>>0]=(l|0)>255?-1:l&255;c[j>>2]=k;b=b+1|0}while((b|0)!=(f|0));return}}function Dc(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0;e=c[a+8>>2]|0;f=r(c[a+52>>2]|0,e)|0;if((e|0)<=0)return;g=a+36|0;h=a+44|0;i=a+80|0;j=a+40|0;a=0;do{k=c[g>>2]|0;l=d[b+a>>0]|0;m=a+e|0;if((c[h>>2]|0)>1)n=d[b+m>>0]|0;else n=l;o=r(k,l)|0;p=c[i>>2]|0;c[p+(a<<2)>>2]=o;if((m|0)<(f|0)){o=l;l=k;k=m;q=n;s=m;while(1){m=l-(c[j>>2]|0)|0;t=k+e|0;if((m|0)<0){u=c[g>>2]|0;v=d[b+t>>0]|0;w=q;x=u+m|0;y=t;z=u}else{v=q;w=o;x=m;y=k;z=c[g>>2]|0}m=(r(z,v)|0)+(r(w-v|0,x)|0)|0;c[p+(s<<2)>>2]=m;s=s+e|0;if((s|0)>=(f|0))break;else{o=w;l=x;k=y;q=v}}}a=a+1|0}while((a|0)!=(e|0));return}function Ec(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0;e=c[b+8>>2]|0;f=r(c[b+52>>2]|0,e)|0;if((e|0)<=0)return;g=b+36|0;h=b+40|0;i=b+80|0;j=b+12|0;b=0;do{if((b|0)<(f|0)){k=0;l=0;m=b;n=b;while(1){o=(c[g>>2]|0)+k|0;p=c[h>>2]|0;if((o|0)>0){q=l;s=n;t=o;do{t=t-p|0;u=a[d+s>>0]|0;q=q+(u&255)|0;s=s+e|0}while((t|0)>0);w=u&255;x=t;y=q;z=s}else{w=0;x=o;y=l;z=n}A=r(w,0-x|0)|0;B=(r(p,y)|0)-A|0;c[(c[i>>2]|0)+(m<<2)>>2]=B;B=Cf(c[j>>2]|0,0,A|0,0)|0;Df(B|0,v()|0,-2147483648,0)|0;l=v()|0;m=m+e|0;if((m|0)>=(f|0))break;else{k=x;n=z}}}b=b+1|0}while((b|0)!=(e|0));return}function Fc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=(18?p>>>18:p)&255;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=r*26149|0;t=s+-14234+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;a[i>>0]=u;u=q*6419|0;t=r*13320|0;r=s+8708-(8?u>>>8:u)-(8?t>>>8:t)|0;if(r>>>0<16384)v=6?r>>>6:r;else v=((31?r>>31:r)&-255)+255|0;a[i+1>>0]=v;v=q*33050|0;q=s+-17685+(8?v>>>8:v)|0;if(q>>>0<16384)w=6?q>>>6:q;else w=((31?q>>31:q)&-255)+255|0;a[i+2>>0]=w;a[i+3>>0]=-1;w=(c|0)!=0;if(w){q=n+131074+(o*3|0)|0;v=(2?q>>>2:q)&255;s=(18?q>>>18:q)&255;q=(d[c>>0]|0)*19077|0;r=8?q>>>8:q;q=s*26149|0;t=(8?q>>>8:q)+-14234+r|0;if(t>>>0<16384)x=6?t>>>6:t;else x=((31?t>>31:t)&-255)+255|0;a[j>>0]=x;x=v*6419|0;t=s*13320|0;s=8708-(8?x>>>8:x)-(8?t>>>8:t)+r|0;if(s>>>0<16384)y=6?s>>>6:s;else y=((31?s>>31:s)&-255)+255|0;a[j+1>>0]=y;y=v*33050|0;v=(8?y>>>8:y)+-17685+r|0;if(v>>>0<16384)z=6?v>>>6:v;else z=((31?v>>31:v)&-255)+255|0;a[j+2>>0]=z;a[j+3>>0]=-1}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){v=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);r=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);y=v+n|0;s=y+524296+z+r|0;t=s+(y<<1)|0;y=3?t>>>3:t;t=s+(r+z<<1)|0;s=3?t>>>3:t;t=y+z|0;x=s+v|0;q=o<<1;u=q+-1|0;p=u<<2;C=i+p|0;D=(1?t>>>1:t)&255;E=(17?t>>>17:t)&255;t=(d[b+u>>0]|0)*19077|0;F=8?t>>>8:t;t=E*26149|0;G=F+-14234+(8?t>>>8:t)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;a[C>>0]=H;G=D*6419|0;t=E*13320|0;E=F+8708-(8?G>>>8:G)-(8?t>>>8:t)|0;if(E>>>0<16384)I=6?E>>>6:E;else I=((31?E>>31:E)&-255)+255|0;a[C+1>>0]=I;E=D*33050|0;D=F+-17685+(8?E>>>8:E)|0;if(D>>>0<16384)J=6?D>>>6:D;else J=((31?D>>31:D)&-255)+255|0;a[C+2>>0]=J;a[C+3>>0]=-1;C=o<<3;D=i+C|0;E=(1?x>>>1:x)&255;F=(17?x>>>17:x)&255;x=(d[b+q>>0]|0)*19077|0;t=8?x>>>8:x;x=F*26149|0;G=(8?x>>>8:x)+-14234+t|0;if(G>>>0<16384)K=6?G>>>6:G;else K=((31?G>>31:G)&-255)+255|0;a[D>>0]=K;G=E*6419|0;x=F*13320|0;F=8708-(8?G>>>8:G)-(8?x>>>8:x)+t|0;if(F>>>0<16384)L=6?F>>>6:F;else L=((31?F>>31:F)&-255)+255|0;a[D+1>>0]=L;F=E*33050|0;E=(8?F>>>8:F)+-17685+t|0;if(E>>>0<16384)M=6?E>>>6:E;else M=((31?E>>31:E)&-255)+255|0;a[D+2>>0]=M;a[D+3>>0]=-1;if(w){D=s+n|0;s=y+r|0;y=j+p|0;p=(1?D>>>1:D)&255;E=(17?D>>>17:D)&255;D=(d[c+u>>0]|0)*19077|0;u=8?D>>>8:D;D=E*26149|0;t=(8?D>>>8:D)+-14234+u|0;if(t>>>0<16384)N=6?t>>>6:t;else N=((31?t>>31:t)&-255)+255|0;a[y>>0]=N;t=p*6419|0;D=E*13320|0;E=8708-(8?t>>>8:t)-(8?D>>>8:D)+u|0;if(E>>>0<16384)O=6?E>>>6:E;else O=((31?E>>31:E)&-255)+255|0;a[y+1>>0]=O;E=p*33050|0;p=(8?E>>>8:E)+-17685+u|0;if(p>>>0<16384)P=6?p>>>6:p;else P=((31?p>>31:p)&-255)+255|0;a[y+2>>0]=P;a[y+3>>0]=-1;y=j+C|0;C=(1?s>>>1:s)&255;p=(17?s>>>17:s)&255;s=(d[c+q>>0]|0)*19077|0;q=8?s>>>8:s;s=p*26149|0;u=(8?s>>>8:s)+-14234+q|0;if(u>>>0<16384)Q=6?u>>>6:u;else Q=((31?u>>31:u)&-255)+255|0;a[y>>0]=Q;u=C*6419|0;s=p*13320|0;p=8708-(8?u>>>8:u)-(8?s>>>8:s)+q|0;if(p>>>0<16384)R=6?p>>>6:p;else R=((31?p>>31:p)&-255)+255|0;a[y+1>>0]=R;p=C*33050|0;C=(8?p>>>8:p)+-17685+q|0;if(C>>>0<16384)S=6?C>>>6:C;else S=((31?C>>31:C)&-255)+255|0;a[y+2>>0]=S;a[y+3>>0]=-1}if((o|0)<(m|0)){z=v;n=r;o=o+1|0}else{A=v;B=r;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=l<<2;n=i+o|0;i=(2?k>>>2:k)&255;z=(18?k>>>18:k)&255;k=(d[b+l>>0]|0)*19077|0;b=8?k>>>8:k;k=z*26149|0;m=(8?k>>>8:k)+-14234+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;a[n>>0]=T;T=i*6419|0;m=z*13320|0;z=8708-(8?T>>>8:T)-(8?m>>>8:m)+b|0;if(z>>>0<16384)U=6?z>>>6:z;else U=((31?z>>31:z)&-255)+255|0;a[n+1>>0]=U;U=i*33050|0;i=(8?U>>>8:U)+-17685+b|0;if(i>>>0<16384)V=6?i>>>6:i;else V=((31?i>>31:i)&-255)+255|0;a[n+2>>0]=V;a[n+3>>0]=-1;if(!w)return;w=A+131074+(B*3|0)|0;B=j+o|0;o=(2?w>>>2:w)&255;j=(18?w>>>18:w)&255;w=(d[c+l>>0]|0)*19077|0;l=8?w>>>8:w;w=j*26149|0;c=(8?w>>>8:w)+-14234+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;a[B>>0]=W;W=o*6419|0;c=j*13320|0;j=8708-(8?W>>>8:W)-(8?c>>>8:c)+l|0;if(j>>>0<16384)X=6?j>>>6:j;else X=((31?j>>31:j)&-255)+255|0;a[B+1>>0]=X;X=o*33050|0;o=(8?X>>>8:X)+-17685+l|0;if(o>>>0<16384)Y=6?o>>>6:o;else Y=((31?o>>31:o)&-255)+255|0;a[B+2>>0]=Y;a[B+3>>0]=-1;return}function Gc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=(18?p>>>18:p)&255;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=q*33050|0;t=s+-17685+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;a[i>>0]=u;u=q*6419|0;q=r*13320|0;t=s+8708-(8?u>>>8:u)-(8?q>>>8:q)|0;if(t>>>0<16384)v=6?t>>>6:t;else v=((31?t>>31:t)&-255)+255|0;a[i+1>>0]=v;v=r*26149|0;r=s+-14234+(8?v>>>8:v)|0;if(r>>>0<16384)w=6?r>>>6:r;else w=((31?r>>31:r)&-255)+255|0;a[i+2>>0]=w;a[i+3>>0]=-1;w=(c|0)!=0;if(w){r=n+131074+(o*3|0)|0;v=(2?r>>>2:r)&255;s=(18?r>>>18:r)&255;r=(d[c>>0]|0)*19077|0;t=8?r>>>8:r;r=v*33050|0;q=(8?r>>>8:r)+-17685+t|0;if(q>>>0<16384)x=6?q>>>6:q;else x=((31?q>>31:q)&-255)+255|0;a[j>>0]=x;x=v*6419|0;v=s*13320|0;q=8708-(8?x>>>8:x)-(8?v>>>8:v)+t|0;if(q>>>0<16384)y=6?q>>>6:q;else y=((31?q>>31:q)&-255)+255|0;a[j+1>>0]=y;y=s*26149|0;s=(8?y>>>8:y)+-14234+t|0;if(s>>>0<16384)z=6?s>>>6:s;else z=((31?s>>31:s)&-255)+255|0;a[j+2>>0]=z;a[j+3>>0]=-1}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){s=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);t=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);y=s+n|0;q=y+524296+z+t|0;v=q+(y<<1)|0;y=3?v>>>3:v;v=q+(t+z<<1)|0;q=3?v>>>3:v;v=y+z|0;x=q+s|0;r=o<<1;u=r+-1|0;p=u<<2;C=i+p|0;D=(1?v>>>1:v)&255;E=(17?v>>>17:v)&255;v=(d[b+u>>0]|0)*19077|0;F=8?v>>>8:v;v=D*33050|0;G=F+-17685+(8?v>>>8:v)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;a[C>>0]=H;G=D*6419|0;D=E*13320|0;v=F+8708-(8?G>>>8:G)-(8?D>>>8:D)|0;if(v>>>0<16384)I=6?v>>>6:v;else I=((31?v>>31:v)&-255)+255|0;a[C+1>>0]=I;v=E*26149|0;E=F+-14234+(8?v>>>8:v)|0;if(E>>>0<16384)J=6?E>>>6:E;else J=((31?E>>31:E)&-255)+255|0;a[C+2>>0]=J;a[C+3>>0]=-1;C=o<<3;E=i+C|0;v=(1?x>>>1:x)&255;F=(17?x>>>17:x)&255;x=(d[b+r>>0]|0)*19077|0;D=8?x>>>8:x;x=v*33050|0;G=(8?x>>>8:x)+-17685+D|0;if(G>>>0<16384)K=6?G>>>6:G;else K=((31?G>>31:G)&-255)+255|0;a[E>>0]=K;G=v*6419|0;v=F*13320|0;x=8708-(8?G>>>8:G)-(8?v>>>8:v)+D|0;if(x>>>0<16384)L=6?x>>>6:x;else L=((31?x>>31:x)&-255)+255|0;a[E+1>>0]=L;x=F*26149|0;F=(8?x>>>8:x)+-14234+D|0;if(F>>>0<16384)M=6?F>>>6:F;else M=((31?F>>31:F)&-255)+255|0;a[E+2>>0]=M;a[E+3>>0]=-1;if(w){E=q+n|0;q=y+t|0;y=j+p|0;p=(1?E>>>1:E)&255;F=(17?E>>>17:E)&255;E=(d[c+u>>0]|0)*19077|0;u=8?E>>>8:E;E=p*33050|0;D=(8?E>>>8:E)+-17685+u|0;if(D>>>0<16384)N=6?D>>>6:D;else N=((31?D>>31:D)&-255)+255|0;a[y>>0]=N;D=p*6419|0;p=F*13320|0;E=8708-(8?D>>>8:D)-(8?p>>>8:p)+u|0;if(E>>>0<16384)O=6?E>>>6:E;else O=((31?E>>31:E)&-255)+255|0;a[y+1>>0]=O;E=F*26149|0;F=(8?E>>>8:E)+-14234+u|0;if(F>>>0<16384)P=6?F>>>6:F;else P=((31?F>>31:F)&-255)+255|0;a[y+2>>0]=P;a[y+3>>0]=-1;y=j+C|0;C=(1?q>>>1:q)&255;F=(17?q>>>17:q)&255;q=(d[c+r>>0]|0)*19077|0;r=8?q>>>8:q;q=C*33050|0;u=(8?q>>>8:q)+-17685+r|0;if(u>>>0<16384)Q=6?u>>>6:u;else Q=((31?u>>31:u)&-255)+255|0;a[y>>0]=Q;u=C*6419|0;C=F*13320|0;q=8708-(8?u>>>8:u)-(8?C>>>8:C)+r|0;if(q>>>0<16384)R=6?q>>>6:q;else R=((31?q>>31:q)&-255)+255|0;a[y+1>>0]=R;q=F*26149|0;F=(8?q>>>8:q)+-14234+r|0;if(F>>>0<16384)S=6?F>>>6:F;else S=((31?F>>31:F)&-255)+255|0;a[y+2>>0]=S;a[y+3>>0]=-1}if((o|0)<(m|0)){z=s;n=t;o=o+1|0}else{A=s;B=t;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=l<<2;n=i+o|0;i=(2?k>>>2:k)&255;z=(18?k>>>18:k)&255;k=(d[b+l>>0]|0)*19077|0;b=8?k>>>8:k;k=i*33050|0;m=(8?k>>>8:k)+-17685+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;a[n>>0]=T;T=i*6419|0;i=z*13320|0;m=8708-(8?T>>>8:T)-(8?i>>>8:i)+b|0;if(m>>>0<16384)U=6?m>>>6:m;else U=((31?m>>31:m)&-255)+255|0;a[n+1>>0]=U;U=z*26149|0;z=(8?U>>>8:U)+-14234+b|0;if(z>>>0<16384)V=6?z>>>6:z;else V=((31?z>>31:z)&-255)+255|0;a[n+2>>0]=V;a[n+3>>0]=-1;if(!w)return;w=A+131074+(B*3|0)|0;B=j+o|0;o=(2?w>>>2:w)&255;j=(18?w>>>18:w)&255;w=(d[c+l>>0]|0)*19077|0;l=8?w>>>8:w;w=o*33050|0;c=(8?w>>>8:w)+-17685+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;a[B>>0]=W;W=o*6419|0;o=j*13320|0;c=8708-(8?W>>>8:W)-(8?o>>>8:o)+l|0;if(c>>>0<16384)X=6?c>>>6:c;else X=((31?c>>31:c)&-255)+255|0;a[B+1>>0]=X;X=j*26149|0;j=(8?X>>>8:X)+-14234+l|0;if(j>>>0<16384)Y=6?j>>>6:j;else Y=((31?j>>31:j)&-255)+255|0;a[B+2>>0]=Y;a[B+3>>0]=-1;return}function Hc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=18?p>>>18:p;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=r*26149|0;t=s+-14234+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;a[i>>0]=u;u=q*6419|0;t=r*13320|0;r=s+8708-(8?t>>>8:t)-(8?u>>>8:u)|0;if(r>>>0<16384)v=6?r>>>6:r;else v=((31?r>>31:r)&-255)+255|0;a[i+1>>0]=v;v=q*33050|0;q=s+-17685+(8?v>>>8:v)|0;if(q>>>0<16384)w=6?q>>>6:q;else w=((31?q>>31:q)&-255)+255|0;a[i+2>>0]=w;w=(c|0)!=0;if(w){q=n+131074+(o*3|0)|0;v=(2?q>>>2:q)&255;s=18?q>>>18:q;q=(d[c>>0]|0)*19077|0;r=8?q>>>8:q;q=s*26149|0;u=(8?q>>>8:q)+-14234+r|0;if(u>>>0<16384)x=6?u>>>6:u;else x=((31?u>>31:u)&-255)+255|0;a[j>>0]=x;x=v*6419|0;u=s*13320|0;s=8708-(8?u>>>8:u)-(8?x>>>8:x)+r|0;if(s>>>0<16384)y=6?s>>>6:s;else y=((31?s>>31:s)&-255)+255|0;a[j+1>>0]=y;y=v*33050|0;v=(8?y>>>8:y)+-17685+r|0;if(v>>>0<16384)z=6?v>>>6:v;else z=((31?v>>31:v)&-255)+255|0;a[j+2>>0]=z}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){v=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);r=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);y=v+n|0;s=y+524296+z+r|0;x=s+(y<<1)|0;y=3?x>>>3:x;x=s+(r+z<<1)|0;s=3?x>>>3:x;x=y+z|0;u=s+v|0;q=o<<1;t=q+-1|0;p=(1?x>>>1:x)&255;C=17?x>>>17:x;x=t*3|0;D=i+x|0;E=(d[b+t>>0]|0)*19077|0;F=8?E>>>8:E;E=C*26149|0;G=F+-14234+(8?E>>>8:E)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;a[D>>0]=H;G=p*6419|0;E=C*13320|0;C=F+8708-(8?E>>>8:E)-(8?G>>>8:G)|0;if(C>>>0<16384)I=6?C>>>6:C;else I=((31?C>>31:C)&-255)+255|0;a[D+1>>0]=I;C=p*33050|0;p=F+-17685+(8?C>>>8:C)|0;if(p>>>0<16384)J=6?p>>>6:p;else J=((31?p>>31:p)&-255)+255|0;a[D+2>>0]=J;D=(1?u>>>1:u)&255;p=17?u>>>17:u;u=o*6|0;C=i+u|0;F=(d[b+q>>0]|0)*19077|0;G=8?F>>>8:F;F=p*26149|0;E=(8?F>>>8:F)+-14234+G|0;if(E>>>0<16384)K=6?E>>>6:E;else K=((31?E>>31:E)&-255)+255|0;a[C>>0]=K;E=D*6419|0;F=p*13320|0;p=8708-(8?F>>>8:F)-(8?E>>>8:E)+G|0;if(p>>>0<16384)L=6?p>>>6:p;else L=((31?p>>31:p)&-255)+255|0;a[C+1>>0]=L;p=D*33050|0;D=(8?p>>>8:p)+-17685+G|0;if(D>>>0<16384)M=6?D>>>6:D;else M=((31?D>>31:D)&-255)+255|0;a[C+2>>0]=M;if(w){C=s+n|0;s=y+r|0;y=(1?C>>>1:C)&255;D=17?C>>>17:C;C=j+x|0;x=(d[c+t>>0]|0)*19077|0;t=8?x>>>8:x;x=D*26149|0;G=(8?x>>>8:x)+-14234+t|0;if(G>>>0<16384)N=6?G>>>6:G;else N=((31?G>>31:G)&-255)+255|0;a[C>>0]=N;G=y*6419|0;x=D*13320|0;D=8708-(8?x>>>8:x)-(8?G>>>8:G)+t|0;if(D>>>0<16384)O=6?D>>>6:D;else O=((31?D>>31:D)&-255)+255|0;a[C+1>>0]=O;D=y*33050|0;y=(8?D>>>8:D)+-17685+t|0;if(y>>>0<16384)P=6?y>>>6:y;else P=((31?y>>31:y)&-255)+255|0;a[C+2>>0]=P;C=(1?s>>>1:s)&255;y=17?s>>>17:s;s=j+u|0;u=(d[c+q>>0]|0)*19077|0;q=8?u>>>8:u;u=y*26149|0;t=(8?u>>>8:u)+-14234+q|0;if(t>>>0<16384)Q=6?t>>>6:t;else Q=((31?t>>31:t)&-255)+255|0;a[s>>0]=Q;t=C*6419|0;u=y*13320|0;y=8708-(8?u>>>8:u)-(8?t>>>8:t)+q|0;if(y>>>0<16384)R=6?y>>>6:y;else R=((31?y>>31:y)&-255)+255|0;a[s+1>>0]=R;y=C*33050|0;C=(8?y>>>8:y)+-17685+q|0;if(C>>>0<16384)S=6?C>>>6:C;else S=((31?C>>31:C)&-255)+255|0;a[s+2>>0]=S}if((o|0)<(m|0)){z=v;n=r;o=o+1|0}else{A=v;B=r;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=(2?k>>>2:k)&255;n=18?k>>>18:k;k=l*3|0;z=i+k|0;i=(d[b+l>>0]|0)*19077|0;b=8?i>>>8:i;i=n*26149|0;m=(8?i>>>8:i)+-14234+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;a[z>>0]=T;T=o*6419|0;m=n*13320|0;n=8708-(8?m>>>8:m)-(8?T>>>8:T)+b|0;if(n>>>0<16384)U=6?n>>>6:n;else U=((31?n>>31:n)&-255)+255|0;a[z+1>>0]=U;U=o*33050|0;o=(8?U>>>8:U)+-17685+b|0;if(o>>>0<16384)V=6?o>>>6:o;else V=((31?o>>31:o)&-255)+255|0;a[z+2>>0]=V;if(!w)return;w=A+131074+(B*3|0)|0;B=(2?w>>>2:w)&255;A=18?w>>>18:w;w=j+k|0;k=(d[c+l>>0]|0)*19077|0;l=8?k>>>8:k;k=A*26149|0;c=(8?k>>>8:k)+-14234+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;a[w>>0]=W;W=B*6419|0;c=A*13320|0;A=8708-(8?c>>>8:c)-(8?W>>>8:W)+l|0;if(A>>>0<16384)X=6?A>>>6:A;else X=((31?A>>31:A)&-255)+255|0;a[w+1>>0]=X;X=B*33050|0;B=(8?X>>>8:X)+-17685+l|0;if(B>>>0<16384)Y=6?B>>>6:B;else Y=((31?B>>31:B)&-255)+255|0;a[w+2>>0]=Y;return}function Ic(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=18?p>>>18:p;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=q*33050|0;t=s+-17685+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;a[i>>0]=u;u=q*6419|0;q=r*13320|0;t=s+8708-(8?q>>>8:q)-(8?u>>>8:u)|0;if(t>>>0<16384)v=6?t>>>6:t;else v=((31?t>>31:t)&-255)+255|0;a[i+1>>0]=v;v=r*26149|0;r=s+-14234+(8?v>>>8:v)|0;if(r>>>0<16384)w=6?r>>>6:r;else w=((31?r>>31:r)&-255)+255|0;a[i+2>>0]=w;w=(c|0)!=0;if(w){r=n+131074+(o*3|0)|0;v=(2?r>>>2:r)&255;s=18?r>>>18:r;r=(d[c>>0]|0)*19077|0;t=8?r>>>8:r;r=v*33050|0;u=(8?r>>>8:r)+-17685+t|0;if(u>>>0<16384)x=6?u>>>6:u;else x=((31?u>>31:u)&-255)+255|0;a[j>>0]=x;x=v*6419|0;v=s*13320|0;u=8708-(8?v>>>8:v)-(8?x>>>8:x)+t|0;if(u>>>0<16384)y=6?u>>>6:u;else y=((31?u>>31:u)&-255)+255|0;a[j+1>>0]=y;y=s*26149|0;s=(8?y>>>8:y)+-14234+t|0;if(s>>>0<16384)z=6?s>>>6:s;else z=((31?s>>31:s)&-255)+255|0;a[j+2>>0]=z}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){s=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);t=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);y=s+n|0;u=y+524296+z+t|0;x=u+(y<<1)|0;y=3?x>>>3:x;x=u+(t+z<<1)|0;u=3?x>>>3:x;x=y+z|0;v=u+s|0;r=o<<1;q=r+-1|0;p=(1?x>>>1:x)&255;C=17?x>>>17:x;x=q*3|0;D=i+x|0;E=(d[b+q>>0]|0)*19077|0;F=8?E>>>8:E;E=p*33050|0;G=F+-17685+(8?E>>>8:E)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;a[D>>0]=H;G=p*6419|0;p=C*13320|0;E=F+8708-(8?p>>>8:p)-(8?G>>>8:G)|0;if(E>>>0<16384)I=6?E>>>6:E;else I=((31?E>>31:E)&-255)+255|0;a[D+1>>0]=I;E=C*26149|0;C=F+-14234+(8?E>>>8:E)|0;if(C>>>0<16384)J=6?C>>>6:C;else J=((31?C>>31:C)&-255)+255|0;a[D+2>>0]=J;D=(1?v>>>1:v)&255;C=17?v>>>17:v;v=o*6|0;E=i+v|0;F=(d[b+r>>0]|0)*19077|0;G=8?F>>>8:F;F=D*33050|0;p=(8?F>>>8:F)+-17685+G|0;if(p>>>0<16384)K=6?p>>>6:p;else K=((31?p>>31:p)&-255)+255|0;a[E>>0]=K;p=D*6419|0;D=C*13320|0;F=8708-(8?D>>>8:D)-(8?p>>>8:p)+G|0;if(F>>>0<16384)L=6?F>>>6:F;else L=((31?F>>31:F)&-255)+255|0;a[E+1>>0]=L;F=C*26149|0;C=(8?F>>>8:F)+-14234+G|0;if(C>>>0<16384)M=6?C>>>6:C;else M=((31?C>>31:C)&-255)+255|0;a[E+2>>0]=M;if(w){E=u+n|0;u=y+t|0;y=(1?E>>>1:E)&255;C=17?E>>>17:E;E=j+x|0;x=(d[c+q>>0]|0)*19077|0;q=8?x>>>8:x;x=y*33050|0;G=(8?x>>>8:x)+-17685+q|0;if(G>>>0<16384)N=6?G>>>6:G;else N=((31?G>>31:G)&-255)+255|0;a[E>>0]=N;G=y*6419|0;y=C*13320|0;x=8708-(8?y>>>8:y)-(8?G>>>8:G)+q|0;if(x>>>0<16384)O=6?x>>>6:x;else O=((31?x>>31:x)&-255)+255|0;a[E+1>>0]=O;x=C*26149|0;C=(8?x>>>8:x)+-14234+q|0;if(C>>>0<16384)P=6?C>>>6:C;else P=((31?C>>31:C)&-255)+255|0;a[E+2>>0]=P;E=(1?u>>>1:u)&255;C=17?u>>>17:u;u=j+v|0;v=(d[c+r>>0]|0)*19077|0;r=8?v>>>8:v;v=E*33050|0;q=(8?v>>>8:v)+-17685+r|0;if(q>>>0<16384)Q=6?q>>>6:q;else Q=((31?q>>31:q)&-255)+255|0;a[u>>0]=Q;q=E*6419|0;E=C*13320|0;v=8708-(8?E>>>8:E)-(8?q>>>8:q)+r|0;if(v>>>0<16384)R=6?v>>>6:v;else R=((31?v>>31:v)&-255)+255|0;a[u+1>>0]=R;v=C*26149|0;C=(8?v>>>8:v)+-14234+r|0;if(C>>>0<16384)S=6?C>>>6:C;else S=((31?C>>31:C)&-255)+255|0;a[u+2>>0]=S}if((o|0)<(m|0)){z=s;n=t;o=o+1|0}else{A=s;B=t;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=(2?k>>>2:k)&255;n=18?k>>>18:k;k=l*3|0;z=i+k|0;i=(d[b+l>>0]|0)*19077|0;b=8?i>>>8:i;i=o*33050|0;m=(8?i>>>8:i)+-17685+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;a[z>>0]=T;T=o*6419|0;o=n*13320|0;m=8708-(8?o>>>8:o)-(8?T>>>8:T)+b|0;if(m>>>0<16384)U=6?m>>>6:m;else U=((31?m>>31:m)&-255)+255|0;a[z+1>>0]=U;U=n*26149|0;n=(8?U>>>8:U)+-14234+b|0;if(n>>>0<16384)V=6?n>>>6:n;else V=((31?n>>31:n)&-255)+255|0;a[z+2>>0]=V;if(!w)return;w=A+131074+(B*3|0)|0;B=(2?w>>>2:w)&255;A=18?w>>>18:w;w=j+k|0;k=(d[c+l>>0]|0)*19077|0;l=8?k>>>8:k;k=B*33050|0;c=(8?k>>>8:k)+-17685+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;a[w>>0]=W;W=B*6419|0;B=A*13320|0;c=8708-(8?B>>>8:B)-(8?W>>>8:W)+l|0;if(c>>>0<16384)X=6?c>>>6:c;else X=((31?c>>31:c)&-255)+255|0;a[w+1>>0]=X;X=A*26149|0;A=(8?X>>>8:X)+-14234+l|0;if(A>>>0<16384)Y=6?A>>>6:A;else Y=((31?A>>31:A)&-255)+255|0;a[w+2>>0]=Y;return}function Jc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=a[b>>0]|0;a[i>>0]=-1;r=(2?p>>>2:p)&255;s=(18?p>>>18:p)&255;p=(q&255)*19077|0;q=8?p>>>8:p;p=s*26149|0;t=q+-14234+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;a[i+1>>0]=u;u=r*6419|0;t=s*13320|0;s=q+8708-(8?u>>>8:u)-(8?t>>>8:t)|0;if(s>>>0<16384)v=6?s>>>6:s;else v=((31?s>>31:s)&-255)+255|0;a[i+2>>0]=v;v=r*33050|0;r=q+-17685+(8?v>>>8:v)|0;if(r>>>0<16384)w=6?r>>>6:r;else w=((31?r>>31:r)&-255)+255|0;a[i+3>>0]=w;w=(c|0)!=0;if(w){r=n+131074+(o*3|0)|0;v=a[c>>0]|0;a[j>>0]=-1;q=(2?r>>>2:r)&255;s=(18?r>>>18:r)&255;r=(v&255)*19077|0;v=8?r>>>8:r;r=s*26149|0;t=(8?r>>>8:r)+-14234+v|0;if(t>>>0<16384)x=6?t>>>6:t;else x=((31?t>>31:t)&-255)+255|0;a[j+1>>0]=x;x=q*6419|0;t=s*13320|0;s=8708-(8?x>>>8:x)-(8?t>>>8:t)+v|0;if(s>>>0<16384)y=6?s>>>6:s;else y=((31?s>>31:s)&-255)+255|0;a[j+2>>0]=y;y=q*33050|0;q=(8?y>>>8:y)+-17685+v|0;if(q>>>0<16384)z=6?q>>>6:q;else z=((31?q>>31:q)&-255)+255|0;a[j+3>>0]=z}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){q=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);v=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);y=q+n|0;s=y+524296+z+v|0;t=s+(y<<1)|0;y=3?t>>>3:t;t=s+(v+z<<1)|0;s=3?t>>>3:t;t=y+z|0;x=s+q|0;r=o<<1;u=r+-1|0;p=a[b+u>>0]|0;C=u<<2;D=i+C|0;a[D>>0]=-1;E=(1?t>>>1:t)&255;F=(17?t>>>17:t)&255;t=(p&255)*19077|0;p=8?t>>>8:t;t=F*26149|0;G=p+-14234+(8?t>>>8:t)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;a[D+1>>0]=H;G=E*6419|0;t=F*13320|0;F=p+8708-(8?G>>>8:G)-(8?t>>>8:t)|0;if(F>>>0<16384)I=6?F>>>6:F;else I=((31?F>>31:F)&-255)+255|0;a[D+2>>0]=I;F=E*33050|0;E=p+-17685+(8?F>>>8:F)|0;if(E>>>0<16384)J=6?E>>>6:E;else J=((31?E>>31:E)&-255)+255|0;a[D+3>>0]=J;D=a[b+r>>0]|0;E=o<<3;F=i+E|0;a[F>>0]=-1;p=(1?x>>>1:x)&255;t=(17?x>>>17:x)&255;x=(D&255)*19077|0;D=8?x>>>8:x;x=t*26149|0;G=(8?x>>>8:x)+-14234+D|0;if(G>>>0<16384)K=6?G>>>6:G;else K=((31?G>>31:G)&-255)+255|0;a[F+1>>0]=K;G=p*6419|0;x=t*13320|0;t=8708-(8?G>>>8:G)-(8?x>>>8:x)+D|0;if(t>>>0<16384)L=6?t>>>6:t;else L=((31?t>>31:t)&-255)+255|0;a[F+2>>0]=L;t=p*33050|0;p=(8?t>>>8:t)+-17685+D|0;if(p>>>0<16384)M=6?p>>>6:p;else M=((31?p>>31:p)&-255)+255|0;a[F+3>>0]=M;if(w){F=s+n|0;s=y+v|0;y=a[c+u>>0]|0;u=j+C|0;a[u>>0]=-1;C=(1?F>>>1:F)&255;p=(17?F>>>17:F)&255;F=(y&255)*19077|0;y=8?F>>>8:F;F=p*26149|0;D=(8?F>>>8:F)+-14234+y|0;if(D>>>0<16384)N=6?D>>>6:D;else N=((31?D>>31:D)&-255)+255|0;a[u+1>>0]=N;D=C*6419|0;F=p*13320|0;p=8708-(8?D>>>8:D)-(8?F>>>8:F)+y|0;if(p>>>0<16384)O=6?p>>>6:p;else O=((31?p>>31:p)&-255)+255|0;a[u+2>>0]=O;p=C*33050|0;C=(8?p>>>8:p)+-17685+y|0;if(C>>>0<16384)P=6?C>>>6:C;else P=((31?C>>31:C)&-255)+255|0;a[u+3>>0]=P;u=a[c+r>>0]|0;r=j+E|0;a[r>>0]=-1;E=(1?s>>>1:s)&255;C=(17?s>>>17:s)&255;s=(u&255)*19077|0;u=8?s>>>8:s;s=C*26149|0;y=(8?s>>>8:s)+-14234+u|0;if(y>>>0<16384)Q=6?y>>>6:y;else Q=((31?y>>31:y)&-255)+255|0;a[r+1>>0]=Q;y=E*6419|0;s=C*13320|0;C=8708-(8?y>>>8:y)-(8?s>>>8:s)+u|0;if(C>>>0<16384)R=6?C>>>6:C;else R=((31?C>>31:C)&-255)+255|0;a[r+2>>0]=R;C=E*33050|0;E=(8?C>>>8:C)+-17685+u|0;if(E>>>0<16384)S=6?E>>>6:E;else S=((31?E>>31:E)&-255)+255|0;a[r+3>>0]=S}if((o|0)<(m|0)){z=q;n=v;o=o+1|0}else{A=q;B=v;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=a[b+l>>0]|0;b=l<<2;n=i+b|0;a[n>>0]=-1;i=(2?k>>>2:k)&255;z=(18?k>>>18:k)&255;k=(o&255)*19077|0;o=8?k>>>8:k;k=z*26149|0;m=(8?k>>>8:k)+-14234+o|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;a[n+1>>0]=T;T=i*6419|0;m=z*13320|0;z=8708-(8?T>>>8:T)-(8?m>>>8:m)+o|0;if(z>>>0<16384)U=6?z>>>6:z;else U=((31?z>>31:z)&-255)+255|0;a[n+2>>0]=U;U=i*33050|0;i=(8?U>>>8:U)+-17685+o|0;if(i>>>0<16384)V=6?i>>>6:i;else V=((31?i>>31:i)&-255)+255|0;a[n+3>>0]=V;if(!w)return;w=A+131074+(B*3|0)|0;B=a[c+l>>0]|0;l=j+b|0;a[l>>0]=-1;b=(2?w>>>2:w)&255;j=(18?w>>>18:w)&255;w=(B&255)*19077|0;B=8?w>>>8:w;w=j*26149|0;c=(8?w>>>8:w)+-14234+B|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;a[l+1>>0]=W;W=b*6419|0;c=j*13320|0;j=8708-(8?W>>>8:W)-(8?c>>>8:c)+B|0;if(j>>>0<16384)X=6?j>>>6:j;else X=((31?j>>31:j)&-255)+255|0;a[l+2>>0]=X;X=b*33050|0;b=(8?X>>>8:X)+-17685+B|0;if(b>>>0<16384)Y=6?b>>>6:b;else Y=((31?b>>31:b)&-255)+255|0;a[l+3>>0]=Y;return}function Kc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=18?p>>>18:p;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=r*26149|0;t=s+-14234+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;t=q*6419|0;p=r*13320|0;r=s+8708-(8?p>>>8:p)-(8?t>>>8:t)|0;if(r>>>0<16384)v=6?r>>>6:r;else v=((31?r>>31:r)&-255)+255|0;r=q*33050|0;q=s+-17685+(8?r>>>8:r)|0;if(q>>>0<16384)w=6?q>>>6:q;else w=((31?q>>31:q)&-255)+255|0;a[i>>0]=(4?v>>>4:v)|u&240;a[i+1>>0]=w|15;w=(c|0)!=0;if(w){u=n+131074+(o*3|0)|0;v=(2?u>>>2:u)&255;q=18?u>>>18:u;u=(d[c>>0]|0)*19077|0;r=8?u>>>8:u;u=q*26149|0;s=(8?u>>>8:u)+-14234+r|0;if(s>>>0<16384)x=6?s>>>6:s;else x=((31?s>>31:s)&-255)+255|0;s=v*6419|0;u=q*13320|0;q=8708-(8?u>>>8:u)-(8?s>>>8:s)+r|0;if(q>>>0<16384)y=6?q>>>6:q;else y=((31?q>>31:q)&-255)+255|0;q=v*33050|0;v=(8?q>>>8:q)+-17685+r|0;if(v>>>0<16384)z=6?v>>>6:v;else z=((31?v>>31:v)&-255)+255|0;a[j>>0]=(4?y>>>4:y)|x&240;a[j+1>>0]=z|15}if((k|0)<3){A=n;B=o}else{z=n;n=o;o=1;while(1){x=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);y=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);v=x+n|0;r=v+524296+z+y|0;q=r+(v<<1)|0;v=3?q>>>3:q;q=r+(y+z<<1)|0;r=3?q>>>3:q;q=v+z|0;s=r+x|0;u=o<<1;t=u+-1|0;p=(1?q>>>1:q)&255;C=17?q>>>17:q;q=t<<1;D=i+q|0;E=(d[b+t>>0]|0)*19077|0;F=8?E>>>8:E;E=C*26149|0;G=F+-14234+(8?E>>>8:E)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;G=p*6419|0;E=C*13320|0;C=F+8708-(8?E>>>8:E)-(8?G>>>8:G)|0;if(C>>>0<16384)I=6?C>>>6:C;else I=((31?C>>31:C)&-255)+255|0;C=p*33050|0;p=F+-17685+(8?C>>>8:C)|0;if(p>>>0<16384)J=6?p>>>6:p;else J=((31?p>>31:p)&-255)+255|0;a[D>>0]=(4?I>>>4:I)|H&240;a[D+1>>0]=J|15;D=(1?s>>>1:s)&255;p=17?s>>>17:s;s=o<<2;C=i+s|0;F=(d[b+u>>0]|0)*19077|0;G=8?F>>>8:F;F=p*26149|0;E=(8?F>>>8:F)+-14234+G|0;if(E>>>0<16384)K=6?E>>>6:E;else K=((31?E>>31:E)&-255)+255|0;E=D*6419|0;F=p*13320|0;p=8708-(8?F>>>8:F)-(8?E>>>8:E)+G|0;if(p>>>0<16384)L=6?p>>>6:p;else L=((31?p>>31:p)&-255)+255|0;p=D*33050|0;D=(8?p>>>8:p)+-17685+G|0;if(D>>>0<16384)M=6?D>>>6:D;else M=((31?D>>31:D)&-255)+255|0;a[C>>0]=(4?L>>>4:L)|K&240;a[C+1>>0]=M|15;if(w){C=r+n|0;r=v+y|0;v=(1?C>>>1:C)&255;D=17?C>>>17:C;C=j+q|0;q=(d[c+t>>0]|0)*19077|0;t=8?q>>>8:q;q=D*26149|0;G=(8?q>>>8:q)+-14234+t|0;if(G>>>0<16384)N=6?G>>>6:G;else N=((31?G>>31:G)&-255)+255|0;G=v*6419|0;q=D*13320|0;D=8708-(8?q>>>8:q)-(8?G>>>8:G)+t|0;if(D>>>0<16384)O=6?D>>>6:D;else O=((31?D>>31:D)&-255)+255|0;D=v*33050|0;v=(8?D>>>8:D)+-17685+t|0;if(v>>>0<16384)P=6?v>>>6:v;else P=((31?v>>31:v)&-255)+255|0;a[C>>0]=(4?O>>>4:O)|N&240;a[C+1>>0]=P|15;C=(1?r>>>1:r)&255;v=17?r>>>17:r;r=j+s|0;s=(d[c+u>>0]|0)*19077|0;u=8?s>>>8:s;s=v*26149|0;t=(8?s>>>8:s)+-14234+u|0;if(t>>>0<16384)Q=6?t>>>6:t;else Q=((31?t>>31:t)&-255)+255|0;t=C*6419|0;s=v*13320|0;v=8708-(8?s>>>8:s)-(8?t>>>8:t)+u|0;if(v>>>0<16384)R=6?v>>>6:v;else R=((31?v>>31:v)&-255)+255|0;v=C*33050|0;C=(8?v>>>8:v)+-17685+u|0;if(C>>>0<16384)S=6?C>>>6:C;else S=((31?C>>31:C)&-255)+255|0;a[r>>0]=(4?R>>>4:R)|Q&240;a[r+1>>0]=S|15}if((o|0)<(m|0)){z=x;n=y;o=o+1|0}else{A=x;B=y;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=(2?k>>>2:k)&255;n=18?k>>>18:k;k=l<<1;z=i+k|0;i=(d[b+l>>0]|0)*19077|0;b=8?i>>>8:i;i=n*26149|0;m=(8?i>>>8:i)+-14234+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;m=o*6419|0;i=n*13320|0;n=8708-(8?i>>>8:i)-(8?m>>>8:m)+b|0;if(n>>>0<16384)U=6?n>>>6:n;else U=((31?n>>31:n)&-255)+255|0;n=o*33050|0;o=(8?n>>>8:n)+-17685+b|0;if(o>>>0<16384)V=6?o>>>6:o;else V=((31?o>>31:o)&-255)+255|0;a[z>>0]=(4?U>>>4:U)|T&240;a[z+1>>0]=V|15;if(!w)return;w=A+131074+(B*3|0)|0;B=(2?w>>>2:w)&255;A=18?w>>>18:w;w=j+k|0;k=(d[c+l>>0]|0)*19077|0;l=8?k>>>8:k;k=A*26149|0;c=(8?k>>>8:k)+-14234+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;c=B*6419|0;k=A*13320|0;A=8708-(8?k>>>8:k)-(8?c>>>8:c)+l|0;if(A>>>0<16384)X=6?A>>>6:A;else X=((31?A>>31:A)&-255)+255|0;A=B*33050|0;B=(8?A>>>8:A)+-17685+l|0;if(B>>>0<16384)Y=6?B>>>6:B;else Y=((31?B>>31:B)&-255)+255|0;a[w>>0]=(4?X>>>4:X)|W&240;a[w+1>>0]=Y|15;return}\nfunction Lc(b,c,e,f,g,h,i,j,k){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;k=k|0;var l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0;l=k+-1|0;m=1?l>>1:l;n=(d[f>>0]|0)<<16|(d[e>>0]|0);o=(d[h>>0]|0)<<16|(d[g>>0]|0);p=(n*3|0)+131074+o|0;q=(2?p>>>2:p)&255;r=18?p>>>18:p;p=(d[b>>0]|0)*19077|0;s=8?p>>>8:p;p=r*26149|0;t=s+-14234+(8?p>>>8:p)|0;if(t>>>0<16384)u=6?t>>>6:t;else u=((31?t>>31:t)&-255)+255|0;t=q*6419|0;p=r*13320|0;r=s+8708-(8?p>>>8:p)-(8?t>>>8:t)|0;if(r>>>0<16384)v=6?r>>>6:r;else v=((31?r>>31:r)&-255)+255|0;r=q*33050|0;q=s+-17685+(8?r>>>8:r)|0;if(q>>>0<16384)w=6?q>>>6:q;else w=((31?q>>31:q)&-255)+255|0;a[i>>0]=(5?v>>>5:v)|u&248;a[i+1>>0]=(3?w>>>3:w)|v<<3&224;v=(c|0)!=0;if(v){w=n+131074+(o*3|0)|0;u=(2?w>>>2:w)&255;q=18?w>>>18:w;w=(d[c>>0]|0)*19077|0;r=8?w>>>8:w;w=q*26149|0;s=(8?w>>>8:w)+-14234+r|0;if(s>>>0<16384)x=6?s>>>6:s;else x=((31?s>>31:s)&-255)+255|0;s=u*6419|0;w=q*13320|0;q=8708-(8?w>>>8:w)-(8?s>>>8:s)+r|0;if(q>>>0<16384)y=6?q>>>6:q;else y=((31?q>>31:q)&-255)+255|0;q=u*33050|0;u=(8?q>>>8:q)+-17685+r|0;if(u>>>0<16384)z=6?u>>>6:u;else z=((31?u>>31:u)&-255)+255|0;a[j>>0]=(5?y>>>5:y)|x&248;a[j+1>>0]=(3?z>>>3:z)|y<<3&224}if((k|0)<3){A=n;B=o}else{y=n;n=o;o=1;while(1){z=(d[f+o>>0]|0)<<16|(d[e+o>>0]|0);x=(d[h+o>>0]|0)<<16|(d[g+o>>0]|0);u=z+n|0;r=u+524296+y+x|0;q=r+(u<<1)|0;u=3?q>>>3:q;q=r+(x+y<<1)|0;r=3?q>>>3:q;q=u+y|0;s=r+z|0;w=o<<1;t=w+-1|0;p=(1?q>>>1:q)&255;C=17?q>>>17:q;q=t<<1;D=i+q|0;E=(d[b+t>>0]|0)*19077|0;F=8?E>>>8:E;E=C*26149|0;G=F+-14234+(8?E>>>8:E)|0;if(G>>>0<16384)H=6?G>>>6:G;else H=((31?G>>31:G)&-255)+255|0;G=p*6419|0;E=C*13320|0;C=F+8708-(8?E>>>8:E)-(8?G>>>8:G)|0;if(C>>>0<16384)I=6?C>>>6:C;else I=((31?C>>31:C)&-255)+255|0;C=p*33050|0;p=F+-17685+(8?C>>>8:C)|0;if(p>>>0<16384)J=6?p>>>6:p;else J=((31?p>>31:p)&-255)+255|0;a[D>>0]=(5?I>>>5:I)|H&248;a[D+1>>0]=(3?J>>>3:J)|I<<3&224;D=(1?s>>>1:s)&255;p=17?s>>>17:s;s=o<<2;C=i+s|0;F=(d[b+w>>0]|0)*19077|0;G=8?F>>>8:F;F=p*26149|0;E=(8?F>>>8:F)+-14234+G|0;if(E>>>0<16384)K=6?E>>>6:E;else K=((31?E>>31:E)&-255)+255|0;E=D*6419|0;F=p*13320|0;p=8708-(8?F>>>8:F)-(8?E>>>8:E)+G|0;if(p>>>0<16384)L=6?p>>>6:p;else L=((31?p>>31:p)&-255)+255|0;p=D*33050|0;D=(8?p>>>8:p)+-17685+G|0;if(D>>>0<16384)M=6?D>>>6:D;else M=((31?D>>31:D)&-255)+255|0;a[C>>0]=(5?L>>>5:L)|K&248;a[C+1>>0]=(3?M>>>3:M)|L<<3&224;if(v){C=r+n|0;r=u+x|0;u=(1?C>>>1:C)&255;D=17?C>>>17:C;C=j+q|0;q=(d[c+t>>0]|0)*19077|0;t=8?q>>>8:q;q=D*26149|0;G=(8?q>>>8:q)+-14234+t|0;if(G>>>0<16384)N=6?G>>>6:G;else N=((31?G>>31:G)&-255)+255|0;G=u*6419|0;q=D*13320|0;D=8708-(8?q>>>8:q)-(8?G>>>8:G)+t|0;if(D>>>0<16384)O=6?D>>>6:D;else O=((31?D>>31:D)&-255)+255|0;D=u*33050|0;u=(8?D>>>8:D)+-17685+t|0;if(u>>>0<16384)P=6?u>>>6:u;else P=((31?u>>31:u)&-255)+255|0;a[C>>0]=(5?O>>>5:O)|N&248;a[C+1>>0]=(3?P>>>3:P)|O<<3&224;C=(1?r>>>1:r)&255;u=17?r>>>17:r;r=j+s|0;s=(d[c+w>>0]|0)*19077|0;w=8?s>>>8:s;s=u*26149|0;t=(8?s>>>8:s)+-14234+w|0;if(t>>>0<16384)Q=6?t>>>6:t;else Q=((31?t>>31:t)&-255)+255|0;t=C*6419|0;s=u*13320|0;u=8708-(8?s>>>8:s)-(8?t>>>8:t)+w|0;if(u>>>0<16384)R=6?u>>>6:u;else R=((31?u>>31:u)&-255)+255|0;u=C*33050|0;C=(8?u>>>8:u)+-17685+w|0;if(C>>>0<16384)S=6?C>>>6:C;else S=((31?C>>31:C)&-255)+255|0;a[r>>0]=(5?R>>>5:R)|Q&248;a[r+1>>0]=(3?S>>>3:S)|R<<3&224}if((o|0)<(m|0)){y=z;n=x;o=o+1|0}else{A=z;B=x;break}}}if(k&1|0)return;k=B+131074+(A*3|0)|0;o=(2?k>>>2:k)&255;n=18?k>>>18:k;k=l<<1;y=i+k|0;i=(d[b+l>>0]|0)*19077|0;b=8?i>>>8:i;i=n*26149|0;m=(8?i>>>8:i)+-14234+b|0;if(m>>>0<16384)T=6?m>>>6:m;else T=((31?m>>31:m)&-255)+255|0;m=o*6419|0;i=n*13320|0;n=8708-(8?i>>>8:i)-(8?m>>>8:m)+b|0;if(n>>>0<16384)U=6?n>>>6:n;else U=((31?n>>31:n)&-255)+255|0;n=o*33050|0;o=(8?n>>>8:n)+-17685+b|0;if(o>>>0<16384)V=6?o>>>6:o;else V=((31?o>>31:o)&-255)+255|0;a[y>>0]=(5?U>>>5:U)|T&248;a[y+1>>0]=(3?V>>>3:V)|U<<3&224;if(!v)return;v=A+131074+(B*3|0)|0;B=(2?v>>>2:v)&255;A=18?v>>>18:v;v=j+k|0;k=(d[c+l>>0]|0)*19077|0;l=8?k>>>8:k;k=A*26149|0;c=(8?k>>>8:k)+-14234+l|0;if(c>>>0<16384)W=6?c>>>6:c;else W=((31?c>>31:c)&-255)+255|0;c=B*6419|0;k=A*13320|0;A=8708-(8?k>>>8:k)-(8?c>>>8:c)+l|0;if(A>>>0<16384)X=6?A>>>6:A;else X=((31?A>>31:A)&-255)+255|0;A=B*33050|0;B=(8?A>>>8:A)+-17685+l|0;if(B>>>0<16384)Y=6?B>>>6:B;else Y=((31?B>>31:B)&-255)+255|0;a[v>>0]=(5?X>>>5:X)|W&248;a[v+1>>0]=(3?Y>>>3:Y)|X<<3&224;return}function Mc(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=c[d>>2]|0;g=c[e>>2]|0;h=((b|0)<0)<<31>>31;i=((a|0)<0)<<31>>31;if((b|0)>0&(f|0)==0){j=Cf(g|0,((g|0)<0)<<31>>31|0,a|0,i|0)|0;k=v()|0;l=Df(b|0,h|0,-1,-1)|0;m=Df(l|0,v()|0,j|0,k|0)|0;k=Hf(m|0,v()|0,b|0,h|0)|0;v()|0;n=k}else n=f;if((a|0)>0&(g|0)==0){f=Cf(n|0,((n|0)<0)<<31>>31|0,b|0,h|0)|0;h=v()|0;b=Df(a|0,i|0,-1,-1)|0;k=Df(b|0,v()|0,f|0,h|0)|0;h=Hf(k|0,v()|0,a|0,i|0)|0;v()|0;o=h}else o=g;if((n|0)<1|(o|0)<1){p=0;return p|0}c[d>>2]=n;c[e>>2]=o;p=1;return p|0}function Nc(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0;if(!b)g=0;else g=a[b>>0]|0;if((f|0)<=0)return;b=g;g=0;do{b=(d[c+g>>0]|0)+(b&255)&255;a[e+g>>0]=b;g=g+1|0}while((g|0)!=(f|0));return}function Oc(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0;g=(f|0)>0;if(!b){if(!g)return;h=0;i=0;do{h=(h&255)+(d[c+i>>0]|0)|0;a[e+i>>0]=h;i=i+1|0}while((i|0)!=(f|0));return}else{if(!g)return;g=0;do{a[e+g>>0]=(d[c+g>>0]|0)+(d[b+g>>0]|0);g=g+1|0}while((g|0)!=(f|0));return}}function Pc(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0;if(!b){if((f|0)<=0)return;g=0;h=0;do{g=(g&255)+(d[c+h>>0]|0)|0;a[e+h>>0]=g;h=h+1|0}while((h|0)!=(f|0));return}h=a[b>>0]|0;if((f|0)<=0)return;g=(h&255)-(h&255)+(h&255)|0;i=(g>>>0<256?g:(31?g>>>31:g)+255|0)+(d[c>>0]|0)|0;a[e>>0]=i;if((f|0)==1)return;g=1;j=i;i=h;do{h=i;i=a[b+g>>0]|0;k=(j&255)-(h&255)+(i&255)|0;j=(k>>>0<256?k:(31?k>>>31:k)+255|0)+(d[c+g>>0]|0)|0;a[e+g>>0]=j;g=g+1|0}while((g|0)!=(f|0));return}function Qc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0;a[g>>0]=a[b>>0]|0;h=b+1|0;i=g+1|0;j=c+-1|0;k=(c|0)>1;if(k){c=0;do{a[i+c>>0]=(d[h+c>>0]|0)-(d[b+c>>0]|0);c=c+1|0}while((c|0)!=(j|0))}c=b+f|0;h=g+f|0;if((e|0)<=1)return;if(!k){k=1;g=c;i=h;l=b;while(1){a[i>>0]=(d[g>>0]|0)-(d[l>>0]|0);k=k+1|0;if((k|0)==(e|0))break;else{m=g;g=g+f|0;i=i+f|0;l=m}}return}l=1;i=c;c=h;h=b;while(1){a[c>>0]=(d[i>>0]|0)-(d[h>>0]|0);b=i+1|0;g=c+1|0;k=0;do{a[g+k>>0]=(d[b+k>>0]|0)-(d[i+k>>0]|0);k=k+1|0}while((k|0)!=(j|0));l=l+1|0;if((l|0)==(e|0))break;else{k=i;i=i+f|0;c=c+f|0;h=k}}return}function Rc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0;a[g>>0]=a[b>>0]|0;h=b+1|0;i=g+1|0;j=c+-1|0;if((c|0)>1){k=0;do{a[i+k>>0]=(d[h+k>>0]|0)-(d[b+k>>0]|0);k=k+1|0}while((k|0)!=(j|0))}if(!((c|0)>0&(e|0)>1))return;j=1;k=g;g=b;do{b=g;g=g+f|0;k=k+f|0;h=0;do{a[k+h>>0]=(d[g+h>>0]|0)-(d[b+h>>0]|0);h=h+1|0}while((h|0)!=(c|0));j=j+1|0}while((j|0)!=(e|0));return}function Sc(b,c,e,f,g){b=b|0;c=c|0;e=e|0;f=f|0;g=g|0;var h=0,i=0,j=0,k=0,l=0,m=0,n=0;a[g>>0]=a[b>>0]|0;h=b+1|0;i=g+1|0;j=c+-1|0;k=(c|0)>1;if(k){l=0;do{a[i+l>>0]=(d[h+l>>0]|0)-(d[b+l>>0]|0);l=l+1|0}while((l|0)!=(j|0))}j=g+f|0;g=b+f|0;if((e|0)<=1)return;l=~f;if(!k){k=1;h=j;i=g;m=b;while(1){a[h>>0]=(d[i>>0]|0)-(d[m>>0]|0);k=k+1|0;if((k|0)==(e|0))break;else{n=i;h=h+f|0;i=i+f|0;m=n}}return}m=1;i=j;j=g;g=b;while(1){a[i>>0]=(d[j>>0]|0)-(d[g>>0]|0);b=1;do{h=(d[g+b>>0]|0)+(d[j+(b+-1)>>0]|0)-(d[j+(b+l)>>0]|0)|0;a[i+b>>0]=(d[j+b>>0]|0)-(h>>>0<256?h:(31?h>>>31:h)+255|0);b=b+1|0}while((b|0)!=(c|0));m=m+1|0;if((m|0)==(e|0))break;else{b=j;i=i+f|0;j=j+f|0;g=b}}return}function Tc(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0;if(!a){b=2;return b|0}d=(c[a+8>>2]|0)+-1|0;if((c[a>>2]|0)>>>0<=10){e=a+20|0;f=c[e>>2]|0;g=r(f,d)|0;h=a+16|0;c[h>>2]=(c[h>>2]|0)+g;c[e>>2]=0-f;b=0;return b|0}f=a+32|0;e=c[f>>2]|0;g=r(e,d)|0;h=a+16|0;c[h>>2]=(c[h>>2]|0)+g;c[f>>2]=0-e;e=1?d>>1:d;f=a+36|0;g=c[f>>2]|0;h=r(g,e)|0;i=a+20|0;c[i>>2]=(c[i>>2]|0)+h;c[f>>2]=0-g;g=a+40|0;f=c[g>>2]|0;h=r(f,e)|0;e=a+24|0;c[e>>2]=(c[e>>2]|0)+h;c[g>>2]=0-f;f=a+28|0;g=c[f>>2]|0;if(!g){b=0;return b|0}h=a+44|0;a=c[h>>2]|0;e=g+(r(a,d)|0)|0;c[f>>2]=e;c[h>>2]=0-a;b=0;return b|0}function Uc(b,d,e,f){b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0;g=Y;Y=Y+16|0;h=g+4|0;i=g;if((d|0)<1|((b|0)<1|(f|0)==0)){j=2;Y=g;return j|0}k=(e|0)!=0;if(k){if(c[e+8>>2]|0){l=c[e+20>>2]|0;m=c[e+24>>2]|0;n=c[e+12>>2]|0;o=c[e+16>>2]|0;if((m|0)<1|((l|0)<1|(o|n|0)<0)){j=2;Y=g;return j|0}if(((n&-2)+l|0)>(b|0)|((o&-2)+m|0)>(d|0)){j=2;Y=g;return j|0}else{p=l;q=m}}else{p=b;q=d}if(c[e+28>>2]|0){c[h>>2]=c[e+32>>2];c[i>>2]=c[e+36>>2];m=(Mc(p,q,h,i)|0)==0;if(m){j=2;Y=g;return j|0}else{s=c[h>>2]|0;t=c[i>>2]|0}}else{s=p;t=q}}else{s=b;t=d}c[f+4>>2]=s;d=f+8|0;c[d>>2]=t;b=c[f>>2]|0;if((t|0)<1|(s|0)<1|b>>>0>12){j=2;Y=g;return j|0}do if((c[f+12>>2]|0)<1?(q=f+80|0,(c[q>>2]|0)==0):0){p=((s|0)<0)<<31>>31;i=a[8683+b>>0]|0;h=Cf(i&255|0,0,s|0,p|0)|0;m=v()|0;if(m>>>0>0|(m|0)==0&h>>>0>4294967295){j=2;Y=g;return j|0}h=r(s,i&255)|0;i=((t|0)<0)<<31>>31;m=Cf(h|0,((h|0)<0)<<31>>31|0,t|0,i|0)|0;l=v()|0;o=b>>>0>10;if(o){n=(s+1|0)/2|0;u=(t+1|0)/2|0;w=Cf(n|0,((n|0)<0)<<31>>31|0,u|0,((u|0)<0)<<31>>31|0)|0;u=v()|0;x=(b|0)==12;y=Cf(s|0,p|0,t|0,i|0)|0;i=v()|0;z=n;A=x?s:0;B=w;C=u;D=x?y:0;E=x?i:0}else{z=0;A=0;B=0;C=0;D=0;E=0}i=Jf(B|0,C|0,1)|0;x=v()|0;y=Df(D|0,E|0,m|0,l|0)|0;l=Df(y|0,v()|0,i|0,x|0)|0;x=wa(l,v()|0,1)|0;if(!x){j=1;Y=g;return j|0}c[q>>2]=x;c[f+16>>2]=x;if(!o){c[f+20>>2]=h;c[f+24>>2]=m;break}c[f+32>>2]=h;c[f+48>>2]=m;h=x+m|0;c[f+20>>2]=h;c[f+36>>2]=z;c[f+52>>2]=B;c[f+24>>2]=h+B;c[f+40>>2]=z;c[f+56>>2]=B;if((b|0)==12)c[f+28>>2]=h+i;c[f+60>>2]=D;c[f+44>>2]=A}while(0);A=Vc(f)|0;if((A|0)!=0|k^1){j=A;Y=g;return j|0}if(!(c[e+48>>2]|0)){j=0;Y=g;return j|0}e=(c[d>>2]|0)+-1|0;if((c[f>>2]|0)>>>0<=10){d=f+20|0;A=c[d>>2]|0;k=r(A,e)|0;D=f+16|0;c[D>>2]=(c[D>>2]|0)+k;c[d>>2]=0-A;j=0;Y=g;return j|0}A=f+32|0;d=c[A>>2]|0;k=r(d,e)|0;D=f+16|0;c[D>>2]=(c[D>>2]|0)+k;c[A>>2]=0-d;d=1?e>>1:e;A=f+36|0;k=c[A>>2]|0;D=r(k,d)|0;b=f+20|0;c[b>>2]=(c[b>>2]|0)+D;c[A>>2]=0-k;k=f+40|0;A=c[k>>2]|0;D=r(A,d)|0;d=f+24|0;c[d>>2]=(c[d>>2]|0)+D;c[k>>2]=0-A;A=f+28|0;k=c[A>>2]|0;if(!k){j=0;Y=g;return j|0}D=f+44|0;f=c[D>>2]|0;d=k+(r(f,e)|0)|0;c[A>>2]=d;c[D>>2]=0-f;j=0;Y=g;return j|0}function Vc(a){a=a|0;var b=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0;b=c[a>>2]|0;e=c[a+4>>2]|0;f=c[a+8>>2]|0;if(b>>>0>12){g=2;return g|0}do if(b>>>0>10){h=(e+1|0)/2|0;i=c[a+32>>2]|0;j=(i|0)>-1?i:0-i|0;i=c[a+36>>2]|0;k=(i|0)>-1?i:0-i|0;i=c[a+40>>2]|0;l=(i|0)>-1?i:0-i|0;i=c[a+44>>2]|0;m=(i|0)>-1?i:0-i|0;i=f+-1|0;n=((i|0)<0)<<31>>31;o=Cf(j|0,((j|0)<0)<<31>>31|0,i|0,n|0)|0;p=((e|0)<0)<<31>>31;q=Df(o|0,v()|0,e|0,p|0)|0;o=v()|0;s=((f+1|0)/2|0)+-1|0;t=((s|0)<0)<<31>>31;u=Cf(k|0,((k|0)<0)<<31>>31|0,s|0,t|0)|0;w=((h|0)<0)<<31>>31;x=Df(u|0,v()|0,h|0,w|0)|0;u=v()|0;y=Cf(l|0,((l|0)<0)<<31>>31|0,s|0,t|0)|0;t=Df(y|0,v()|0,h|0,w|0)|0;w=v()|0;y=(c[a+24>>2]|0)!=0&((c[a+20>>2]|0)!=0&((c[a+16>>2]|0)!=0&((l|0)>=(h|0)&((k|0)>=(h|0)&((j|0)>=(e|0)&((o>>>0<0|((o|0)==0?q>>>0<=(c[a+48>>2]|0)>>>0:0))&(u>>>0<0|((u|0)==0?x>>>0<=(c[a+52>>2]|0)>>>0:0))&(w>>>0<0|((w|0)==0?t>>>0<=(c[a+56>>2]|0)>>>0:0))))))));if((b|0)==12){t=Cf(m|0,((m|0)<0)<<31>>31|0,i|0,n|0)|0;n=Df(t|0,v()|0,e|0,p|0)|0;p=v()|0;if((c[a+28>>2]|0)!=0&((m|0)>=(e|0)&y&(p>>>0<0|((p|0)==0?n>>>0<=(c[a+60>>2]|0)>>>0:0))))break;else g=2;return g|0}else{if(y)break;else g=2;return g|0}}else{y=c[a+20>>2]|0;n=(y|0)>-1?y:0-y|0;y=f+-1|0;p=Cf(n|0,((n|0)<0)<<31>>31|0,y|0,((y|0)<0)<<31>>31|0)|0;y=v()|0;m=r(e,d[8683+b>>0]|0)|0;t=Df(p|0,y|0,m|0,((m|0)<0)<<31>>31|0)|0;y=v()|0;if(!((c[a+16>>2]|0)!=0&((n|0)>=(m|0)&(y>>>0<0|((y|0)==0?t>>>0<=(c[a+24>>2]|0)>>>0:0))))){g=2;return g|0}}while(0);g=0;return g|0}function Wc(a,b){a=a|0;b=b|0;var d=0;if((a|0)==0|(b&-256|0)!=512){d=0;return d|0}b=a;a=b+84|0;do{c[b>>2]=0;b=b+4|0}while((b|0)<(a|0));d=1;return d|0}function Xc(a){a=a|0;var b=0;if(!a)return;b=a+80|0;if((c[a+12>>2]|0)<1)pa(c[b>>2]|0);c[b>>2]=0;return}function Yc(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=a+4|0;c[b+4>>2]=c[e>>2];f=a+8|0;c[b+8>>2]=c[f>>2];if(Vc(b)|0){g=2;return g|0}h=c[a>>2]|0;i=c[a+16>>2]|0;if(h>>>0<=10){j=r(c[e>>2]|0,d[8683+h>>0]|0)|0;Zc(i,c[a+20>>2]|0,c[b+16>>2]|0,c[b+20>>2]|0,j,c[f>>2]|0);g=0;return g|0}Zc(i,c[a+32>>2]|0,c[b+16>>2]|0,c[b+32>>2]|0,c[e>>2]|0,c[f>>2]|0);Zc(c[a+20>>2]|0,c[a+36>>2]|0,c[b+20>>2]|0,c[b+36>>2]|0,((c[e>>2]|0)+1|0)/2|0,((c[f>>2]|0)+1|0)/2|0);Zc(c[a+24>>2]|0,c[a+40>>2]|0,c[b+24>>2]|0,c[b+40>>2]|0,((c[e>>2]|0)+1|0)/2|0,((c[f>>2]|0)+1|0)/2|0);i=c[a>>2]|0;switch(i|0){case 1:case 3:case 4:case 5:case 12:break;default:if((i+-7|0)>>>0>3){g=0;return g|0}}Zc(c[a+28>>2]|0,c[a+44>>2]|0,c[b+28>>2]|0,c[b+44>>2]|0,c[e>>2]|0,c[f>>2]|0);g=0;return g|0}function Zc(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;if((f|0)<=0)return;g=f;f=a;a=c;while(1){Lf(a|0,f|0,e|0)|0;if((g|0)>1){g=g+-1|0;f=f+b|0;a=a+d|0}else break}return}function _c(a,b){a=a|0;b=b|0;var d=0;if((c[a+12>>2]|0)<=1){d=0;return d|0}if(!(b|0?((c[a>>2]|0)+-7|0)>>>0<4:0)){d=0;return d|0}d=(c[b+8>>2]|0)!=0&1;return d|0}function $c(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0;if(!a)return;e=c[a+44>>2]|0;do if((e|0)>=0){if((e|0)<=100){f=e*255|0;if((f|0)>99)g=(f|0)/100|0;else break}else g=255;f=c[b+800>>2]|0;if((f|0)<12){h=r(g,d[8696+((f|0)>0?f:0)>>0]|0)|0;f=3?h>>3:h;c[b+804>>2]=f;i=f}else i=c[b+804>>2]|0;f=c[b+832>>2]|0;if((f|0)<12){h=r(g,d[8696+((f|0)>0?f:0)>>0]|0)|0;f=3?h>>3:h;c[b+836>>2]=f;j=f}else j=c[b+836>>2]|0;f=c[b+864>>2]|0;if((f|0)<12){h=r(g,d[8696+((f|0)>0?f:0)>>0]|0)|0;f=3?h>>3:h;c[b+868>>2]=f;k=f}else k=c[b+868>>2]|0;f=c[b+896>>2]|0;if((f|0)<12){h=r(g,d[8696+((f|0)>0?f:0)>>0]|0)|0;f=3?h>>3:h;c[b+900>>2]=f;l=f}else l=c[b+900>>2]|0;if(l|(k|(j|i))|0){ad(b+544|0,1.0);c[b+540>>2]=1}}while(0);i=c[a+52>>2]|0;a=b+2372|0;c[a>>2]=i;if((i|0)>100){c[a>>2]=100;return}if((i|0)>=0)return;c[a>>2]=0;return}function ad(a,b){a=a|0;b=+b;var d=0;Lf(a+8|0,3888,220)|0;c[a>>2]=0;c[a+4>>2]=31;if(!(b<0.0))if(b>1.0)d=256;else d=~~(b*256.0)>>>0;else d=0;c[a+228>>2]=d;return}function bd(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;d=a+160|0;if((c[a+2308>>2]|0)>0?(e=c[a+2300>>2]|0,(e|0)>=(c[a+300>>2]|0)):0)f=(e|0)<=(c[a+308>>2]|0);else f=0;e=f&1;g=a+148|0;if(!(c[g>>2]|0)){c[a+164>>2]=c[a+2300>>2];c[a+168>>2]=e;cd(a,d);h=dd(a,b)|0;return h|0}i=a+124|0;j=(ed()|0)+8|0;if(!((aa[c[j>>2]&7](i)|0)&1)){h=0;return h|0}h=a+180|0;j=b;b=h+108|0;do{c[h>>2]=c[j>>2];h=h+4|0;j=j+4|0}while((h|0)<(b|0));j=a+152|0;c[d>>2]=c[j>>2];c[a+164>>2]=c[a+2300>>2];c[a+168>>2]=e;if((c[g>>2]|0)==2){g=a+176|0;e=c[g>>2]|0;h=a+2304|0;c[g>>2]=c[h>>2];c[h>>2]=e}else cd(a,d);if(!f){k=ed()|0;l=k+12|0;m=c[l>>2]|0;ea[m&31](i);n=c[j>>2]|0;o=n+1|0;p=a+156|0;q=c[p>>2]|0;r=(o|0)==(q|0);s=r?0:o;c[j>>2]=s;return 1}f=a+172|0;d=c[f>>2]|0;e=a+2260|0;c[f>>2]=c[e>>2];c[e>>2]=d;k=ed()|0;l=k+12|0;m=c[l>>2]|0;ea[m&31](i);n=c[j>>2]|0;o=n+1|0;p=a+156|0;q=c[p>>2]|0;r=(o|0)==(q|0);s=r?0:o;c[j>>2]=s;return 1}function cd(b,f){b=b|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0,Ra=0,Sa=0,Ta=0,Ua=0,Va=0,Wa=0,Xa=0,Ya=0,Za=0,_a=0,$a=0,ab=0,bb=0,cb=0,db=0,eb=0,fb=0,gb=0,hb=0,ib=0,jb=0,kb=0,lb=0,mb=0,nb=0,ob=0,pb=0,qb=0,rb=0,sb=0,tb=0,ub=0,vb=0,wb=0,xb=0,yb=0,zb=0,Ab=0,Bb=0,Cb=0,Db=0,Eb=0,Fb=0,Gb=0,Hb=0,Ib=0,Jb=0,Kb=0,Lb=0,Mb=0,Nb=0,Ob=0;g=c[f+4>>2]|0;h=c[f>>2]|0;i=c[b+2264>>2]|0;j=i+40|0;k=i+584|0;a[i+39>>0]=-127;a[i+71>>0]=-127;a[i+103>>0]=-127;a[i+135>>0]=-127;a[i+167>>0]=-127;a[i+199>>0]=-127;a[i+231>>0]=-127;a[i+263>>0]=-127;a[i+295>>0]=-127;a[i+327>>0]=-127;a[i+359>>0]=-127;a[i+391>>0]=-127;a[i+423>>0]=-127;a[i+455>>0]=-127;a[i+487>>0]=-127;a[i+519>>0]=-127;l=i+600|0;a[i+583>>0]=-127;a[i+599>>0]=-127;a[i+615>>0]=-127;a[i+631>>0]=-127;a[i+647>>0]=-127;a[i+663>>0]=-127;a[i+679>>0]=-127;a[i+695>>0]=-127;a[i+711>>0]=-127;a[i+727>>0]=-127;a[i+743>>0]=-127;a[i+759>>0]=-127;a[i+775>>0]=-127;a[i+791>>0]=-127;a[i+807>>0]=-127;a[i+823>>0]=-127;m=(g|0)>0;if(m){a[i+567>>0]=-127;a[i+551>>0]=-127;a[i+7>>0]=-127}else{n=i+7|0;o=n+21|0;do{a[n>>0]=127;n=n+1|0}while((n|0)<(o|0));n=i+551|0;o=n+9|0;do{a[n>>0]=127;n=n+1|0}while((n|0)<(o|0));n=i+567|0;o=n+9|0;do{a[n>>0]=127;n=n+1|0}while((n|0)<(o|0))}p=b+288|0;if((c[p>>2]|0)<=0)return;q=f+16|0;f=b+2252|0;s=i+8|0;t=i+552|0;u=i+568|0;v=i+24|0;w=(g|0)==0;x=i+408|0;y=i+280|0;z=i+152|0;A=w?6:5;B=w?4:0;w=b+292|0;C=i+520|0;D=i+808|0;E=i+824|0;F=h<<4;G=b+2280|0;H=h<<3;h=b+2284|0;I=b+2268|0;J=b+2272|0;K=b+2276|0;b=i+4|0;L=i+20|0;M=i+36|0;N=i+52|0;O=i+68|0;P=i+84|0;Q=i+100|0;R=i+116|0;S=i+132|0;T=i+148|0;U=i+164|0;V=i+180|0;W=i+196|0;X=i+212|0;Y=i+228|0;Z=i+244|0;_=i+260|0;$=i+276|0;aa=i+292|0;ba=i+308|0;ca=i+324|0;da=i+340|0;fa=i+356|0;ga=i+372|0;ha=i+388|0;ia=i+404|0;ja=i+420|0;ka=i+436|0;la=i+452|0;ma=i+468|0;na=i+484|0;oa=i+500|0;pa=i+516|0;qa=i+532|0;ra=i+548|0;sa=i+556|0;ta=i+564|0;ua=i+572|0;va=i+580|0;wa=i+588|0;xa=i+596|0;ya=i+604|0;za=i+612|0;Aa=i+620|0;Ba=i+628|0;Ca=i+636|0;Da=i+644|0;Ea=i+652|0;Fa=i+660|0;Ga=i+668|0;Ha=i+676|0;Ia=i+684|0;Ja=i+692|0;Ka=i+700|0;La=i+708|0;Ma=i+716|0;Na=i+724|0;Oa=i+732|0;Pa=i+740|0;Qa=i+748|0;Ra=i+756|0;Sa=i+764|0;Ta=i+772|0;Ua=i+780|0;Va=i+788|0;Wa=i+796|0;Xa=i+804|0;Ya=i+812|0;Za=i+820|0;_a=i+828|0;$a=i+72|0;ab=i+104|0;bb=i+136|0;cb=i+168|0;db=i+200|0;eb=i+232|0;fb=i+264|0;gb=i+296|0;hb=i+328|0;ib=i+360|0;jb=i+392|0;kb=i+424|0;lb=i+456|0;mb=i+488|0;nb=i+520|0;ob=i+616|0;pb=i+632|0;qb=i+648|0;rb=i+664|0;sb=i+680|0;tb=i+696|0;ub=i+712|0;vb=i+728|0;wb=i+744|0;xb=i+760|0;yb=i+776|0;zb=i+792|0;Ab=i+808|0;Bb=i+824|0;i=0;do{Cb=c[q>>2]|0;Db=(i|0)==0;if(!Db){Eb=d[L>>0]|d[L+1>>0]<<8|d[L+2>>0]<<16|d[L+3>>0]<<24;a[b>>0]=Eb;a[b+1>>0]=Eb>>8;a[b+2>>0]=Eb>>16;a[b+3>>0]=Eb>>24;Eb=d[N>>0]|d[N+1>>0]<<8|d[N+2>>0]<<16|d[N+3>>0]<<24;a[M>>0]=Eb;a[M+1>>0]=Eb>>8;a[M+2>>0]=Eb>>16;a[M+3>>0]=Eb>>24;Eb=d[P>>0]|d[P+1>>0]<<8|d[P+2>>0]<<16|d[P+3>>0]<<24;a[O>>0]=Eb;a[O+1>>0]=Eb>>8;a[O+2>>0]=Eb>>16;a[O+3>>0]=Eb>>24;Eb=d[R>>0]|d[R+1>>0]<<8|d[R+2>>0]<<16|d[R+3>>0]<<24;a[Q>>0]=Eb;a[Q+1>>0]=Eb>>8;a[Q+2>>0]=Eb>>16;a[Q+3>>0]=Eb>>24;Eb=d[T>>0]|d[T+1>>0]<<8|d[T+2>>0]<<16|d[T+3>>0]<<24;a[S>>0]=Eb;a[S+1>>0]=Eb>>8;a[S+2>>0]=Eb>>16;a[S+3>>0]=Eb>>24;Eb=d[V>>0]|d[V+1>>0]<<8|d[V+2>>0]<<16|d[V+3>>0]<<24;a[U>>0]=Eb;a[U+1>>0]=Eb>>8;a[U+2>>0]=Eb>>16;a[U+3>>0]=Eb>>24;Eb=d[X>>0]|d[X+1>>0]<<8|d[X+2>>0]<<16|d[X+3>>0]<<24;a[W>>0]=Eb;a[W+1>>0]=Eb>>8;a[W+2>>0]=Eb>>16;a[W+3>>0]=Eb>>24;Eb=d[Z>>0]|d[Z+1>>0]<<8|d[Z+2>>0]<<16|d[Z+3>>0]<<24;a[Y>>0]=Eb;a[Y+1>>0]=Eb>>8;a[Y+2>>0]=Eb>>16;a[Y+3>>0]=Eb>>24;Eb=d[$>>0]|d[$+1>>0]<<8|d[$+2>>0]<<16|d[$+3>>0]<<24;a[_>>0]=Eb;a[_+1>>0]=Eb>>8;a[_+2>>0]=Eb>>16;a[_+3>>0]=Eb>>24;Eb=d[ba>>0]|d[ba+1>>0]<<8|d[ba+2>>0]<<16|d[ba+3>>0]<<24;a[aa>>0]=Eb;a[aa+1>>0]=Eb>>8;a[aa+2>>0]=Eb>>16;a[aa+3>>0]=Eb>>24;Eb=d[da>>0]|d[da+1>>0]<<8|d[da+2>>0]<<16|d[da+3>>0]<<24;a[ca>>0]=Eb;a[ca+1>>0]=Eb>>8;a[ca+2>>0]=Eb>>16;a[ca+3>>0]=Eb>>24;Eb=d[ga>>0]|d[ga+1>>0]<<8|d[ga+2>>0]<<16|d[ga+3>>0]<<24;a[fa>>0]=Eb;a[fa+1>>0]=Eb>>8;a[fa+2>>0]=Eb>>16;a[fa+3>>0]=Eb>>24;Eb=d[ia>>0]|d[ia+1>>0]<<8|d[ia+2>>0]<<16|d[ia+3>>0]<<24;a[ha>>0]=Eb;a[ha+1>>0]=Eb>>8;a[ha+2>>0]=Eb>>16;a[ha+3>>0]=Eb>>24;Eb=d[ka>>0]|d[ka+1>>0]<<8|d[ka+2>>0]<<16|d[ka+3>>0]<<24;a[ja>>0]=Eb;a[ja+1>>0]=Eb>>8;a[ja+2>>0]=Eb>>16;a[ja+3>>0]=Eb>>24;Eb=d[ma>>0]|d[ma+1>>0]<<8|d[ma+2>>0]<<16|d[ma+3>>0]<<24;a[la>>0]=Eb;a[la+1>>0]=Eb>>8;a[la+2>>0]=Eb>>16;a[la+3>>0]=Eb>>24;Eb=d[oa>>0]|d[oa+1>>0]<<8|d[oa+2>>0]<<16|d[oa+3>>0]<<24;a[na>>0]=Eb;a[na+1>>0]=Eb>>8;a[na+2>>0]=Eb>>16;a[na+3>>0]=Eb>>24;Eb=d[qa>>0]|d[qa+1>>0]<<8|d[qa+2>>0]<<16|d[qa+3>>0]<<24;a[pa>>0]=Eb;a[pa+1>>0]=Eb>>8;a[pa+2>>0]=Eb>>16;a[pa+3>>0]=Eb>>24;Eb=d[sa>>0]|d[sa+1>>0]<<8|d[sa+2>>0]<<16|d[sa+3>>0]<<24;a[ra>>0]=Eb;a[ra+1>>0]=Eb>>8;a[ra+2>>0]=Eb>>16;a[ra+3>>0]=Eb>>24;Eb=d[ua>>0]|d[ua+1>>0]<<8|d[ua+2>>0]<<16|d[ua+3>>0]<<24;a[ta>>0]=Eb;a[ta+1>>0]=Eb>>8;a[ta+2>>0]=Eb>>16;a[ta+3>>0]=Eb>>24;Eb=d[wa>>0]|d[wa+1>>0]<<8|d[wa+2>>0]<<16|d[wa+3>>0]<<24;a[va>>0]=Eb;a[va+1>>0]=Eb>>8;a[va+2>>0]=Eb>>16;a[va+3>>0]=Eb>>24;Eb=d[ya>>0]|d[ya+1>>0]<<8|d[ya+2>>0]<<16|d[ya+3>>0]<<24;a[xa>>0]=Eb;a[xa+1>>0]=Eb>>8;a[xa+2>>0]=Eb>>16;a[xa+3>>0]=Eb>>24;Eb=d[Aa>>0]|d[Aa+1>>0]<<8|d[Aa+2>>0]<<16|d[Aa+3>>0]<<24;a[za>>0]=Eb;a[za+1>>0]=Eb>>8;a[za+2>>0]=Eb>>16;a[za+3>>0]=Eb>>24;Eb=d[Ca>>0]|d[Ca+1>>0]<<8|d[Ca+2>>0]<<16|d[Ca+3>>0]<<24;a[Ba>>0]=Eb;a[Ba+1>>0]=Eb>>8;a[Ba+2>>0]=Eb>>16;a[Ba+3>>0]=Eb>>24;Eb=d[Ea>>0]|d[Ea+1>>0]<<8|d[Ea+2>>0]<<16|d[Ea+3>>0]<<24;a[Da>>0]=Eb;a[Da+1>>0]=Eb>>8;a[Da+2>>0]=Eb>>16;a[Da+3>>0]=Eb>>24;Eb=d[Ga>>0]|d[Ga+1>>0]<<8|d[Ga+2>>0]<<16|d[Ga+3>>0]<<24;a[Fa>>0]=Eb;a[Fa+1>>0]=Eb>>8;a[Fa+2>>0]=Eb>>16;a[Fa+3>>0]=Eb>>24;Eb=d[Ia>>0]|d[Ia+1>>0]<<8|d[Ia+2>>0]<<16|d[Ia+3>>0]<<24;a[Ha>>0]=Eb;a[Ha+1>>0]=Eb>>8;a[Ha+2>>0]=Eb>>16;a[Ha+3>>0]=Eb>>24;Eb=d[Ka>>0]|d[Ka+1>>0]<<8|d[Ka+2>>0]<<16|d[Ka+3>>0]<<24;a[Ja>>0]=Eb;a[Ja+1>>0]=Eb>>8;a[Ja+2>>0]=Eb>>16;a[Ja+3>>0]=Eb>>24;Eb=d[Ma>>0]|d[Ma+1>>0]<<8|d[Ma+2>>0]<<16|d[Ma+3>>0]<<24;a[La>>0]=Eb;a[La+1>>0]=Eb>>8;a[La+2>>0]=Eb>>16;a[La+3>>0]=Eb>>24;Eb=d[Oa>>0]|d[Oa+1>>0]<<8|d[Oa+2>>0]<<16|d[Oa+3>>0]<<24;a[Na>>0]=Eb;a[Na+1>>0]=Eb>>8;a[Na+2>>0]=Eb>>16;a[Na+3>>0]=Eb>>24;Eb=d[Qa>>0]|d[Qa+1>>0]<<8|d[Qa+2>>0]<<16|d[Qa+3>>0]<<24;a[Pa>>0]=Eb;a[Pa+1>>0]=Eb>>8;a[Pa+2>>0]=Eb>>16;a[Pa+3>>0]=Eb>>24;Eb=d[Sa>>0]|d[Sa+1>>0]<<8|d[Sa+2>>0]<<16|d[Sa+3>>0]<<24;a[Ra>>0]=Eb;a[Ra+1>>0]=Eb>>8;a[Ra+2>>0]=Eb>>16;a[Ra+3>>0]=Eb>>24;Eb=d[Ua>>0]|d[Ua+1>>0]<<8|d[Ua+2>>0]<<16|d[Ua+3>>0]<<24;a[Ta>>0]=Eb;a[Ta+1>>0]=Eb>>8;a[Ta+2>>0]=Eb>>16;a[Ta+3>>0]=Eb>>24;Eb=d[Wa>>0]|d[Wa+1>>0]<<8|d[Wa+2>>0]<<16|d[Wa+3>>0]<<24;a[Va>>0]=Eb;a[Va+1>>0]=Eb>>8;a[Va+2>>0]=Eb>>16;a[Va+3>>0]=Eb>>24;Eb=d[Ya>>0]|d[Ya+1>>0]<<8|d[Ya+2>>0]<<16|d[Ya+3>>0]<<24;a[Xa>>0]=Eb;a[Xa+1>>0]=Eb>>8;a[Xa+2>>0]=Eb>>16;a[Xa+3>>0]=Eb>>24;Eb=d[_a>>0]|d[_a+1>>0]<<8|d[_a+2>>0]<<16|d[_a+3>>0]<<24;a[Za>>0]=Eb;a[Za+1>>0]=Eb>>8;a[Za+2>>0]=Eb>>16;a[Za+3>>0]=Eb>>24}Eb=c[f>>2]|0;Fb=Eb+(i<<5)|0;Gb=c[Cb+(i*800|0)+788>>2]|0;if(m){n=s;Hb=Fb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));Ib=Eb+(i<<5)+16|0;Jb=Ib;Kb=d[Jb>>0]|d[Jb+1>>0]<<8|d[Jb+2>>0]<<16|d[Jb+3>>0]<<24;Jb=Ib+4|0;Ib=d[Jb>>0]|d[Jb+1>>0]<<8|d[Jb+2>>0]<<16|d[Jb+3>>0]<<24;Jb=t;Lb=Jb;a[Lb>>0]=Kb;a[Lb+1>>0]=Kb>>8;a[Lb+2>>0]=Kb>>16;a[Lb+3>>0]=Kb>>24;Kb=Jb+4|0;a[Kb>>0]=Ib;a[Kb+1>>0]=Ib>>8;a[Kb+2>>0]=Ib>>16;a[Kb+3>>0]=Ib>>24;Ib=Eb+(i<<5)+24|0;Kb=Ib;Jb=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Ib+4|0;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=u;Lb=Kb;a[Lb>>0]=Jb;a[Lb+1>>0]=Jb>>8;a[Lb+2>>0]=Jb>>16;a[Lb+3>>0]=Jb>>24;Jb=Kb+4|0;a[Jb>>0]=Ib;a[Jb+1>>0]=Ib>>8;a[Jb+2>>0]=Ib>>16;a[Jb+3>>0]=Ib>>24}a:do if(!(a[Cb+(i*800|0)+768>>0]|0)){Ib=a[Cb+(i*800|0)+769>>0]|0;Jb=Db?A:B;ea[c[9344+((Ib<<24>>24==0?Jb:Ib&255)<<2)>>2]&31](j);if(!Gb)Mb=Jb;else{Ib=Gb;Kb=0;while(1){Lb=Cb+(i*800|0)+(Kb<<4<<1)|0;Nb=j+(e[4112+(Kb<<1)>>1]|0)|0;switch((30?Ib>>>30:Ib)&3){case 3:{vd(Lb,Nb,0);break}case 2:{xd(Lb,Nb);break}case 1:{wd(Lb,Nb);break}default:{}}Kb=Kb+1|0;if((Kb|0)==16){Mb=Jb;break a}else Ib=Ib<<2}}}else{do if(m)if((i|0)<((c[p>>2]|0)+-1|0)){Ib=Fb+32|0;Jb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;a[v>>0]=Jb;a[v+1>>0]=Jb>>8;a[v+2>>0]=Jb>>16;a[v+3>>0]=Jb>>24;Ob=Jb;break}else{Jb=a[Eb+(i<<5)+15>>0]|0;Nf(v|0,Jb|0,4)|0;Ib=Jb&255;Jb=Ib<<8|Ib;Ob=Jb|Jb<<16;break}else Ob=c[v>>2]|0;while(0);c[x>>2]=Ob;c[y>>2]=Ob;c[z>>2]=Ob;Jb=Gb;Ib=0;while(1){Kb=j+(e[4112+(Ib<<1)>>1]|0)|0;ea[c[9376+((a[Cb+(i*800|0)+769+Ib>>0]&255)<<2)>>2]&31](Kb);Nb=Cb+(i*800|0)+(Ib<<4<<1)|0;switch((30?Jb>>>30:Jb)&3){case 3:{vd(Nb,Kb,0);break}case 2:{xd(Nb,Kb);break}case 1:{wd(Nb,Kb);break}default:{}}Ib=Ib+1|0;if((Ib|0)==16)break;else Jb=Jb<<2}Mb=Db?A:B}while(0);Db=c[Cb+(i*800|0)+792>>2]|0;Gb=a[Cb+(i*800|0)+785>>0]|0;Jb=9424+((Gb<<24>>24==0?Mb:Gb&255)<<2)|0;ea[c[Jb>>2]&31](k);ea[c[Jb>>2]&31](l);Jb=Cb+(i*800|0)+512|0;do if(Db&255|0)if(!(Db&170)){zd(Jb,k);break}else{yd(Jb,k);break}while(0);Jb=Cb+(i*800|0)+640|0;do if(Db&65280|0)if(!(Db&43520)){zd(Jb,l);break}else{yd(Jb,l);break}while(0);if((g|0)<((c[w>>2]|0)+-1|0)){n=Fb;Hb=C;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));Fb=D;Jb=Fb;Db=d[Jb>>0]|d[Jb+1>>0]<<8|d[Jb+2>>0]<<16|d[Jb+3>>0]<<24;Jb=Fb+4|0;Fb=d[Jb>>0]|d[Jb+1>>0]<<8|d[Jb+2>>0]<<16|d[Jb+3>>0]<<24;Jb=Eb+(i<<5)+16|0;Cb=Jb;a[Cb>>0]=Db;a[Cb+1>>0]=Db>>8;a[Cb+2>>0]=Db>>16;a[Cb+3>>0]=Db>>24;Db=Jb+4|0;a[Db>>0]=Fb;a[Db+1>>0]=Fb>>8;a[Db+2>>0]=Fb>>16;a[Db+3>>0]=Fb>>24;Fb=E;Db=Fb;Jb=d[Db>>0]|d[Db+1>>0]<<8|d[Db+2>>0]<<16|d[Db+3>>0]<<24;Db=Fb+4|0;Fb=d[Db>>0]|d[Db+1>>0]<<8|d[Db+2>>0]<<16|d[Db+3>>0]<<24;Db=Eb+(i<<5)+24|0;Cb=Db;a[Cb>>0]=Jb;a[Cb+1>>0]=Jb>>8;a[Cb+2>>0]=Jb>>16;a[Cb+3>>0]=Jb>>24;Jb=Db+4|0;a[Jb>>0]=Fb;a[Jb+1>>0]=Fb>>8;a[Jb+2>>0]=Fb>>16;a[Jb+3>>0]=Fb>>24}Fb=r(F,c[G>>2]|0)|0;Jb=c[h>>2]|0;Db=(c[I>>2]|0)+(i<<4)+Fb|0;Fb=i<<3;Cb=(c[J>>2]|0)+Fb|0;Gb=(c[K>>2]|0)+Fb|0;n=Db;Hb=j;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+(c[G>>2]|0)|0;Hb=$a;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+(c[G>>2]<<1)|0;Hb=ab;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*3|0)|0;Hb=bb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+(c[G>>2]<<2)|0;Hb=cb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*5|0)|0;Hb=db;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*6|0)|0;Hb=eb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*7|0)|0;Hb=fb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+(c[G>>2]<<3)|0;Hb=gb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*9|0)|0;Hb=hb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*10|0)|0;Hb=ib;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*11|0)|0;Hb=jb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*12|0)|0;Hb=kb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*13|0)|0;Hb=lb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*14|0)|0;Hb=mb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));n=Db+((c[G>>2]|0)*15|0)|0;Hb=nb;o=n+16|0;do{a[n>>0]=a[Hb>>0]|0;n=n+1|0;Hb=Hb+1|0}while((n|0)<(o|0));Db=r(Jb,H)|0;Eb=Cb+Db|0;Fb=Gb+Db|0;Db=k;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=l;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=ob;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+(c[h>>2]|0)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=pb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+(c[h>>2]|0)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=qb;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+(c[h>>2]<<1)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=rb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+(c[h>>2]<<1)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=sb;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+((c[h>>2]|0)*3|0)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=tb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+((c[h>>2]|0)*3|0)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=ub;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+(c[h>>2]<<2)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=vb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+(c[h>>2]<<2)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=wb;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+((c[h>>2]|0)*5|0)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=xb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+((c[h>>2]|0)*5|0)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=yb;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+((c[h>>2]|0)*6|0)|0;Nb=Ib;a[Nb>>0]=Kb;a[Nb+1>>0]=Kb>>8;a[Nb+2>>0]=Kb>>16;a[Nb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=zb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+((c[h>>2]|0)*6|0)|0;Nb=Kb;a[Nb>>0]=Ib;a[Nb+1>>0]=Ib>>8;a[Nb+2>>0]=Ib>>16;a[Nb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;Db=Ab;Ib=Db;Kb=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Db+4|0;Db=d[Ib>>0]|d[Ib+1>>0]<<8|d[Ib+2>>0]<<16|d[Ib+3>>0]<<24;Ib=Eb+((c[h>>2]|0)*7|0)|0;Eb=Ib;a[Eb>>0]=Kb;a[Eb+1>>0]=Kb>>8;a[Eb+2>>0]=Kb>>16;a[Eb+3>>0]=Kb>>24;Kb=Ib+4|0;a[Kb>>0]=Db;a[Kb+1>>0]=Db>>8;a[Kb+2>>0]=Db>>16;a[Kb+3>>0]=Db>>24;Db=Bb;Kb=Db;Ib=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Db+4|0;Db=d[Kb>>0]|d[Kb+1>>0]<<8|d[Kb+2>>0]<<16|d[Kb+3>>0]<<24;Kb=Fb+((c[h>>2]|0)*7|0)|0;Fb=Kb;a[Fb>>0]=Ib;a[Fb+1>>0]=Ib>>8;a[Fb+2>>0]=Ib>>16;a[Fb+3>>0]=Ib>>24;Ib=Kb+4|0;a[Ib>>0]=Db;a[Ib+1>>0]=Db>>8;a[Ib+2>>0]=Db>>16;a[Ib+3>>0]=Db>>24;i=i+1|0}while((i|0)<(c[p>>2]|0));return}function dd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,ba=0;f=Y;Y=Y+64|0;g=f;h=b+160|0;i=c[h>>2]|0;j=b+2308|0;k=d[8708+(c[j>>2]|0)>>0]|0;l=b+2280|0;m=c[l>>2]|0;n=r(m,k)|0;o=b+2284|0;p=c[o>>2]|0;q=r(1?k>>>1:k,p)|0;s=r(m,i<<4)|0;m=r(p,i<<3)|0;p=b+2268|0;t=0-n|0;u=(c[p>>2]|0)+t+s|0;v=b+2272|0;w=0-q|0;x=(c[v>>2]|0)+w+m|0;y=b+2276|0;z=(c[y>>2]|0)+w+m|0;A=b+164|0;B=c[A>>2]|0;C=(B|0)==0;D=(B|0)>=((c[b+308>>2]|0)+-1|0);if((c[b+148>>2]|0)==2)cd(b,h);if(c[b+168>>2]|0?(E=c[b+296>>2]|0,F=b+304|0,(E|0)<(c[F>>2]|0)):0){G=b+172|0;H=(c[A>>2]|0)>0;A=E;do{E=c[h>>2]|0;I=c[l>>2]|0;J=c[G>>2]|0;K=(c[p>>2]|0)+(r(E<<4,I)|0)+(A<<4)|0;L=d[J+(A<<2)+1>>0]|0;M=a[J+(A<<2)>>0]|0;N=M&255;do if(M<<24>>24)if((c[j>>2]|0)==1){if((A|0)>0)Gd(K,I,N+4|0);O=J+(A<<2)+2|0;if(a[O>>0]|0)Id(K,I,N);if(H)Fd(K,I,N+4|0);if(!(a[O>>0]|0))break;Hd(K,I,N);break}else{O=c[o>>2]|0;P=r(O,E<<3)|0;Q=A<<3;R=(c[v>>2]|0)+P+Q|0;S=(c[y>>2]|0)+P+Q|0;Q=d[J+(A<<2)+3>>0]|0;P=N+4|0;if((A|0)>0){Cd(K,I,P,L,Q);Kd(R,S,O,P,L,Q)}T=J+(A<<2)+2|0;if(a[T>>0]|0){Jd(K,I,N,L,Q);Ld(R,S,O,N,L,Q)}if(H){Ad(K,I,P,L,Q);Dd(R,S,O,P,L,Q)}if(!(a[T>>0]|0))break;Bd(K,I,N,L,Q);Ed(R,S,O,N,L,Q);break}while(0);A=A+1|0}while((A|0)<(c[F>>2]|0))}if(c[b+540>>2]|0?(F=c[b+296>>2]|0,A=b+304|0,H=c[A>>2]|0,(F|0)<(H|0)):0){j=b+176|0;G=b+544|0;L=b+548|0;N=F;F=H;while(1){H=c[o>>2]|0;I=(c[j>>2]|0)+(N*800|0)+796|0;K=a[I>>0]|0;if((K&255)>3){J=K&255;K=c[v>>2]|0;E=r(c[h>>2]<<3,H)|0;M=c[y>>2]|0;Q=0;O=c[G>>2]|0;S=c[L>>2]|0;do{R=b+552+(O<<2)|0;T=(c[R>>2]|0)-(c[b+552+(S<<2)>>2]|0)|0;c[R>>2]=T&2147483647;R=(c[G>>2]|0)+1|0;O=(R|0)==55?0:R;c[G>>2]=O;R=(c[L>>2]|0)+1|0;S=(R|0)==55?0:R;c[L>>2]=S;R=T<<1;T=r(24?R>>24:R,J)|0;a[g+Q>>0]=(8?T>>>8:T)+128;Q=Q+1|0}while((Q|0)!=64);Q=N<<3;ie(g,K+E+Q|0,H);J=d[I>>0]|0;S=0;O=c[G>>2]|0;T=c[L>>2]|0;do{R=b+552+(O<<2)|0;P=(c[R>>2]|0)-(c[b+552+(T<<2)>>2]|0)|0;c[R>>2]=P&2147483647;R=(c[G>>2]|0)+1|0;O=(R|0)==55?0:R;c[G>>2]=O;R=(c[L>>2]|0)+1|0;T=(R|0)==55?0:R;c[L>>2]=T;R=P<<1;P=r(24?R>>24:R,J)|0;a[g+S>>0]=(8?P>>>8:P)+128;S=S+1|0}while((S|0)!=64);ie(g,M+E+Q|0,H);U=c[A>>2]|0}else U=F;N=N+1|0;if((N|0)>=(U|0))break;else F=U}}U=e+44|0;if(c[U>>2]|0){F=B<<4;if(C){c[e+20>>2]=(c[p>>2]|0)+s;c[e+24>>2]=(c[v>>2]|0)+m;V=0;W=(c[y>>2]|0)+m|0}else{c[e+20>>2]=u;c[e+24>>2]=x;V=F-k|0;W=z}c[e+28>>2]=W;W=F+16+(D?0:0-k|0)|0;k=c[e+88>>2]|0;F=(W|0)>(k|0)?k:W;W=e+104|0;c[W>>2]=0;if((c[b+2348>>2]|0)!=0&(F|0)>(V|0)){k=ua(b,e,V,F-V|0)|0;c[W>>2]=k;if(!k){X=md(b,3,8711)|0;Y=f;return X|0}else Z=k}else Z=0;k=c[e+84>>2]|0;if((k|0)>(V|0)){m=k-V|0;s=r(c[l>>2]|0,m)|0;C=e+20|0;c[C>>2]=(c[C>>2]|0)+s;s=r(c[o>>2]|0,1?m>>1:m)|0;C=e+24|0;c[C>>2]=(c[C>>2]|0)+s;C=e+28|0;c[C>>2]=(c[C>>2]|0)+s;if(!Z){_=k;$=0}else{s=Z+(r(c[e>>2]|0,m)|0)|0;c[W>>2]=s;_=k;$=s}}else{_=V;$=Z}if((F|0)>(_|0)){Z=c[e+76>>2]|0;V=e+20|0;c[V>>2]=(c[V>>2]|0)+Z;V=1?Z>>1:Z;s=e+24|0;c[s>>2]=(c[s>>2]|0)+V;s=e+28|0;c[s>>2]=(c[s>>2]|0)+V;if($|0)c[W>>2]=$+Z;c[e+8>>2]=_-k;c[e+12>>2]=(c[e+80>>2]|0)-Z;c[e+16>>2]=F-_;ba=aa[c[U>>2]&7](e)|0}else ba=1}else ba=1;if(D|(i+1|0)!=(c[b+156>>2]|0)){X=ba;Y=f;return X|0}Lf((c[p>>2]|0)+t|0,u+(c[l>>2]<<4)|0,n|0)|0;Lf((c[v>>2]|0)+w|0,x+(c[o>>2]<<3)|0,q|0)|0;Lf((c[y>>2]|0)+w|0,z+(c[o>>2]<<3)|0,q|0)|0;X=ba;Y=f;return X|0}function ed(){return 8140}function fd(a){a=a|0;c[a>>2]=0;c[a+4>>2]=0;c[a+8>>2]=0;c[a+12>>2]=0;c[a+16>>2]=0;c[a+20>>2]=0;return}function gd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0;b=a+20|0;c[b>>2]=0;d=a+4|0;e=c[d>>2]|0;switch(e|0){case 0:{f=va(1,0,80)|0;c[a>>2]=f;if(!f){g=0;return g|0}do if(!(Se(f,0)|0)){h=f+28|0;if(Q(h|0,0)|0){Ve(f)|0;break}Te(f)|0;if(T(f+76|0,0,6,a|0)|0){Ue(f)|0;Ve(f)|0;P(h|0)|0;break}c[d>>2]=1;Ue(f)|0;g=1;return g|0}while(0);pa(f);c[a>>2]=0;g=0;return g|0}case 1:{g=e;return g|0}default:{e=c[a>>2]|0;if(!e){g=1;return g|0}Te(e)|0;if((c[d>>2]|0)>>>0>=2){a=e+28|0;do S(a|0,e|0)|0;while((c[d>>2]|0)!=1)}Ue(e)|0;g=(c[b>>2]|0)==0&1;return g|0}}return 0}function hd(a){a=a|0;var b=0,d=0,e=0;b=c[a>>2]|0;if(b|0){Te(b)|0;d=a+4|0;if((c[d>>2]|0)>>>0>=2){e=b+28|0;do S(e|0,b|0)|0;while((c[d>>2]|0)!=1)}Ue(b)|0}return (c[a+20>>2]|0)==0|0}function id(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;if(!b)return;Te(b)|0;d=a+4|0;switch(c[d>>2]|0){case 0:break;case 1:{e=b+28|0;f=6;break}default:{a=b+28|0;do S(a|0,b|0)|0;while((c[d>>2]|0)!=1);e=a;f=6}}if((f|0)==6){c[d>>2]=2;R(e|0)|0}Ue(b)|0;return}function jd(a){a=a|0;var b=0,d=0;b=c[a+8>>2]|0;if(!b)return;d=(ba[b&31](c[a+12>>2]|0,c[a+16>>2]|0)|0)==0&1;b=a+20|0;c[b>>2]=c[b>>2]|d;return}function kd(a){a=a|0;var b=0,d=0,e=0,f=0,g=0;b=c[a>>2]|0;if(!b)return;Te(b)|0;d=a+4|0;switch(c[d>>2]|0){case 0:break;case 1:{e=b+28|0;f=6;break}default:{g=b+28|0;do S(g|0,b|0)|0;while((c[d>>2]|0)!=1);e=g;f=6}}if((f|0)==6){c[d>>2]=0;R(e|0)|0}Ue(b)|0;U(c[b+76>>2]|0,0)|0;Ve(b)|0;P(b+28|0)|0;pa(b);c[a>>2]=0;return}function ld(a){a=a|0;var b=0,d=0,e=0,f=0;b=c[a>>2]|0;d=a+4|0;e=b+28|0;a:while(1){Te(b)|0;b:while(1){switch(c[d>>2]|0){case 0:{break a;break}case 2:{f=5;break b;break}case 1:break;default:{f=7;break b}}S(e|0,b|0)|0}if((f|0)==5){f=0;ea[c[8156>>2]&31](a);c[d>>2]=1;R(e|0)|0;Ue(b)|0}else if((f|0)==7){f=0;R(e|0)|0;Ue(b)|0}}R(e|0)|0;Ue(b)|0;return 0}function md(a,b,d){a=a|0;b=b|0;d=d|0;if(c[a>>2]|0)return 0;c[a>>2]=b;c[a+8>>2]=d;c[a+4>>2]=0;return 0}function nd(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;f=c[e+48>>2]|0;if(f|0?(aa[f&7](e)|0)==0:0){md(b,6,8740)|0;g=c[b>>2]|0;return g|0}f=b+2308|0;if(!(c[e+68>>2]|0)){h=c[f>>2]|0;i=d[8708+h>>0]|0;if((h|0)==2){c[b+296>>2]=0;j=i;k=2;l=b+300|0;m=11}else{n=h;o=i;m=8}}else{c[f>>2]=0;n=0;o=0;m=8}if((m|0)==8){f=(c[e+76>>2]|0)-o|0;i=b+296|0;c[i>>2]=4?f>>4:f;h=(c[e+84>>2]|0)-o|0;p=b+300|0;c[p>>2]=4?h>>4:h;if((f|0)<0)c[i>>2]=0;if((h|0)<0){j=o;k=n;l=p;m=11}else{q=o;r=n}}if((m|0)==11){c[l>>2]=0;q=j;r=k}k=q+15|0;q=k+(c[e+88>>2]|0)|0;j=4?q>>4:q;q=b+308|0;c[q>>2]=j;l=k+(c[e+80>>2]|0)|0;e=4?l>>4:l;l=c[b+288>>2]|0;c[b+304>>2]=(e|0)>(l|0)?l:e;e=c[b+292>>2]|0;if((j|0)>(e|0))c[q>>2]=e;if((r|0)<=0){g=0;return g|0}r=b+60|0;e=b+68|0;q=b+72|0;j=b+64|0;l=b+88|0;k=b+112|0;m=(c[b+104>>2]|0)==0;n=0;do{if(!m){o=a[b+120+n>>0]|0;if(!(c[k>>2]|0))s=(c[r>>2]|0)+o|0;else s=o}else s=c[r>>2]|0;if(c[e>>2]|0){o=(c[q>>2]|0)+s|0;p=(o|0)<63?o:63;h=(p|0)>0?p:0;if((o|0)>0){p=c[j>>2]|0;i=(p|0)>4?2:1;f=i?h>>>i:h;i=9-p|0;t=(p|0)>0?((f|0)>(i|0)?i:f):h;f=(t|0)>1?t:1;a[b+2312+(n<<3)+1>>0]=f;a[b+2312+(n<<3)+3>>0]=(h|0)>39?2:(h|0)>14&1;u=f+(h<<1)&255}else u=0;a[b+2312+(n<<3)>>0]=u;a[b+2312+(n<<3)+2>>0]=0;h=(c[l>>2]|0)+o|0;o=(h|0)<63?h:63;f=(o|0)>0?o:0;if((h|0)>0){h=c[j>>2]|0;o=(h|0)>4?2:1;t=o?f>>>o:f;o=9-h|0;i=(h|0)>0?((t|0)>(o|0)?o:t):f;t=(i|0)>1?i:1;a[b+2312+(n<<3)+5>>0]=t;a[b+2312+(n<<3)+7>>0]=(f|0)>39?2:(f|0)>14&1;v=t+(f<<1)&255}else v=0}else{f=(s|0)<63?s:63;t=(f|0)>0?f:0;if((s|0)>0){f=c[j>>2]|0;i=(f|0)>4?2:1;o=i?t>>>i:t;i=9-f|0;h=(f|0)>0?((o|0)>(i|0)?i:o):t;o=(h|0)>1?h:1;h=o&255;a[b+2312+(n<<3)+1>>0]=h;i=(t|0)>39?2:(t|0)>14&1;a[b+2312+(n<<3)+3>>0]=i;a[b+2312+(n<<3)+5>>0]=h;a[b+2312+(n<<3)+7>>0]=i;w=o+(t<<1)&255}else w=0;a[b+2312+(n<<3)>>0]=w;a[b+2312+(n<<3)+2>>0]=0;v=w}a[b+2312+(n<<3)+4>>0]=v;a[b+2312+(n<<3)+6>>0]=1;n=n+1|0}while((n|0)!=4);g=0;return g|0}function od(a,b){a=a|0;b=b|0;var d=0,e=0;if((c[a+148>>2]|0)>0){d=(ed()|0)+8|0;e=aa[c[d>>2]&7](a+124|0)|0}else e=1;a=c[b+52>>2]|0;if(!a)return e|0;ea[a&31](b);return e|0}function pd(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;if(!a)return 0;else return ((c[a+40>>2]|0)==0?0:(d|0)>511?2:0)|0;return 0}function qd(a,b){a=a|0;b=b|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;f=a+152|0;c[f>>2]=0;g=a+148|0;do if((c[g>>2]|0)>0){h=(ed()|0)+4|0;if(aa[c[h>>2]&7](a+124|0)|0){c[a+136>>2]=a;c[a+140>>2]=a+180;c[a+132>>2]=20;h=(c[a+2308>>2]|0)>0?3:2;c[a+156>>2]=h;i=h;break}if(!(md(a,1,8759)|0)){j=0;return j|0}else{i=c[a+156>>2]|0;break}}else{c[a+156>>2]=1;i=1}while(0);h=c[a+288>>2]|0;k=h<<2;l=h<<5;m=(h<<1)+2|0;n=a+2308|0;o=c[n>>2]|0;p=c[g>>2]|0;q=r((p|0)>0?2:1,k)|0;s=(o|0)>0?q:0;q=r(h*800|0,(p|0)==2?2:1)|0;t=i<<4;u=r(((t+(d[8708+o>>0]|0)|0)*3|0)/2|0,l)|0;if(!(c[a+2348>>2]|0)){w=0;x=0}else{o=Cf(e[a+50>>1]|0|0,0,e[a+48>>1]|0|0,0)|0;w=o;x=v()|0}o=Df(l|0,0,863,0)|0;y=Df(o|0,v()|0,k|0,0)|0;o=Df(y|0,v()|0,m|0,0)|0;y=Df(o|0,v()|0,q|0,0)|0;o=Df(y|0,v()|0,s|0,0)|0;y=Df(o|0,v()|0,u|0,0)|0;o=Df(y|0,v()|0,w|0,x|0)|0;y=v()|0;if(!((o|0)==(o|0)&(y|0)==0)){j=0;return j|0}z=a+2292|0;A=a+2288|0;B=c[A>>2]|0;do if(y>>>0>0|((y|0)==0?o>>>0>(c[z>>2]|0)>>>0:0)){pa(B);c[z>>2]=0;C=wa(o,y,1)|0;c[A>>2]=C;if(C|0){c[z>>2]=o;D=c[g>>2]|0;E=C;F=13;break}if(!(md(a,1,8789)|0)){j=0;return j|0}else{G=a+2276|0;H=a+2280|0;I=a+2284|0;J=a+2268|0;K=a+2272|0;break}}else{D=p;E=B;F=13}while(0);if((F|0)==13){F=a+2244|0;c[F>>2]=E;B=E+k|0;c[a+2252>>2]=B;E=B+l|0;l=E+2|0;c[a+2256>>2]=l;B=E+m|0;E=(s|0)==0?0:B;c[a+2260>>2]=E;c[a+160>>2]=0;c[a+172>>2]=(D|0)>0?E+(h<<2)|0:E;E=B+s+31&-32;c[a+2264>>2]=E;s=E+832|0;c[a+2304>>2]=s;E=a+176|0;c[E>>2]=s;if((D|0)==2)c[E>>2]=s+(h*800|0);E=s+q|0;q=h<<4;s=a+2280|0;c[s>>2]=q;D=h<<3;h=a+2284|0;c[h>>2]=D;B=d[8708+(c[n>>2]|0)>>0]|0;n=r(q,B)|0;p=r(1?B>>>1:B,D)|0;B=E+n|0;n=a+2268|0;c[n>>2]=B;g=B+(r(q,t)|0)+p|0;t=a+2272|0;c[t>>2]=g;q=g+(r(i<<3,D)|0)+p|0;p=a+2276|0;c[p>>2]=q;c[f>>2]=0;c[a+2364>>2]=(w|0)==0&(x|0)==0?0:E+u|0;Nf(l+-2|0,0,m|0)|0;rd(a);Nf(c[F>>2]|0,0,k|0)|0;G=p;H=s;I=h;J=n;K=t}c[b+8>>2]=0;c[b+20>>2]=c[J>>2];c[b+24>>2]=c[K>>2];c[b+28>>2]=c[G>>2];c[b+32>>2]=c[H>>2];c[b+36>>2]=c[I>>2];c[b+104>>2]=0;sd();j=1;return j|0}function rd(b){b=b|0;var d=0;d=c[b+2256>>2]|0;a[d+-2>>0]=0;a[d+-1>>0]=0;c[b+2248>>2]=0;c[b+2296>>2]=0;return}function sd(){var a=0;if(Te(10140)|0)return;if(!(c[2041]|0))a=0;else{c[2344]=6;c[2345]=7;c[2346]=8;c[2348]=9;c[2350]=10;c[2347]=11;c[2349]=12;c[2351]=13;c[2352]=14;c[2353]=15;c[2336]=16;c[2337]=17;c[2338]=18;c[2339]=19;c[2340]=20;c[2341]=21;c[2342]=22;c[2356]=23;c[2357]=24;c[2358]=25;c[2359]=26;c[2360]=27;c[2361]=28;c[2362]=29;a=c[2485]|0}c[2041]=a;Ue(10140)|0;return}function td(){return}function ud(a,d){a=a|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0;e=Y;Y=Y+64|0;f=e;g=b[a>>1]|0;h=b[a+24>>1]|0;i=h+g|0;j=b[a+8>>1]|0;k=b[a+16>>1]|0;l=k+j|0;m=j-k|0;k=g-h|0;h=l+i|0;c[f>>2]=h;g=f+32|0;c[g>>2]=i-l;l=f+16|0;c[l>>2]=m+k;i=f+48|0;c[i>>2]=k-m;m=b[a+2>>1]|0;k=b[a+26>>1]|0;j=k+m|0;n=b[a+10>>1]|0;o=b[a+18>>1]|0;p=o+n|0;q=n-o|0;o=m-k|0;k=p+j|0;c[f+4>>2]=k;m=f+36|0;c[m>>2]=j-p;p=q+o|0;c[f+20>>2]=p;j=f+52|0;c[j>>2]=o-q;q=b[a+4>>1]|0;o=b[a+28>>1]|0;n=o+q|0;r=b[a+12>>1]|0;s=b[a+20>>1]|0;t=s+r|0;u=r-s|0;s=q-o|0;o=t+n|0;c[f+8>>2]=o;q=n-t|0;c[f+40>>2]=q;t=u+s|0;c[f+24>>2]=t;n=f+56|0;c[n>>2]=s-u;u=b[a+6>>1]|0;s=b[a+30>>1]|0;r=s+u|0;v=b[a+14>>1]|0;w=b[a+22>>1]|0;a=w+v|0;x=v-w|0;w=u-s|0;s=a+r|0;c[f+12>>2]=s;u=r-a|0;c[f+44>>2]=u;a=x+w|0;c[f+28>>2]=a;r=w-x|0;c[f+60>>2]=r;f=h+3|0;h=f+s|0;x=o+k|0;w=k-o|0;o=f-s|0;s=x+h|0;b[d>>1]=3?s>>>3:s;s=w+o|0;b[d+32>>1]=3?s>>>3:s;s=h-x|0;b[d+64>>1]=3?s>>>3:s;s=o-w|0;b[d+96>>1]=3?s>>>3:s;s=(c[l>>2]|0)+3|0;l=s+a|0;w=t+p|0;o=p-t|0;t=s-a|0;a=w+l|0;b[d+128>>1]=3?a>>>3:a;a=o+t|0;b[d+160>>1]=3?a>>>3:a;a=l-w|0;b[d+192>>1]=3?a>>>3:a;a=t-o|0;b[d+224>>1]=3?a>>>3:a;a=(c[g>>2]|0)+3|0;g=a+u|0;o=c[m>>2]|0;m=q+o|0;t=o-q|0;q=a-u|0;u=m+g|0;b[d+256>>1]=3?u>>>3:u;u=t+q|0;b[d+288>>1]=3?u>>>3:u;u=g-m|0;b[d+320>>1]=3?u>>>3:u;u=q-t|0;b[d+352>>1]=3?u>>>3:u;u=(c[i>>2]|0)+3|0;i=u+r|0;t=c[j>>2]|0;j=c[n>>2]|0;n=j+t|0;q=t-j|0;j=u-r|0;r=n+i|0;b[d+384>>1]=3?r>>>3:r;r=q+j|0;b[d+416>>1]=3?r>>>3:r;r=i-n|0;b[d+448>>1]=3?r>>>3:r;r=j-q|0;b[d+480>>1]=3?r>>>3:r;Y=e;return}function vd(a,b,c){a=a|0;b=b|0;c=c|0;le(a,b);if(!c)return;le(a+32|0,b+4|0);return}function wd(c,e){c=c|0;e=e|0;var f=0,g=0;f=(b[c>>1]|0)+4|0;c=3?f>>3:f;f=c+(d[e>>0]|0)|0;a[e>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+1|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+2|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+3|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+32|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+33|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+34|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+35|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+64|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+65|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+66|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+67|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+96|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+97|0;g=c+(d[f>>0]|0)|0;a[f>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=e+98|0;f=c+(d[g>>0]|0)|0;a[g>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+99|0;e=c+(d[f>>0]|0)|0;a[f>>0]=e>>>0>255?(31?e>>>31:e)+255|0:e;return}function xd(c,e){c=c|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;f=(b[c>>1]|0)+4|0;g=b[c+8>>1]|0;h=g*35468|0;i=16?h>>16:h;h=g*20091|0;j=(16?h>>16:h)+g|0;g=b[c+2>>1]|0;c=g*35468|0;h=16?c>>16:c;c=g*20091|0;k=(16?c>>16:c)+g|0;g=j+f|0;c=g+k|0;l=(3?c>>3:c)+(d[e>>0]|0)|0;a[e>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=e+1|0;c=g+h|0;m=(3?c>>3:c)+(d[l>>0]|0)|0;a[l>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=e+2|0;l=g-h|0;c=(3?l>>3:l)+(d[m>>0]|0)|0;a[m>>0]=c>>>0>255?(31?c>>>31:c)+255|0:c;c=e+3|0;m=g-k|0;g=(3?m>>3:m)+(d[c>>0]|0)|0;a[c>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=i+f|0;c=e+32|0;m=k+g|0;l=(3?m>>3:m)+(d[c>>0]|0)|0;a[c>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=e+33|0;c=g+h|0;m=(3?c>>3:c)+(d[l>>0]|0)|0;a[l>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=e+34|0;l=g-h|0;c=(3?l>>3:l)+(d[m>>0]|0)|0;a[m>>0]=c>>>0>255?(31?c>>>31:c)+255|0:c;c=e+35|0;m=g-k|0;g=(3?m>>3:m)+(d[c>>0]|0)|0;a[c>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=f-i|0;i=e+64|0;c=k+g|0;m=(3?c>>3:c)+(d[i>>0]|0)|0;a[i>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=e+65|0;i=g+h|0;c=(3?i>>3:i)+(d[m>>0]|0)|0;a[m>>0]=c>>>0>255?(31?c>>>31:c)+255|0:c;c=e+66|0;m=g-h|0;i=(3?m>>3:m)+(d[c>>0]|0)|0;a[c>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=e+67|0;c=g-k|0;g=(3?c>>3:c)+(d[i>>0]|0)|0;a[i>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=f-j|0;j=e+96|0;f=g+k|0;i=(3?f>>3:f)+(d[j>>0]|0)|0;a[j>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=e+97|0;j=g+h|0;f=(3?j>>3:j)+(d[i>>0]|0)|0;a[i>>0]=f>>>0>255?(31?f>>>31:f)+255|0:f;f=e+98|0;i=g-h|0;h=(3?i>>3:i)+(d[f>>0]|0)|0;a[f>>0]=h>>>0>255?(31?h>>>31:h)+255|0:h;h=e+99|0;e=g-k|0;k=(3?e>>3:e)+(d[h>>0]|0)|0;a[h>>0]=k>>>0>255?(31?k>>>31:k)+255|0:k;return}function yd(a,b){a=a|0;b=b|0;vd(a,b,1);vd(a+64|0,b+128|0,1);return}function zd(a,c){a=a|0;c=c|0;var d=0;if(b[a>>1]|0)wd(a,c);d=a+32|0;if(b[d>>1]|0)wd(d,c+4|0);d=a+64|0;if(b[d>>1]|0)wd(d,c+128|0);d=a+96|0;if(!(b[d>>1]|0))return;wd(d,c+132|0);return}function Ad(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ke(a,b,1,16,c,d,e);return}function Bd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0;f=b<<2;g=a+f|0;je(g,b,1,16,c,d,e);a=g+f|0;je(a,b,1,16,c,d,e);je(a+f|0,b,1,16,c,d,e);return}function Cd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ke(a,1,b,16,c,d,e);return}function Dd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ke(a,c,1,8,d,e,f);ke(b,c,1,8,d,e,f);return}function Ed(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;var g=0;g=c<<2;je(a+g|0,c,1,8,d,e,f);je(b+g|0,c,1,8,d,e,f);return}function Fd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0;g=f<<1|1;f=r(e,-2)|0;h=0-e|0;i=c[2027]|0;j=c[2024]|0;k=c[2025]|0;l=c[2026]|0;m=0;do{n=b+m|0;o=n+h|0;p=d[o>>0]|0;q=d[n>>0]|0;s=(d[n+f>>0]|0)-(d[n+e>>0]|0)|0;if(((d[i+(p-q)>>0]<<2)+(d[i+s>>0]|0)|0)<=(g|0)){t=((q-p|0)*3|0)+(a[j+s>>0]|0)|0;s=t+4|0;u=a[k+(3?s>>3:s)>>0]|0;s=t+3|0;a[o>>0]=a[l+((a[k+(3?s>>3:s)>>0]|0)+p)>>0]|0;a[n>>0]=a[l+(q-u)>>0]|0}m=m+1|0}while((m|0)!=16);return}function Gd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0;g=f<<1|1;f=c[2027]|0;h=c[2024]|0;i=c[2025]|0;j=c[2026]|0;k=0;do{l=b+(r(k,e)|0)|0;m=l+-1|0;n=d[m>>0]|0;o=d[l>>0]|0;p=(d[l+-2>>0]|0)-(d[l+1>>0]|0)|0;if(((d[f+(n-o)>>0]<<2)+(d[f+p>>0]|0)|0)<=(g|0)){q=((o-n|0)*3|0)+(a[h+p>>0]|0)|0;p=q+4|0;s=a[i+(3?p>>3:p)>>0]|0;p=q+3|0;a[m>>0]=a[j+((a[i+(3?p>>3:p)>>0]|0)+n)>>0]|0;a[l>>0]=a[j+(o-s)>>0]|0}k=k+1|0}while((k|0)!=16);return}function Hd(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0;g=e<<2;h=f<<1|1;f=r(e,-2)|0;i=0-e|0;j=c[2027]|0;k=c[2024]|0;l=c[2025]|0;m=c[2026]|0;n=b+g|0;b=0;do{o=n+b|0;p=o+i|0;q=d[p>>0]|0;s=d[o>>0]|0;t=(d[o+f>>0]|0)-(d[o+e>>0]|0)|0;if(((d[j+(q-s)>>0]<<2)+(d[j+t>>0]|0)|0)<=(h|0)){u=((s-q|0)*3|0)+(a[k+t>>0]|0)|0;t=u+4|0;v=a[l+(3?t>>3:t)>>0]|0;t=u+3|0;a[p>>0]=a[m+((a[l+(3?t>>3:t)>>0]|0)+q)>>0]|0;a[o>>0]=a[m+(s-v)>>0]|0}b=b+1|0}while((b|0)!=16);b=n+g|0;n=0;do{v=b+n|0;s=v+i|0;o=d[s>>0]|0;q=d[v>>0]|0;t=(d[v+f>>0]|0)-(d[v+e>>0]|0)|0;if(((d[j+(o-q)>>0]<<2)+(d[j+t>>0]|0)|0)<=(h|0)){p=((q-o|0)*3|0)+(a[k+t>>0]|0)|0;t=p+4|0;u=a[l+(3?t>>3:t)>>0]|0;t=p+3|0;a[s>>0]=a[m+((a[l+(3?t>>3:t)>>0]|0)+o)>>0]|0;a[v>>0]=a[m+(q-u)>>0]|0}n=n+1|0}while((n|0)!=16);n=b+g|0;g=0;do{b=n+g|0;u=b+i|0;q=d[u>>0]|0;v=d[b>>0]|0;o=(d[b+f>>0]|0)-(d[b+e>>0]|0)|0;if(((d[j+(q-v)>>0]<<2)+(d[j+o>>0]|0)|0)<=(h|0)){t=((v-q|0)*3|0)+(a[k+o>>0]|0)|0;o=t+4|0;s=a[l+(3?o>>3:o)>>0]|0;o=t+3|0;a[u>>0]=a[m+((a[l+(3?o>>3:o)>>0]|0)+q)>>0]|0;a[b>>0]=a[m+(v-s)>>0]|0}g=g+1|0}while((g|0)!=16);return}function Id(b,e,f){b=b|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0;g=f<<1|1;f=c[2027]|0;h=c[2024]|0;i=c[2025]|0;j=c[2026]|0;k=b+4|0;l=0;do{m=k+(r(l,e)|0)|0;n=m+-1|0;o=d[n>>0]|0;p=d[m>>0]|0;q=(d[m+-2>>0]|0)-(d[m+1>>0]|0)|0;if(((d[f+(o-p)>>0]<<2)+(d[f+q>>0]|0)|0)<=(g|0)){s=((p-o|0)*3|0)+(a[h+q>>0]|0)|0;q=s+4|0;t=a[i+(3?q>>3:q)>>0]|0;q=s+3|0;a[n>>0]=a[j+((a[i+(3?q>>3:q)>>0]|0)+o)>>0]|0;a[m>>0]=a[j+(p-t)>>0]|0}l=l+1|0}while((l|0)!=16);l=b+8|0;k=0;do{t=l+(r(k,e)|0)|0;p=t+-1|0;m=d[p>>0]|0;o=d[t>>0]|0;q=(d[t+-2>>0]|0)-(d[t+1>>0]|0)|0;if(((d[f+(m-o)>>0]<<2)+(d[f+q>>0]|0)|0)<=(g|0)){n=((o-m|0)*3|0)+(a[h+q>>0]|0)|0;q=n+4|0;s=a[i+(3?q>>3:q)>>0]|0;q=n+3|0;a[p>>0]=a[j+((a[i+(3?q>>3:q)>>0]|0)+m)>>0]|0;a[t>>0]=a[j+(o-s)>>0]|0}k=k+1|0}while((k|0)!=16);k=b+12|0;b=0;do{l=k+(r(b,e)|0)|0;s=l+-1|0;o=d[s>>0]|0;t=d[l>>0]|0;m=(d[l+-2>>0]|0)-(d[l+1>>0]|0)|0;if(((d[f+(o-t)>>0]<<2)+(d[f+m>>0]|0)|0)<=(g|0)){q=((t-o|0)*3|0)+(a[h+m>>0]|0)|0;m=q+4|0;p=a[i+(3?m>>3:m)>>0]|0;m=q+3|0;a[s>>0]=a[j+((a[i+(3?m>>3:m)>>0]|0)+o)>>0]|0;a[l>>0]=a[j+(t-p)>>0]|0}b=b+1|0}while((b|0)!=16);return}function Jd(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;je(a+4|0,1,b,16,c,d,e);je(a+8|0,1,b,16,c,d,e);je(a+12|0,1,b,16,c,d,e);return}function Kd(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ke(a,1,c,8,d,e,f);ke(b,1,c,8,d,e,f);return}function Ld(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;je(a+4|0,1,c,8,d,e,f);je(b+4|0,1,c,8,d,e,f);return}function Md(a){a=a|0;var b=0,c=0;b=(d[a+-32>>0]|0)+4+(d[a+-1>>0]|0)+(d[a+-31>>0]|0)+(d[a+31>>0]|0)+(d[a+-30>>0]|0)+(d[a+63>>0]|0)+(d[a+-29>>0]|0)+(d[a+95>>0]|0)|0;c=(3?b>>>3:b)&255;Nf(a|0,c|0,4)|0;Nf(a+32|0,c|0,4)|0;Nf(a+64|0,c|0,4)|0;Nf(a+96|0,c|0,4)|0;return}function Nd(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0;e=(c[2026]|0)+(0-(d[b+-33>>0]|0))|0;f=e+(d[b+-1>>0]|0)|0;g=d[b+-32>>0]|0;a[b>>0]=a[f+g>>0]|0;h=d[b+-31>>0]|0;a[b+1>>0]=a[f+h>>0]|0;i=d[b+-30>>0]|0;a[b+2>>0]=a[f+i>>0]|0;j=d[b+-29>>0]|0;a[b+3>>0]=a[f+j>>0]|0;f=e+(d[b+31>>0]|0)|0;a[b+32>>0]=a[f+g>>0]|0;a[b+33>>0]=a[f+h>>0]|0;a[b+34>>0]=a[f+i>>0]|0;a[b+35>>0]=a[f+j>>0]|0;f=e+(d[b+63>>0]|0)|0;a[b+64>>0]=a[f+g>>0]|0;a[b+65>>0]=a[f+h>>0]|0;a[b+66>>0]=a[f+i>>0]|0;a[b+67>>0]=a[f+j>>0]|0;f=e+(d[b+95>>0]|0)|0;a[b+96>>0]=a[f+g>>0]|0;a[b+97>>0]=a[f+h>>0]|0;a[b+98>>0]=a[f+i>>0]|0;a[b+99>>0]=a[f+j>>0]|0;return}function Od(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0;c=d[b+-32>>0]|0;e=d[b+-31>>0]|0;f=e+2|0;g=f+(d[b+-33>>0]|0)+(c<<1)|0;h=(2?g>>>2:g)&255;g=d[b+-30>>0]|0;i=g+2|0;j=i+c+(e<<1)|0;e=(2?j>>>2:j)&255;j=d[b+-29>>0]|0;c=f+(g<<1)+j|0;g=(2?c>>>2:c)&255;c=i+(j<<1)+(d[b+-28>>0]|0)|0;j=(2?c>>>2:c)&255;a[b>>0]=h;a[b+1>>0]=e;a[b+2>>0]=g;a[b+3>>0]=j;a[b+32>>0]=h;a[b+33>>0]=e;a[b+34>>0]=g;a[b+35>>0]=j;a[b+64>>0]=h;a[b+65>>0]=e;a[b+66>>0]=g;a[b+67>>0]=j;a[b+96>>0]=h;a[b+97>>0]=e;a[b+98>>0]=g;a[b+99>>0]=j;return}function Pd(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c=d[b+-1>>0]|0;e=d[b+31>>0]|0;f=d[b+63>>0]|0;g=d[b+-33>>0]|0;h=d[b+-32>>0]|0;i=d[b+-31>>0]|0;j=d[b+-30>>0]|0;k=d[b+-29>>0]|0;l=e+2|0;m=l+(f<<1)+(d[b+95>>0]|0)|0;a[b+96>>0]=2?m>>>2:m;m=c+2|0;n=m+(e<<1)+f|0;f=(2?n>>>2:n)&255;a[b+64>>0]=f;a[b+97>>0]=f;f=l+(c<<1)+g|0;c=(2?f>>>2:f)&255;a[b+32>>0]=c;a[b+65>>0]=c;a[b+98>>0]=c;c=m+h+(g<<1)|0;m=(2?c>>>2:c)&255;a[b>>0]=m;a[b+33>>0]=m;a[b+66>>0]=m;a[b+99>>0]=m;m=g+2+i+(h<<1)|0;g=(2?m>>>2:m)&255;a[b+1>>0]=g;a[b+34>>0]=g;a[b+67>>0]=g;g=h+2+j+(i<<1)|0;h=(2?g>>>2:g)&255;a[b+2>>0]=h;a[b+35>>0]=h;h=i+2+k+(j<<1)|0;a[b+3>>0]=2?h>>>2:h;return}function Qd(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=d[b+-31>>0]|0;e=d[b+-30>>0]|0;f=d[b+-29>>0]|0;g=d[b+-28>>0]|0;h=d[b+-27>>0]|0;i=d[b+-26>>0]|0;j=d[b+-25>>0]|0;k=e+2|0;l=k+(d[b+-32>>0]|0)+(c<<1)|0;a[b>>0]=2?l>>>2:l;l=f+2|0;m=l+c+(e<<1)|0;e=(2?m>>>2:m)&255;a[b+32>>0]=e;a[b+1>>0]=e;e=k+(f<<1)+g|0;f=(2?e>>>2:e)&255;a[b+64>>0]=f;a[b+33>>0]=f;a[b+2>>0]=f;f=l+(g<<1)+h|0;l=(2?f>>>2:f)&255;a[b+96>>0]=l;a[b+65>>0]=l;a[b+34>>0]=l;a[b+3>>0]=l;l=g+2+(h<<1)+i|0;g=(2?l>>>2:l)&255;a[b+97>>0]=g;a[b+66>>0]=g;a[b+35>>0]=g;g=h+2+(i<<1)+j|0;h=(2?g>>>2:g)&255;a[b+98>>0]=h;a[b+67>>0]=h;h=i+2+j+(j<<1)|0;a[b+99>>0]=2?h>>>2:h;return}function Rd(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0;c=d[b+-1>>0]|0;e=d[b+31>>0]|0;f=d[b+63>>0]|0;g=d[b+95>>0]|0;h=e+2|0;i=h+(d[b+-33>>0]|0)+(c<<1)|0;j=r((2?i>>>2:i)&255,16843009)|0;a[b>>0]=j;a[b+1>>0]=j>>8;a[b+2>>0]=j>>16;a[b+3>>0]=j>>24;j=b+32|0;i=f+2|0;k=i+c+(e<<1)|0;e=r((2?k>>>2:k)&255,16843009)|0;a[j>>0]=e;a[j+1>>0]=e>>8;a[j+2>>0]=e>>16;a[j+3>>0]=e>>24;e=b+64|0;j=h+(f<<1)+g|0;f=r((2?j>>>2:j)&255,16843009)|0;a[e>>0]=f;a[e+1>>0]=f>>8;a[e+2>>0]=f>>16;a[e+3>>0]=f>>24;f=b+96|0;b=i+g+(g<<1)|0;g=r((2?b>>>2:b)&255,16843009)|0;a[f>>0]=g;a[f+1>>0]=g>>8;a[f+2>>0]=g>>16;a[f+3>>0]=g>>24;return}function Sd(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c=d[b+-1>>0]|0;e=d[b+31>>0]|0;f=d[b+63>>0]|0;g=d[b+-33>>0]|0;h=d[b+-32>>0]|0;i=d[b+-31>>0]|0;j=d[b+-30>>0]|0;k=d[b+-29>>0]|0;l=h+1|0;m=l+g|0;n=(1?m>>>1:m)&255;a[b+65>>0]=n;a[b>>0]=n;n=l+i|0;l=(1?n>>>1:n)&255;a[b+66>>0]=l;a[b+1>>0]=l;l=i+1+j|0;n=(1?l>>>1:l)&255;a[b+67>>0]=n;a[b+2>>0]=n;n=j+1+k|0;a[b+3>>0]=1?n>>>1:n;n=c+2|0;l=n+f+(e<<1)|0;a[b+96>>0]=2?l>>>2:l;l=g+2|0;f=l+e+(c<<1)|0;a[b+64>>0]=2?f>>>2:f;f=n+(g<<1)+h|0;g=(2?f>>>2:f)&255;a[b+97>>0]=g;a[b+32>>0]=g;g=l+(h<<1)+i|0;l=(2?g>>>2:g)&255;a[b+98>>0]=l;a[b+33>>0]=l;l=h+2+(i<<1)+j|0;h=(2?l>>>2:l)&255;a[b+99>>0]=h;a[b+34>>0]=h;h=i+2+(j<<1)+k|0;a[b+35>>0]=2?h>>>2:h;return}function Td(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;c=d[b+-32>>0]|0;e=d[b+-31>>0]|0;f=d[b+-30>>0]|0;g=d[b+-29>>0]|0;h=d[b+-28>>0]|0;i=d[b+-27>>0]|0;j=d[b+-26>>0]|0;k=d[b+-25>>0]|0;l=e+1|0;m=l+c|0;a[b>>0]=1?m>>>1:m;m=l+f|0;l=(1?m>>>1:m)&255;a[b+64>>0]=l;a[b+1>>0]=l;l=f+1+g|0;m=(1?l>>>1:l)&255;a[b+65>>0]=m;a[b+2>>0]=m;m=g+1+h|0;l=(1?m>>>1:m)&255;a[b+66>>0]=l;a[b+3>>0]=l;l=f+2|0;m=l+c+(e<<1)|0;a[b+32>>0]=2?m>>>2:m;m=g+2|0;c=m+e+(f<<1)|0;f=(2?c>>>2:c)&255;a[b+96>>0]=f;a[b+33>>0]=f;f=l+(g<<1)+h|0;g=(2?f>>>2:f)&255;a[b+97>>0]=g;a[b+34>>0]=g;g=m+(h<<1)+i|0;m=(2?g>>>2:g)&255;a[b+98>>0]=m;a[b+35>>0]=m;m=h+2+(i<<1)+j|0;a[b+67>>0]=2?m>>>2:m;m=i+2+(j<<1)+k|0;a[b+99>>0]=2?m>>>2:m;return}function Ud(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;c=d[b+-1>>0]|0;e=d[b+31>>0]|0;f=d[b+63>>0]|0;g=d[b+95>>0]|0;h=d[b+-33>>0]|0;i=d[b+-32>>0]|0;j=d[b+-31>>0]|0;k=d[b+-30>>0]|0;l=c+1|0;m=l+h|0;n=(1?m>>>1:m)&255;a[b+34>>0]=n;a[b>>0]=n;n=l+e|0;l=(1?n>>>1:n)&255;a[b+66>>0]=l;a[b+32>>0]=l;l=e+1+f|0;n=(1?l>>>1:l)&255;a[b+98>>0]=n;a[b+64>>0]=n;n=f+1+g|0;a[b+96>>0]=1?n>>>1:n;n=i+2+(j<<1)+k|0;a[b+3>>0]=2?n>>>2:n;n=h+2+(i<<1)+j|0;a[b+2>>0]=2?n>>>2:n;n=c+2|0;j=n+(h<<1)+i|0;i=(2?j>>>2:j)&255;a[b+35>>0]=i;a[b+1>>0]=i;i=e+2|0;j=i+(c<<1)+h|0;h=(2?j>>>2:j)&255;a[b+67>>0]=h;a[b+33>>0]=h;h=n+f+(e<<1)|0;e=(2?h>>>2:h)&255;a[b+99>>0]=e;a[b+65>>0]=e;e=i+g+(f<<1)|0;a[b+97>>0]=2?e>>>2:e;return}function Vd(b){b=b|0;var c=0,e=0,f=0,g=0,h=0,i=0,j=0;c=d[b+-1>>0]|0;e=d[b+31>>0]|0;f=d[b+63>>0]|0;g=a[b+95>>0]|0;h=g&255;i=e+1|0;j=i+c|0;a[b>>0]=1?j>>>1:j;j=i+f|0;i=(1?j>>>1:j)&255;a[b+32>>0]=i;a[b+2>>0]=i;i=f+1+h|0;j=(1?i>>>1:i)&255;a[b+64>>0]=j;a[b+34>>0]=j;j=f+2|0;i=j+c+(e<<1)|0;a[b+1>>0]=2?i>>>2:i;i=h+2+e+(f<<1)|0;f=(2?i>>>2:i)&255;a[b+33>>0]=f;a[b+3>>0]=f;f=j+h+(h<<1)|0;h=(2?f>>>2:f)&255;a[b+65>>0]=h;a[b+35>>0]=h;a[b+66>>0]=g;a[b+67>>0]=g;Nf(b+96|0,g|0,4)|0;return}function Wd(a){a=a|0;var b=0,c=0;b=(d[a+-1>>0]|0)+16+(d[a+-32>>0]|0)+(d[a+31>>0]|0)+(d[a+-31>>0]|0)+(d[a+63>>0]|0)+(d[a+-30>>0]|0)+(d[a+95>>0]|0)+(d[a+-29>>0]|0)+(d[a+127>>0]|0)+(d[a+-28>>0]|0)+(d[a+159>>0]|0)+(d[a+-27>>0]|0)+(d[a+191>>0]|0)+(d[a+-26>>0]|0)+(d[a+223>>0]|0)+(d[a+-25>>0]|0)+(d[a+255>>0]|0)+(d[a+-24>>0]|0)+(d[a+287>>0]|0)+(d[a+-23>>0]|0)+(d[a+319>>0]|0)+(d[a+-22>>0]|0)+(d[a+351>>0]|0)+(d[a+-21>>0]|0)+(d[a+383>>0]|0)+(d[a+-20>>0]|0)+(d[a+415>>0]|0)+(d[a+-19>>0]|0)+(d[a+447>>0]|0)+(d[a+-18>>0]|0)+(d[a+479>>0]|0)+(d[a+-17>>0]|0)|0;c=(5?b>>>5:b)&255;Nf(a|0,c|0,16)|0;Nf(a+32|0,c|0,16)|0;Nf(a+64|0,c|0,16)|0;Nf(a+96|0,c|0,16)|0;Nf(a+128|0,c|0,16)|0;Nf(a+160|0,c|0,16)|0;Nf(a+192|0,c|0,16)|0;Nf(a+224|0,c|0,16)|0;Nf(a+256|0,c|0,16)|0;Nf(a+288|0,c|0,16)|0;Nf(a+320|0,c|0,16)|0;Nf(a+352|0,c|0,16)|0;Nf(a+384|0,c|0,16)|0;Nf(a+416|0,c|0,16)|0;Nf(a+448|0,c|0,16)|0;Nf(a+480|0,c|0,16)|0;return}function Xd(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0;e=b+-32|0;f=(c[2026]|0)+(0-(d[b+-33>>0]|0))|0;g=b+-31|0;h=b+-30|0;i=b+-29|0;j=b+-28|0;k=b+-27|0;l=b+-26|0;m=b+-25|0;n=b+-24|0;o=b+-23|0;p=b+-22|0;q=b+-21|0;r=b+-20|0;s=b+-19|0;t=b+-18|0;u=b+-17|0;v=b;b=0;while(1){w=f+(d[v+-1>>0]|0)|0;a[v>>0]=a[w+(d[e>>0]|0)>>0]|0;a[v+1>>0]=a[w+(d[g>>0]|0)>>0]|0;a[v+2>>0]=a[w+(d[h>>0]|0)>>0]|0;a[v+3>>0]=a[w+(d[i>>0]|0)>>0]|0;a[v+4>>0]=a[w+(d[j>>0]|0)>>0]|0;a[v+5>>0]=a[w+(d[k>>0]|0)>>0]|0;a[v+6>>0]=a[w+(d[l>>0]|0)>>0]|0;a[v+7>>0]=a[w+(d[m>>0]|0)>>0]|0;a[v+8>>0]=a[w+(d[n>>0]|0)>>0]|0;a[v+9>>0]=a[w+(d[o>>0]|0)>>0]|0;a[v+10>>0]=a[w+(d[p>>0]|0)>>0]|0;a[v+11>>0]=a[w+(d[q>>0]|0)>>0]|0;a[v+12>>0]=a[w+(d[r>>0]|0)>>0]|0;a[v+13>>0]=a[w+(d[s>>0]|0)>>0]|0;a[v+14>>0]=a[w+(d[t>>0]|0)>>0]|0;a[v+15>>0]=a[w+(d[u>>0]|0)>>0]|0;b=b+1|0;if((b|0)==16)break;else v=v+32|0}return}function Yd(b){b=b|0;var c=0,d=0,e=0,f=0;c=b+-32|0;d=b;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+32|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+64|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+96|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+128|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+160|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+192|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+224|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+256|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+288|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+320|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+352|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+384|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+416|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+448|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));d=b+480|0;e=c;f=d+16|0;do{a[d>>0]=a[e>>0]|0;d=d+1|0;e=e+1|0}while((d|0)<(f|0));return}function Zd(b){b=b|0;Nf(b|0,a[b+-1>>0]|0,16)|0;Nf(b+32|0,a[b+31>>0]|0,16)|0;Nf(b+64|0,a[b+63>>0]|0,16)|0;Nf(b+96|0,a[b+95>>0]|0,16)|0;Nf(b+128|0,a[b+127>>0]|0,16)|0;Nf(b+160|0,a[b+159>>0]|0,16)|0;Nf(b+192|0,a[b+191>>0]|0,16)|0;Nf(b+224|0,a[b+223>>0]|0,16)|0;Nf(b+256|0,a[b+255>>0]|0,16)|0;Nf(b+288|0,a[b+287>>0]|0,16)|0;Nf(b+320|0,a[b+319>>0]|0,16)|0;Nf(b+352|0,a[b+351>>0]|0,16)|0;Nf(b+384|0,a[b+383>>0]|0,16)|0;Nf(b+416|0,a[b+415>>0]|0,16)|0;Nf(b+448|0,a[b+447>>0]|0,16)|0;Nf(b+480|0,a[b+479>>0]|0,16)|0;return}function _d(a){a=a|0;var b=0,c=0;b=(d[a+-1>>0]|0)+8+(d[a+31>>0]|0)+(d[a+63>>0]|0)+(d[a+95>>0]|0)+(d[a+127>>0]|0)+(d[a+159>>0]|0)+(d[a+191>>0]|0)+(d[a+223>>0]|0)+(d[a+255>>0]|0)+(d[a+287>>0]|0)+(d[a+319>>0]|0)+(d[a+351>>0]|0)+(d[a+383>>0]|0)+(d[a+415>>0]|0)+(d[a+447>>0]|0)+(d[a+479>>0]|0)|0;c=(4?b>>>4:b)&255;Nf(a|0,c|0,16)|0;Nf(a+32|0,c|0,16)|0;Nf(a+64|0,c|0,16)|0;Nf(a+96|0,c|0,16)|0;Nf(a+128|0,c|0,16)|0;Nf(a+160|0,c|0,16)|0;Nf(a+192|0,c|0,16)|0;Nf(a+224|0,c|0,16)|0;Nf(a+256|0,c|0,16)|0;Nf(a+288|0,c|0,16)|0;Nf(a+320|0,c|0,16)|0;Nf(a+352|0,c|0,16)|0;Nf(a+384|0,c|0,16)|0;Nf(a+416|0,c|0,16)|0;Nf(a+448|0,c|0,16)|0;Nf(a+480|0,c|0,16)|0;return}function $d(a){a=a|0;var b=0,c=0;b=(d[a+-32>>0]|0)+8+(d[a+-31>>0]|0)+(d[a+-30>>0]|0)+(d[a+-29>>0]|0)+(d[a+-28>>0]|0)+(d[a+-27>>0]|0)+(d[a+-26>>0]|0)+(d[a+-25>>0]|0)+(d[a+-24>>0]|0)+(d[a+-23>>0]|0)+(d[a+-22>>0]|0)+(d[a+-21>>0]|0)+(d[a+-20>>0]|0)+(d[a+-19>>0]|0)+(d[a+-18>>0]|0)+(d[a+-17>>0]|0)|0;c=(4?b>>>4:b)&255;Nf(a|0,c|0,16)|0;Nf(a+32|0,c|0,16)|0;Nf(a+64|0,c|0,16)|0;Nf(a+96|0,c|0,16)|0;Nf(a+128|0,c|0,16)|0;Nf(a+160|0,c|0,16)|0;Nf(a+192|0,c|0,16)|0;Nf(a+224|0,c|0,16)|0;Nf(a+256|0,c|0,16)|0;Nf(a+288|0,c|0,16)|0;Nf(a+320|0,c|0,16)|0;Nf(a+352|0,c|0,16)|0;Nf(a+384|0,c|0,16)|0;Nf(a+416|0,c|0,16)|0;Nf(a+448|0,c|0,16)|0;Nf(a+480|0,c|0,16)|0;return}function ae(b){b=b|0;var c=0,d=0;c=b;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+32|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+64|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+96|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+128|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+160|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+192|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+224|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+256|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+288|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+320|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+352|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+384|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+416|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+448|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));c=b+480|0;d=c+16|0;do{a[c>>0]=128;c=c+1|0}while((c|0)<(d|0));return}function be(a){a=a|0;var b=0,c=0;b=(d[a+-32>>0]|0)+8+(d[a+-1>>0]|0)+(d[a+-31>>0]|0)+(d[a+31>>0]|0)+(d[a+-30>>0]|0)+(d[a+63>>0]|0)+(d[a+-29>>0]|0)+(d[a+95>>0]|0)+(d[a+-28>>0]|0)+(d[a+127>>0]|0)+(d[a+-27>>0]|0)+(d[a+159>>0]|0)+(d[a+-26>>0]|0)+(d[a+191>>0]|0)+(d[a+-25>>0]|0)+(d[a+223>>0]|0)|0;c=(4?b>>>4:b)&255;Nf(a|0,c|0,8)|0;Nf(a+32|0,c|0,8)|0;Nf(a+64|0,c|0,8)|0;Nf(a+96|0,c|0,8)|0;Nf(a+128|0,c|0,8)|0;Nf(a+160|0,c|0,8)|0;Nf(a+192|0,c|0,8)|0;Nf(a+224|0,c|0,8)|0;return}function ce(b){b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=b+-32|0;f=(c[2026]|0)+(0-(d[b+-33>>0]|0))|0;g=f+(d[b+-1>>0]|0)|0;h=d[e>>0]|0;a[b>>0]=a[g+h>>0]|0;i=b+-31|0;j=d[i>>0]|0;a[b+1>>0]=a[g+j>>0]|0;k=b+-30|0;l=d[k>>0]|0;a[b+2>>0]=a[g+l>>0]|0;m=b+-29|0;n=d[m>>0]|0;a[b+3>>0]=a[g+n>>0]|0;o=b+-28|0;p=d[o>>0]|0;a[b+4>>0]=a[g+p>>0]|0;q=b+-27|0;r=d[q>>0]|0;a[b+5>>0]=a[g+r>>0]|0;s=b+-26|0;t=d[s>>0]|0;a[b+6>>0]=a[g+t>>0]|0;u=b+-25|0;v=d[u>>0]|0;a[b+7>>0]=a[g+v>>0]|0;g=f+(d[b+31>>0]|0)|0;a[b+32>>0]=a[g+h>>0]|0;a[b+33>>0]=a[g+j>>0]|0;a[b+34>>0]=a[g+l>>0]|0;a[b+35>>0]=a[g+n>>0]|0;a[b+36>>0]=a[g+p>>0]|0;a[b+37>>0]=a[g+r>>0]|0;a[b+38>>0]=a[g+t>>0]|0;a[b+39>>0]=a[g+v>>0]|0;g=f+(d[b+63>>0]|0)|0;a[b+64>>0]=a[g+h>>0]|0;a[b+65>>0]=a[g+j>>0]|0;a[b+66>>0]=a[g+l>>0]|0;a[b+67>>0]=a[g+n>>0]|0;a[b+68>>0]=a[g+p>>0]|0;a[b+69>>0]=a[g+r>>0]|0;a[b+70>>0]=a[g+t>>0]|0;a[b+71>>0]=a[g+v>>0]|0;v=f+(d[b+95>>0]|0)|0;g=d[e>>0]|0;a[b+96>>0]=a[v+g>>0]|0;t=d[i>>0]|0;a[b+97>>0]=a[v+t>>0]|0;r=d[k>>0]|0;a[b+98>>0]=a[v+r>>0]|0;p=d[m>>0]|0;a[b+99>>0]=a[v+p>>0]|0;n=d[o>>0]|0;a[b+100>>0]=a[v+n>>0]|0;l=d[q>>0]|0;a[b+101>>0]=a[v+l>>0]|0;j=d[s>>0]|0;a[b+102>>0]=a[v+j>>0]|0;h=d[u>>0]|0;a[b+103>>0]=a[v+h>>0]|0;v=f+(d[b+127>>0]|0)|0;a[b+128>>0]=a[v+g>>0]|0;a[b+129>>0]=a[v+t>>0]|0;a[b+130>>0]=a[v+r>>0]|0;a[b+131>>0]=a[v+p>>0]|0;a[b+132>>0]=a[v+n>>0]|0;a[b+133>>0]=a[v+l>>0]|0;a[b+134>>0]=a[v+j>>0]|0;a[b+135>>0]=a[v+h>>0]|0;h=f+(d[b+159>>0]|0)|0;a[b+160>>0]=a[h+g>>0]|0;a[b+161>>0]=a[h+t>>0]|0;a[b+162>>0]=a[h+(d[k>>0]|0)>>0]|0;a[b+163>>0]=a[h+(d[m>>0]|0)>>0]|0;a[b+164>>0]=a[h+(d[o>>0]|0)>>0]|0;a[b+165>>0]=a[h+(d[q>>0]|0)>>0]|0;a[b+166>>0]=a[h+(d[s>>0]|0)>>0]|0;a[b+167>>0]=a[h+(d[u>>0]|0)>>0]|0;h=f+(d[b+191>>0]|0)|0;a[b+192>>0]=a[h+(d[e>>0]|0)>>0]|0;a[b+193>>0]=a[h+(d[i>>0]|0)>>0]|0;a[b+194>>0]=a[h+(d[k>>0]|0)>>0]|0;a[b+195>>0]=a[h+(d[m>>0]|0)>>0]|0;a[b+196>>0]=a[h+(d[o>>0]|0)>>0]|0;a[b+197>>0]=a[h+(d[q>>0]|0)>>0]|0;a[b+198>>0]=a[h+(d[s>>0]|0)>>0]|0;a[b+199>>0]=a[h+(d[u>>0]|0)>>0]|0;h=f+(d[b+223>>0]|0)|0;a[b+224>>0]=a[h+(d[e>>0]|0)>>0]|0;a[b+225>>0]=a[h+(d[i>>0]|0)>>0]|0;a[b+226>>0]=a[h+(d[k>>0]|0)>>0]|0;a[b+227>>0]=a[h+(d[m>>0]|0)>>0]|0;a[b+228>>0]=a[h+(d[o>>0]|0)>>0]|0;a[b+229>>0]=a[h+(d[q>>0]|0)>>0]|0;a[b+230>>0]=a[h+(d[s>>0]|0)>>0]|0;a[b+231>>0]=a[h+(d[u>>0]|0)>>0]|0;return}function de(b){b=b|0;var c=0,e=0,f=0,g=0;c=b+-32|0;e=c;f=d[e>>0]|d[e+1>>0]<<8|d[e+2>>0]<<16|d[e+3>>0]<<24;e=c+4|0;c=d[e>>0]|d[e+1>>0]<<8|d[e+2>>0]<<16|d[e+3>>0]<<24;e=b;g=e;a[g>>0]=f;a[g+1>>0]=f>>8;a[g+2>>0]=f>>16;a[g+3>>0]=f>>24;g=e+4|0;a[g>>0]=c;a[g+1>>0]=c>>8;a[g+2>>0]=c>>16;a[g+3>>0]=c>>24;g=b+32|0;e=g;a[e>>0]=f;a[e+1>>0]=f>>8;a[e+2>>0]=f>>16;a[e+3>>0]=f>>24;e=g+4|0;a[e>>0]=c;a[e+1>>0]=c>>8;a[e+2>>0]=c>>16;a[e+3>>0]=c>>24;e=b+64|0;g=e;a[g>>0]=f;a[g+1>>0]=f>>8;a[g+2>>0]=f>>16;a[g+3>>0]=f>>24;g=e+4|0;a[g>>0]=c;a[g+1>>0]=c>>8;a[g+2>>0]=c>>16;a[g+3>>0]=c>>24;g=b+96|0;e=g;a[e>>0]=f;a[e+1>>0]=f>>8;a[e+2>>0]=f>>16;a[e+3>>0]=f>>24;e=g+4|0;a[e>>0]=c;a[e+1>>0]=c>>8;a[e+2>>0]=c>>16;a[e+3>>0]=c>>24;e=b+128|0;g=e;a[g>>0]=f;a[g+1>>0]=f>>8;a[g+2>>0]=f>>16;a[g+3>>0]=f>>24;g=e+4|0;a[g>>0]=c;a[g+1>>0]=c>>8;a[g+2>>0]=c>>16;a[g+3>>0]=c>>24;g=b+160|0;e=g;a[e>>0]=f;a[e+1>>0]=f>>8;a[e+2>>0]=f>>16;a[e+3>>0]=f>>24;e=g+4|0;a[e>>0]=c;a[e+1>>0]=c>>8;a[e+2>>0]=c>>16;a[e+3>>0]=c>>24;e=b+192|0;g=e;a[g>>0]=f;a[g+1>>0]=f>>8;a[g+2>>0]=f>>16;a[g+3>>0]=f>>24;g=e+4|0;a[g>>0]=c;a[g+1>>0]=c>>8;a[g+2>>0]=c>>16;a[g+3>>0]=c>>24;g=b+224|0;b=g;a[b>>0]=f;a[b+1>>0]=f>>8;a[b+2>>0]=f>>16;a[b+3>>0]=f>>24;f=g+4|0;a[f>>0]=c;a[f+1>>0]=c>>8;a[f+2>>0]=c>>16;a[f+3>>0]=c>>24;return}function ee(b){b=b|0;Nf(b|0,a[b+-1>>0]|0,8)|0;Nf(b+32|0,a[b+31>>0]|0,8)|0;Nf(b+64|0,a[b+63>>0]|0,8)|0;Nf(b+96|0,a[b+95>>0]|0,8)|0;Nf(b+128|0,a[b+127>>0]|0,8)|0;Nf(b+160|0,a[b+159>>0]|0,8)|0;Nf(b+192|0,a[b+191>>0]|0,8)|0;Nf(b+224|0,a[b+223>>0]|0,8)|0;return}function fe(a){a=a|0;var b=0,c=0;b=(d[a+-1>>0]|0)+4+(d[a+31>>0]|0)+(d[a+63>>0]|0)+(d[a+95>>0]|0)+(d[a+127>>0]|0)+(d[a+159>>0]|0)+(d[a+191>>0]|0)+(d[a+223>>0]|0)|0;c=(3?b>>>3:b)&255;Nf(a|0,c|0,8)|0;Nf(a+32|0,c|0,8)|0;Nf(a+64|0,c|0,8)|0;Nf(a+96|0,c|0,8)|0;Nf(a+128|0,c|0,8)|0;Nf(a+160|0,c|0,8)|0;Nf(a+192|0,c|0,8)|0;Nf(a+224|0,c|0,8)|0;return}function ge(a){a=a|0;var b=0,c=0;b=(d[a+-32>>0]|0)+4+(d[a+-31>>0]|0)+(d[a+-30>>0]|0)+(d[a+-29>>0]|0)+(d[a+-28>>0]|0)+(d[a+-27>>0]|0)+(d[a+-26>>0]|0)+(d[a+-25>>0]|0)|0;c=(3?b>>>3:b)&255;Nf(a|0,c|0,8)|0;Nf(a+32|0,c|0,8)|0;Nf(a+64|0,c|0,8)|0;Nf(a+96|0,c|0,8)|0;Nf(a+128|0,c|0,8)|0;Nf(a+160|0,c|0,8)|0;Nf(a+192|0,c|0,8)|0;Nf(a+224|0,c|0,8)|0;return}function he(b){b=b|0;var c=0,d=0;c=b;d=c;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=c+4|0;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=b+32|0;c=d;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=d+4|0;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=b+64|0;d=c;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=c+4|0;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=b+96|0;c=d;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=d+4|0;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=b+128|0;d=c;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=c+4|0;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=b+160|0;c=d;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=d+4|0;a[c>>0]=-2139062144;a[c+1>>0]=-2139062144>>8;a[c+2>>0]=-2139062144>>16;a[c+3>>0]=-2139062144>>24;c=b+192|0;d=c;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=c+4|0;a[d>>0]=-2139062144;a[d+1>>0]=-2139062144>>8;a[d+2>>0]=-2139062144>>16;a[d+3>>0]=-2139062144>>24;d=b+224|0;b=d;a[b>>0]=-2139062144;a[b+1>>0]=-2139062144>>8;a[b+2>>0]=-2139062144>>16;a[b+3>>0]=-2139062144>>24;b=d+4|0;a[b>>0]=-2139062144;a[b+1>>0]=-2139062144>>8;a[b+2>>0]=-2139062144>>16;a[b+3>>0]=-2139062144>>24;return}function ie(b,c,e){b=b|0;c=c|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0;if((e|0)==1){f=c;g=0;h=b;i=a[c+6>>0]|0;while(1){j=(d[h>>0]|0)+-120|0;k=(4?j>>4:j)+(d[f>>0]|0)|0;a[f>>0]=k>>>0>255?(31?k>>>31:k)+255|0:k;k=(d[h+1>>0]|0)+-120|0;j=f+1|0;l=(4?k>>4:k)+(d[j>>0]|0)|0;a[j>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=(d[h+2>>0]|0)+-120|0;j=f+2|0;k=(4?l>>4:l)+(d[j>>0]|0)|0;a[j>>0]=k>>>0>255?(31?k>>>31:k)+255|0:k;k=(d[h+3>>0]|0)+-120|0;j=f+3|0;l=(4?k>>4:k)+(d[j>>0]|0)|0;a[j>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=(d[h+4>>0]|0)+-120|0;j=f+4|0;k=(4?l>>4:l)+(d[j>>0]|0)|0;a[j>>0]=k>>>0>255?(31?k>>>31:k)+255|0:k;k=(d[h+5>>0]|0)+-120|0;j=f+5|0;l=(4?k>>4:k)+(d[j>>0]|0)|0;a[j>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=(d[h+6>>0]|0)+-120|0;j=(4?l>>4:l)+(i&255)|0;a[f+6>>0]=j>>>0>255?(31?j>>>31:j)+255|0:j;j=(d[h+7>>0]|0)+-120|0;l=f+7|0;k=(4?j>>4:j)+(d[l>>0]|0)|0;i=(k>>>0>255?(31?k>>>31:k)+255|0:k)&255;a[l>>0]=i;g=g+1|0;if((g|0)==8)break;else{f=f+e|0;h=h+8|0}}return}else{h=c;c=0;f=b;while(1){b=(d[f>>0]|0)+-120|0;g=(4?b>>4:b)+(d[h>>0]|0)|0;a[h>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=(d[f+1>>0]|0)+-120|0;b=h+1|0;i=(4?g>>4:g)+(d[b>>0]|0)|0;a[b>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=(d[f+2>>0]|0)+-120|0;b=h+2|0;g=(4?i>>4:i)+(d[b>>0]|0)|0;a[b>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=(d[f+3>>0]|0)+-120|0;b=h+3|0;i=(4?g>>4:g)+(d[b>>0]|0)|0;a[b>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=(d[f+4>>0]|0)+-120|0;b=h+4|0;g=(4?i>>4:i)+(d[b>>0]|0)|0;a[b>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=(d[f+5>>0]|0)+-120|0;b=h+5|0;i=(4?g>>4:g)+(d[b>>0]|0)|0;a[b>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=(d[f+6>>0]|0)+-120|0;b=h+6|0;g=(4?i>>4:i)+(d[b>>0]|0)|0;a[b>>0]=g>>>0>255?(31?g>>>31:g)+255|0:g;g=(d[f+7>>0]|0)+-120|0;b=h+7|0;i=(4?g>>4:g)+(d[b>>0]|0)|0;a[b>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;c=c+1|0;if((c|0)==8)break;else{h=h+e|0;f=f+8|0}}return}}function je(b,e,f,g,h,i,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;k=h<<1|1;if((g|0)<=0)return;h=r(e,-3)|0;l=r(e,-2)|0;m=0-e|0;n=e<<1;o=e*3|0;p=c[2027]|0;q=r(e,-4)|0;s=c[2024]|0;t=c[2025]|0;u=c[2026]|0;v=b;b=g;while(1){g=b;b=b+-1|0;w=d[v+h>>0]|0;x=v+l|0;y=d[x>>0]|0;z=v+m|0;A=d[z>>0]|0;B=d[v>>0]|0;C=v+e|0;D=d[C>>0]|0;E=d[v+n>>0]|0;F=d[v+o>>0]|0;G=y-D|0;do if((((((((d[p+(A-B)>>0]<<2)+(d[p+G>>0]|0)|0)<=(k|0)?(d[p+((d[v+q>>0]|0)-w)>>0]|0)<=(i|0):0)?(d[p+(w-y)>>0]|0)<=(i|0):0)?(H=d[p+(y-A)>>0]|0,(H|0)<=(i|0)):0)?(d[p+(F-E)>>0]|0)<=(i|0):0)?(d[p+(E-D)>>0]|0)<=(i|0):0)?(I=d[p+(D-B)>>0]|0,(I|0)<=(i|0)):0){J=(B-A|0)*3|0;if((H|0)>(j|0)|(I|0)>(j|0)){I=J+(a[s+G>>0]|0)|0;H=I+4|0;K=a[t+(3?H>>3:H)>>0]|0;H=I+3|0;a[z>>0]=a[u+((a[t+(3?H>>3:H)>>0]|0)+A)>>0]|0;a[v>>0]=a[u+(B-K)>>0]|0;break}else{K=J+4|0;H=a[t+(3?K>>3:K)>>0]|0;K=J+3|0;J=a[t+(3?K>>3:K)>>0]|0;K=H+1|0;I=1?K>>1:K;a[x>>0]=a[u+(I+y)>>0]|0;a[z>>0]=a[u+(J+A)>>0]|0;a[v>>0]=a[u+(B-H)>>0]|0;a[C>>0]=a[u+(D-I)>>0]|0;break}}while(0);if((g|0)<=1)break;else v=v+f|0}return}function ke(b,e,f,g,h,i,j){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0;k=h<<1|1;if((g|0)<=0)return;h=r(e,-3)|0;l=r(e,-2)|0;m=0-e|0;n=e<<1;o=e*3|0;p=c[2027]|0;q=r(e,-4)|0;s=c[2024]|0;t=c[2025]|0;u=c[2026]|0;v=b;b=g;while(1){g=b;b=b+-1|0;w=v+h|0;x=d[w>>0]|0;y=v+l|0;z=d[y>>0]|0;A=v+m|0;B=d[A>>0]|0;C=d[v>>0]|0;D=v+e|0;E=d[D>>0]|0;F=v+n|0;G=d[F>>0]|0;H=d[v+o>>0]|0;I=z-E|0;do if((((((((d[p+(B-C)>>0]<<2)+(d[p+I>>0]|0)|0)<=(k|0)?(d[p+((d[v+q>>0]|0)-x)>>0]|0)<=(i|0):0)?(d[p+(x-z)>>0]|0)<=(i|0):0)?(J=d[p+(z-B)>>0]|0,(J|0)<=(i|0)):0)?(d[p+(H-G)>>0]|0)<=(i|0):0)?(d[p+(G-E)>>0]|0)<=(i|0):0)?(K=d[p+(E-C)>>0]|0,(K|0)<=(i|0)):0){L=((C-B|0)*3|0)+(a[s+I>>0]|0)|0;if((J|0)>(j|0)|(K|0)>(j|0)){K=L+4|0;J=a[t+(3?K>>3:K)>>0]|0;K=L+3|0;a[A>>0]=a[u+((a[t+(3?K>>3:K)>>0]|0)+B)>>0]|0;a[v>>0]=a[u+(C-J)>>0]|0;break}else{J=a[s+L>>0]|0;L=(J*27|0)+63|0;K=7?L>>7:L;L=(J*18|0)+63|0;M=7?L>>7:L;L=(J*9|0)+63|0;J=7?L>>7:L;a[w>>0]=a[u+(J+x)>>0]|0;a[y>>0]=a[u+(M+z)>>0]|0;a[A>>0]=a[u+(K+B)>>0]|0;a[v>>0]=a[u+(C-K)>>0]|0;a[D>>0]=a[u+(E-M)>>0]|0;a[F>>0]=a[u+(G-J)>>0]|0;break}}while(0);if((g|0)<=1)break;else v=v+f|0}return}function le(e,f){e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;g=Y;Y=Y+64|0;h=g;i=b[e>>1]|0;j=b[e+16>>1]|0;k=j+i|0;l=i-j|0;j=b[e+8>>1]|0;i=j*35468|0;m=b[e+24>>1]|0;n=m*20091|0;o=(16?i>>16:i)-m-(16?n>>16:n)|0;n=j*20091|0;i=m*35468|0;m=(16?n>>16:n)+j+(16?i>>16:i)|0;c[h>>2]=m+k;i=h+4|0;c[i>>2]=o+l;c[h+8>>2]=l-o;c[h+12>>2]=k-m;m=b[e+2>>1]|0;k=b[e+18>>1]|0;o=k+m|0;l=m-k|0;k=b[e+10>>1]|0;m=k*35468|0;j=b[e+26>>1]|0;n=j*20091|0;p=(16?m>>16:m)-j-(16?n>>16:n)|0;n=k*20091|0;m=j*35468|0;j=(16?n>>16:n)+k+(16?m>>16:m)|0;m=j+o|0;c[h+16>>2]=m;c[h+20>>2]=p+l;c[h+24>>2]=l-p;c[h+28>>2]=o-j;j=b[e+4>>1]|0;o=b[e+20>>1]|0;p=o+j|0;l=j-o|0;o=b[e+12>>1]|0;j=o*35468|0;k=b[e+28>>1]|0;n=k*20091|0;q=(16?j>>16:j)-k-(16?n>>16:n)|0;n=o*20091|0;j=k*35468|0;k=(16?n>>16:n)+o+(16?j>>16:j)|0;j=k+p|0;c[h+32>>2]=j;c[h+36>>2]=q+l;c[h+40>>2]=l-q;c[h+44>>2]=p-k;k=b[e+6>>1]|0;p=b[e+22>>1]|0;q=p+k|0;l=k-p|0;p=b[e+14>>1]|0;k=p*35468|0;o=b[e+30>>1]|0;e=o*20091|0;n=(16?k>>16:k)-o-(16?e>>16:e)|0;e=p*20091|0;k=o*35468|0;o=(16?e>>16:e)+p+(16?k>>16:k)|0;k=o+q|0;c[h+48>>2]=k;p=n+l|0;c[h+52>>2]=p;c[h+56>>2]=l-n;c[h+60>>2]=q-o;o=(c[h>>2]|0)+4|0;q=o+j|0;n=o-j|0;j=m*35468|0;o=k*20091|0;l=(16?j>>16:j)-k-(16?o>>16:o)|0;o=m*20091|0;j=k*35468|0;k=(16?o>>16:o)+m+(16?j>>16:j)|0;j=k+q|0;m=(3?j>>3:j)+(d[f>>0]|0)|0;a[f>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=f+1|0;j=l+n|0;o=(3?j>>3:j)+(d[m>>0]|0)|0;a[m>>0]=o>>>0>255?(31?o>>>31:o)+255|0:o;o=f+2|0;m=n-l|0;l=(3?m>>3:m)+(d[o>>0]|0)|0;a[o>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=f+3|0;o=q-k|0;k=(3?o>>3:o)+(d[l>>0]|0)|0;a[l>>0]=k>>>0>255?(31?k>>>31:k)+255|0:k;k=f+32|0;l=(c[i>>2]|0)+4|0;i=c[h+36>>2]|0;o=l+i|0;q=l-i|0;i=c[h+20>>2]|0;l=i*35468|0;m=p*20091|0;n=(16?l>>16:l)-p-(16?m>>16:m)|0;m=i*20091|0;l=p*35468|0;p=(16?m>>16:m)+i+(16?l>>16:l)|0;l=p+o|0;i=(3?l>>3:l)+(d[k>>0]|0)|0;a[k>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;i=f+33|0;k=n+q|0;l=(3?k>>3:k)+(d[i>>0]|0)|0;a[i>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=f+34|0;i=q-n|0;n=(3?i>>3:i)+(d[l>>0]|0)|0;a[l>>0]=n>>>0>255?(31?n>>>31:n)+255|0:n;n=f+35|0;l=o-p|0;p=(3?l>>3:l)+(d[n>>0]|0)|0;a[n>>0]=p>>>0>255?(31?p>>>31:p)+255|0:p;p=f+64|0;n=(c[h+8>>2]|0)+4|0;l=c[h+40>>2]|0;o=n+l|0;i=n-l|0;l=c[h+24>>2]|0;n=l*35468|0;q=c[h+56>>2]|0;k=q*20091|0;m=(16?n>>16:n)-q-(16?k>>16:k)|0;k=l*20091|0;n=q*35468|0;q=(16?k>>16:k)+l+(16?n>>16:n)|0;n=q+o|0;l=(3?n>>3:n)+(d[p>>0]|0)|0;a[p>>0]=l>>>0>255?(31?l>>>31:l)+255|0:l;l=f+65|0;p=m+i|0;n=(3?p>>3:p)+(d[l>>0]|0)|0;a[l>>0]=n>>>0>255?(31?n>>>31:n)+255|0:n;n=f+66|0;l=i-m|0;m=(3?l>>3:l)+(d[n>>0]|0)|0;a[n>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=f+67|0;n=o-q|0;q=(3?n>>3:n)+(d[m>>0]|0)|0;a[m>>0]=q>>>0>255?(31?q>>>31:q)+255|0:q;q=f+96|0;m=(c[h+12>>2]|0)+4|0;n=c[h+44>>2]|0;o=m+n|0;l=m-n|0;n=c[h+28>>2]|0;m=n*35468|0;i=c[h+60>>2]|0;h=i*20091|0;p=(16?m>>16:m)-i-(16?h>>16:h)|0;h=n*20091|0;m=i*35468|0;i=(16?h>>16:h)+n+(16?m>>16:m)|0;m=i+o|0;n=(3?m>>3:m)+(d[q>>0]|0)|0;a[q>>0]=n>>>0>255?(31?n>>>31:n)+255|0:n;n=f+97|0;q=p+l|0;m=(3?q>>3:q)+(d[n>>0]|0)|0;a[n>>0]=m>>>0>255?(31?m>>>31:m)+255|0:m;m=f+98|0;n=l-p|0;p=(3?n>>3:n)+(d[m>>0]|0)|0;a[m>>0]=p>>>0>255?(31?p>>>31:p)+255|0:p;p=f+99|0;f=o-i|0;i=(3?f>>3:f)+(d[p>>0]|0)|0;a[p>>0]=i>>>0>255?(31?i>>>31:i)+255|0:i;Y=g;return}function me(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0;if((a|0)==0|(d|0)==0|(e&-256|0)!=512){f=2;return f|0}e=d;g=e+40|0;do{c[e>>2]=0;e=e+4|0}while((e|0)<(g|0));f=ne(a,b,d,d+4|0,d+8|0,d+12|0,d+16|0,0)|0;return f|0}function ne(a,b,e,f,g,h,i,j){a=a|0;b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;var k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0;k=Y;Y=Y+16|0;l=k+4|0;m=k;n=a;c[l>>2]=0;c[m>>2]=0;o=(j|0)!=0;if(o)p=c[j+8>>2]|0;else p=0;if((a|0)==0|b>>>0<12){q=7;Y=k;return q|0}if(!(af(a,8828,4)|0)){if(af(a+8|0,8833,4)|0){q=3;Y=k;return q|0}s=(d[a+5>>0]|0)<<8|(d[a+4>>0]|0)|((d[a+7>>0]|0)<<8|(d[a+6>>0]|0))<<16;if((s+-12|0)>>>0>4294967274){q=3;Y=k;return q|0}t=b+-12|0;if(t>>>0<8|(p|0)!=0&s>>>0>(b+-8|0)>>>0){q=7;Y=k;return q|0}else{u=t;v=a+12|0;w=s;x=1}}else{u=b;v=n;w=0;x=0}s=v;if(!(af(s,8838,4)|0)){if(((d[s+5>>0]|0)<<8|(d[s+4>>0]|0)|((d[s+7>>0]|0)<<8|(d[s+6>>0]|0))<<16|0)!=10){q=3;Y=k;return q|0}if(u>>>0<18){q=7;Y=k;return q|0}a=d[s+8>>0]|0;t=((d[s+13>>0]|0)<<8|(d[s+12>>0]|0)|(d[s+14>>0]|0)<<16)+1|0;y=((d[s+16>>0]|0)<<8|(d[s+15>>0]|0)|(d[s+17>>0]|0)<<16)+1|0;z=r(t,y)|0;A=(y|0)==0;if(A?0:((z>>>0)/((A?1:y)>>>0)|0|0)!=(t|0)){q=3;Y=k;return q|0}A=a&2;if(x){B=a;C=1;D=y;E=t;F=u+-18|0;G=1?A>>>1:A;H=s+18|0;I=(A|0)!=0;J=1}else{q=3;Y=k;return q|0}}else{B=0;C=0;D=0;E=0;F=u;G=0;H=v;I=0;J=0}v=(g|0)==0;if(!v)c[g>>2]=(4?B>>>4:B)&1;if(h|0)c[h>>2]=G;h=(i|0)==0;if(!h)c[i>>2]=0;c[l>>2]=E;c[m>>2]=D;B=(j|0)==0;a:do if(!(B&(J&I))){b:do if(F>>>0>=4){if(!(x&(C|0)!=0))if((C|w|0)==0?(u=H,(af(u,8843,4)|0)==0):0){K=u;L=25}else{M=F;N=H;O=0;P=0}else{K=H;L=25}c:do if((L|0)==25){if(F>>>0<8){Q=0;break b}if(!w){u=K;A=F;s=H;t=0;y=0;while(1){a=(d[u+5>>0]|0)<<8|(d[u+4>>0]|0)|((d[u+7>>0]|0)<<8|(d[u+6>>0]|0))<<16;if(a>>>0>4294967286){q=3;break}z=a+9&-2;if(!(af(u,8848,4)|0)){M=A;N=s;O=t;P=y;break c}if(!(af(u,8853,4)|0)){M=A;N=s;O=t;P=y;break c}if(A>>>0>>0){Q=y;break b}R=(af(u,8843,4)|0)==0;S=R?u+8|0:y;T=u+z|0;U=A-z|0;if(U>>>0<8){Q=S;break b}else{u=T;A=U;s=T;t=R?a:t;y=S}}Y=k;return q|0}y=K;t=22;s=F;A=H;u=0;S=0;while(1){a=(d[y+5>>0]|0)<<8|(d[y+4>>0]|0)|((d[y+7>>0]|0)<<8|(d[y+6>>0]|0))<<16;if(a>>>0>4294967286){q=3;L=65;break}R=a+9&-2;T=R+t|0;if(T>>>0>w>>>0){q=3;L=65;break}if(!(af(y,8848,4)|0)){M=s;N=A;O=u;P=S;break c}if(!(af(y,8853,4)|0)){M=s;N=A;O=u;P=S;break c}if(s>>>0>>0){Q=S;break b}U=(af(y,8843,4)|0)==0;z=U?y+8|0:S;V=y+R|0;W=s-R|0;if(W>>>0<8){Q=z;break b}else{y=V;t=T;s=W;A=V;u=U?a:u;S=z}}if((L|0)==65){Y=k;return q|0}}while(0);S=N;u=(af(S,8853,4)|0)==0;A=u&1;if(M>>>0<8)Q=P;else{if(u|(af(S,8848,4)|0)==0){u=(d[S+5>>0]|0)<<8|(d[S+4>>0]|0)|((d[S+7>>0]|0)<<8|(d[S+6>>0]|0))<<16;if(w>>>0>11&u>>>0>(w+-12|0)>>>0){q=3;Y=k;return q|0}s=M+-8|0;if((p|0)!=0&u>>>0>s>>>0){Q=P;break}X=s;Z=S+8|0;_=u;$=A}else{X=M;Z=N;_=M;$=oe(S,M)|0}if(_>>>0>4294967286){q=3;Y=k;return q|0}if(!(h|(G|0)!=0))c[i>>2]=($|0)==0?1:2;if(!$){if(X>>>0<10){Q=P;break}if(!(pe(Z,X,_,l,m)|0)){q=3;Y=k;return q|0}}else{if(X>>>0<5){Q=P;break}if(!(qe(Z,X,l,m,g)|0)){q=3;Y=k;return q|0}}if(C|0?!((E|0)==(c[l>>2]|0)?(D|0)==(c[m>>2]|0):0):0){q=3;Y=k;return q|0}if(!o){aa=P;break a}c[j>>2]=n;c[j+4>>2]=b;S=j+8|0;c[S>>2]=0;c[S+4>>2]=0;c[j+16>>2]=P;c[j+20>>2]=O;c[j+24>>2]=_;c[j+28>>2]=w;c[j+32>>2]=$;c[j+12>>2]=Z-n;aa=P;break a}}else Q=0;while(0);if(B&(C|0)!=0)aa=Q;else{q=7;Y=k;return q|0}}else aa=0;while(0);if(!v)c[g>>2]=c[g>>2]|(aa|0)!=0;if(e|0)c[e>>2]=c[l>>2];if(!f){q=0;Y=k;return q|0}c[f>>2]=c[m>>2];q=0;Y=k;return q|0}function oe(b,c){b=b|0;c=c|0;var e=0;if(c>>>0<=4){e=0;return e|0}if((a[b>>0]|0)!=47){e=0;return e|0}e=(d[b+4>>0]|0)<32&1;return e|0}function pe(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0;if((b|0)==0|e>>>0<10){i=0;return i|0}if((a[b+3>>0]|0)!=-99){i=0;return i|0}if((a[b+4>>0]|0)!=1){i=0;return i|0}if((a[b+5>>0]|0)!=42){i=0;return i|0}e=d[b>>0]|0;j=d[b+1>>0]<<8|e|d[b+2>>0]<<16;k=d[b+7>>0]<<8&16128|d[b+6>>0];l=d[b+9>>0]<<8&16128|d[b+8>>0];if(!((e&25|0)==16&(5?j>>>5:j)>>>0>>0)){i=0;return i|0}if((k|0)==0|(l|0)==0){i=0;return i|0}if(g|0)c[g>>2]=k;if(!h){i=1;return i|0}c[h>>2]=l;i=1;return i|0}function qe(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0;i=Y;Y=Y+32|0;j=i;if((b|0)==0|e>>>0<5){k=0;Y=i;return k|0}if((a[b>>0]|0)!=47){k=0;Y=i;return k|0}if((d[b+4>>0]|0)>31){k=0;Y=i;return k|0}$a(j,b,e);if(((Ga(j,8)|0)==47?(e=(Ga(j,14)|0)+1|0,b=(Ga(j,14)|0)+1|0,l=Ga(j,1)|0,(Ga(j,3)|0)==0):0)?(c[j+24>>2]|0)==0:0){if(f|0)c[f>>2]=e;if(g|0)c[g>>2]=b;if(!h)m=1;else{c[h>>2]=l;m=1}}else m=0;k=m;Y=i;return k|0}function re(a){a=a|0;var b=0;if(!a)return;b=(ed()|0)+20|0;ea[c[b>>2]&31](a+124|0);oa(a);b=a+2288|0;pa(c[b>>2]|0);c[b>>2]=0;c[a+2292>>2]=0;b=a+12|0;c[b>>2]=0;c[b+4>>2]=0;c[b+8>>2]=0;c[b+12>>2]=0;c[b+16>>2]=0;c[b+20>>2]=0;c[b+24>>2]=0;c[a+4>>2]=0;pa(a);return}function se(){var a=0,b=0;a=va(1,0,2376)|0;if(!a)return a|0;c[a>>2]=0;c[a+8>>2]=8858;b=ed()|0;ea[c[b>>2]&31](a+124|0);c[a+4>>2]=0;c[a+312>>2]=0;if(c[2549]|0)return a|0;c[2549]=1;return a|0}function te(){var a=0,b=0;a=va(1,0,272)|0;if(!a){b=0;return b|0}c[a>>2]=0;c[a+4>>2]=2;_a();b=a;return b|0}function ue(e,f){e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0;if(!e){g=0;return g|0}c[e>>2]=0;h=e+8|0;c[h>>2]=8858;if(!f){c[e>>2]=2;c[h>>2]=8861;c[e+4>>2]=0;g=0;return g|0}i=c[f+64>>2]|0;j=c[f+60>>2]|0;if(j>>>0<4){c[e>>2]=7;c[h>>2]=8898;c[e+4>>2]=0;g=0;return g|0}k=d[i>>0]|0;l=d[i+1>>0]<<8|k|d[i+2>>0]<<16;m=(k&1^1)&255;n=e+40|0;a[n>>0]=m;o=(1?k>>>1:k)&7;a[e+41>>0]=o;p=(4?k>>>4:k)&1;a[e+42>>0]=p;k=5?l>>>5:l;l=e+44|0;c[l>>2]=k;if((o&255)>3){c[e>>2]=3;c[h>>2]=8916;c[e+4>>2]=0;g=0;return g|0}if(!(p<<24>>24)){c[e>>2]=4;c[h>>2]=8947;c[e+4>>2]=0;g=0;return g|0}p=i+3|0;o=j+-3|0;do if(!(m<<24>>24)){q=p;r=o;s=k}else{if(o>>>0<7){c[e>>2]=7;c[h>>2]=8970;c[e+4>>2]=0;g=0;return g|0}if(((a[p>>0]|0)==-99?(a[i+4>>0]|0)==1:0)?(a[i+5>>0]|0)==42:0){t=i+7|0;u=d[t>>0]<<8&16128|d[i+6>>0];b[e+48>>1]=u;v=a[t>>0]|0;a[e+52>>0]=6?(v&255)>>>6:v&255;v=i+9|0;t=d[v>>0]<<8&16128|d[i+8>>0];b[e+50>>1]=t;w=a[v>>0]|0;a[e+53>>0]=6?(w&255)>>>6:w&255;w=u+15|0;c[e+288>>2]=4?w>>>4:w;w=t+15|0;c[e+292>>2]=4?w>>>4:w;c[f>>2]=u;c[f+4>>2]=t;c[f+72>>2]=0;c[f+84>>2]=0;c[f+76>>2]=0;c[f+80>>2]=u;c[f+88>>2]=t;c[f+92>>2]=0;c[f+96>>2]=u;c[f+100>>2]=t;c[f+12>>2]=u;c[f+16>>2]=t;De(e+904|0);c[e+104>>2]=0;c[e+108>>2]=0;c[e+112>>2]=1;c[e+116>>2]=0;c[e+120>>2]=0;q=i+10|0;r=j+-10|0;s=c[l>>2]|0;break}c[e>>2]=3;c[h>>2]=8998;c[e+4>>2]=0;g=0;return g|0}while(0);if(s>>>0>r>>>0){if(c[e>>2]|0){g=0;return g|0}c[e>>2]=7;c[h>>2]=9012;c[e+4>>2]=0;g=0;return g|0}j=e+12|0;Ee(j,q,s);s=c[l>>2]|0;l=q+s|0;i=r-s|0;if(a[n>>0]|0){s=(Fe(j,1)|0)&255;a[e+54>>0]=s;s=(Fe(j,1)|0)&255;a[e+55>>0]=s}s=Fe(j,1)|0;c[e+104>>2]=s;if(s){s=Fe(j,1)|0;f=e+108|0;c[f>>2]=s;if(Fe(j,1)|0){s=Fe(j,1)|0;c[e+112>>2]=s;if(!(Fe(j,1)|0))x=0;else x=(Ge(j,7)|0)&255;a[e+116>>0]=x;if(!(Fe(j,1)|0))y=0;else y=(Ge(j,7)|0)&255;a[e+117>>0]=y;if(!(Fe(j,1)|0))z=0;else z=(Ge(j,7)|0)&255;a[e+118>>0]=z;if(!(Fe(j,1)|0))A=0;else A=(Ge(j,7)|0)&255;a[e+119>>0]=A;if(!(Fe(j,1)|0))B=0;else B=(Ge(j,6)|0)&255;a[e+120>>0]=B;if(!(Fe(j,1)|0))C=0;else C=(Ge(j,6)|0)&255;a[e+121>>0]=C;if(!(Fe(j,1)|0))D=0;else D=(Ge(j,6)|0)&255;a[e+122>>0]=D;if(!(Fe(j,1)|0))E=0;else E=(Ge(j,6)|0)&255;a[e+123>>0]=E}if(c[f>>2]|0){if(!(Fe(j,1)|0))F=-1;else F=(Fe(j,8)|0)&255;a[e+904>>0]=F;if(!(Fe(j,1)|0))G=-1;else G=(Fe(j,8)|0)&255;a[e+905>>0]=G;if(!(Fe(j,1)|0))H=-1;else H=(Fe(j,8)|0)&255;a[e+906>>0]=H}}else c[e+108>>2]=0;H=e+36|0;if(c[H>>2]|0){if(c[e>>2]|0){g=0;return g|0}c[e>>2]=3;c[h>>2]=9033;c[e+4>>2]=0;g=0;return g|0}G=Fe(j,1)|0;F=e+56|0;c[F>>2]=G;G=Fe(j,6)|0;f=e+60|0;c[f>>2]=G;G=Fe(j,3)|0;c[e+64>>2]=G;G=Fe(j,1)|0;c[e+68>>2]=G;do if(G|0?Fe(j,1)|0:0){if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+72>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+76>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+80>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+84>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+88>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+92>>2]=E}if(Fe(j,1)|0){E=Ge(j,6)|0;c[e+96>>2]=E}if(!(Fe(j,1)|0))break;E=Ge(j,6)|0;c[e+100>>2]=E}while(0);if(!(c[f>>2]|0))I=0;else I=(c[F>>2]|0)==0?2:1;c[e+2308>>2]=I;if(c[H>>2]|0){if(c[e>>2]|0){g=0;return g|0}c[e>>2]=3;c[h>>2]=9061;c[e+4>>2]=0;g=0;return g|0}H=q+r|0;r=(1<<(Fe(j,2)|0))+-1|0;c[e+312>>2]=r;q=r*3|0;if(i>>>0>=q>>>0){I=l+q|0;F=i-q|0;if(!r){J=F;K=I}else{q=0;i=F;F=I;I=l;while(1){l=d[I+1>>0]<<8|d[I>>0]|d[I+2>>0]<<16;f=l>>>0>i>>>0?i:l;Ee(e+316+(q*28|0)|0,F,f);l=F+f|0;G=i-f|0;q=q+1|0;if((q|0)==(r|0)){J=G;K=l;break}else{i=G;F=l;I=I+3|0}}}Ee(e+316+(r*28|0)|0,K,J);if(K>>>0>>0){He(e);if(a[n>>0]|0){Fe(j,1)|0;Ie(j,e);c[e+4>>2]=1;g=1;return g|0}if(c[e>>2]|0){g=0;return g|0}c[e>>2]=4;c[h>>2]=9112;c[e+4>>2]=0;g=0;return g|0}else L=5}else L=7;if(c[e>>2]|0){g=0;return g|0}c[e>>2]=L;c[h>>2]=9088;c[e+4>>2]=0;g=0;return g|0}function ve(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0,Ka=0,La=0,Ma=0,Na=0,Oa=0,Pa=0,Qa=0;f=e+288|0;if((c[f>>2]|0)<=0){g=e+36|0;h=c[g>>2]|0;i=(h|0)==0;j=i&1;return j|0}k=e+2244|0;l=e+2248|0;m=e+2304|0;n=e+108|0;o=e+2236|0;p=e+904|0;q=b+4|0;t=b+8|0;u=e+2240|0;v=b+12|0;w=b+20|0;x=e+906|0;y=e+905|0;z=0;do{A=(c[k>>2]|0)+(z<<2)|0;B=c[m>>2]|0;if(!(c[n>>2]|0))C=0;else{D=d[p>>0]|0;E=c[q>>2]|0;F=c[t>>2]|0;do if((F|0)<0){G=c[v>>2]|0;if(G>>>0<(c[w>>2]|0)>>>0){H=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;c[v>>2]=G+3;G=Kf(H|0)|0;c[b>>2]=c[b>>2]<<24|(8?G>>>8:G);G=F+24|0;c[t>>2]=G;I=G;break}else{Ce(b);I=c[t>>2]|0;break}}else I=F;while(0);F=r(E,D)|0;G=8?F>>>8:F;F=c[b>>2]|0;H=(I?F>>>I:F)>>>0>G>>>0;if(H){J=F-(G+1<>2]=J;K=E-G|0;L=J}else{K=G+1|0;L=F}F=(s(K|0)|0)^24;G=I-F|0;c[t>>2]=G;J=(K<>2]=J;if(H){H=d[x>>0]|0;do if((G|0)<0){F=c[v>>2]|0;if(F>>>0<(c[w>>2]|0)>>>0){M=d[F>>0]|d[F+1>>0]<<8|d[F+2>>0]<<16|d[F+3>>0]<<24;c[v>>2]=F+3;F=Kf(M|0)|0;M=(8?F>>>8:F)|L<<24;c[b>>2]=M;F=G+24|0;c[t>>2]=F;N=M;O=F;break}else{Ce(b);N=c[b>>2]|0;O=c[t>>2]|0;break}}else{N=L;O=G}while(0);E=r(J,H)|0;D=8?E>>>8:E;E=(O?N>>>O:N)>>>0>D>>>0;if(E){c[b>>2]=N-(D+1<>2]=O-D;c[q>>2]=(P<>0]|0;do if((G|0)<0){D=c[v>>2]|0;if(D>>>0<(c[w>>2]|0)>>>0){F=d[D>>0]|d[D+1>>0]<<8|d[D+2>>0]<<16|d[D+3>>0]<<24;c[v>>2]=D+3;D=Kf(F|0)|0;F=(8?D>>>8:D)|L<<24;c[b>>2]=F;D=G+24|0;c[t>>2]=D;R=F;S=D;break}else{Ce(b);R=c[b>>2]|0;S=c[t>>2]|0;break}}else{R=L;S=G}while(0);G=r(J,E)|0;H=8?G>>>8:G;G=(S?R>>>S:R)>>>0>H>>>0;if(G){c[b>>2]=R-(H+1<>2]=S-H;c[q>>2]=(T<>0]=C;if(!(c[o>>2]|0)){U=c[t>>2]|0;V=c[q>>2]|0}else{G=d[u>>0]|0;H=c[q>>2]|0;D=c[t>>2]|0;do if((D|0)<0){F=c[v>>2]|0;if(F>>>0<(c[w>>2]|0)>>>0){M=d[F>>0]|d[F+1>>0]<<8|d[F+2>>0]<<16|d[F+3>>0]<<24;c[v>>2]=F+3;F=Kf(M|0)|0;c[b>>2]=c[b>>2]<<24|(8?F>>>8:F);F=D+24|0;c[t>>2]=F;W=F;break}else{Ce(b);W=c[t>>2]|0;break}}else W=D;while(0);D=r(H,G)|0;J=8?D>>>8:D;D=c[b>>2]|0;E=(W?D>>>W:D)>>>0>J>>>0;if(E){c[b>>2]=D-(J+1<>2]=D;F=(X<>2]=F;a[B+(z*800|0)+797>>0]=E&1;U=D;V=F}do if((U|0)<0){F=c[v>>2]|0;if(F>>>0<(c[w>>2]|0)>>>0){D=d[F>>0]|d[F+1>>0]<<8|d[F+2>>0]<<16|d[F+3>>0]<<24;c[v>>2]=F+3;F=Kf(D|0)|0;c[b>>2]=c[b>>2]<<24|(8?F>>>8:F);F=U+24|0;c[t>>2]=F;Y=F;break}else{Ce(b);Y=c[t>>2]|0;break}}else Y=U;while(0);H=V*145|0;G=8?H>>>8:H;H=c[b>>2]|0;F=(Y?H>>>Y:H)>>>0>G>>>0;if(F){D=H-(G+1<>2]=D;Z=V-G|0;_=D}else{Z=G+1|0;_=H}H=(s(Z|0)|0)^24;G=Y-H|0;c[t>>2]=G;D=(Z<>2]=D;a[B+(z*800|0)+768>>0]=(F^1)&1;if(F){do if((G|0)<0){F=c[v>>2]|0;if(F>>>0<(c[w>>2]|0)>>>0){H=d[F>>0]|d[F+1>>0]<<8|d[F+2>>0]<<16|d[F+3>>0]<<24;c[v>>2]=F+3;F=Kf(H|0)|0;H=(8?F>>>8:F)|_<<24;c[b>>2]=H;F=G+24|0;c[t>>2]=F;$=H;aa=F;break}else{Ce(b);$=c[b>>2]|0;aa=c[t>>2]|0;break}}else{$=_;aa=G}while(0);G=D*156|0;F=8?G>>>8:G;G=(aa?$>>>aa:$)>>>0>F>>>0;if(G){H=$-(F+1<>2]=H;ba=D-F|0;ca=H}else{ba=F+1|0;ca=$}F=(s(ba|0)|0)^24;H=aa-F|0;c[t>>2]=H;E=(ba<>2]=E;F=(H|0)<0;if(G){do if(F){G=c[v>>2]|0;if(G>>>0<(c[w>>2]|0)>>>0){J=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;c[v>>2]=G+3;G=Kf(J|0)|0;J=(8?G>>>8:G)|ca<<24;c[b>>2]=J;G=H+24|0;c[t>>2]=G;da=J;ea=G;break}else{Ce(b);da=c[b>>2]|0;ea=c[t>>2]|0;break}}else{da=ca;ea=H}while(0);D=(1?E>>>1:E)&16777215;G=(ea?da>>>ea:da)>>>0>D>>>0;if(G){c[b>>2]=da-(D+1<>2]=ea-D;c[q>>2]=(fa<>2]|0;if(G>>>0<(c[w>>2]|0)>>>0){D=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;c[v>>2]=G+3;G=Kf(D|0)|0;D=(8?G>>>8:G)|ca<<24;c[b>>2]=D;G=H+24|0;c[t>>2]=G;ha=D;ia=G;break}else{Ce(b);ha=c[b>>2]|0;ia=c[t>>2]|0;break}}else{ha=ca;ia=H}while(0);H=E*163|0;F=8?H>>>8:H;H=(ia?ha>>>ia:ha)>>>0>F>>>0;if(H){c[b>>2]=ha-(F+1<>2]=ia-F;c[q>>2]=(ja<>0]=H;Nf(A|0,H|0,4)|0;Nf(l|0,H|0,4)|0}else{H=B+(z*800|0)+769|0;F=0;while(1){G=e+2248+F|0;D=0;J=d[G>>0]|0;do{M=A+D|0;ka=d[M>>0]|0;la=d[4144+(ka*90|0)+(J*9|0)>>0]|0;ma=c[q>>2]|0;na=c[t>>2]|0;do if((na|0)<0){oa=c[v>>2]|0;if(oa>>>0<(c[w>>2]|0)>>>0){pa=d[oa>>0]|d[oa+1>>0]<<8|d[oa+2>>0]<<16|d[oa+3>>0]<<24;c[v>>2]=oa+3;oa=Kf(pa|0)|0;c[b>>2]=c[b>>2]<<24|(8?oa>>>8:oa);oa=na+24|0;c[t>>2]=oa;qa=oa;break}else{Ce(b);qa=c[t>>2]|0;break}}else qa=na;while(0);na=r(ma,la)|0;oa=8?na>>>8:na;na=c[b>>2]|0;pa=(qa?na>>>qa:na)>>>0>oa>>>0;ra=pa&1;if(pa){pa=na-(oa+1<>2]=pa;sa=ma-oa|0;ta=pa}else{sa=oa+1|0;ta=na}na=(s(sa|0)|0)^24;oa=qa-na|0;c[t>>2]=oa;pa=(sa<>2]=pa;na=a[5056+ra>>0]|0;if(!((ra?41706>>>ra:41706)&1))ua=na;else{ra=na;na=oa;oa=ta;va=pa;while(1){pa=ra<<1;wa=d[4144+(ka*90|0)+(J*9|0)+ra>>0]|0;do if((na|0)<0){xa=c[v>>2]|0;if(xa>>>0<(c[w>>2]|0)>>>0){ya=d[xa>>0]|d[xa+1>>0]<<8|d[xa+2>>0]<<16|d[xa+3>>0]<<24;c[v>>2]=xa+3;xa=Kf(ya|0)|0;ya=(8?xa>>>8:xa)|oa<<24;c[b>>2]=ya;xa=na+24|0;c[t>>2]=xa;za=ya;Aa=xa;break}else{Ce(b);za=c[b>>2]|0;Aa=c[t>>2]|0;break}}else{za=oa;Aa=na}while(0);xa=r(va,wa)|0;ya=8?xa>>>8:xa;xa=(Aa?za>>>Aa:za)>>>0>ya>>>0;if(xa){Ba=za-(ya+1<>2]=Ba;Ca=va-ya|0;Da=Ba}else{Ca=ya+1|0;Da=za}ya=(s(Ca|0)|0)^24;na=Aa-ya|0;c[t>>2]=na;va=(Ca<>2]=va;ya=pa|xa&1;Ea=a[5056+ya>>0]|0;if(!((ya?41706>>>ya:41706)&1))break;else{ra=Ea<<24>>24;oa=Da}}ua=Ea<<24>>24}J=0-ua|0;Fa=J&255;a[M>>0]=Fa;D=D+1|0}while((D|0)!=4);D=d[A>>0]|d[A+1>>0]<<8|d[A+2>>0]<<16|d[A+3>>0]<<24;a[H>>0]=D;a[H+1>>0]=D>>8;a[H+2>>0]=D>>16;a[H+3>>0]=D>>24;a[G>>0]=Fa;F=F+1|0;if((F|0)==4)break;else H=H+4|0}}H=c[q>>2]|0;F=c[t>>2]|0;do if((F|0)<0){A=c[v>>2]|0;if(A>>>0<(c[w>>2]|0)>>>0){E=d[A>>0]|d[A+1>>0]<<8|d[A+2>>0]<<16|d[A+3>>0]<<24;c[v>>2]=A+3;A=Kf(E|0)|0;c[b>>2]=c[b>>2]<<24|(8?A>>>8:A);A=F+24|0;c[t>>2]=A;Ga=A;break}else{Ce(b);Ga=c[t>>2]|0;break}}else Ga=F;while(0);F=H*142|0;A=8?F>>>8:F;F=c[b>>2]|0;E=(Ga?F>>>Ga:F)>>>0>A>>>0;if(E){D=F-(A+1<>2]=D;Ha=H-A|0;Ia=D}else{Ha=A+1|0;Ia=F}F=(s(Ha|0)|0)^24;A=Ga-F|0;c[t>>2]=A;D=(Ha<>2]=D;if(E){do if((A|0)<0){E=c[v>>2]|0;if(E>>>0<(c[w>>2]|0)>>>0){F=d[E>>0]|d[E+1>>0]<<8|d[E+2>>0]<<16|d[E+3>>0]<<24;c[v>>2]=E+3;E=Kf(F|0)|0;F=(8?E>>>8:E)|Ia<<24;c[b>>2]=F;E=A+24|0;c[t>>2]=E;Ja=F;Ka=E;break}else{Ce(b);Ja=c[b>>2]|0;Ka=c[t>>2]|0;break}}else{Ja=Ia;Ka=A}while(0);A=D*114|0;H=8?A>>>8:A;A=(Ka?Ja>>>Ka:Ja)>>>0>H>>>0;if(A){E=Ja-(H+1<>2]=E;La=D-H|0;Ma=E}else{La=H+1|0;Ma=Ja}H=(s(La|0)|0)^24;E=Ka-H|0;c[t>>2]=E;F=(La<>2]=F;if(A){do if((E|0)<0){A=c[v>>2]|0;if(A>>>0<(c[w>>2]|0)>>>0){H=d[A>>0]|d[A+1>>0]<<8|d[A+2>>0]<<16|d[A+3>>0]<<24;c[v>>2]=A+3;A=Kf(H|0)|0;H=(8?A>>>8:A)|Ma<<24;c[b>>2]=H;A=E+24|0;c[t>>2]=A;Na=H;Oa=A;break}else{Ce(b);Na=c[b>>2]|0;Oa=c[t>>2]|0;break}}else{Na=Ma;Oa=E}while(0);E=F*183|0;D=8?E>>>8:E;E=(Oa?Na>>>Oa:Na)>>>0>D>>>0;if(E){c[b>>2]=Na-(D+1<>2]=Oa-D;c[q>>2]=(Pa<>0]=Qa;z=z+1|0}while((z|0)<(c[f>>2]|0));g=e+36|0;h=c[g>>2]|0;i=(h|0)==0;j=i&1;return j|0}function we(e,f){e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0;g=Y;Y=Y+32|0;h=g;i=c[e+2256>>2]|0;j=e+2296|0;k=c[j>>2]|0;l=i+(k<<1)|0;m=c[e+2304>>2]|0;if((c[e+2236>>2]|0)!=0?(n=a[m+(k*800|0)+797>>0]|0,o=n&255,n<<24>>24!=0):0){a[l>>0]=0;a[i+-2>>0]=0;if(!(a[m+(k*800|0)+768>>0]|0)){a[i+(k<<1)+1>>0]=0;a[i+-1>>0]=0}c[m+(k*800|0)+788>>2]=0;c[m+(k*800|0)+792>>2]=0;a[m+(k*800|0)+796>>0]=0;p=o}else{o=m+(k*800|0)|0;n=d[m+(k*800|0)+798>>0]|0;Nf(o|0,0,768)|0;if(!(a[m+(k*800|0)+768>>0]|0)){c[h>>2]=0;c[h+4>>2]=0;c[h+8>>2]=0;c[h+12>>2]=0;c[h+16>>2]=0;c[h+20>>2]=0;c[h+24>>2]=0;c[h+28>>2]=0;q=i+(k<<1)+1|0;r=i+-1|0;s=da[c[2549]&1](f,e+2032|0,(d[r>>0]|0)+(d[q>>0]|0)|0,e+776+(n<<5)+8|0,0,h)|0;t=(s|0)>0&1;a[r>>0]=t;a[q>>0]=t;if((s|0)>1)ud(h,o);else{s=(b[h>>1]|0)+3|0;h=(3?s>>3:s)&65535;b[m+(k*800|0)>>1]=h;b[m+(k*800|0)+32>>1]=h;b[m+(k*800|0)+64>>1]=h;b[m+(k*800|0)+96>>1]=h;b[m+(k*800|0)+128>>1]=h;b[m+(k*800|0)+160>>1]=h;b[m+(k*800|0)+192>>1]=h;b[m+(k*800|0)+224>>1]=h;b[m+(k*800|0)+256>>1]=h;b[m+(k*800|0)+288>>1]=h;b[m+(k*800|0)+320>>1]=h;b[m+(k*800|0)+352>>1]=h;b[m+(k*800|0)+384>>1]=h;b[m+(k*800|0)+416>>1]=h;b[m+(k*800|0)+448>>1]=h;b[m+(k*800|0)+480>>1]=h}u=1;v=0}else{u=0;v=3}h=e+1964+(v*68|0)|0;v=i+-2|0;i=e+776+(n<<5)|0;s=o;o=a[l>>0]&15;t=a[v>>0]&15;q=0;r=0;while(1){w=t&255;x=o&255;y=da[c[2549]&1](f,h,(w&1)+(x&1)|0,i,u,s)|0;z=(y|0)>(u|0)&1;A=1?x>>>1:x;x=z<<7|A;B=(b[s>>1]|0)!=0&1;C=s+32|0;D=da[c[2549]&1](f,h,(A&1)+z|0,i,u,C)|0;z=(D|0)>(u|0)&1;A=1?x>>>1:x;x=z<<7|A;E=((D|0)>3?3:(D|0)>1?2:(b[C>>1]|0)!=0&1)|((y|0)>3?12:(y|0)>1?8:B<<2);B=s+64|0;y=da[c[2549]&1](f,h,(A&1)+z|0,i,u,B)|0;z=(y|0)>(u|0)&1;A=1?x>>>1:x;x=((y|0)>3?3:(y|0)>1?2:(b[B>>1]|0)!=0&1)|E<<2;E=s+96|0;B=z<<7|A&224;y=da[c[2549]&1](f,h,(A&1)+z|0,i,u,E)|0;z=((y|0)>(u|0)&1)<<7;A=(z|(1?B>>>1:B))&255;o=4?(A&255)>>>4:A&255;F=z|(1?w>>>1:w);q=x<<2|q<<8|((y|0)>3?3:(y|0)>1?2:(b[E>>1]|0)!=0&1);r=r+1|0;if((r|0)==4)break;else{s=s+128|0;t=F&255}}t=m+(k*800|0)+512|0;s=e+2100|0;r=e+776+(n<<5)+16|0;u=d[l>>0]|0;i=d[v>>0]|0;h=da[c[2549]&1](f,s,((4?i>>>4:i)&1)+((4?u>>>4:u)&1)|0,r,0,t)|0;E=(h|0)>0&1;y=(b[t>>1]|0)!=0&1;t=m+(k*800|0)+544|0;x=da[c[2549]&1](f,s,((5?u>>>5:u)&1)+E|0,r,0,t)|0;u=(x|0)>0&1;w=((x|0)>3?3:(x|0)>1?2:(b[t>>1]|0)!=0&1)|((h|0)>3?12:(h|0)>1?8:y<<2);y=m+(k*800|0)+576|0;h=da[c[2549]&1](f,s,((5?i>>>5:i)&1)+E|0,r,0,y)|0;E=(h|0)>0&1;i=((h|0)>3?3:(h|0)>1?2:(b[y>>1]|0)!=0&1)|w<<2;w=m+(k*800|0)+608|0;y=da[c[2549]&1](f,s,E+u|0,r,0,w)|0;h=(y|0)>0&1;t=((y|0)>3?3:(y|0)>1?2:(b[w>>1]|0)!=0&1)|i<<2;i=m+(k*800|0)+640|0;w=d[l>>0]|0;y=d[v>>0]|0;x=da[c[2549]&1](f,s,((6?y>>>6:y)&1)+((6?w>>>6:w)&1)|0,r,0,i)|0;z=(x|0)>0&1;A=(b[i>>1]|0)!=0&1;i=m+(k*800|0)+672|0;B=da[c[2549]&1](f,s,(7?w>>>7:w)+z|0,r,0,i)|0;w=(B|0)>0&1;C=((B|0)>3?3:(B|0)>1?2:(b[i>>1]|0)!=0&1)|((x|0)>3?12:(x|0)>1?8:A<<2);A=m+(k*800|0)+704|0;x=da[c[2549]&1](f,s,(7?y>>>7:y)+z|0,r,0,A)|0;z=(x|0)>0&1;y=((x|0)>3?3:(x|0)>1?2:(b[A>>1]|0)!=0&1)|C<<2;C=m+(k*800|0)+736|0;A=da[c[2549]&1](f,s,z+w|0,r,0,C)|0;r=(A|0)>0&1;s=t|(((A|0)>3?3:(A|0)>1?2:(b[C>>1]|0)!=0&1)|y<<2)<<8;a[l>>0]=(h<<1|E)<<4|o&255|(r<<1|z)<<6;a[v>>0]=u<<4|(4?F>>>4:F)|h<<5|w<<6|r<<7;c[m+(k*800|0)+788>>2]=q;c[m+(k*800|0)+792>>2]=s;if(!(s&43690))G=c[e+776+(n<<5)+28>>2]&255;else G=0;a[m+(k*800|0)+796>>0]=G;p=(s|q|0)==0&1}if((c[e+2308>>2]|0)<=0){H=f+24|0;I=c[H>>2]|0;J=(I|0)==0;K=J&1;Y=g;return K|0}q=c[e+2260>>2]|0;s=c[j>>2]|0;j=q+(s<<2)|0;G=e+2312+(d[m+(k*800|0)+798>>0]<<3)+(d[m+(k*800|0)+768>>0]<<2)|0;k=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;a[j>>0]=k;a[j+1>>0]=k>>8;a[j+2>>0]=k>>16;a[j+3>>0]=k>>24;k=q+(s<<2)+2|0;a[k>>0]=d[k>>0]|(p|0)==0;H=f+24|0;I=c[H>>2]|0;J=(I|0)==0;K=J&1;Y=g;return K|0}function xe(a,b){a=a|0;b=b|0;var d=0,e=0,f=0,g=0;if(!a){d=0;return d|0}if(!b){c[a>>2]=2;d=0;return d|0}c[a+8>>2]=b;c[a>>2]=0;e=a+24|0;$a(e,c[b+64>>2]|0,c[b+60>>2]|0);if(((Ga(e,8)|0)==47?(f=(Ga(e,14)|0)+1|0,g=(Ga(e,14)|0)+1|0,Ga(e,1)|0,(Ga(e,3)|0)==0):0)?(c[a+48>>2]|0)==0:0){c[a+4>>2]=2;c[b>>2]=f;c[b+4>>2]=g;if(ab(f,g,1,a,0)|0){d=1;return d|0}ra(a);d=0;return d|0}c[a>>2]=3;ra(a);d=0;return d|0}function ye(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0;if(!a){b=0;return b|0}d=c[a+8>>2]|0;e=c[d+40>>2]|0;f=a+4|0;a:do if(!(c[f>>2]|0)){g=a+16|0;h=a+100|0;i=a+104|0;j=23}else{k=a+12|0;c[k>>2]=c[e>>2];if(!(Ub(c[e+20>>2]|0,d,3)|0)){c[a>>2]=2;break}l=c[d>>2]|0;m=a+100|0;n=c[m>>2]|0;o=a+104|0;p=c[o>>2]|0;q=Cf(p|0,((p|0)<0)<<31>>31|0,n|0,((n|0)<0)<<31>>31|0)|0;n=v()|0;p=l&65535;r=Jf(l|0,((l|0)<0)<<31>>31|0,4)|0;l=Df(r|0,v()|0,p|0,0)|0;r=Df(l|0,v()|0,q|0,n|0)|0;n=wa(r,v()|0,4)|0;r=a+16|0;c[r>>2]=n;if(!n){c[a>>2]=1;c[a+20>>2]=0;break}c[a+20>>2]=n+(q<<2)+(p<<2);p=d+92|0;do if(c[p>>2]|0){q=c[d+12>>2]|0;n=c[d+96>>2]|0;l=c[d+16>>2]|0;s=c[d+100>>2]|0;t=((n|0)<0)<<31>>31;u=Jf(n|0,t|0,5)|0;w=Df(u|0,v()|0,84,0)|0;x=v()|0;y=Jf(n|0,t|0,2)|0;t=Df(w|0,x|0,y|0,v()|0)|0;y=wa(t,v()|0,1)|0;if(y){c[a+264>>2]=y;c[a+268>>2]=y;t=y+84|0;Wb(y,q,l,t+u|0,n,s,0,4,t);if(!(c[p>>2]|0)){j=12;break}else{j=13;break}}else{c[a>>2]=1;break a}}else j=12;while(0);if((j|0)==12){p=c[c[k>>2]>>2]|0;if((p+-7|0)>>>0>3)z=p;else j=13}if((j|0)==13){Da();z=c[c[k>>2]>>2]|0}if(z>>>0>10?(ze(),c[(c[k>>2]|0)+28>>2]|0):0)Da();if(((c[a+56>>2]|0?(c[a+120>>2]|0)>0:0)?(p=a+136|0,(c[p>>2]|0)==0):0)?(db(p,c[a+132>>2]|0)|0)==0:0){c[a>>2]=1;break}c[f>>2]=0;g=r;h=m;i=o;j=23}while(0);if((j|0)==23?Ia(a,c[g>>2]|0,c[h>>2]|0,c[i>>2]|0,c[d+88>>2]|0,2)|0:0){c[e+16>>2]=c[a+116>>2];b=1;return b|0}ra(a);b=0;return b|0}function ze(){if(Te(10168)|0)return;c[2042]=0;Ue(10168)|0;return}function Ae(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)<=0)return;f=0;do{g=c[b+(f<<2)>>2]|0;h=((g&255)*6420|0)+1081344+(((16?g>>>16:g)&255)*16839|0)+(((8?g>>>8:g)&255)*33059|0)|0;a[d+f>>0]=16?h>>>16:h;f=f+1|0}while((f|0)!=(e|0));return}function Be(b,e,f,g,h){b=b|0;e=e|0;f=f|0;g=g|0;h=h|0;var i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0;i=1?g>>1:g;if((g|0)>1)if(!h){j=0;while(1){k=j<<1;l=c[b+(k<<2)>>2]|0;m=c[b+((k|1)<<2)>>2]|0;k=((15?m>>>15:m)&510)+((15?l>>>15:l)&510)|0;n=((7?m>>>7:m)&510)+((7?l>>>7:l)&510)|0;o=(m<<1&510)+(l<<1&510)|0;l=(r(n,-19081)|0)+(r(k,-9719)|0)+(o*28800|0)|0;m=l+33685504|0;p=18?m>>18:m;m=(r(n,-24116)|0)+(k*28800|0)+(r(o,-4684)|0)|0;o=m+33685504|0;k=18?o>>18:o;o=e+j|0;n=(p>>>0<256?p:(l|0)<-33685504?0:255)+1+(d[o>>0]|0)|0;a[o>>0]=1?n>>>1:n;n=f+j|0;o=(k>>>0<256?k:(m|0)<-33685504?0:255)+1+(d[n>>0]|0)|0;a[n>>0]=1?o>>>1:o;o=j+1|0;if((o|0)<(i|0))j=o;else{q=o;break}}}else{j=0;while(1){o=j<<1;n=c[b+(o<<2)>>2]|0;m=c[b+((o|1)<<2)>>2]|0;o=((15?m>>>15:m)&510)+((15?n>>>15:n)&510)|0;k=((7?m>>>7:m)&510)+((7?n>>>7:n)&510)|0;l=(m<<1&510)+(n<<1&510)|0;n=(r(k,-19081)|0)+(r(o,-9719)|0)+(l*28800|0)|0;m=n+33685504|0;p=18?m>>18:m;m=(r(k,-24116)|0)+(o*28800|0)+(r(l,-4684)|0)|0;l=m+33685504|0;o=18?l>>18:l;a[e+j>>0]=p>>>0<256?p:(n|0)<-33685504?0:255;a[f+j>>0]=o>>>0<256?o:(m|0)<-33685504?0:255;m=j+1|0;if((m|0)<(i|0))j=m;else{q=m;break}}}else q=0;if(!(g&1))return;g=c[b+(q<<1<<2)>>2]|0;b=(14?g>>>14:g)&1020;j=(6?g>>>6:g)&1020;i=g<<2&1020;g=(r(j,-19081)|0)+(r(b,-9719)|0)+(i*28800|0)|0;m=g+33685504|0;o=18?m>>18:m;m=o>>>0<256?o:(g|0)<-33685504?0:255;g=(r(j,-24116)|0)+(b*28800|0)+(r(i,-4684)|0)|0;i=g+33685504|0;b=18?i>>18:i;i=b>>>0<256?b:(g|0)<-33685504?0:255;if(!h){h=e+q|0;g=m+1+(d[h>>0]|0)|0;a[h>>0]=1?g>>>1:g;g=f+q|0;h=i+1+(d[g>>0]|0)|0;a[g>>0]=1?h>>>1:h;return}else{a[e+q>>0]=m;a[f+q>>0]=i;return}}function Ce(a){a=a|0;var b=0,e=0,f=0;b=a+12|0;e=c[b>>2]|0;if(e>>>0<(c[a+16>>2]|0)>>>0){f=a+8|0;c[f>>2]=(c[f>>2]|0)+8;c[b>>2]=e+1;c[a>>2]=c[a>>2]<<8|(d[e>>0]|0);return}e=a+24|0;if(!(c[e>>2]|0)){c[a>>2]=c[a>>2]<<8;b=a+8|0;c[b>>2]=(c[b>>2]|0)+8;c[e>>2]=1;return}else{c[a+8>>2]=0;return}}function De(c){c=c|0;b[c>>1]=65535;a[c+2>>0]=255;return}function Ee(a,b,e){a=a|0;b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;c[a+4>>2]=254;c[a>>2]=0;f=a+8|0;c[f>>2]=-8;g=a+24|0;c[g>>2]=0;h=a+12|0;c[h>>2]=b;i=b+e|0;c[a+16>>2]=i;j=e>>>0>3?i+-4+1|0:b;c[a+20>>2]=j;if(j>>>0>b>>>0){j=d[b>>0]|d[b+1>>0]<<8|d[b+2>>0]<<16|d[b+3>>0]<<24;c[h>>2]=b+3;i=Kf(j|0)|0;c[a>>2]=8?i>>>8:i;c[f>>2]=16;return}if((e|0)>0){c[f>>2]=0;c[h>>2]=b+1;c[a>>2]=d[b>>0];return}else{c[a>>2]=0;c[f>>2]=0;c[g>>2]=1;return}}function Fe(a,b){a=a|0;b=b|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,t=0,u=0;if((b|0)<=0){e=0;return e|0}f=a+4|0;g=a+8|0;h=a+12|0;i=a+20|0;j=a+16|0;k=a+24|0;l=0;m=b;b=c[g>>2]|0;n=c[f>>2]|0;while(1){o=m;m=m+-1|0;do if((b|0)<0){p=c[h>>2]|0;if(p>>>0<(c[i>>2]|0)>>>0){q=d[p>>0]|d[p+1>>0]<<8|d[p+2>>0]<<16|d[p+3>>0]<<24;c[h>>2]=p+3;r=Kf(q|0)|0;c[a>>2]=c[a>>2]<<24|(8?r>>>8:r);r=b+24|0;c[g>>2]=r;t=r;break}if(p>>>0<(c[j>>2]|0)>>>0){r=b+8|0;c[g>>2]=r;c[h>>2]=p+1;c[a>>2]=c[a>>2]<<8|(d[p>>0]|0);t=r;break}if(!(c[k>>2]|0)){c[a>>2]=c[a>>2]<<8;r=b+8|0;c[g>>2]=r;c[k>>2]=1;t=r;break}else{c[g>>2]=0;t=0;break}}else t=b;while(0);r=(1?n>>>1:n)&16777215;p=c[a>>2]|0;q=(t?p>>>t:p)>>>0>r>>>0;if(q){c[a>>2]=p-(r+1<>2]=b;n=(u<>2]=n;r=(q&1)<>2]|0)==0;o=0;do{if(n)if(!o){p=g;q=16}else{r=b+776+(o<<5)|0;c[r>>2]=c[m>>2];c[r+4>>2]=c[m+4>>2];c[r+8>>2]=c[m+8>>2];c[r+12>>2]=c[m+12>>2];c[r+16>>2]=c[m+16>>2];c[r+20>>2]=c[m+20>>2];c[r+24>>2]=c[m+24>>2];c[r+28>>2]=c[m+28>>2]}else{p=((c[f>>2]|0)==0?g:0)+(a[b+116+o>>0]|0)|0;q=16}if((q|0)==16){q=0;r=p+h|0;s=(r|0)<127?r:127;c[b+776+(o<<5)>>2]=d[7200+((s|0)>0?s:0)>>0];s=(p|0)<127?p:127;c[b+776+(o<<5)+4>>2]=e[7328+(((s|0)>0?s:0)<<1)>>1];s=p+i|0;r=(s|0)<127?s:127;c[b+776+(o<<5)+8>>2]=d[7200+((r|0)>0?r:0)>>0]<<1;r=p+j|0;s=(r|0)<127?r:127;r=(e[7328+(((s|0)>0?s:0)<<1)>>1]|0)*101581|0;c[b+776+(o<<5)+12>>2]=r>>>0<524288?8:16?r>>>16:r;r=p+k|0;s=(r|0)<117?r:117;c[b+776+(o<<5)+16>>2]=d[7200+((s|0)>0?s:0)>>0];s=p+l|0;r=(s|0)<127?s:127;c[b+776+(o<<5)+20>>2]=e[7328+(((r|0)>0?r:0)<<1)>>1];c[b+776+(o<<5)+24>>2]=s}o=o+1|0}while((o|0)!=4);return}function Ie(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0;f=b+4|0;g=b+8|0;h=b+12|0;i=b+20|0;j=0;do{k=0;do{l=0;do{m=d[5088+(j*264|0)+(k*33|0)+l>>0]|0;n=c[f>>2]|0;o=c[g>>2]|0;do if((o|0)<0){p=c[h>>2]|0;if(p>>>0<(c[i>>2]|0)>>>0){q=d[p>>0]|d[p+1>>0]<<8|d[p+2>>0]<<16|d[p+3>>0]<<24;c[h>>2]=p+3;p=Kf(q|0)|0;c[b>>2]=c[b>>2]<<24|(8?p>>>8:p);p=o+24|0;c[g>>2]=p;t=p;break}else{Ce(b);t=c[g>>2]|0;break}}else t=o;while(0);o=r(n,m)|0;p=8?o>>>8:o;o=c[b>>2]|0;q=(t?o>>>t:o)>>>0>p>>>0;if(q){c[b>>2]=o-(p+1<>2]=t-p;c[f>>2]=(u<>0]|0;a[e+907+(j*264|0)+(k*33|0)+l>>0]=v;l=l+1|0}while((l|0)!=11);l=0;do{q=d[5088+(j*264|0)+(k*33|0)+11+l>>0]|0;p=c[f>>2]|0;o=c[g>>2]|0;do if((o|0)<0){w=c[h>>2]|0;if(w>>>0<(c[i>>2]|0)>>>0){x=d[w>>0]|d[w+1>>0]<<8|d[w+2>>0]<<16|d[w+3>>0]<<24;c[h>>2]=w+3;w=Kf(x|0)|0;c[b>>2]=c[b>>2]<<24|(8?w>>>8:w);w=o+24|0;c[g>>2]=w;y=w;break}else{Ce(b);y=c[g>>2]|0;break}}else y=o;while(0);o=r(p,q)|0;n=8?o>>>8:o;o=c[b>>2]|0;m=(y?o>>>y:o)>>>0>n>>>0;if(m){c[b>>2]=o-(n+1<>2]=y-n;c[f>>2]=(z<>0]|0;a[e+907+(j*264|0)+(k*33|0)+11+l>>0]=A;l=l+1|0}while((l|0)!=11);l=0;do{m=d[5088+(j*264|0)+(k*33|0)+22+l>>0]|0;n=c[f>>2]|0;o=c[g>>2]|0;do if((o|0)<0){w=c[h>>2]|0;if(w>>>0<(c[i>>2]|0)>>>0){x=d[w>>0]|d[w+1>>0]<<8|d[w+2>>0]<<16|d[w+3>>0]<<24;c[h>>2]=w+3;w=Kf(x|0)|0;c[b>>2]=c[b>>2]<<24|(8?w>>>8:w);w=o+24|0;c[g>>2]=w;B=w;break}else{Ce(b);B=c[g>>2]|0;break}}else B=o;while(0);o=r(n,m)|0;p=8?o>>>8:o;o=c[b>>2]|0;q=(B?o>>>B:o)>>>0>p>>>0;if(q){c[b>>2]=o-(p+1<>2]=B-p;c[f>>2]=(C<>0]|0;a[e+907+(j*264|0)+(k*33|0)+22+l>>0]=D;l=l+1|0}while((l|0)!=11);k=k+1|0}while((k|0)!=8);k=e+907+(j*264|0)|0;c[e+1964+(j*68|0)>>2]=k;c[e+1964+(j*68|0)+4>>2]=e+907+(j*264|0)+33;c[e+1964+(j*68|0)+8>>2]=e+907+(j*264|0)+66;c[e+1964+(j*68|0)+12>>2]=e+907+(j*264|0)+99;l=e+907+(j*264|0)+198|0;c[e+1964+(j*68|0)+16>>2]=l;c[e+1964+(j*68|0)+20>>2]=e+907+(j*264|0)+132;c[e+1964+(j*68|0)+24>>2]=e+907+(j*264|0)+165;c[e+1964+(j*68|0)+28>>2]=l;c[e+1964+(j*68|0)+32>>2]=l;c[e+1964+(j*68|0)+36>>2]=l;c[e+1964+(j*68|0)+40>>2]=l;c[e+1964+(j*68|0)+44>>2]=l;c[e+1964+(j*68|0)+48>>2]=l;c[e+1964+(j*68|0)+52>>2]=l;c[e+1964+(j*68|0)+56>>2]=l;c[e+1964+(j*68|0)+60>>2]=e+907+(j*264|0)+231;c[e+1964+(j*68|0)+64>>2]=k;j=j+1|0}while((j|0)!=4);j=Fe(b,1)|0;c[e+2236>>2]=j;if(!j)return;j=(Fe(b,8)|0)&255;a[e+2240>>0]=j;return}function Je(a,e,f,g,h,i){a=a|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0;if((h|0)>=16){j=16;return j|0}k=a+4|0;l=a+8|0;m=a+12|0;n=a+20|0;o=(c[e+(h<<2)>>2]|0)+(f*11|0)|0;f=h;h=c[l>>2]|0;p=c[k>>2]|0;a:while(1){q=d[o>>0]|0;do if((h|0)<0){t=c[m>>2]|0;if(t>>>0<(c[n>>2]|0)>>>0){u=d[t>>0]|d[t+1>>0]<<8|d[t+2>>0]<<16|d[t+3>>0]<<24;c[m>>2]=t+3;t=Kf(u|0)|0;c[a>>2]=c[a>>2]<<24|(8?t>>>8:t);t=h+24|0;c[l>>2]=t;v=t;break}else{Ce(a);v=c[l>>2]|0;break}}else v=h;while(0);t=r(p,q)|0;u=8?t>>>8:t;t=c[a>>2]|0;w=(v?t>>>v:t)>>>0>u>>>0;if(w){x=t-(u+1<>2]=x;y=p-u|0;z=x}else{y=u+1|0;z=t}t=(s(y|0)|0)^24;u=v-t|0;c[l>>2]=u;x=(y<>2]=x;if(!w){j=f;A=37;break}w=o;t=f;B=u;u=z;C=x;while(1){x=d[w+1>>0]|0;do if((B|0)<0){D=c[m>>2]|0;if(D>>>0<(c[n>>2]|0)>>>0){E=d[D>>0]|d[D+1>>0]<<8|d[D+2>>0]<<16|d[D+3>>0]<<24;c[m>>2]=D+3;D=Kf(E|0)|0;E=u<<24|(8?D>>>8:D);c[a>>2]=E;D=B+24|0;c[l>>2]=D;F=E;G=D;break}else{Ce(a);F=c[a>>2]|0;G=c[l>>2]|0;break}}else{F=u;G=B}while(0);D=r(C,x)|0;E=8?D>>>8:D;D=(G?F>>>G:F)>>>0>E>>>0;if(D){H=F-(E+1<>2]=H;I=C-E|0;J=H}else{I=E+1|0;J=F}E=(s(I|0)|0)^24;K=G-E|0;c[l>>2]=K;L=(I<>2]=L;M=t+1|0;if(D)break;if((M|0)==16){j=16;A=37;break a}w=c[e+(M<<2)>>2]|0;t=M;B=K;u=J;C=L}C=c[e+(M<<2)>>2]|0;u=d[w+2>>0]|0;do if((K|0)<0){B=c[m>>2]|0;if(B>>>0<(c[n>>2]|0)>>>0){q=d[B>>0]|d[B+1>>0]<<8|d[B+2>>0]<<16|d[B+3>>0]<<24;c[m>>2]=B+3;B=Kf(q|0)|0;q=J<<24|(8?B>>>8:B);c[a>>2]=q;B=K+24|0;c[l>>2]=B;N=q;O=B;break}else{Ce(a);N=c[a>>2]|0;O=c[l>>2]|0;break}}else{N=J;O=K}while(0);B=r(L,u)|0;q=8?B>>>8:B;B=(O?N>>>O:N)>>>0>q>>>0;if(B){c[a>>2]=N-(q+1<>2]=D;c[k>>2]=(P<>2]|0}else{Q=1;R=C+11|0;S=D}do if((S|0)<0){D=c[m>>2]|0;if(D>>>0<(c[n>>2]|0)>>>0){B=d[D>>0]|d[D+1>>0]<<8|d[D+2>>0]<<16|d[D+3>>0]<<24;c[m>>2]=D+3;D=Kf(B|0)|0;c[a>>2]=c[a>>2]<<24|(8?D>>>8:D);D=S+24|0;c[l>>2]=D;T=D;break}else{Ce(a);T=c[l>>2]|0;break}}else T=S;while(0);C=c[k>>2]|0;w=1?C>>>1:C;u=c[a>>2]|0;D=w-(T?u>>>T:u)|0;B=31?D>>31:D;D=T+-1|0;c[l>>2]=D;q=B+C|1;c[k>>2]=q;c[a>>2]=u-((B&w+1)<0&1)<<2)>>2]|0)|0)&65535;b[i+((d[7584+t>>0]|0)<<1)>>1]=w;if((t|0)<15){o=R;f=M;h=D;p=q}else{j=16;A=37;break}}if((A|0)==37)return j|0;return 0}function Ke(b,e){b=b|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Y=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0;f=d[e+3>>0]|0;g=b+4|0;h=c[g>>2]|0;i=b+8|0;j=c[i>>2]|0;do if((j|0)<0){k=b+12|0;l=c[k>>2]|0;if(l>>>0<(c[b+20>>2]|0)>>>0){m=d[l>>0]|d[l+1>>0]<<8|d[l+2>>0]<<16|d[l+3>>0]<<24;c[k>>2]=l+3;l=Kf(m|0)|0;c[b>>2]=c[b>>2]<<24|(8?l>>>8:l);l=j+24|0;c[i>>2]=l;n=l;break}else{Ce(b);n=c[i>>2]|0;break}}else n=j;while(0);j=r(h,f)|0;f=8?j>>>8:j;j=c[b>>2]|0;l=(n?j>>>n:j)>>>0>f>>>0;if(l){m=j-(f+1<>2]=m;o=h-f|0;p=m}else{o=f+1|0;p=j}j=(s(o|0)|0)^24;f=n-j|0;c[i>>2]=f;n=(o<>2]=n;if(!l){l=d[e+4>>0]|0;do if((f|0)<0){j=b+12|0;o=c[j>>2]|0;if(o>>>0<(c[b+20>>2]|0)>>>0){m=d[o>>0]|d[o+1>>0]<<8|d[o+2>>0]<<16|d[o+3>>0]<<24;c[j>>2]=o+3;o=Kf(m|0)|0;m=p<<24|(8?o>>>8:o);c[b>>2]=m;o=f+24|0;c[i>>2]=o;q=m;t=o;break}else{Ce(b);q=c[b>>2]|0;t=c[i>>2]|0;break}}else{q=p;t=f}while(0);o=r(n,l)|0;l=8?o>>>8:o;o=(t?q>>>t:q)>>>0>l>>>0;if(o){m=q-(l+1<>2]=m;u=n-l|0;v=m}else{u=l+1|0;v=q}q=(s(u|0)|0)^24;l=t-q|0;c[i>>2]=l;t=(u<>2]=t;if(!o){w=2;return w|0}o=d[e+5>>0]|0;do if((l|0)<0){q=b+12|0;u=c[q>>2]|0;if(u>>>0<(c[b+20>>2]|0)>>>0){m=d[u>>0]|d[u+1>>0]<<8|d[u+2>>0]<<16|d[u+3>>0]<<24;c[q>>2]=u+3;u=Kf(m|0)|0;m=v<<24|(8?u>>>8:u);c[b>>2]=m;u=l+24|0;c[i>>2]=u;x=m;y=u;break}else{Ce(b);x=c[b>>2]|0;y=c[i>>2]|0;break}}else{x=v;y=l}while(0);l=r(t,o)|0;o=8?l>>>8:l;l=(y?x>>>y:x)>>>0>o>>>0;if(l){c[b>>2]=x-(o+1<>2]=y-o;c[g>>2]=(z<>0]|0;do if((f|0)<0){o=b+12|0;z=c[o>>2]|0;if(z>>>0<(c[b+20>>2]|0)>>>0){y=d[z>>0]|d[z+1>>0]<<8|d[z+2>>0]<<16|d[z+3>>0]<<24;c[o>>2]=z+3;z=Kf(y|0)|0;y=p<<24|(8?z>>>8:z);c[b>>2]=y;z=f+24|0;c[i>>2]=z;A=y;B=z;break}else{Ce(b);A=c[b>>2]|0;B=c[i>>2]|0;break}}else{A=p;B=f}while(0);f=r(n,l)|0;l=8?f>>>8:f;f=(B?A>>>B:A)>>>0>l>>>0;if(f){p=A-(l+1<>2]=p;C=n-l|0;D=p}else{C=l+1|0;D=A}A=(s(C|0)|0)^24;l=B-A|0;c[i>>2]=l;B=(C<>2]=B;if(f){f=d[e+8>>0]|0;do if((l|0)<0){A=b+12|0;C=c[A>>2]|0;if(C>>>0<(c[b+20>>2]|0)>>>0){p=d[C>>0]|d[C+1>>0]<<8|d[C+2>>0]<<16|d[C+3>>0]<<24;c[A>>2]=C+3;C=Kf(p|0)|0;p=D<<24|(8?C>>>8:C);c[b>>2]=p;C=l+24|0;c[i>>2]=C;E=p;F=C;break}else{Ce(b);E=c[b>>2]|0;F=c[i>>2]|0;break}}else{E=D;F=l}while(0);C=r(B,f)|0;f=8?C>>>8:C;C=(F?E>>>F:E)>>>0>f>>>0;p=C&1;if(C){A=E-(f+1<>2]=A;G=B-f|0;H=A}else{G=f+1|0;H=E}E=(s(G|0)|0)^24;f=F-E|0;c[i>>2]=f;F=(G<>2]=F;E=d[e+(C?10:9)>>0]|0;do if((f|0)<0){C=b+12|0;G=c[C>>2]|0;if(G>>>0<(c[b+20>>2]|0)>>>0){A=d[G>>0]|d[G+1>>0]<<8|d[G+2>>0]<<16|d[G+3>>0]<<24;c[C>>2]=G+3;G=Kf(A|0)|0;A=H<<24|(8?G>>>8:G);c[b>>2]=A;G=f+24|0;c[i>>2]=G;I=A;J=G;break}else{Ce(b);I=c[b>>2]|0;J=c[i>>2]|0;break}}else{I=H;J=f}while(0);f=r(F,E)|0;E=8?f>>>8:f;f=(J?I>>>J:I)>>>0>E>>>0;if(f){H=I-(E+1<>2]=H;K=F-E|0;L=H}else{K=E+1|0;L=I}I=(s(K|0)|0)^24;E=J-I|0;c[i>>2]=E;J=(K<>2]=J;I=p<<1|f&1;f=c[7600+(I<<2)>>2]|0;p=a[f>>0]|0;if(!(p<<24>>24))M=0;else{K=b+12|0;H=b+20|0;F=f;f=0;G=p;p=E;E=L;L=J;while(1){J=G&255;do if((p|0)<0){A=c[K>>2]|0;if(A>>>0<(c[H>>2]|0)>>>0){C=d[A>>0]|d[A+1>>0]<<8|d[A+2>>0]<<16|d[A+3>>0]<<24;c[K>>2]=A+3;A=Kf(C|0)|0;C=E<<24|(8?A>>>8:A);c[b>>2]=C;A=p+24|0;c[i>>2]=A;N=C;O=A;break}else{Ce(b);N=c[b>>2]|0;O=c[i>>2]|0;break}}else{N=E;O=p}while(0);A=r(L,J)|0;C=8?A>>>8:A;A=(O?N>>>O:N)>>>0>C>>>0;if(A){n=N-(C+1<>2]=n;P=L-C|0;Q=n}else{P=C+1|0;Q=N}C=(s(P|0)|0)^24;p=O-C|0;c[i>>2]=p;L=(P<>2]=L;C=f<<1|A&1;F=F+1|0;G=a[F>>0]|0;if(!(G<<24>>24)){M=C;break}else{f=C;E=Q}}}w=M+(8<>0]|0;do if((l|0)<0){e=b+12|0;M=c[e>>2]|0;if(M>>>0<(c[b+20>>2]|0)>>>0){Q=d[M>>0]|d[M+1>>0]<<8|d[M+2>>0]<<16|d[M+3>>0]<<24;c[e>>2]=M+3;M=Kf(Q|0)|0;Q=D<<24|(8?M>>>8:M);c[b>>2]=Q;M=l+24|0;c[i>>2]=M;R=Q;S=M;break}else{Ce(b);R=c[b>>2]|0;S=c[i>>2]|0;break}}else{R=D;S=l}while(0);l=r(B,I)|0;I=8?l>>>8:l;l=(S?R>>>S:R)>>>0>I>>>0;if(l){D=R-(I+1<>2]=D;T=B-I|0;U=D}else{T=I+1|0;U=R}R=(s(T|0)|0)^24;I=S-R|0;c[i>>2]=I;S=(T<>2]=S;R=(I|0)<0;if(!l){do if(R){l=b+12|0;T=c[l>>2]|0;if(T>>>0<(c[b+20>>2]|0)>>>0){D=d[T>>0]|d[T+1>>0]<<8|d[T+2>>0]<<16|d[T+3>>0]<<24;c[l>>2]=T+3;T=Kf(D|0)|0;D=U<<24|(8?T>>>8:T);c[b>>2]=D;T=I+24|0;c[i>>2]=T;V=D;W=T;break}else{Ce(b);V=c[b>>2]|0;W=c[i>>2]|0;break}}else{V=U;W=I}while(0);T=S*159|0;D=8?T>>>8:T;T=(W?V>>>W:V)>>>0>D>>>0;if(T){c[b>>2]=V-(D+1<>2]=W-D;c[g>>2]=(X<>2]|0;if(D>>>0<(c[b+20>>2]|0)>>>0){X=d[D>>0]|d[D+1>>0]<<8|d[D+2>>0]<<16|d[D+3>>0]<<24;c[T>>2]=D+3;D=Kf(X|0)|0;X=U<<24|(8?D>>>8:D);c[b>>2]=X;D=I+24|0;c[i>>2]=D;Y=X;Z=D;break}else{Ce(b);Y=c[b>>2]|0;Z=c[i>>2]|0;break}}else{Y=U;Z=I}while(0);I=S*165|0;U=8?I>>>8:I;I=(Z?Y>>>Z:Y)>>>0>U>>>0;if(I){R=Y-(U+1<>2]=R;_=S-U|0;$=R}else{_=U+1|0;$=Y}Y=(s(_|0)|0)^24;U=Z-Y|0;c[i>>2]=U;Z=(_<>2]=Z;Y=((I&1)<<1)+7|0;do if((U|0)<0){I=b+12|0;_=c[I>>2]|0;if(_>>>0<(c[b+20>>2]|0)>>>0){R=d[_>>0]|d[_+1>>0]<<8|d[_+2>>0]<<16|d[_+3>>0]<<24;c[I>>2]=_+3;_=Kf(R|0)|0;R=$<<24|(8?_>>>8:_);c[b>>2]=R;_=U+24|0;c[i>>2]=_;aa=R;ba=_;break}else{Ce(b);aa=c[b>>2]|0;ba=c[i>>2]|0;break}}else{aa=$;ba=U}while(0);U=Z*145|0;$=8?U>>>8:U;U=(ba?aa>>>ba:aa)>>>0>$>>>0;if(U){c[b>>2]=aa-($+1<>2]=ba-$;c[g>>2]=(ca<<$)+-1;w=Y+(U&1)|0;return w|0}function Le(b,d){b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0;if(!b){e=0;return e|0}if(!d){if(c[b>>2]|0){e=0;return e|0}c[b>>2]=2;c[b+8>>2]=9156;c[b+4>>2]=0;e=0;return e|0}f=b+4|0;if((c[f>>2]|0)==0?(ue(b,d)|0)==0:0){e=0;return e|0}if(!(nd(b,d)|0)){a:do if(!(qd(b,d)|0))g=0;else{h=b+2300|0;c[h>>2]=0;i=b+308|0;b:do if((c[i>>2]|0)>0){j=b+312|0;k=b+12|0;l=b+2296|0;m=b+288|0;n=b+2256|0;o=b+2248|0;p=0;c:while(1){q=b+316+((c[j>>2]&p)*28|0)|0;if(!(ve(k,b)|0)){r=12;break}if((c[l>>2]|0)<(c[m>>2]|0))do{if(!(we(b,q)|0)){r=17;break c}s=(c[l>>2]|0)+1|0;c[l>>2]=s}while((s|0)<(c[m>>2]|0));q=c[n>>2]|0;a[q+-2>>0]=0;a[q+-1>>0]=0;c[o>>2]=0;c[l>>2]=0;if(!(bd(b,d)|0)){r=21;break}p=(c[h>>2]|0)+1|0;c[h>>2]=p;if((p|0)>=(c[i>>2]|0))break b}if((r|0)==12){if(c[b>>2]|0){g=0;break a}c[b>>2]=7;c[b+8>>2]=9193;c[f>>2]=0;g=0;break a}else if((r|0)==17){if(c[b>>2]|0){g=0;break a}c[b>>2]=7;c[b+8>>2]=9234;c[f>>2]=0;g=0;break a}else if((r|0)==21){if(c[b>>2]|0){g=0;break a}c[b>>2]=6;c[b+8>>2]=9269;c[f>>2]=0;g=0;break a}}while(0);if((c[b+148>>2]|0)>0?(i=(ed()|0)+8|0,(aa[c[i>>2]&7](b+124|0)|0)==0):0){g=0;break}g=1}while(0);r=(od(b,d)|0)&g;if(r|0){c[f>>2]=0;e=r;return e|0}}r=(ed()|0)+20|0;ea[c[r>>2]&31](b+124|0);oa(b);r=b+2288|0;pa(c[r>>2]|0);c[r>>2]=0;c[b+2292>>2]=0;r=b+12|0;c[r>>2]=0;c[r+4>>2]=0;c[r+8>>2]=0;c[r+12>>2]=0;c[r+16>>2]=0;c[r+20>>2]=0;c[r+24>>2]=0;c[f>>2]=0;e=0;return e|0}function Me(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;e=Y;Y=Y+160|0;f=e+148|0;g=e+144|0;h=e+36|0;i=e;c[i>>2]=a;j=i+4|0;c[j>>2]=b;c[i+8>>2]=1;c[g>>2]=0;k=ne(a,b,0,0,0,g,0,i)|0;c[f>>2]=k;if(!(c[f>>2]|0)){if(c[g>>2]|0)l=4}else if((c[f>>2]|0)==7&(c[g>>2]|0)!=0)l=4;if((l|0)==4)c[f>>2]=4;l=c[f>>2]|0;if(l|0){m=l;Y=e;return m|0}ya(h,520)|0;l=c[i+12>>2]|0;c[h+64>>2]=(c[i>>2]|0)+l;c[h+60>>2]=(c[j>>2]|0)-l;za(d,h);if(!(c[i+32>>2]|0)){l=se()|0;if(!l){m=1;Y=e;return m|0}c[l+2348>>2]=c[i+16>>2];c[l+2352>>2]=c[i+20>>2];if(ue(l,h)|0){j=h+4|0;f=d+20|0;g=Uc(c[h>>2]|0,c[j>>2]|0,c[f>>2]|0,c[d>>2]|0)|0;if(!g){k=pd(c[f>>2]|0,i,c[h>>2]|0,c[j>>2]|0)|0;c[l+148>>2]=k;$c(c[f>>2]|0,l);if(!(Le(l,h)|0))n=c[l>>2]|0;else n=0}else n=g}else n=c[l>>2]|0;re(l);o=n}else{n=te()|0;if(!n){m=1;Y=e;return m|0}if(xe(n,h)|0){l=Uc(c[h>>2]|0,c[h+4>>2]|0,c[d+20>>2]|0,c[d>>2]|0)|0;if(!l)if(!(ye(n)|0))p=c[n>>2]|0;else p=0;else p=l}else p=c[n>>2]|0;qa(n);o=p}if(o|0){Xc(c[d>>2]|0);m=o;Y=e;return m|0}o=c[d+20>>2]|0;if(!o){m=0;Y=e;return m|0}if(!(c[o+48>>2]|0)){m=0;Y=e;return m|0}m=Tc(c[d>>2]|0)|0;Y=e;return m|0}function Ne(a,b){a=a|0;b=b|0;var c=0;if((a|0)==0|(b&-256|0)!=512){c=0;return c|0}Nf(a|0,0,200)|0;Wc(a+40|0,520)|0;c=1;return c|0}function Oe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0;e=Y;Y=Y+144|0;f=e+88|0;g=e;if(!d){h=2;Y=e;return h|0}a:do if(!a)i=2;else{j=d;k=j+40|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));l=d+4|0;m=ne(a,b,d,l,d+8|0,d+12|0,d+16|0,0)|0;switch(m|0){case 0:break;case 7:{h=3;Y=e;return h|0}default:{i=m;break a}}j=f+4|0;k=j+52|0;do{c[j>>2]=0;j=j+4|0}while((j|0)<(k|0));c[f+20>>2]=d+124;j=d+40|0;c[f>>2]=j;if(!(_c(j,d)|0)){h=Me(a,b,f)|0;Y=e;return h|0}Wc(g,520)|0;c[g>>2]=c[j>>2];c[g+4>>2]=c[d>>2];c[g+8>>2]=c[l>>2];c[f>>2]=g;k=Me(a,b,f)|0;if(!k)n=Yc(g,j)|0;else n=k;Xc(g);h=n;Y=e;return h|0}while(0);h=i;Y=e;return h|0}\nfunction Pe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0,Ja=0;b=Y;Y=Y+16|0;d=b;do if(a>>>0<245){e=a>>>0<11?16:a+11&-8;f=3?e>>>3:e;g=c[2550]|0;h=f?g>>>f:g;if(h&3|0){i=(h&1^1)+f|0;j=10240+(i<<1<<2)|0;k=j+8|0;l=c[k>>2]|0;m=l+8|0;n=c[m>>2]|0;if((n|0)==(j|0))c[2550]=g&~(1<>2]=j;c[k>>2]=n}n=i<<3;c[l+4>>2]=n|3;i=l+n+4|0;c[i>>2]=c[i>>2]|1;o=m;Y=b;return o|0}m=c[2552]|0;if(e>>>0>m>>>0){if(h|0){i=2<>>12:i)&16;f=n?i>>>n:i;i=(5?f>>>5:f)&8;h=i?f>>>i:f;f=(2?h>>>2:h)&4;l=f?h>>>f:h;h=(1?l>>>1:l)&2;k=h?l>>>h:l;l=(1?k>>>1:k)&1;j=(i|n|f|h|l)+(l?k>>>l:k)|0;k=10240+(j<<1<<2)|0;l=k+8|0;h=c[l>>2]|0;f=h+8|0;n=c[f>>2]|0;if((n|0)==(k|0)){i=g&~(1<>2]=k;c[l>>2]=n;p=g}n=j<<3;j=n-e|0;c[h+4>>2]=e|3;l=h+e|0;c[l+4>>2]=j|1;c[h+n>>2]=j;if(m|0){n=c[2555]|0;h=3?m>>>3:m;k=10240+(h<<1<<2)|0;i=1<>2]|0;r=i}c[r>>2]=n;c[q+12>>2]=n;c[n+8>>2]=q;c[n+12>>2]=k}c[2552]=j;c[2555]=l;o=f;Y=b;return o|0}f=c[2551]|0;if(f){l=(f&0-f)+-1|0;j=(12?l>>>12:l)&16;k=j?l>>>j:l;l=(5?k>>>5:k)&8;n=l?k>>>l:k;k=(2?n>>>2:n)&4;i=k?n>>>k:n;n=(1?i>>>1:i)&2;h=n?i>>>n:i;i=(1?h>>>1:h)&1;s=c[10504+((l|j|k|n|i)+(i?h>>>i:h)<<2)>>2]|0;h=s;i=s;n=(c[s+4>>2]&-8)-e|0;while(1){s=c[h+16>>2]|0;if(!s){k=c[h+20>>2]|0;if(!k)break;else t=k}else t=s;s=(c[t+4>>2]&-8)-e|0;k=s>>>0>>0;h=t;i=k?t:i;n=k?s:n}h=i+e|0;if(h>>>0>i>>>0){s=c[i+24>>2]|0;k=c[i+12>>2]|0;do if((k|0)==(i|0)){j=i+20|0;l=c[j>>2]|0;if(!l){u=i+16|0;v=c[u>>2]|0;if(!v){w=0;break}else{x=v;y=u}}else{x=l;y=j}j=x;l=y;while(1){u=j+20|0;v=c[u>>2]|0;if(!v){z=j+16|0;A=c[z>>2]|0;if(!A)break;else{B=A;C=z}}else{B=v;C=u}j=B;l=C}c[l>>2]=0;w=j}else{u=c[i+8>>2]|0;c[u+12>>2]=k;c[k+8>>2]=u;w=k}while(0);do if(s|0){k=c[i+28>>2]|0;u=10504+(k<<2)|0;if((i|0)==(c[u>>2]|0)){c[u>>2]=w;if(!w){c[2551]=f&~(1<>2]|0)==(i|0)?k:s+20|0)>>2]=w;if(!w)break}c[w+24>>2]=s;k=c[i+16>>2]|0;if(k|0){c[w+16>>2]=k;c[k+24>>2]=w}k=c[i+20>>2]|0;if(k|0){c[w+20>>2]=k;c[k+24>>2]=w}}while(0);if(n>>>0<16){s=n+e|0;c[i+4>>2]=s|3;f=i+s+4|0;c[f>>2]=c[f>>2]|1}else{c[i+4>>2]=e|3;c[h+4>>2]=n|1;c[h+n>>2]=n;if(m|0){f=c[2555]|0;s=3?m>>>3:m;k=10240+(s<<1<<2)|0;u=1<>2]|0;E=u}c[E>>2]=f;c[D+12>>2]=f;c[f+8>>2]=D;c[f+12>>2]=k}c[2552]=n;c[2555]=h}o=i+8|0;Y=b;return o|0}else F=e}else F=e}else F=e}else if(a>>>0<=4294967231){k=a+11|0;f=k&-8;u=c[2551]|0;if(u){s=0-f|0;v=8?k>>>8:k;if(v)if(f>>>0>16777215)G=31;else{k=v+1048320|0;z=(16?k>>>16:k)&8;k=v<>>16:v)&4;v=k<>>16:k)&2;k=v<>>15:k)|0;k=v+7|0;G=(k?f>>>k:f)&1|v<<1}else G=0;v=c[10504+(G<<2)>>2]|0;a:do if(!v){I=0;J=0;K=s;L=61}else{k=0;H=s;z=v;A=f<<((G|0)==31?0:25-(1?G>>>1:G)|0);M=0;while(1){N=(c[z+4>>2]&-8)-f|0;if(N>>>0>>0)if(!N){O=z;P=0;Q=z;L=65;break a}else{R=z;S=N}else{R=k;S=H}N=c[z+20>>2]|0;z=c[z+16+((31?A>>>31:A)<<2)>>2]|0;T=(N|0)==0|(N|0)==(z|0)?M:N;if(!z){I=T;J=R;K=S;L=61;break}else{k=R;H=S;A=A<<1;M=T}}}while(0);if((L|0)==61){if((I|0)==0&(J|0)==0){v=2<>>12:v)&16;e=s?v>>>s:v;v=(5?e>>>5:e)&8;i=v?e>>>v:e;e=(2?i>>>2:i)&4;h=e?i>>>e:i;i=(1?h>>>1:h)&2;n=i?h>>>i:h;h=(1?n>>>1:n)&1;U=0;V=c[10504+((v|s|e|i|h)+(h?n>>>h:n)<<2)>>2]|0}else{U=J;V=I}if(!V){W=U;X=K}else{O=U;P=K;Q=V;L=65}}if((L|0)==65){n=O;h=P;i=Q;while(1){e=(c[i+4>>2]&-8)-f|0;s=e>>>0>>0;v=s?e:h;e=s?i:n;s=c[i+16>>2]|0;if(!s)Z=c[i+20>>2]|0;else Z=s;if(!Z){W=e;X=v;break}else{n=e;h=v;i=Z}}}if(((W|0)!=0?X>>>0<((c[2552]|0)-f|0)>>>0:0)?(i=W+f|0,i>>>0>W>>>0):0){h=c[W+24>>2]|0;n=c[W+12>>2]|0;do if((n|0)==(W|0)){v=W+20|0;e=c[v>>2]|0;if(!e){s=W+16|0;g=c[s>>2]|0;if(!g){_=0;break}else{$=g;aa=s}}else{$=e;aa=v}v=$;e=aa;while(1){s=v+20|0;g=c[s>>2]|0;if(!g){m=v+16|0;M=c[m>>2]|0;if(!M)break;else{ba=M;ca=m}}else{ba=g;ca=s}v=ba;e=ca}c[e>>2]=0;_=v}else{s=c[W+8>>2]|0;c[s+12>>2]=n;c[n+8>>2]=s;_=n}while(0);do if(h){n=c[W+28>>2]|0;s=10504+(n<<2)|0;if((W|0)==(c[s>>2]|0)){c[s>>2]=_;if(!_){s=u&~(1<>2]|0)==(W|0)?s:h+20|0)>>2]=_;if(!_){da=u;break}}c[_+24>>2]=h;s=c[W+16>>2]|0;if(s|0){c[_+16>>2]=s;c[s+24>>2]=_}s=c[W+20>>2]|0;if(s){c[_+20>>2]=s;c[s+24>>2]=_;da=u}else da=u}else da=u;while(0);b:do if(X>>>0<16){u=X+f|0;c[W+4>>2]=u|3;h=W+u+4|0;c[h>>2]=c[h>>2]|1}else{c[W+4>>2]=f|3;c[i+4>>2]=X|1;c[i+X>>2]=X;h=3?X>>>3:X;if(X>>>0<256){u=10240+(h<<1<<2)|0;s=c[2550]|0;n=1<>2]|0;fa=n}c[fa>>2]=i;c[ea+12>>2]=i;c[i+8>>2]=ea;c[i+12>>2]=u;break}u=8?X>>>8:X;if(u)if(X>>>0>16777215)ga=31;else{n=u+1048320|0;s=(16?n>>>16:n)&8;n=u<>>16:u)&4;u=n<>>16:n)&2;n=u<>>15:n)|0;n=u+7|0;ga=(n?X>>>n:X)&1|u<<1}else ga=0;u=10504+(ga<<2)|0;c[i+28>>2]=ga;n=i+16|0;c[n+4>>2]=0;c[n>>2]=0;n=1<>2]=i;c[i+24>>2]=u;c[i+12>>2]=i;c[i+8>>2]=i;break}n=c[u>>2]|0;c:do if((c[n+4>>2]&-8|0)==(X|0))ha=n;else{u=X<<((ga|0)==31?0:25-(1?ga>>>1:ga)|0);g=n;while(1){ia=g+16+((31?u>>>31:u)<<2)|0;s=c[ia>>2]|0;if(!s)break;if((c[s+4>>2]&-8|0)==(X|0)){ha=s;break c}else{u=u<<1;g=s}}c[ia>>2]=i;c[i+24>>2]=g;c[i+12>>2]=i;c[i+8>>2]=i;break b}while(0);n=ha+8|0;v=c[n>>2]|0;c[v+12>>2]=i;c[n>>2]=i;c[i+8>>2]=v;c[i+12>>2]=ha;c[i+24>>2]=0}while(0);o=W+8|0;Y=b;return o|0}else F=f}else F=f}else F=-1;while(0);W=c[2552]|0;if(W>>>0>=F>>>0){ha=W-F|0;ia=c[2555]|0;if(ha>>>0>15){X=ia+F|0;c[2555]=X;c[2552]=ha;c[X+4>>2]=ha|1;c[ia+W>>2]=ha;c[ia+4>>2]=F|3}else{c[2552]=0;c[2555]=0;c[ia+4>>2]=W|3;ha=ia+W+4|0;c[ha>>2]=c[ha>>2]|1}o=ia+8|0;Y=b;return o|0}ia=c[2553]|0;if(ia>>>0>F>>>0){ha=ia-F|0;c[2553]=ha;W=c[2556]|0;X=W+F|0;c[2556]=X;c[X+4>>2]=ha|1;c[W+4>>2]=F|3;o=W+8|0;Y=b;return o|0}if(!(c[2668]|0)){c[2670]=4096;c[2669]=4096;c[2671]=-1;c[2672]=-1;c[2673]=0;c[2661]=0;c[2668]=d&-16^1431655768;ja=4096}else ja=c[2670]|0;d=F+48|0;W=F+47|0;ha=ja+W|0;X=0-ja|0;ja=ha&X;if(ja>>>0<=F>>>0){o=0;Y=b;return o|0}ga=c[2660]|0;if(ga|0?(da=c[2658]|0,ea=da+ja|0,ea>>>0<=da>>>0|ea>>>0>ga>>>0):0){o=0;Y=b;return o|0}d:do if(!(c[2661]&4)){ga=c[2556]|0;e:do if(ga){ea=10648;while(1){da=c[ea>>2]|0;if(da>>>0<=ga>>>0?(da+(c[ea+4>>2]|0)|0)>>>0>ga>>>0:0)break;da=c[ea+8>>2]|0;if(!da){L=128;break e}else ea=da}da=ha-ia&X;if(da>>>0<2147483647){fa=Of(da|0)|0;if((fa|0)==((c[ea>>2]|0)+(c[ea+4>>2]|0)|0))if((fa|0)==(-1|0))ka=da;else{la=da;ma=fa;L=145;break d}else{na=fa;oa=da;L=136}}else ka=0}else L=128;while(0);do if((L|0)==128){ga=Of(0)|0;if((ga|0)!=(-1|0)?(f=ga,da=c[2669]|0,fa=da+-1|0,_=((fa&f|0)==0?0:(fa+f&0-da)-f|0)+ja|0,f=c[2658]|0,da=_+f|0,_>>>0>F>>>0&_>>>0<2147483647):0){fa=c[2660]|0;if(fa|0?da>>>0<=f>>>0|da>>>0>fa>>>0:0){ka=0;break}fa=Of(_|0)|0;if((fa|0)==(ga|0)){la=_;ma=ga;L=145;break d}else{na=fa;oa=_;L=136}}else ka=0}while(0);do if((L|0)==136){_=0-oa|0;if(!(d>>>0>oa>>>0&(oa>>>0<2147483647&(na|0)!=(-1|0))))if((na|0)==(-1|0)){ka=0;break}else{la=oa;ma=na;L=145;break d}fa=c[2670]|0;ga=W-oa+fa&0-fa;if(ga>>>0>=2147483647){la=oa;ma=na;L=145;break d}if((Of(ga|0)|0)==(-1|0)){Of(_|0)|0;ka=0;break}else{la=ga+oa|0;ma=na;L=145;break d}}while(0);c[2661]=c[2661]|4;pa=ka;L=143}else{pa=0;L=143}while(0);if(((L|0)==143?ja>>>0<2147483647:0)?(ka=Of(ja|0)|0,ja=Of(0)|0,na=ja-ka|0,oa=na>>>0>(F+40|0)>>>0,!((ka|0)==(-1|0)|oa^1|ka>>>0>>0&((ka|0)!=(-1|0)&(ja|0)!=(-1|0))^1)):0){la=oa?na:pa;ma=ka;L=145}if((L|0)==145){ka=(c[2658]|0)+la|0;c[2658]=ka;if(ka>>>0>(c[2659]|0)>>>0)c[2659]=ka;ka=c[2556]|0;f:do if(ka){pa=10648;while(1){qa=c[pa>>2]|0;ra=c[pa+4>>2]|0;if((ma|0)==(qa+ra|0)){L=154;break}na=c[pa+8>>2]|0;if(!na)break;else pa=na}if(((L|0)==154?(na=pa+4|0,(c[pa+12>>2]&8|0)==0):0)?ma>>>0>ka>>>0&qa>>>0<=ka>>>0:0){c[na>>2]=ra+la;na=(c[2553]|0)+la|0;oa=ka+8|0;ja=(oa&7|0)==0?0:0-oa&7;oa=ka+ja|0;W=na-ja|0;c[2556]=oa;c[2553]=W;c[oa+4>>2]=W|1;c[ka+na+4>>2]=40;c[2557]=c[2672];break}if(ma>>>0<(c[2554]|0)>>>0)c[2554]=ma;na=ma+la|0;W=10648;while(1){if((c[W>>2]|0)==(na|0)){L=162;break}oa=c[W+8>>2]|0;if(!oa)break;else W=oa}if((L|0)==162?(c[W+12>>2]&8|0)==0:0){c[W>>2]=ma;pa=W+4|0;c[pa>>2]=(c[pa>>2]|0)+la;pa=ma+8|0;oa=ma+((pa&7|0)==0?0:0-pa&7)|0;pa=na+8|0;ja=na+((pa&7|0)==0?0:0-pa&7)|0;pa=oa+F|0;d=ja-oa-F|0;c[oa+4>>2]=F|3;g:do if((ka|0)==(ja|0)){X=(c[2553]|0)+d|0;c[2553]=X;c[2556]=pa;c[pa+4>>2]=X|1}else{if((c[2555]|0)==(ja|0)){X=(c[2552]|0)+d|0;c[2552]=X;c[2555]=pa;c[pa+4>>2]=X|1;c[pa+X>>2]=X;break}X=c[ja+4>>2]|0;if((X&3|0)==1){ia=X&-8;ha=3?X>>>3:X;h:do if(X>>>0<256){ga=c[ja+8>>2]|0;_=c[ja+12>>2]|0;if((_|0)==(ga|0)){c[2550]=c[2550]&~(1<>2]=_;c[_+8>>2]=ga;break}}else{ga=c[ja+24>>2]|0;_=c[ja+12>>2]|0;do if((_|0)==(ja|0)){fa=ja+16|0;da=fa+4|0;f=c[da>>2]|0;if(!f){ca=c[fa>>2]|0;if(!ca){sa=0;break}else{ta=ca;ua=fa}}else{ta=f;ua=da}da=ta;f=ua;while(1){fa=da+20|0;ca=c[fa>>2]|0;if(!ca){ba=da+16|0;aa=c[ba>>2]|0;if(!aa)break;else{va=aa;wa=ba}}else{va=ca;wa=fa}da=va;f=wa}c[f>>2]=0;sa=da}else{fa=c[ja+8>>2]|0;c[fa+12>>2]=_;c[_+8>>2]=fa;sa=_}while(0);if(!ga)break;_=c[ja+28>>2]|0;g=10504+(_<<2)|0;do if((c[g>>2]|0)!=(ja|0)){fa=ga+16|0;c[((c[fa>>2]|0)==(ja|0)?fa:ga+20|0)>>2]=sa;if(!sa)break h}else{c[g>>2]=sa;if(sa|0)break;c[2551]=c[2551]&~(1<<_);break h}while(0);c[sa+24>>2]=ga;_=ja+16|0;g=c[_>>2]|0;if(g|0){c[sa+16>>2]=g;c[g+24>>2]=sa}g=c[_+4>>2]|0;if(!g)break;c[sa+20>>2]=g;c[g+24>>2]=sa}while(0);xa=ja+ia|0;ya=ia+d|0}else{xa=ja;ya=d}ha=xa+4|0;c[ha>>2]=c[ha>>2]&-2;c[pa+4>>2]=ya|1;c[pa+ya>>2]=ya;ha=3?ya>>>3:ya;if(ya>>>0<256){X=10240+(ha<<1<<2)|0;ea=c[2550]|0;g=1<>2]|0;Aa=g}c[Aa>>2]=pa;c[za+12>>2]=pa;c[pa+8>>2]=za;c[pa+12>>2]=X;break}X=8?ya>>>8:ya;do if(!X)Ba=0;else{if(ya>>>0>16777215){Ba=31;break}g=X+1048320|0;ea=(16?g>>>16:g)&8;g=X<>>16:ha)&4;ha=g<<_;g=ha+245760|0;fa=(16?g>>>16:g)&2;g=ha<>>15:g)|0;g=ha+7|0;Ba=(g?ya>>>g:ya)&1|ha<<1}while(0);X=10504+(Ba<<2)|0;c[pa+28>>2]=Ba;ia=pa+16|0;c[ia+4>>2]=0;c[ia>>2]=0;ia=c[2551]|0;ha=1<>2]=pa;c[pa+24>>2]=X;c[pa+12>>2]=pa;c[pa+8>>2]=pa;break}ha=c[X>>2]|0;i:do if((c[ha+4>>2]&-8|0)==(ya|0))Ca=ha;else{X=ya<<((Ba|0)==31?0:25-(1?Ba>>>1:Ba)|0);ia=ha;while(1){Da=ia+16+((31?X>>>31:X)<<2)|0;g=c[Da>>2]|0;if(!g)break;if((c[g+4>>2]&-8|0)==(ya|0)){Ca=g;break i}else{X=X<<1;ia=g}}c[Da>>2]=pa;c[pa+24>>2]=ia;c[pa+12>>2]=pa;c[pa+8>>2]=pa;break g}while(0);ha=Ca+8|0;X=c[ha>>2]|0;c[X+12>>2]=pa;c[ha>>2]=pa;c[pa+8>>2]=X;c[pa+12>>2]=Ca;c[pa+24>>2]=0}while(0);o=oa+8|0;Y=b;return o|0}pa=10648;while(1){d=c[pa>>2]|0;if(d>>>0<=ka>>>0?(Ea=d+(c[pa+4>>2]|0)|0,Ea>>>0>ka>>>0):0)break;pa=c[pa+8>>2]|0}pa=Ea+-47|0;oa=pa+8|0;d=pa+((oa&7|0)==0?0:0-oa&7)|0;oa=ka+16|0;pa=d>>>0>>0?ka:d;d=pa+8|0;ja=la+-40|0;na=ma+8|0;W=(na&7|0)==0?0:0-na&7;na=ma+W|0;X=ja-W|0;c[2556]=na;c[2553]=X;c[na+4>>2]=X|1;c[ma+ja+4>>2]=40;c[2557]=c[2672];ja=pa+4|0;c[ja>>2]=27;c[d>>2]=c[2662];c[d+4>>2]=c[2663];c[d+8>>2]=c[2664];c[d+12>>2]=c[2665];c[2662]=ma;c[2663]=la;c[2665]=0;c[2664]=d;d=pa+24|0;do{X=d;d=d+4|0;c[d>>2]=7}while((X+8|0)>>>0>>0);if((pa|0)!=(ka|0)){d=pa-ka|0;c[ja>>2]=c[ja>>2]&-2;c[ka+4>>2]=d|1;c[pa>>2]=d;X=3?d>>>3:d;if(d>>>0<256){na=10240+(X<<1<<2)|0;W=c[2550]|0;ha=1<>2]|0;Ga=ha}c[Ga>>2]=ka;c[Fa+12>>2]=ka;c[ka+8>>2]=Fa;c[ka+12>>2]=na;break}na=8?d>>>8:d;if(na)if(d>>>0>16777215)Ha=31;else{ha=na+1048320|0;W=(16?ha>>>16:ha)&8;ha=na<>>16:na)&4;na=ha<>>16:ha)&2;ha=na<>>15:ha)|0;ha=na+7|0;Ha=(ha?d>>>ha:d)&1|na<<1}else Ha=0;na=10504+(Ha<<2)|0;c[ka+28>>2]=Ha;c[ka+20>>2]=0;c[oa>>2]=0;ha=c[2551]|0;ga=1<>2]=ka;c[ka+24>>2]=na;c[ka+12>>2]=ka;c[ka+8>>2]=ka;break}ga=c[na>>2]|0;j:do if((c[ga+4>>2]&-8|0)==(d|0))Ia=ga;else{na=d<<((Ha|0)==31?0:25-(1?Ha>>>1:Ha)|0);ha=ga;while(1){Ja=ha+16+((31?na>>>31:na)<<2)|0;W=c[Ja>>2]|0;if(!W)break;if((c[W+4>>2]&-8|0)==(d|0)){Ia=W;break j}else{na=na<<1;ha=W}}c[Ja>>2]=ka;c[ka+24>>2]=ha;c[ka+12>>2]=ka;c[ka+8>>2]=ka;break f}while(0);d=Ia+8|0;ga=c[d>>2]|0;c[ga+12>>2]=ka;c[d>>2]=ka;c[ka+8>>2]=ga;c[ka+12>>2]=Ia;c[ka+24>>2]=0}}else{ga=c[2554]|0;if((ga|0)==0|ma>>>0>>0)c[2554]=ma;c[2662]=ma;c[2663]=la;c[2665]=0;c[2559]=c[2668];c[2558]=-1;c[2563]=10240;c[2562]=10240;c[2565]=10248;c[2564]=10248;c[2567]=10256;c[2566]=10256;c[2569]=10264;c[2568]=10264;c[2571]=10272;c[2570]=10272;c[2573]=10280;c[2572]=10280;c[2575]=10288;c[2574]=10288;c[2577]=10296;c[2576]=10296;c[2579]=10304;c[2578]=10304;c[2581]=10312;c[2580]=10312;c[2583]=10320;c[2582]=10320;c[2585]=10328;c[2584]=10328;c[2587]=10336;c[2586]=10336;c[2589]=10344;c[2588]=10344;c[2591]=10352;c[2590]=10352;c[2593]=10360;c[2592]=10360;c[2595]=10368;c[2594]=10368;c[2597]=10376;c[2596]=10376;c[2599]=10384;c[2598]=10384;c[2601]=10392;c[2600]=10392;c[2603]=10400;c[2602]=10400;c[2605]=10408;c[2604]=10408;c[2607]=10416;c[2606]=10416;c[2609]=10424;c[2608]=10424;c[2611]=10432;c[2610]=10432;c[2613]=10440;c[2612]=10440;c[2615]=10448;c[2614]=10448;c[2617]=10456;c[2616]=10456;c[2619]=10464;c[2618]=10464;c[2621]=10472;c[2620]=10472;c[2623]=10480;c[2622]=10480;c[2625]=10488;c[2624]=10488;ga=la+-40|0;d=ma+8|0;oa=(d&7|0)==0?0:0-d&7;d=ma+oa|0;pa=ga-oa|0;c[2556]=d;c[2553]=pa;c[d+4>>2]=pa|1;c[ma+ga+4>>2]=40;c[2557]=c[2672]}while(0);ma=c[2553]|0;if(ma>>>0>F>>>0){la=ma-F|0;c[2553]=la;ma=c[2556]|0;ka=ma+F|0;c[2556]=ka;c[ka+4>>2]=la|1;c[ma+4>>2]=F|3;o=ma+8|0;Y=b;return o|0}}ma=_e()|0;c[ma>>2]=12;o=0;Y=b;return o|0}function Qe(a){a=a|0;var b=0,d=0,e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0;if(!a)return;b=a+-8|0;d=c[2554]|0;e=c[a+-4>>2]|0;a=e&-8;f=b+a|0;do if(!(e&1)){g=c[b>>2]|0;if(!(e&3))return;h=b+(0-g)|0;i=g+a|0;if(h>>>0>>0)return;if((c[2555]|0)==(h|0)){j=f+4|0;k=c[j>>2]|0;if((k&3|0)!=3){l=h;m=i;n=h;break}c[2552]=i;c[j>>2]=k&-2;c[h+4>>2]=i|1;c[h+i>>2]=i;return}k=3?g>>>3:g;if(g>>>0<256){g=c[h+8>>2]|0;j=c[h+12>>2]|0;if((j|0)==(g|0)){c[2550]=c[2550]&~(1<>2]=j;c[j+8>>2]=g;l=h;m=i;n=h;break}}g=c[h+24>>2]|0;j=c[h+12>>2]|0;do if((j|0)==(h|0)){k=h+16|0;o=k+4|0;p=c[o>>2]|0;if(!p){q=c[k>>2]|0;if(!q){r=0;break}else{s=q;t=k}}else{s=p;t=o}o=s;p=t;while(1){k=o+20|0;q=c[k>>2]|0;if(!q){u=o+16|0;v=c[u>>2]|0;if(!v)break;else{w=v;x=u}}else{w=q;x=k}o=w;p=x}c[p>>2]=0;r=o}else{k=c[h+8>>2]|0;c[k+12>>2]=j;c[j+8>>2]=k;r=j}while(0);if(g){j=c[h+28>>2]|0;k=10504+(j<<2)|0;if((c[k>>2]|0)==(h|0)){c[k>>2]=r;if(!r){c[2551]=c[2551]&~(1<>2]|0)==(h|0)?j:g+20|0)>>2]=r;if(!r){l=h;m=i;n=h;break}}c[r+24>>2]=g;j=h+16|0;k=c[j>>2]|0;if(k|0){c[r+16>>2]=k;c[k+24>>2]=r}k=c[j+4>>2]|0;if(k){c[r+20>>2]=k;c[k+24>>2]=r;l=h;m=i;n=h}else{l=h;m=i;n=h}}else{l=h;m=i;n=h}}else{l=b;m=a;n=b}while(0);if(n>>>0>=f>>>0)return;b=f+4|0;a=c[b>>2]|0;if(!(a&1))return;if(!(a&2)){if((c[2556]|0)==(f|0)){r=(c[2553]|0)+m|0;c[2553]=r;c[2556]=l;c[l+4>>2]=r|1;if((l|0)!=(c[2555]|0))return;c[2555]=0;c[2552]=0;return}if((c[2555]|0)==(f|0)){r=(c[2552]|0)+m|0;c[2552]=r;c[2555]=n;c[l+4>>2]=r|1;c[n+r>>2]=r;return}r=(a&-8)+m|0;x=3?a>>>3:a;do if(a>>>0<256){w=c[f+8>>2]|0;t=c[f+12>>2]|0;if((t|0)==(w|0)){c[2550]=c[2550]&~(1<>2]=t;c[t+8>>2]=w;break}}else{w=c[f+24>>2]|0;t=c[f+12>>2]|0;do if((t|0)==(f|0)){s=f+16|0;d=s+4|0;e=c[d>>2]|0;if(!e){k=c[s>>2]|0;if(!k){y=0;break}else{z=k;A=s}}else{z=e;A=d}d=z;e=A;while(1){s=d+20|0;k=c[s>>2]|0;if(!k){j=d+16|0;q=c[j>>2]|0;if(!q)break;else{B=q;C=j}}else{B=k;C=s}d=B;e=C}c[e>>2]=0;y=d}else{o=c[f+8>>2]|0;c[o+12>>2]=t;c[t+8>>2]=o;y=t}while(0);if(w|0){t=c[f+28>>2]|0;h=10504+(t<<2)|0;if((c[h>>2]|0)==(f|0)){c[h>>2]=y;if(!y){c[2551]=c[2551]&~(1<>2]|0)==(f|0)?t:w+20|0)>>2]=y;if(!y)break}c[y+24>>2]=w;t=f+16|0;h=c[t>>2]|0;if(h|0){c[y+16>>2]=h;c[h+24>>2]=y}h=c[t+4>>2]|0;if(h|0){c[y+20>>2]=h;c[h+24>>2]=y}}}while(0);c[l+4>>2]=r|1;c[n+r>>2]=r;if((l|0)==(c[2555]|0)){c[2552]=r;return}else D=r}else{c[b>>2]=a&-2;c[l+4>>2]=m|1;c[n+m>>2]=m;D=m}m=3?D>>>3:D;if(D>>>0<256){n=10240+(m<<1<<2)|0;a=c[2550]|0;b=1<>2]|0;F=b}c[F>>2]=l;c[E+12>>2]=l;c[l+8>>2]=E;c[l+12>>2]=n;return}n=8?D>>>8:D;if(n)if(D>>>0>16777215)G=31;else{E=n+1048320|0;F=(16?E>>>16:E)&8;E=n<>>16:n)&4;n=E<>>16:E)&2;E=n<>>15:E)|0;E=n+7|0;G=(E?D>>>E:D)&1|n<<1}else G=0;n=10504+(G<<2)|0;c[l+28>>2]=G;c[l+20>>2]=0;c[l+16>>2]=0;E=c[2551]|0;a=1<>2]=l;c[l+24>>2]=n;c[l+12>>2]=l;c[l+8>>2]=l}else{F=c[n>>2]|0;b:do if((c[F+4>>2]&-8|0)==(D|0))H=F;else{b=D<<((G|0)==31?0:25-(1?G>>>1:G)|0);m=F;while(1){I=m+16+((31?b>>>31:b)<<2)|0;r=c[I>>2]|0;if(!r)break;if((c[r+4>>2]&-8|0)==(D|0)){H=r;break b}else{b=b<<1;m=r}}c[I>>2]=l;c[l+24>>2]=m;c[l+12>>2]=l;c[l+8>>2]=l;break a}while(0);F=H+8|0;w=c[F>>2]|0;c[w+12>>2]=l;c[F>>2]=l;c[l+8>>2]=w;c[l+12>>2]=H;c[l+24>>2]=0}while(0);l=(c[2558]|0)+-1|0;c[2558]=l;if(l|0)return;l=10656;while(1){H=c[l>>2]|0;if(!H)break;else l=H+8|0}c[2558]=-1;return}function Re(a,b){a=a|0;b=b|0;var d=0,e=0;if(a){d=r(b,a)|0;if((b|a)>>>0>65535)e=((d>>>0)/(a>>>0)|0|0)==(b|0)?d:-1;else e=d}else e=0;d=Pe(e)|0;if(!d)return d|0;if(!(c[d+-4>>2]&3))return d|0;Nf(d|0,0,e|0)|0;return d|0}function Se(a,b){a=a|0;b=b|0;return 0}function Te(a){a=a|0;return 0}function Ue(a){a=a|0;return 0}function Ve(a){a=a|0;return 0}function We(a){a=a|0;var b=0,d=0,e=0;b=Y;Y=Y+16|0;d=b;e=$e(c[a+60>>2]|0)|0;c[d>>2]=e;e=Ze(I(6,d|0)|0)|0;Y=b;return e|0}function Xe(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,v=0;e=Y;Y=Y+48|0;f=e+32|0;g=e+16|0;h=e;i=a+28|0;j=c[i>>2]|0;c[h>>2]=j;k=a+20|0;l=(c[k>>2]|0)-j|0;c[h+4>>2]=l;c[h+8>>2]=b;c[h+12>>2]=d;b=l+d|0;l=a+60|0;c[g>>2]=c[l>>2];c[g+4>>2]=h;c[g+8>>2]=2;j=Ze(H(146,g|0)|0)|0;a:do if((b|0)!=(j|0)){g=2;m=b;n=h;o=j;while(1){if((o|0)<0)break;m=m-o|0;p=c[n+4>>2]|0;q=o>>>0>p>>>0;r=q?n+8|0:n;s=g+(q<<31>>31)|0;t=o-(q?p:0)|0;c[r>>2]=(c[r>>2]|0)+t;p=r+4|0;c[p>>2]=(c[p>>2]|0)-t;c[f>>2]=c[l>>2];c[f+4>>2]=r;c[f+8>>2]=s;o=Ze(H(146,f|0)|0)|0;if((m|0)==(o|0)){u=3;break a}else{g=s;n=r}}c[a+16>>2]=0;c[i>>2]=0;c[k>>2]=0;c[a>>2]=c[a>>2]|32;if((g|0)==2)v=0;else v=d-(c[n+4>>2]|0)|0}else u=3;while(0);if((u|0)==3){u=c[a+44>>2]|0;c[a+16>>2]=u+(c[a+48>>2]|0);a=u;c[i>>2]=a;c[k>>2]=a;v=d}Y=e;return v|0}function Ye(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,g=0,h=0;e=Y;Y=Y+32|0;f=e;g=e+20|0;c[f>>2]=c[a+60>>2];c[f+4>>2]=0;c[f+8>>2]=b;c[f+12>>2]=g;c[f+16>>2]=d;if((Ze(G(140,f|0)|0)|0)<0){c[g>>2]=-1;h=-1}else h=c[g>>2]|0;Y=e;return h|0}function Ze(a){a=a|0;var b=0,d=0;if(a>>>0>4294963200){b=_e()|0;c[b>>2]=0-a;d=-1}else d=a;return d|0}function _e(){return 10696}function $e(a){a=a|0;return a|0}function af(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0;a:do if(!d)e=0;else{f=b;g=d;h=c;while(1){i=a[f>>0]|0;j=a[h>>0]|0;if(i<<24>>24!=j<<24>>24)break;g=g+-1|0;if(!g){e=0;break a}else{f=f+1|0;h=h+1|0}}e=(i&255)-(j&255)|0}while(0);return e|0}function bf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0,u=0,v=0,w=0,x=0,y=0;f=d&255;g=(e|0)!=0;a:do if(g&(b&3|0)!=0){h=d&255;i=b;j=e;while(1){if((a[i>>0]|0)==h<<24>>24){k=i;l=j;m=6;break a}n=i+1|0;o=j+-1|0;p=(o|0)!=0;if(p&(n&3|0)!=0){i=n;j=o}else{q=n;s=o;t=p;m=5;break}}}else{q=b;s=e;t=g;m=5}while(0);if((m|0)==5)if(t){k=q;l=s;m=6}else m=16;b:do if((m|0)==6){s=d&255;if((a[k>>0]|0)==s<<24>>24)if(!l){m=16;break}else{u=k;break}q=r(f,16843009)|0;c:do if(l>>>0>3){t=k;g=l;while(1){e=c[t>>2]^q;if((e&-2139062144^-2139062144)&e+-16843009|0){v=g;w=t;break c}e=t+4|0;b=g+-4|0;if(b>>>0>3){t=e;g=b}else{x=e;y=b;m=11;break}}}else{x=k;y=l;m=11}while(0);if((m|0)==11)if(!y){m=16;break}else{v=y;w=x}q=w;g=v;while(1){if((a[q>>0]|0)==s<<24>>24){u=q;break b}g=g+-1|0;if(!g){m=16;break}else q=q+1|0}}while(0);if((m|0)==16)u=0;return u|0}function cf(){return 8300}function df(a){a=a|0;return (a+-48|0)>>>0<10|0}function ef(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0;f=Y;Y=Y+224|0;g=f+208|0;h=f+160|0;i=f+80|0;j=f;k=h;l=k+40|0;do{c[k>>2]=0;k=k+4|0}while((k|0)<(l|0));c[g>>2]=c[e>>2];if((ff(0,d,g,i,h)|0)<0)m=-1;else{if((c[b+76>>2]|0)>-1)n=gf(b)|0;else n=0;e=c[b>>2]|0;k=e&32;if((a[b+74>>0]|0)<1)c[b>>2]=e&-33;e=b+48|0;if(!(c[e>>2]|0)){l=b+44|0;o=c[l>>2]|0;c[l>>2]=j;p=b+28|0;c[p>>2]=j;q=b+20|0;c[q>>2]=j;c[e>>2]=80;r=b+16|0;c[r>>2]=j+80;j=ff(b,d,g,i,h)|0;if(!o)s=j;else{ca[c[b+36>>2]&15](b,0,0)|0;t=(c[q>>2]|0)==0?-1:j;c[l>>2]=o;c[e>>2]=0;c[r>>2]=0;c[p>>2]=0;c[q>>2]=0;s=t}}else s=ff(b,d,g,i,h)|0;h=c[b>>2]|0;c[b>>2]=h|k;if(n|0)hf(b);m=(h&32|0)==0?s:-1}Y=f;return m|0}function ff(d,e,f,h,i){d=d|0;e=e|0;f=f|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,s=0,t=0,u=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0,ja=0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0;j=Y;Y=Y+64|0;k=j+56|0;l=j+40|0;m=j;n=j+48|0;o=j+60|0;c[k>>2]=e;e=(d|0)!=0;p=m+40|0;q=p;r=m+39|0;m=n+4|0;s=0;t=0;u=0;a:while(1){w=s;x=t;while(1){do if((x|0)>-1)if((w|0)>(2147483647-x|0)){y=_e()|0;c[y>>2]=75;z=-1;break}else{z=w+x|0;break}else z=x;while(0);A=c[k>>2]|0;y=a[A>>0]|0;if(!(y<<24>>24)){B=92;break a}C=y;y=A;b:while(1){switch(C<<24>>24){case 37:{B=10;break b;break}case 0:{D=y;break b;break}default:{}}E=y+1|0;c[k>>2]=E;C=a[E>>0]|0;y=E}c:do if((B|0)==10){B=0;C=y;E=y;while(1){if((a[E+1>>0]|0)!=37){D=C;break c}F=C+1|0;E=E+2|0;c[k>>2]=E;if((a[E>>0]|0)!=37){D=F;break}else C=F}}while(0);w=D-A|0;if(e)jf(d,A,w);if(!w)break;else x=z}x=(df(a[(c[k>>2]|0)+1>>0]|0)|0)==0;w=c[k>>2]|0;if(!x?(a[w+2>>0]|0)==36:0){G=(a[w+1>>0]|0)+-48|0;H=1;I=3}else{G=-1;H=u;I=1}x=w+I|0;c[k>>2]=x;w=a[x>>0]|0;y=(w<<24>>24)+-32|0;if(y>>>0>31|(1<>2]=E;F=a[E>>0]|0;C=(F<<24>>24)+-32|0;if(C>>>0>31|(1<>24==42){if((df(a[L+1>>0]|0)|0)!=0?(y=c[k>>2]|0,(a[y+2>>0]|0)==36):0){w=y+1|0;c[i+((a[w>>0]|0)+-48<<2)>>2]=10;M=c[h+((a[w>>0]|0)+-48<<3)>>2]|0;N=1;O=y+3|0}else{if(H|0){P=-1;break}if(e){y=(c[f>>2]|0)+(4-1)&~(4-1);w=c[y>>2]|0;c[f>>2]=y+4;Q=w}else Q=0;M=Q;N=0;O=(c[k>>2]|0)+1|0}c[k>>2]=O;w=(M|0)<0;R=w?0-M|0:M;S=w?J|8192:J;T=N;U=O}else{w=kf(k)|0;if((w|0)<0){P=-1;break}R=w;S=J;T=H;U=c[k>>2]|0}do if((a[U>>0]|0)==46){w=U+1|0;if((a[w>>0]|0)!=42){c[k>>2]=w;w=kf(k)|0;V=w;W=c[k>>2]|0;break}if(df(a[U+2>>0]|0)|0?(w=c[k>>2]|0,(a[w+3>>0]|0)==36):0){y=w+2|0;c[i+((a[y>>0]|0)+-48<<2)>>2]=10;C=c[h+((a[y>>0]|0)+-48<<3)>>2]|0;y=w+4|0;c[k>>2]=y;V=C;W=y;break}if(T|0){P=-1;break a}if(e){y=(c[f>>2]|0)+(4-1)&~(4-1);C=c[y>>2]|0;c[f>>2]=y+4;X=C}else X=0;C=(c[k>>2]|0)+2|0;c[k>>2]=C;V=X;W=C}else{V=-1;W=U}while(0);C=0;y=W;while(1){if(((a[y>>0]|0)+-65|0)>>>0>57){P=-1;break a}w=y;y=y+1|0;c[k>>2]=y;Z=a[(a[w>>0]|0)+-65+(7616+(C*58|0))>>0]|0;_=Z&255;if((_+-1|0)>>>0>=8)break;else C=_}if(!(Z<<24>>24)){P=-1;break}w=(G|0)>-1;do if(Z<<24>>24==19)if(w){P=-1;break a}else B=54;else{if(w){c[i+(G<<2)>>2]=_;E=h+(G<<3)|0;x=c[E+4>>2]|0;F=l;c[F>>2]=c[E>>2];c[F+4>>2]=x;B=54;break}if(!e){P=0;break a}lf(l,_,f);$=c[k>>2]|0;B=55}while(0);if((B|0)==54){B=0;if(e){$=y;B=55}else aa=0}d:do if((B|0)==55){B=0;w=a[$+-1>>0]|0;x=(C|0)!=0&(w&15|0)==3?w&-33:w;w=S&-65537;F=(S&8192|0)==0?S:w;e:do switch(x|0){case 110:{switch((C&255)<<24>>24){case 0:{c[c[l>>2]>>2]=z;aa=0;break d;break}case 1:{c[c[l>>2]>>2]=z;aa=0;break d;break}case 2:{E=c[l>>2]|0;c[E>>2]=z;c[E+4>>2]=((z|0)<0)<<31>>31;aa=0;break d;break}case 3:{b[c[l>>2]>>1]=z;aa=0;break d;break}case 4:{a[c[l>>2]>>0]=z;aa=0;break d;break}case 6:{c[c[l>>2]>>2]=z;aa=0;break d;break}case 7:{E=c[l>>2]|0;c[E>>2]=z;c[E+4>>2]=((z|0)<0)<<31>>31;aa=0;break d;break}default:{aa=0;break d}}break}case 112:{ba=120;ca=V>>>0>8?V:8;da=F|8;B=67;break}case 88:case 120:{ba=x;ca=V;da=F;B=67;break}case 111:{E=l;ea=c[E>>2]|0;fa=c[E+4>>2]|0;E=nf(ea,fa,p)|0;ga=q-E|0;ha=E;ia=0;ja=9285;ka=(F&8|0)==0|(V|0)>(ga|0)?V:ga+1|0;la=F;ma=ea;na=fa;B=73;break}case 105:case 100:{fa=l;ea=c[fa>>2]|0;ga=c[fa+4>>2]|0;if((ga|0)<0){fa=Ef(0,0,ea|0,ga|0)|0;E=v()|0;oa=l;c[oa>>2]=fa;c[oa+4>>2]=E;pa=1;qa=9285;ra=fa;sa=E;B=72;break e}else{pa=(F&2049|0)!=0&1;qa=(F&2048|0)==0?((F&1|0)==0?9285:9287):9286;ra=ea;sa=ga;B=72;break e}break}case 117:{ga=l;pa=0;qa=9285;ra=c[ga>>2]|0;sa=c[ga+4>>2]|0;B=72;break}case 99:{a[r>>0]=c[l>>2];ta=r;ua=0;va=9285;wa=1;xa=w;ya=q;break}case 115:{ga=c[l>>2]|0;ea=(ga|0)==0?9295:ga;ga=bf(ea,0,V)|0;E=(ga|0)==0;ta=ea;ua=0;va=9285;wa=E?V:ga-ea|0;xa=w;ya=E?ea+V|0:ga;break}case 67:{c[n>>2]=c[l>>2];c[m>>2]=0;c[l>>2]=n;za=-1;B=79;break}case 83:{if(!V){pf(d,32,R,0,F);Aa=0;B=89}else{za=V;B=79}break}case 65:case 71:case 70:case 69:case 97:case 103:case 102:case 101:{aa=rf(d,+g[l>>3],R,V,F,x)|0;break d;break}default:{ta=A;ua=0;va=9285;wa=V;xa=F;ya=q}}while(0);f:do if((B|0)==67){B=0;x=l;w=c[x>>2]|0;ga=c[x+4>>2]|0;x=mf(w,ga,p,ba&32)|0;ea=(da&8|0)==0|(w|0)==0&(ga|0)==0;ha=x;ia=ea?0:2;ja=ea?9285:9285+(4?ba>>>4:ba)|0;ka=ca;la=da;ma=w;na=ga;B=73}else if((B|0)==72){B=0;ha=of(ra,sa,p)|0;ia=pa;ja=qa;ka=V;la=F;ma=ra;na=sa;B=73}else if((B|0)==79){B=0;ga=c[l>>2]|0;w=0;while(1){ea=c[ga>>2]|0;if(!ea){Ba=w;break}x=qf(o,ea)|0;Ca=(x|0)<0;if(Ca|x>>>0>(za-w|0)>>>0){B=83;break}ea=x+w|0;if(za>>>0>ea>>>0){ga=ga+4|0;w=ea}else{Ba=ea;break}}if((B|0)==83){B=0;if(Ca){P=-1;break a}else Ba=w}pf(d,32,R,Ba,F);if(!Ba){Aa=0;B=89}else{ga=c[l>>2]|0;ea=0;while(1){x=c[ga>>2]|0;if(!x){Aa=Ba;B=89;break f}E=qf(o,x)|0;ea=E+ea|0;if((ea|0)>(Ba|0)){Aa=Ba;B=89;break f}jf(d,o,E);if(ea>>>0>=Ba>>>0){Aa=Ba;B=89;break}else ga=ga+4|0}}}while(0);if((B|0)==73){B=0;ga=(ma|0)!=0|(na|0)!=0;ea=(ka|0)!=0|ga;w=q-ha+((ga^1)&1)|0;ta=ea?ha:p;ua=ia;va=ja;wa=ea?((ka|0)>(w|0)?ka:w):0;xa=(ka|0)>-1?la&-65537:la;ya=q}else if((B|0)==89){B=0;pf(d,32,R,Aa,F^8192);aa=(R|0)>(Aa|0)?R:Aa;break}w=ya-ta|0;ea=(wa|0)<(w|0)?w:wa;ga=ea+ua|0;E=(R|0)<(ga|0)?ga:R;pf(d,32,E,ga,xa);jf(d,va,ua);pf(d,48,E,ga,xa^65536);pf(d,48,ea,w,0);jf(d,ta,w);pf(d,32,E,ga,xa^8192);aa=E}while(0);s=aa;t=z;u=T}g:do if((B|0)==92)if(!d)if(!u)P=0;else{T=1;while(1){t=c[i+(T<<2)>>2]|0;if(!t)break;lf(h+(T<<3)|0,t,f);t=T+1|0;if(t>>>0<10)T=t;else{P=1;break g}}t=T;while(1){if(c[i+(t<<2)>>2]|0){P=-1;break g}t=t+1|0;if(t>>>0>=10){P=1;break}}}else P=z;while(0);Y=j;return P|0}function gf(a){a=a|0;return 1}function hf(a){a=a|0;return}function jf(a,b,d){a=a|0;b=b|0;d=d|0;if(!(c[a>>2]&32))xf(b,d,a)|0;return}function kf(b){b=b|0;var d=0,e=0,f=0,g=0,h=0;if(!(df(a[c[b>>2]>>0]|0)|0))d=0;else{e=0;while(1){f=c[b>>2]|0;g=(e*10|0)+-48+(a[f>>0]|0)|0;h=f+1|0;c[b>>2]=h;if(!(df(a[h>>0]|0)|0)){d=g;break}else e=g}}return d|0}function lf(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0,h=0,i=0,j=0.0;a:do if(b>>>0<=20)do switch(b|0){case 9:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;c[a>>2]=f;break a;break}case 10:{f=(c[d>>2]|0)+(4-1)&~(4-1);e=c[f>>2]|0;c[d>>2]=f+4;f=a;c[f>>2]=e;c[f+4>>2]=((e|0)<0)<<31>>31;break a;break}case 11:{e=(c[d>>2]|0)+(4-1)&~(4-1);f=c[e>>2]|0;c[d>>2]=e+4;e=a;c[e>>2]=f;c[e+4>>2]=0;break a;break}case 12:{e=(c[d>>2]|0)+(8-1)&~(8-1);f=e;h=c[f>>2]|0;i=c[f+4>>2]|0;c[d>>2]=e+8;e=a;c[e>>2]=h;c[e+4>>2]=i;break a;break}case 13:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&65535)<<16>>16;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 14:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&65535;c[i+4>>2]=0;break a;break}case 15:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=(e&255)<<24>>24;e=a;c[e>>2]=i;c[e+4>>2]=((i|0)<0)<<31>>31;break a;break}case 16:{i=(c[d>>2]|0)+(4-1)&~(4-1);e=c[i>>2]|0;c[d>>2]=i+4;i=a;c[i>>2]=e&255;c[i+4>>2]=0;break a;break}case 17:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+g[i>>3];c[d>>2]=i+8;g[a>>3]=j;break a;break}case 18:{i=(c[d>>2]|0)+(8-1)&~(8-1);j=+g[i>>3];c[d>>2]=i+8;g[a>>3]=j;break a;break}default:break a}while(0);while(0);return}function mf(b,c,e,f){b=b|0;c=c|0;e=e|0;f=f|0;var g=0,h=0;if((b|0)==0&(c|0)==0)g=e;else{h=e;e=c;c=b;while(1){b=h+-1|0;a[b>>0]=d[8080+(c&15)>>0]|0|f;c=If(c|0,e|0,4)|0;e=v()|0;if((c|0)==0&(e|0)==0){g=b;break}else h=b}}return g|0}function nf(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0;if((b|0)==0&(c|0)==0)e=d;else{f=d;d=c;c=b;while(1){b=f+-1|0;a[b>>0]=c&7|48;c=If(c|0,d|0,3)|0;d=v()|0;if((c|0)==0&(d|0)==0){e=b;break}else f=b}}return e|0}function of(b,c,d){b=b|0;c=c|0;d=d|0;var e=0,f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0;if(c>>>0>0|(c|0)==0&b>>>0>4294967295){e=d;f=b;g=c;do{c=f;f=Hf(f|0,g|0,10,0)|0;h=g;g=v()|0;i=Cf(f|0,g|0,10,0)|0;j=Ef(c|0,h|0,i|0,v()|0)|0;v()|0;e=e+-1|0;a[e>>0]=j&255|48}while(h>>>0>9|(h|0)==9&c>>>0>4294967295);k=f;l=e}else{k=b;l=d}if(!k)m=l;else{d=k;k=l;while(1){l=d;d=(d>>>0)/10|0;b=k+-1|0;a[b>>0]=l-(d*10|0)|48;if(l>>>0<10){m=b;break}else k=b}}return m|0}function pf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;var f=0,g=0,h=0;f=Y;Y=Y+256|0;g=f;if((c|0)>(d|0)&(e&73728|0)==0){e=c-d|0;Nf(g|0,b<<24>>24|0,(e>>>0<256?e:256)|0)|0;if(e>>>0>255){b=c-d|0;d=e;do{jf(a,g,256);d=d+-256|0}while(d>>>0>255);h=b&255}else h=e;jf(a,g,h)}Y=f;return}function qf(a,b){a=a|0;b=b|0;var c=0;if(!a)c=0;else c=vf(a,b,0)|0;return c|0}function rf(b,e,f,g,h,i){b=b|0;e=+e;f=f|0;g=g|0;h=h|0;i=i|0;var j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,s=0,t=0.0,u=0,w=0.0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0.0,G=0,H=0,I=0,J=0.0,K=0,L=0,M=0,N=0,O=0,P=0,Q=0.0,R=0,S=0,T=0,U=0,V=0,W=0,X=0,Z=0,_=0,$=0,aa=0,ba=0,ca=0,da=0,ea=0,fa=0,ga=0,ha=0,ia=0.0,ja=0.0,ka=0,la=0,ma=0,na=0,oa=0,pa=0,qa=0,ra=0,sa=0,ta=0,ua=0,va=0,wa=0,xa=0,ya=0,za=0,Aa=0,Ba=0,Ca=0,Da=0,Ea=0,Fa=0,Ga=0,Ha=0,Ia=0;j=Y;Y=Y+560|0;k=j+32|0;l=j+536|0;m=j;n=m;o=j+540|0;c[l>>2]=0;p=o+12|0;q=sf(e)|0;s=v()|0;if((s|0)<0){t=-e;u=sf(t)|0;w=t;x=1;y=9302;z=v()|0;A=u}else{w=e;x=(h&2049|0)!=0&1;y=(h&2048|0)==0?((h&1|0)==0?9303:9308):9305;z=s;A=q}do if(0==0&(z&2146435072|0)==2146435072){q=(i&32|0)!=0;A=x+3|0;pf(b,32,f,A,h&-65537);jf(b,y,x);jf(b,w!=w|0.0!=0.0?(q?9329:9333):q?9321:9325,3);pf(b,32,f,A,h^8192);B=A}else{e=+tf(w,l)*2.0;A=e!=0.0;if(A)c[l>>2]=(c[l>>2]|0)+-1;q=i|32;if((q|0)==97){s=i&32;u=(s|0)==0?y:y+9|0;C=x|2;D=12-g|0;do if(!(g>>>0>11|(D|0)==0)){t=8.0;E=D;do{E=E+-1|0;t=t*16.0}while((E|0)!=0);if((a[u>>0]|0)==45){F=-(t+(-e-t));break}else{F=e+t-t;break}}else F=e;while(0);D=c[l>>2]|0;E=(D|0)<0?0-D|0:D;G=of(E,((E|0)<0)<<31>>31,p)|0;if((G|0)==(p|0)){E=o+11|0;a[E>>0]=48;H=E}else H=G;a[H+-1>>0]=((31?D>>31:D)&2)+43;D=H+-2|0;a[D>>0]=i+15;G=(g|0)<1;E=(h&8|0)==0;I=m;J=F;while(1){K=~~J;L=I+1|0;a[I>>0]=s|d[8080+K>>0];J=(J-+(K|0))*16.0;if((L-n|0)==1?!(E&(G&J==0.0)):0){a[L>>0]=46;M=I+2|0}else M=L;if(!(J!=0.0))break;else I=M}I=M;if((g|0)!=0?(-2-n+I|0)<(g|0):0){G=p;E=D;N=g+2+G-E|0;O=G;P=E}else{E=p;G=D;N=E-n-G+I|0;O=E;P=G}G=N+C|0;pf(b,32,f,G,h);jf(b,u,C);pf(b,48,f,G,h^65536);E=I-n|0;jf(b,m,E);I=O-P|0;pf(b,48,N-(E+I)|0,0,0);jf(b,D,I);pf(b,32,f,G,h^8192);B=G;break}G=(g|0)<0?6:g;if(A){I=(c[l>>2]|0)+-28|0;c[l>>2]=I;Q=e*268435456.0;R=I}else{Q=e;R=c[l>>2]|0}I=(R|0)<0?k:k+288|0;E=I;J=Q;do{s=~~J>>>0;c[E>>2]=s;E=E+4|0;J=(J-+(s>>>0))*1.0e9}while(J!=0.0);A=I;if((R|0)>0){D=I;C=E;u=R;while(1){s=(u|0)<29?u:29;L=C+-4|0;if(L>>>0>=D>>>0){K=L;L=0;do{S=Jf(c[K>>2]|0,0,s|0)|0;T=Df(S|0,v()|0,L|0,0)|0;S=v()|0;L=Hf(T|0,S|0,1e9,0)|0;U=Cf(L|0,v()|0,1e9,0)|0;V=Ef(T|0,S|0,U|0,v()|0)|0;v()|0;c[K>>2]=V;K=K+-4|0}while(K>>>0>=D>>>0);if(L){K=D+-4|0;c[K>>2]=L;W=K}else W=D}else W=D;a:do if(C>>>0>W>>>0){K=C;while(1){V=K+-4|0;if(c[V>>2]|0){X=K;break a}if(V>>>0>W>>>0)K=V;else{X=V;break}}}else X=C;while(0);L=(c[l>>2]|0)-s|0;c[l>>2]=L;if((L|0)>0){D=W;C=X;u=L}else{Z=W;_=X;$=L;break}}}else{Z=I;_=E;$=R}if(($|0)<0){u=((G+25|0)/9|0)+1|0;C=(q|0)==102;D=Z;L=_;K=$;while(1){V=0-K|0;U=(V|0)<9?V:9;if(D>>>0>>0){V=(1<>>U:1e9;T=0;aa=D;do{ba=c[aa>>2]|0;c[aa>>2]=(U?ba>>>U:ba)+T;T=r(ba&V,S)|0;aa=aa+4|0}while(aa>>>0>>0);aa=(c[D>>2]|0)==0?D+4|0:D;if(!T){ca=L;da=aa}else{c[L>>2]=T;ca=L+4|0;da=aa}}else{ca=L;da=(c[D>>2]|0)==0?D+4|0:D}aa=C?I:da;S=ca-aa|0;V=((2?S>>2:S)|0)>(u|0)?aa+(u<<2)|0:ca;K=(c[l>>2]|0)+U|0;c[l>>2]=K;if((K|0)>=0){ea=da;fa=V;break}else{D=da;L=V}}}else{ea=Z;fa=_}if(ea>>>0>>0){L=A-ea|0;D=(2?L>>2:L)*9|0;L=c[ea>>2]|0;if(L>>>0<10)ga=D;else{K=D;D=10;while(1){D=D*10|0;u=K+1|0;if(L>>>0>>0){ga=u;break}else K=u}}}else ga=0;K=(q|0)==103;D=(G|0)!=0;L=G-((q|0)==102?0:ga)+((D&K)<<31>>31)|0;u=fa-A|0;if((L|0)<(((2?u>>2:u)*9|0)+-9|0)){u=L+9216|0;L=(u|0)/9|0;C=I+4+(L+-1024<<2)|0;E=u-(L*9|0)|0;if((E|0)<8){L=E;E=10;while(1){u=E*10|0;if((L|0)<7){L=L+1|0;E=u}else{ha=u;break}}}else ha=10;E=c[C>>2]|0;L=(E>>>0)/(ha>>>0)|0;q=E-(r(L,ha)|0)|0;u=(C+4|0)==(fa|0);if(!(u&(q|0)==0)){t=(L&1|0)==0?9007199254740992.0:9007199254740994.0;L=1?ha>>>1:ha;J=q>>>0>>0?.5:u&(q|0)==(L|0)?1.0:1.5;if(!x){ia=J;ja=t}else{L=(a[y>>0]|0)==45;ia=L?-J:J;ja=L?-t:t}L=E-q|0;c[C>>2]=L;if(ja+ia!=ja){q=L+ha|0;c[C>>2]=q;if(q>>>0>999999999){q=C;L=ea;while(1){E=q+-4|0;c[q>>2]=0;if(E>>>0>>0){u=L+-4|0;c[u>>2]=0;ka=u}else ka=L;u=(c[E>>2]|0)+1|0;c[E>>2]=u;if(u>>>0>999999999){q=E;L=ka}else{la=E;ma=ka;break}}}else{la=C;ma=ea}L=A-ma|0;q=(2?L>>2:L)*9|0;L=c[ma>>2]|0;if(L>>>0<10){na=la;oa=q;pa=ma}else{E=q;q=10;while(1){q=q*10|0;u=E+1|0;if(L>>>0>>0){na=la;oa=u;pa=ma;break}else E=u}}}else{na=C;oa=ga;pa=ea}}else{na=C;oa=ga;pa=ea}E=na+4|0;qa=oa;ra=fa>>>0>E>>>0?E:fa;sa=pa}else{qa=ga;ra=fa;sa=ea}E=0-qa|0;b:do if(ra>>>0>sa>>>0){q=ra;while(1){L=q+-4|0;if(c[L>>2]|0){ta=q;ua=1;break b}if(L>>>0>sa>>>0)q=L;else{ta=L;ua=0;break}}}else{ta=ra;ua=0}while(0);do if(K){C=G+((D^1)&1)|0;if((C|0)>(qa|0)&(qa|0)>-5){va=i+-1|0;wa=C+-1-qa|0}else{va=i+-2|0;wa=C+-1|0}if(!(h&8)){if(ua?(C=c[ta+-4>>2]|0,(C|0)!=0):0)if(!((C>>>0)%10|0)){q=0;U=10;while(1){U=U*10|0;T=q+1|0;if((C>>>0)%(U>>>0)|0|0){xa=T;break}else q=T}}else xa=0;else xa=9;q=ta-A|0;U=((2?q>>2:q)*9|0)+-9|0;if((va|32|0)==102){q=U-xa|0;C=(q|0)>0?q:0;ya=va;za=(wa|0)<(C|0)?wa:C;break}else{C=U+qa-xa|0;U=(C|0)>0?C:0;ya=va;za=(wa|0)<(U|0)?wa:U;break}}else{ya=va;za=wa}}else{ya=i;za=G}while(0);G=(za|0)!=0;A=G?1:(3?h>>>3:h)&1;D=(ya|32|0)==102;if(D){Aa=0;Ba=(qa|0)>0?qa:0}else{K=(qa|0)<0?E:qa;U=of(K,((K|0)<0)<<31>>31,p)|0;K=p;if((K-U|0)<2){C=U;while(1){q=C+-1|0;a[q>>0]=48;if((K-q|0)<2)C=q;else{Ca=q;break}}}else Ca=U;a[Ca+-1>>0]=((31?qa>>31:qa)&2)+43;C=Ca+-2|0;a[C>>0]=ya;Aa=C;Ba=K-C|0}C=x+1+za+A+Ba|0;pf(b,32,f,C,h);jf(b,y,x);pf(b,48,f,C,h^65536);if(D){E=sa>>>0>I>>>0?I:sa;q=m+9|0;T=q;L=m+8|0;u=E;do{V=of(c[u>>2]|0,0,q)|0;if((u|0)==(E|0))if((V|0)==(q|0)){a[L>>0]=48;Da=L}else Da=V;else if(V>>>0>m>>>0){Nf(m|0,48,V-n|0)|0;aa=V;while(1){S=aa+-1|0;if(S>>>0>m>>>0)aa=S;else{Da=S;break}}}else Da=V;jf(b,Da,T-Da|0);u=u+4|0}while(u>>>0<=I>>>0);if(!((h&8|0)==0&(G^1)))jf(b,9337,1);if(u>>>0>>0&(za|0)>0){I=za;T=u;while(1){L=of(c[T>>2]|0,0,q)|0;if(L>>>0>m>>>0){Nf(m|0,48,L-n|0)|0;E=L;while(1){D=E+-1|0;if(D>>>0>m>>>0)E=D;else{Ea=D;break}}}else Ea=L;jf(b,Ea,(I|0)<9?I:9);T=T+4|0;E=I+-9|0;if(!(T>>>0>>0&(I|0)>9)){Fa=E;break}else I=E}}else Fa=za;pf(b,48,Fa+9|0,9,0)}else{I=ua?ta:sa+4|0;if(sa>>>0>>0&(za|0)>-1){T=m+9|0;q=(h&8|0)==0;u=T;G=0-n|0;E=m+8|0;V=za;D=sa;while(1){A=of(c[D>>2]|0,0,T)|0;if((A|0)==(T|0)){a[E>>0]=48;Ga=E}else Ga=A;do if((D|0)==(sa|0)){A=Ga+1|0;jf(b,Ga,1);if(q&(V|0)<1){Ha=A;break}jf(b,9337,1);Ha=A}else{if(Ga>>>0<=m>>>0){Ha=Ga;break}Nf(m|0,48,Ga+G|0)|0;A=Ga;while(1){K=A+-1|0;if(K>>>0>m>>>0)A=K;else{Ha=K;break}}}while(0);L=u-Ha|0;jf(b,Ha,(V|0)>(L|0)?L:V);A=V-L|0;D=D+4|0;if(!(D>>>0>>0&(A|0)>-1)){Ia=A;break}else V=A}}else Ia=za;pf(b,48,Ia+18|0,18,0);jf(b,Aa,p-Aa|0)}pf(b,32,f,C,h^8192);B=C}while(0);Y=j;return ((B|0)<(f|0)?f:B)|0}function sf(a){a=+a;var b=0;g[h>>3]=a;b=c[h>>2]|0;u(c[h+4>>2]|0);return b|0}function tf(a,b){a=+a;b=b|0;return +(+uf(a,b))}function uf(a,b){a=+a;b=b|0;var d=0,e=0,f=0,i=0.0,j=0.0,k=0,l=0.0;g[h>>3]=a;d=c[h>>2]|0;e=c[h+4>>2]|0;f=If(d|0,e|0,52)|0;v()|0;switch(f&2047){case 0:{if(a!=0.0){i=+uf(a*18446744073709551616.0,b);j=i;k=(c[b>>2]|0)+-64|0}else{j=a;k=0}c[b>>2]=k;l=j;break}case 2047:{l=a;break}default:{c[b>>2]=(f&2047)+-1022;c[h>>2]=d;c[h+4>>2]=e&-2146435073|1071644672;l=+g[h>>3]}}return +l}function vf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0;do if(b){if(d>>>0<128){a[b>>0]=d;f=1;break}e=(wf()|0)+188|0;if(!(c[c[e>>2]>>2]|0))if((d&-128|0)==57216){a[b>>0]=d;f=1;break}else{e=_e()|0;c[e>>2]=84;f=-1;break}if(d>>>0<2048){a[b>>0]=(6?d>>>6:d)|192;a[b+1>>0]=d&63|128;f=2;break}if(d>>>0<55296|(d&-8192|0)==57344){a[b>>0]=(12?d>>>12:d)|224;a[b+1>>0]=(6?d>>>6:d)&63|128;a[b+2>>0]=d&63|128;f=3;break}if((d+-65536|0)>>>0<1048576){a[b>>0]=(18?d>>>18:d)|240;a[b+1>>0]=(12?d>>>12:d)&63|128;a[b+2>>0]=(6?d>>>6:d)&63|128;a[b+3>>0]=d&63|128;f=4;break}else{e=_e()|0;c[e>>2]=84;f=-1;break}}else f=1;while(0);return f|0}function wf(){return cf()|0}function xf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0;f=e+16|0;g=c[f>>2]|0;if(!g)if(!(yf(e)|0)){h=c[f>>2]|0;i=5}else j=0;else{h=g;i=5}a:do if((i|0)==5){g=e+20|0;f=c[g>>2]|0;k=f;if((h-f|0)>>>0>>0){j=ca[c[e+36>>2]&15](e,b,d)|0;break}b:do if((a[e+75>>0]|0)<0|(d|0)==0){l=0;m=b;n=d;o=k}else{f=d;while(1){p=f+-1|0;if((a[b+p>>0]|0)==10)break;if(!p){l=0;m=b;n=d;o=k;break b}else f=p}p=ca[c[e+36>>2]&15](e,b,f)|0;if(p>>>0>>0){j=p;break a}l=f;m=b+f|0;n=d-f|0;o=c[g>>2]|0}while(0);Lf(o|0,m|0,n|0)|0;c[g>>2]=(c[g>>2]|0)+n;j=l+n|0}while(0);return j|0}function yf(b){b=b|0;var d=0,e=0,f=0;d=b+74|0;e=a[d>>0]|0;a[d>>0]=e+255|e;e=c[b>>2]|0;if(!(e&8)){c[b+8>>2]=0;c[b+4>>2]=0;d=c[b+44>>2]|0;c[b+28>>2]=d;c[b+20>>2]=d;c[b+16>>2]=d+(c[b+48>>2]|0);f=0}else{c[b>>2]=e|32;f=-1}return f|0}function zf(a,b,d,e){a=a|0;b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0,j=0;f=r(d,b)|0;g=(b|0)==0?0:d;if((c[e+76>>2]|0)>-1){d=(gf(e)|0)==0;h=xf(a,f,e)|0;if(d)i=h;else{hf(e);i=h}}else i=xf(a,f,e)|0;if((i|0)==(f|0))j=g;else j=(i>>>0)/(b>>>0)|0;return j|0}function Af(a,b,d){a=a|0;b=b|0;d=d|0;var e=0,f=0;e=Y;Y=Y+16|0;f=e;c[f>>2]=d;d=ef(a,b,f)|0;Y=e;return d|0}function Bf(a,b){a=a|0;b=b|0;var c=0,d=0,e=0,f=0;c=a&65535;d=b&65535;e=r(d,c)|0;f=a>>>16;a=(e>>>16)+(r(d,f)|0)|0;d=b>>>16;b=r(d,c)|0;return (u((a>>>16)+(r(d,f)|0)+(((a&65535)+b|0)>>>16)|0),a+b<<16|e&65535|0)|0}function Cf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0,f=0;e=a;a=c;c=Bf(e,a)|0;f=v()|0;return (u((r(b,a)|0)+(r(d,e)|0)+f|f&0|0),c|0|0)|0}function Df(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=a+c>>>0;return (u(b+d+(e>>>0>>0|0)>>>0|0),e|0)|0}function Ef(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;var e=0;e=b-d>>>0;e=b-d-(c>>>0>a>>>0|0)>>>0;return (u(e|0),a-c>>>0|0)|0}function Ff(a){a=a|0;return (a?31-(s(a^a-1)|0)|0:32)|0}function Gf(a,b,d,e,f){a=a|0;b=b|0;d=d|0;e=e|0;f=f|0;var g=0,h=0,i=0,j=0,k=0,l=0,m=0,n=0,o=0,p=0,q=0,r=0,t=0,w=0,x=0,y=0,z=0,A=0,B=0,C=0,D=0,E=0,F=0,G=0,H=0,I=0,J=0;g=a;h=b;i=h;j=d;k=e;l=k;if(!i){m=(f|0)!=0;if(!l){if(m){c[f>>2]=(g>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(g>>>0)/(j>>>0)>>>0;return (u(n|0),o)|0}else{if(!m){n=0;o=0;return (u(n|0),o)|0}c[f>>2]=a|0;c[f+4>>2]=b&0;n=0;o=0;return (u(n|0),o)|0}}m=(l|0)==0;do if(j){if(!m){p=(s(l|0)|0)-(s(i|0)|0)|0;if(p>>>0<=31){q=p+1|0;r=31-p|0;t=p-31>>31;w=q;x=g>>>(q>>>0)&t|i<>>(q>>>0)&t;z=0;A=g<>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return (u(n|0),o)|0}r=j-1|0;if(r&j|0){t=(s(j|0)|0)+33-(s(i|0)|0)|0;q=64-t|0;p=32-t|0;B=p>>31;C=t-32|0;D=C>>31;w=t;x=p-1>>31&i>>>(C>>>0)|(i<>>(t>>>0))&D;y=D&i>>>(t>>>0);z=g<>>(C>>>0))&B|g<>31;break}if(f|0){c[f>>2]=r&g;c[f+4>>2]=0}if((j|0)==1){n=h|b&0;o=a|0|0;return (u(n|0),o)|0}else{r=Ff(j|0)|0;n=i>>>(r>>>0)|0;o=i<<32-r|g>>>(r>>>0)|0;return (u(n|0),o)|0}}else{if(m){if(f|0){c[f>>2]=(i>>>0)%(j>>>0);c[f+4>>2]=0}n=0;o=(i>>>0)/(j>>>0)>>>0;return (u(n|0),o)|0}if(!g){if(f|0){c[f>>2]=0;c[f+4>>2]=(i>>>0)%(l>>>0)}n=0;o=(i>>>0)/(l>>>0)>>>0;return (u(n|0),o)|0}r=l-1|0;if(!(r&l)){if(f|0){c[f>>2]=a|0;c[f+4>>2]=r&i|b&0}n=0;o=i>>>((Ff(l|0)|0)>>>0);return (u(n|0),o)|0}r=(s(l|0)|0)-(s(i|0)|0)|0;if(r>>>0<=30){t=r+1|0;p=31-r|0;w=t;x=i<>>(t>>>0);y=i>>>(t>>>0);z=0;A=g<>2]=a|0;c[f+4>>2]=h|b&0;n=0;o=0;return (u(n|0),o)|0}while(0);if(!w){E=A;F=z;G=y;H=x;I=0;J=0}else{b=d|0|0;d=k|e&0;e=Df(b|0,d|0,-1,-1)|0;k=v()|0;h=A;A=z;z=y;y=x;x=w;w=0;do{a=h;h=A>>>31|h<<1;A=w|A<<1;g=y<<1|a>>>31|0;a=y>>>31|z<<1|0;Ef(e|0,k|0,g|0,a|0)|0;i=v()|0;l=i>>31|((i|0)<0?-1:0)<<1;w=l&1;y=Ef(g|0,a|0,l&b|0,(((i|0)<0?-1:0)>>31|((i|0)<0?-1:0)<<1)&d|0)|0;z=v()|0;x=x-1|0}while((x|0)!=0);E=h;F=A;G=z;H=y;I=0;J=w}w=F;F=0;if(f|0){c[f>>2]=H;c[f+4>>2]=G}n=(w|0)>>>31|(E|F)<<1|(F<<1|w>>>31)&0|I;o=(w<<1|0>>>31)&-2|J;return (u(n|0),o)|0}function Hf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return Gf(a,b,c,d,0)|0}function If(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){u(b>>>c|0);return a>>>c|(b&(1<>>c-32|0}function Jf(a,b,c){a=a|0;b=b|0;c=c|0;if((c|0)<32){u(b<>>32-c|0);return a<>8&255)<<16|(a>>16&255)<<8|a>>>24|0}function Lf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0;if((e|0)>=8192){L(b|0,d|0,e|0)|0;return b|0}f=b|0;g=b+e|0;if((b&3)==(d&3)){while(b&3){if(!e)return f|0;a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0;e=e-1|0}h=g&-4|0;e=h-64|0;while((b|0)<=(e|0)){c[b>>2]=c[d>>2];c[b+4>>2]=c[d+4>>2];c[b+8>>2]=c[d+8>>2];c[b+12>>2]=c[d+12>>2];c[b+16>>2]=c[d+16>>2];c[b+20>>2]=c[d+20>>2];c[b+24>>2]=c[d+24>>2];c[b+28>>2]=c[d+28>>2];c[b+32>>2]=c[d+32>>2];c[b+36>>2]=c[d+36>>2];c[b+40>>2]=c[d+40>>2];c[b+44>>2]=c[d+44>>2];c[b+48>>2]=c[d+48>>2];c[b+52>>2]=c[d+52>>2];c[b+56>>2]=c[d+56>>2];c[b+60>>2]=c[d+60>>2];b=b+64|0;d=d+64|0}while((b|0)<(h|0)){c[b>>2]=c[d>>2];b=b+4|0;d=d+4|0}}else{h=g-4|0;while((b|0)<(h|0)){a[b>>0]=a[d>>0]|0;a[b+1>>0]=a[d+1>>0]|0;a[b+2>>0]=a[d+2>>0]|0;a[b+3>>0]=a[d+3>>0]|0;b=b+4|0;d=d+4|0}}while((b|0)<(g|0)){a[b>>0]=a[d>>0]|0;b=b+1|0;d=d+1|0}return f|0}function Mf(b,c,d){b=b|0;c=c|0;d=d|0;var e=0;if((c|0)<(b|0)&(b|0)<(c+d|0)){e=b;c=c+d|0;b=b+d|0;while((d|0)>0){b=b-1|0;c=c-1|0;d=d-1|0;a[b>>0]=a[c>>0]|0}b=e}else Lf(b,c,d)|0;return b|0}function Nf(b,d,e){b=b|0;d=d|0;e=e|0;var f=0,g=0,h=0,i=0;f=b+e|0;d=d&255;if((e|0)>=67){while(b&3){a[b>>0]=d;b=b+1|0}g=f&-4|0;h=d|d<<8|d<<16|d<<24;i=g-64|0;while((b|0)<=(i|0)){c[b>>2]=h;c[b+4>>2]=h;c[b+8>>2]=h;c[b+12>>2]=h;c[b+16>>2]=h;c[b+20>>2]=h;c[b+24>>2]=h;c[b+28>>2]=h;c[b+32>>2]=h;c[b+36>>2]=h;c[b+40>>2]=h;c[b+44>>2]=h;c[b+48>>2]=h;c[b+52>>2]=h;c[b+56>>2]=h;c[b+60>>2]=h;b=b+64|0}while((b|0)<(g|0)){c[b>>2]=h;b=b+4|0}}while((b|0)<(f|0)){a[b>>0]=d;b=b+1|0}return f-e|0}function Of(a){a=a|0;var b=0,d=0;b=c[i>>2]|0;d=b+a|0;if((a|0)>0&(d|0)<(b|0)|(d|0)<0){V(d|0)|0;F(12);return -1}if((d|0)>(J()|0)?(M(d|0)|0)==0:0){F(12);return -1}c[i>>2]=d;return b|0}function Pf(a,b){a=a|0;b=b|0;return aa[a&7](b|0)|0}function Qf(a,b,c){a=a|0;b=b|0;c=c|0;return ba[a&31](b|0,c|0)|0}function Rf(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;return ca[a&15](b|0,c|0,d|0)|0}function Sf(a,b,c,d,e,f,g){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;return da[a&1](b|0,c|0,d|0,e|0,f|0,g|0)|0}function Tf(a,b){a=a|0;b=b|0;ea[a&31](b|0)}function Uf(a,b,c){a=a|0;b=b|0;c=c|0;fa[a&3](b|0,c|0)}function Vf(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;ga[a&31](b|0,c|0,d|0,e|0)}function Wf(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;ha[a&31](b|0,c|0,d|0,e|0,f|0)}function Xf(a,b,c,d,e,f,g,h,i,j){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;j=j|0;ia[a&7](b|0,c|0,d|0,e|0,f|0,g|0,h|0,i|0,j|0)}function Yf(a){a=a|0;t(0);return 0}function Zf(a,b){a=a|0;b=b|0;t(1);return 0}function _f(a,b,c){a=a|0;b=b|0;c=c|0;t(2);return 0}function $f(a,b,c,d,e,f){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;t(3);return 0}function ag(a){a=a|0;t(4)}function bg(a,b){a=a|0;b=b|0;t(5)}function cg(a,b,c,d){a=a|0;b=b|0;c=c|0;d=d|0;t(6)}function dg(a,b,c,d,e){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;t(7)}function eg(a,b,c,d,e,f,g,h,i){a=a|0;b=b|0;c=c|0;d=d|0;e=e|0;f=f|0;g=g|0;h=h|0;i=i|0;t(8)}\n\n// EMSCRIPTEN_END_FUNCS\nvar aa=[Yf,gd,hd,We,Rb,Sb,ld,Yf];var ba=[Zf,gb,hb,ib,jb,kb,lb,mb,nb,ob,pb,qb,rb,sb,tb,Xb,ac,dc,ec,fc,dd,Zf,Zf,Zf,Zf,Zf,Zf,Zf,Zf,Zf,Zf,Zf];var ca=[_f,Xe,Ye,Zb,bc,hc,gc,$b,_b,ic,_f,_f,_f,_f,_f,_f];var da=[$f,Je];var ea=[ag,fd,id,jd,kd,Tb,Md,Nd,Od,Pd,Qd,Rd,Sd,Td,Ud,Vd,Wd,Xd,Yd,Zd,_d,$d,ae,be,ce,de,ee,fe,ge,he,ag,ag];var fa=[bg,Ha,Ka,bg];var ga=[cg,Nc,Oc,Pc,ub,vb,wb,xb,yb,zb,Ab,Bb,Cb,Db,Eb,Fb,Gb,Hb,cg,cg,cg,cg,cg,cg,cg,cg,cg,cg,cg,cg,cg,cg];var ha=[dg,Qc,Rc,Sc,tc,uc,vc,wc,xc,yc,zc,kc,lc,mc,nc,oc,pc,qc,dg,dg,dg,dg,dg,dg,dg,dg,dg,dg,dg,dg,dg,dg];var ia=[eg,Fc,Gc,Hc,Ic,Jc,Kc,Lc];return{_WebpToSDL:na,___errno_location:_e,___muldi3:Cf,___udivdi3:Hf,_bitshift64Lshr:If,_bitshift64Shl:Jf,_emscripten_replace_memory:$,_free:Qe,_i64Add:Df,_i64Subtract:Ef,_llvm_bswap_i32:Kf,_malloc:Pe,_memcpy:Lf,_memmove:Mf,_memset:Nf,_sbrk:Of,dynCall_ii:Pf,dynCall_iii:Qf,dynCall_iiii:Rf,dynCall_iiiiiii:Sf,dynCall_vi:Tf,dynCall_vii:Uf,dynCall_viiii:Vf,dynCall_viiiii:Wf,dynCall_viiiiiiiii:Xf,establishStackSpace:ma,stackAlloc:ja,stackRestore:la,stackSave:ka}})\n\n\n// EMSCRIPTEN_END_ASM\n(asmGlobalArg,asmLibraryArg,buffer);var _WebpToSDL=Module[\"_WebpToSDL\"]=asm[\"_WebpToSDL\"];var ___errno_location=Module[\"___errno_location\"]=asm[\"___errno_location\"];var ___muldi3=Module[\"___muldi3\"]=asm[\"___muldi3\"];var ___udivdi3=Module[\"___udivdi3\"]=asm[\"___udivdi3\"];var _bitshift64Lshr=Module[\"_bitshift64Lshr\"]=asm[\"_bitshift64Lshr\"];var _bitshift64Shl=Module[\"_bitshift64Shl\"]=asm[\"_bitshift64Shl\"];var _emscripten_replace_memory=Module[\"_emscripten_replace_memory\"]=asm[\"_emscripten_replace_memory\"];var _free=Module[\"_free\"]=asm[\"_free\"];var _i64Add=Module[\"_i64Add\"]=asm[\"_i64Add\"];var _i64Subtract=Module[\"_i64Subtract\"]=asm[\"_i64Subtract\"];var _llvm_bswap_i32=Module[\"_llvm_bswap_i32\"]=asm[\"_llvm_bswap_i32\"];var _malloc=Module[\"_malloc\"]=asm[\"_malloc\"];var _memcpy=Module[\"_memcpy\"]=asm[\"_memcpy\"];var _memmove=Module[\"_memmove\"]=asm[\"_memmove\"];var _memset=Module[\"_memset\"]=asm[\"_memset\"];var _sbrk=Module[\"_sbrk\"]=asm[\"_sbrk\"];var establishStackSpace=Module[\"establishStackSpace\"]=asm[\"establishStackSpace\"];var stackAlloc=Module[\"stackAlloc\"]=asm[\"stackAlloc\"];var stackRestore=Module[\"stackRestore\"]=asm[\"stackRestore\"];var stackSave=Module[\"stackSave\"]=asm[\"stackSave\"];var dynCall_ii=Module[\"dynCall_ii\"]=asm[\"dynCall_ii\"];var dynCall_iii=Module[\"dynCall_iii\"]=asm[\"dynCall_iii\"];var dynCall_iiii=Module[\"dynCall_iiii\"]=asm[\"dynCall_iiii\"];var dynCall_iiiiiii=Module[\"dynCall_iiiiiii\"]=asm[\"dynCall_iiiiiii\"];var dynCall_vi=Module[\"dynCall_vi\"]=asm[\"dynCall_vi\"];var dynCall_vii=Module[\"dynCall_vii\"]=asm[\"dynCall_vii\"];var dynCall_viiii=Module[\"dynCall_viiii\"]=asm[\"dynCall_viiii\"];var dynCall_viiiii=Module[\"dynCall_viiiii\"]=asm[\"dynCall_viiiii\"];var dynCall_viiiiiiiii=Module[\"dynCall_viiiiiiiii\"]=asm[\"dynCall_viiiiiiiii\"];Module[\"asm\"]=asm;Module[\"cwrap\"]=cwrap;if(memoryInitializer){if(!isDataURI(memoryInitializer)){memoryInitializer=locateFile(memoryInitializer)}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=Module[\"readBinary\"](memoryInitializer);HEAPU8.set(data,GLOBAL_BASE)}else{addRunDependency(\"memory initializer\");var applyMemoryInitializer=function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,GLOBAL_BASE);if(Module[\"memoryInitializerRequest\"])delete Module[\"memoryInitializerRequest\"].response;removeRunDependency(\"memory initializer\")};var doBrowserLoad=function(){Module[\"readAsync\"](memoryInitializer,applyMemoryInitializer,function(){throw\"could not load memory initializer \"+memoryInitializer})};var memoryInitializerBytes=tryParseAsDataURI(memoryInitializer);if(memoryInitializerBytes){applyMemoryInitializer(memoryInitializerBytes.buffer)}else if(Module[\"memoryInitializerRequest\"]){var useRequest=function(){var request=Module[\"memoryInitializerRequest\"];var response=request.response;if(request.status!==200&&request.status!==0){var data=tryParseAsDataURI(Module[\"memoryInitializerRequestURL\"]);if(data){response=data.buffer}else{console.warn(\"a problem seems to have happened with Module.memoryInitializerRequest, status: \"+request.status+\", retrying \"+memoryInitializer);doBrowserLoad();return}}applyMemoryInitializer(response)};if(Module[\"memoryInitializerRequest\"].response){setTimeout(useRequest,0)}else{Module[\"memoryInitializerRequest\"].addEventListener(\"load\",useRequest)}}else{doBrowserLoad()}}}function ExitStatus(status){this.name=\"ExitStatus\";this.message=\"Program terminated with exit(\"+status+\")\";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;dependenciesFulfilled=function runCaller(){if(!Module[\"calledRun\"])run();if(!Module[\"calledRun\"])dependenciesFulfilled=runCaller};function run(args){args=args||Module[\"arguments\"];if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module[\"calledRun\"])return;function doRun(){if(Module[\"calledRun\"])return;Module[\"calledRun\"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module[\"onRuntimeInitialized\"])Module[\"onRuntimeInitialized\"]();postRun()}if(Module[\"setStatus\"]){Module[\"setStatus\"](\"Running...\");setTimeout(function(){setTimeout(function(){Module[\"setStatus\"](\"\")},1);doRun()},1)}else{doRun()}}Module[\"run\"]=run;function abort(what){if(Module[\"onAbort\"]){Module[\"onAbort\"](what)}if(what!==undefined){out(what);err(what);what=JSON.stringify(what)}else{what=\"\"}ABORT=true;EXITSTATUS=1;throw\"abort(\"+what+\"). Build with -s ASSERTIONS=1 for more info.\"}Module[\"abort\"]=abort;if(Module[\"preInit\"]){if(typeof Module[\"preInit\"]==\"function\")Module[\"preInit\"]=[Module[\"preInit\"]];while(Module[\"preInit\"].length>0){Module[\"preInit\"].pop()()}}Module[\"noExitRuntime\"]=true;run();\n\n\n\tthis.Module = Module\n\tthis.webpToSdl = Module.cwrap(\"WebpToSDL\", \"number\", [\"array\", \"number\"])\n\tthis.setCanvas = function(canvas) { Module.canvas = canvas }\n}\n\nexport {Webp}\n" }, { "id": 90, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/webp-hero/dist/detect-webp-support.js", "name": "./node_modules/webp-hero/dist/detect-webp-support.js", "index": 90, "index2": 89, "size": 729, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 6 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "issuerId": 85, "issuerName": "./src/lib/webp.ts", "issuerPath": [ { "id": 85, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "name": "./src/lib/webp.ts", "profile": { "factory": 273, "building": 1362 } } ], "profile": { "factory": 45, "building": 593 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 85, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/lib/webp.ts", "module": "./src/lib/webp.ts", "moduleName": "./src/lib/webp.ts", "type": "cjs require", "userRequest": "webp-hero/dist/detect-webp-support.js", "loc": "13:33-81" } ], "usedExports": true, "providedExports": [ "detectWebpSupport" ], "optimizationBailout": [ "ModuleConcatenation bailout: Module is referenced from these modules with unsupported syntax: ./src/lib/webp.ts (referenced with cjs require)" ], "depth": 1, "source": "export async function detectWebpSupport() {\n const testImageSources = [\n \"data:image/webp;base64,UklGRjIAAABXRUJQVlA4ICYAAACyAgCdASoCAAEALmk0mk0iIiIiIgBoSygABc6zbAAA/v56QAAAAA==\",\n \"data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=\"\n ];\n const testImage = (src) => {\n return new Promise((resolve, reject) => {\n var img = document.createElement(\"img\");\n img.onerror = error => resolve(false);\n img.onload = () => resolve(true);\n img.src = src;\n });\n };\n const results = await Promise.all(testImageSources.map(testImage));\n return results.every(result => !!result);\n}\n//# sourceMappingURL=detect-webp-support.js.map" } ], "filteredModules": 0, "origins": [ { "module": "", "moduleIdentifier": "", "moduleName": "", "loc": "webp", "request": "./src/lib/webp.ts", "reasons": [] } ] }, { "id": 7, "rendered": true, "initial": true, "entry": false, "reason": "split chunk (cache group: vendors) (name: vendors~index)", "size": 42276, "names": [ "vendors~index" ], "files": [ "vendors~index.chunk.js" ], "hash": "9a0a2c774975688b83e8", "siblings": [ 0, 1, 2, 3, 4, 5 ], "parents": [], "children": [], "childrenByOrder": {}, "modules": [ { "id": 31, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/runtime/api.js", "name": "./node_modules/css-loader/dist/runtime/api.js", "index": 3, "index2": 0, "size": 2677, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 7 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "issuerId": 62, "issuerName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 61, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./src/scss/tgico.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } }, { "id": 62, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "name": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "profile": { "factory": 536, "building": 1483 } } ], "profile": { "factory": 1461, "building": 153 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 54, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/materialize.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/materialize.scss", "type": "cjs require", "userRequest": "../node_modules/css-loader/dist/runtime/api.js", "loc": "1:27-84" }, { "moduleId": 56, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/style.scss", "type": "cjs require", "userRequest": "../../node_modules/css-loader/dist/runtime/api.js", "loc": "1:27-87" }, { "moduleId": 62, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "moduleName": "./node_modules/css-loader/dist/cjs.js!./node_modules/resolve-url-loader!./node_modules/sass-loader/dist/cjs.js??ref--4-3!./src/scss/tgico.scss", "type": "cjs require", "userRequest": "../../node_modules/css-loader/dist/runtime/api.js", "loc": "1:27-87" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 3, "source": "\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\n// css base code, injected by the css-loader\n// eslint-disable-next-line func-names\nmodule.exports = function (useSourceMap) {\n var list = []; // return the list of modules as css string\n\n list.toString = function toString() {\n return this.map(function (item) {\n var content = cssWithMappingToString(item, useSourceMap);\n\n if (item[2]) {\n return \"@media \".concat(item[2], \"{\").concat(content, \"}\");\n }\n\n return content;\n }).join('');\n }; // import a list of modules into the list\n // eslint-disable-next-line func-names\n\n\n list.i = function (modules, mediaQuery) {\n if (typeof modules === 'string') {\n // eslint-disable-next-line no-param-reassign\n modules = [[null, modules, '']];\n }\n\n var alreadyImportedModules = {};\n\n for (var i = 0; i < this.length; i++) {\n // eslint-disable-next-line prefer-destructuring\n var id = this[i][0];\n\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n\n for (var _i = 0; _i < modules.length; _i++) {\n var item = modules[_i]; // skip already imported module\n // this implementation is not 100% perfect for weird media query combinations\n // when a module is imported multiple times with different media queries.\n // I hope this will never occur (Hey this way we have smaller bundles)\n\n if (item[0] == null || !alreadyImportedModules[item[0]]) {\n if (mediaQuery && !item[2]) {\n item[2] = mediaQuery;\n } else if (mediaQuery) {\n item[2] = \"(\".concat(item[2], \") and (\").concat(mediaQuery, \")\");\n }\n\n list.push(item);\n }\n }\n };\n\n return list;\n};\n\nfunction cssWithMappingToString(item, useSourceMap) {\n var content = item[1] || ''; // eslint-disable-next-line prefer-destructuring\n\n var cssMapping = item[3];\n\n if (!cssMapping) {\n return content;\n }\n\n if (useSourceMap && typeof btoa === 'function') {\n var sourceMapping = toComment(cssMapping);\n var sourceURLs = cssMapping.sources.map(function (source) {\n return \"/*# sourceURL=\".concat(cssMapping.sourceRoot).concat(source, \" */\");\n });\n return [content].concat(sourceURLs).concat([sourceMapping]).join('\\n');\n }\n\n return [content].join('\\n');\n} // Adapted from convert-source-map (MIT)\n\n\nfunction toComment(sourceMap) {\n // eslint-disable-next-line no-undef\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n return \"/*# \".concat(data, \" */\");\n}" }, { "id": 32, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js", "name": "./node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js", "index": 4, "index2": 2, "size": 6909, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 7 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "issuerId": 53, "issuerName": "./src/materialize.scss", "issuerPath": [ { "id": 52, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/ts-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/src/index.ts", "name": "./src/index.ts", "profile": { "factory": 41, "building": 1632 } }, { "id": 53, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "name": "./src/materialize.scss", "profile": { "factory": 633, "building": 0, "dependencies": 536 } } ], "profile": { "factory": 537, "building": 1988, "dependencies": 349 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 53, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/materialize.scss", "module": "./src/materialize.scss", "moduleName": "./src/materialize.scss", "type": "cjs require", "userRequest": "!../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js", "loc": "12:13-94" }, { "moduleId": 55, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/style.scss", "module": "./src/scss/style.scss", "moduleName": "./src/scss/style.scss", "type": "cjs require", "userRequest": "!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js", "loc": "12:13-97" }, { "moduleId": 61, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/style-loader/dist/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/css-loader/dist/cjs.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/resolve-url-loader/index.js!/Users/kuzmenko/Documents/projects/tweb/node_modules/sass-loader/dist/cjs.js??ref--4-3!/Users/kuzmenko/Documents/projects/tweb/src/scss/tgico.scss", "module": "./src/scss/tgico.scss", "moduleName": "./src/scss/tgico.scss", "type": "cjs require", "userRequest": "!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js", "loc": "12:13-97" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 2, "source": "\"use strict\";\n\nvar stylesInDom = {};\n\nvar isOldIE = function isOldIE() {\n var memo;\n return function memorize() {\n if (typeof memo === 'undefined') {\n // Test for IE <= 9 as proposed by Browserhacks\n // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805\n // Tests for existence of standard globals is to allow style-loader\n // to operate correctly into non-standard environments\n // @see https://github.com/webpack-contrib/style-loader/issues/177\n memo = Boolean(window && document && document.all && !window.atob);\n }\n\n return memo;\n };\n}();\n\nvar getTarget = function getTarget() {\n var memo = {};\n return function memorize(target) {\n if (typeof memo[target] === 'undefined') {\n var styleTarget = document.querySelector(target); // Special case to return head of iframe instead of iframe itself\n\n if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {\n try {\n // This will throw an exception if access to iframe is blocked\n // due to cross-origin restrictions\n styleTarget = styleTarget.contentDocument.head;\n } catch (e) {\n // istanbul ignore next\n styleTarget = null;\n }\n }\n\n memo[target] = styleTarget;\n }\n\n return memo[target];\n };\n}();\n\nfunction listToStyles(list, options) {\n var styles = [];\n var newStyles = {};\n\n for (var i = 0; i < list.length; i++) {\n var item = list[i];\n var id = options.base ? item[0] + options.base : item[0];\n var css = item[1];\n var media = item[2];\n var sourceMap = item[3];\n var part = {\n css: css,\n media: media,\n sourceMap: sourceMap\n };\n\n if (!newStyles[id]) {\n styles.push(newStyles[id] = {\n id: id,\n parts: [part]\n });\n } else {\n newStyles[id].parts.push(part);\n }\n }\n\n return styles;\n}\n\nfunction addStylesToDom(styles, options) {\n for (var i = 0; i < styles.length; i++) {\n var item = styles[i];\n var domStyle = stylesInDom[item.id];\n var j = 0;\n\n if (domStyle) {\n domStyle.refs++;\n\n for (; j < domStyle.parts.length; j++) {\n domStyle.parts[j](item.parts[j]);\n }\n\n for (; j < item.parts.length; j++) {\n domStyle.parts.push(addStyle(item.parts[j], options));\n }\n } else {\n var parts = [];\n\n for (; j < item.parts.length; j++) {\n parts.push(addStyle(item.parts[j], options));\n }\n\n stylesInDom[item.id] = {\n id: item.id,\n refs: 1,\n parts: parts\n };\n }\n }\n}\n\nfunction insertStyleElement(options) {\n var style = document.createElement('style');\n\n if (typeof options.attributes.nonce === 'undefined') {\n var nonce = typeof __webpack_nonce__ !== 'undefined' ? __webpack_nonce__ : null;\n\n if (nonce) {\n options.attributes.nonce = nonce;\n }\n }\n\n Object.keys(options.attributes).forEach(function (key) {\n style.setAttribute(key, options.attributes[key]);\n });\n\n if (typeof options.insert === 'function') {\n options.insert(style);\n } else {\n var target = getTarget(options.insert || 'head');\n\n if (!target) {\n throw new Error(\"Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.\");\n }\n\n target.appendChild(style);\n }\n\n return style;\n}\n\nfunction removeStyleElement(style) {\n // istanbul ignore if\n if (style.parentNode === null) {\n return false;\n }\n\n style.parentNode.removeChild(style);\n}\n/* istanbul ignore next */\n\n\nvar replaceText = function replaceText() {\n var textStore = [];\n return function replace(index, replacement) {\n textStore[index] = replacement;\n return textStore.filter(Boolean).join('\\n');\n };\n}();\n\nfunction applyToSingletonTag(style, index, remove, obj) {\n var css = remove ? '' : obj.css; // For old IE\n\n /* istanbul ignore if */\n\n if (style.styleSheet) {\n style.styleSheet.cssText = replaceText(index, css);\n } else {\n var cssNode = document.createTextNode(css);\n var childNodes = style.childNodes;\n\n if (childNodes[index]) {\n style.removeChild(childNodes[index]);\n }\n\n if (childNodes.length) {\n style.insertBefore(cssNode, childNodes[index]);\n } else {\n style.appendChild(cssNode);\n }\n }\n}\n\nfunction applyToTag(style, options, obj) {\n var css = obj.css;\n var media = obj.media;\n var sourceMap = obj.sourceMap;\n\n if (media) {\n style.setAttribute('media', media);\n }\n\n if (sourceMap && btoa) {\n css += \"\\n/*# sourceMappingURL=data:application/json;base64,\".concat(btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))), \" */\");\n } // For old IE\n\n /* istanbul ignore if */\n\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n while (style.firstChild) {\n style.removeChild(style.firstChild);\n }\n\n style.appendChild(document.createTextNode(css));\n }\n}\n\nvar singleton = null;\nvar singletonCounter = 0;\n\nfunction addStyle(obj, options) {\n var style;\n var update;\n var remove;\n\n if (options.singleton) {\n var styleIndex = singletonCounter++;\n style = singleton || (singleton = insertStyleElement(options));\n update = applyToSingletonTag.bind(null, style, styleIndex, false);\n remove = applyToSingletonTag.bind(null, style, styleIndex, true);\n } else {\n style = insertStyleElement(options);\n update = applyToTag.bind(null, style, options);\n\n remove = function remove() {\n removeStyleElement(style);\n };\n }\n\n update(obj);\n return function updateStyle(newObj) {\n if (newObj) {\n if (newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap) {\n return;\n }\n\n update(obj = newObj);\n } else {\n remove();\n }\n };\n}\n\nmodule.exports = function (list, options) {\n options = options || {};\n options.attributes = typeof options.attributes === 'object' ? options.attributes : {}; // Force single-tag solution on IE6-9, which has a hard limit on the # of \\n \\n\\n\\n\\n \\n \\n
\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n

Sign in to Telegram

\\n

Please confirm your country and
enter your phone number.

\\n
\\n
\\n \\n \\n \\n
\\n
\\n \\n \\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n

\\n \\n
\\n

\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n

Enter a password

\\n

Your account is protected with
an additional password

\\n
\\n
\\n \\n \\n \\n
\\n \\n
\\n
\\n
\\n
\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n

Your Name

\\n

Enter your name and add
a profile picture

\\n
\\n
\\n \\n \\n
\\n
\\n \\n \\n
\\n \\n
\\n
\\n
\\n
\\n
\\n \\n
Drag to Reposition
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n \\n
\\n
\\n
\\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
Do you want to delete this message?
\\n
\\n \\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n \\n
Send Photo
\\n \\n
\\n
\\n
\\n \\n \\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
\\n
New Group
\\n
Contacts
\\n
Archived
\\n
Saved
\\n
Settings
\\n
Help
\\n
\\n
\\n
\\n
\\n
\\n \\n \\n
\\n
\\n \\n
\\n
\\n
    \\n
    \\n
    \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n \\n \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      Pinned Message
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      Mute
      \\n
      Delete and Leave
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n \\n \\n
      \\n
      Reply
      \\n
      Edit
      \\n
      Copy
      \\n
      Pin
      \\n
      Forward
      \\n
      Delete
      \\n
      \\n
      \\n \\n
      \\n
        \\n
      • Emoji
      • \\n
      • Stickers
      • \\n
      • GIFs
      • \\n
      \\n
      \\n
      \\n
      \\n
      \\n
        \\n
      • \\n
      • \\n
      • \\n
      • \\n
      • \\n
      • \\n
      • \\n
      • \\n
      • \\n
      \\n
      \\n
      \\n
      \\n
      \\n
        \\n
      • \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n \\n \\n
      \\n
      \\n
      \\n \\n \\n
      \\n
      \\n \\n
      \\n
      \\n
      \\n
      \\n \\n
      Info
      \\n\\n \\n\\n
      \\n
      \\n \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n\\n
      \\n

      \\n

      Bio

      \\n
      \\n
      \\n

      \\n

      Username

      \\n
      \\n
      \\n

      \\n

      Phone

      \\n
      \\n
      \\n \\n

      Enabled

      \\n
      \\n\\n
        \\n
      • Members
      • \\n
      • Media
      • \\n
      • Docs
      • \\n \\n
      • Audio
      • \\n
      \\n
      \\n
      \\n
      1
      \\n
      \\n
      \\n \\n
      5
      \\n
      \\n
      \\n
      \\n
      \\n
      \\n \\n \\n\\n\\n';\nreturn __p\n})();}}" }, { "id": 1, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/lodash/lodash.js", "name": "./node_modules/lodash/lodash.js", "index": 1, "index2": 2, "size": 540512, "cacheable": true, "built": true, "optional": false, "prefetched": false, "chunks": [ 0 ], "issuer": "/Users/kuzmenko/Documents/projects/tweb/node_modules/html-webpack-plugin/lib/loader.js!/Users/kuzmenko/Documents/projects/tweb/public/index_template.html", "issuerId": 0, "issuerName": "./node_modules/html-webpack-plugin/lib/loader.js!./public/index_template.html", "issuerPath": [ { "id": 0, "identifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/html-webpack-plugin/lib/loader.js!/Users/kuzmenko/Documents/projects/tweb/public/index_template.html", "name": "./node_modules/html-webpack-plugin/lib/loader.js!./public/index_template.html", "profile": { "factory": 20, "building": 24 } } ], "profile": { "factory": 237, "building": 159 }, "failed": false, "errors": 0, "warnings": 0, "assets": [], "reasons": [ { "moduleId": 0, "moduleIdentifier": "/Users/kuzmenko/Documents/projects/tweb/node_modules/html-webpack-plugin/lib/loader.js!/Users/kuzmenko/Documents/projects/tweb/public/index_template.html", "module": "./node_modules/html-webpack-plugin/lib/loader.js!./public/index_template.html", "moduleName": "./node_modules/html-webpack-plugin/lib/loader.js!./public/index_template.html", "type": "cjs require", "userRequest": "!!../node_modules/lodash/lodash.js", "loc": "1:8-53" } ], "usedExports": true, "providedExports": null, "optimizationBailout": [ "ModuleConcatenation bailout: Module is not an ECMAScript module" ], "depth": 1, "source": "/**\n * @license\n * Lodash \n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n;(function() {\n\n /** Used as a safe reference for `undefined` in pre-ES5 environments. */\n var undefined;\n\n /** Used as the semantic version number. */\n var VERSION = '4.17.15';\n\n /** Used as the size to enable large array optimizations. */\n var LARGE_ARRAY_SIZE = 200;\n\n /** Error message constants. */\n var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.',\n FUNC_ERROR_TEXT = 'Expected a function';\n\n /** Used to stand-in for `undefined` hash values. */\n var HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n /** Used as the maximum memoize cache size. */\n var MAX_MEMOIZE_SIZE = 500;\n\n /** Used as the internal argument placeholder. */\n var PLACEHOLDER = '__lodash_placeholder__';\n\n /** Used to compose bitmasks for cloning. */\n var CLONE_DEEP_FLAG = 1,\n CLONE_FLAT_FLAG = 2,\n CLONE_SYMBOLS_FLAG = 4;\n\n /** Used to compose bitmasks for value comparisons. */\n var COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n /** Used to compose bitmasks for function metadata. */\n var WRAP_BIND_FLAG = 1,\n WRAP_BIND_KEY_FLAG = 2,\n WRAP_CURRY_BOUND_FLAG = 4,\n WRAP_CURRY_FLAG = 8,\n WRAP_CURRY_RIGHT_FLAG = 16,\n WRAP_PARTIAL_FLAG = 32,\n WRAP_PARTIAL_RIGHT_FLAG = 64,\n WRAP_ARY_FLAG = 128,\n WRAP_REARG_FLAG = 256,\n WRAP_FLIP_FLAG = 512;\n\n /** Used as default options for `_.truncate`. */\n var DEFAULT_TRUNC_LENGTH = 30,\n DEFAULT_TRUNC_OMISSION = '...';\n\n /** Used to detect hot functions by number of calls within a span of milliseconds. */\n var HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n /** Used to indicate the type of lazy iteratees. */\n var LAZY_FILTER_FLAG = 1,\n LAZY_MAP_FLAG = 2,\n LAZY_WHILE_FLAG = 3;\n\n /** Used as references for various `Number` constants. */\n var INFINITY = 1 / 0,\n MAX_SAFE_INTEGER = 9007199254740991,\n MAX_INTEGER = 1.7976931348623157e+308,\n NAN = 0 / 0;\n\n /** Used as references for the maximum length and index of an array. */\n var MAX_ARRAY_LENGTH = 4294967295,\n MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1,\n HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;\n\n /** Used to associate wrap methods with their bit flags. */\n var wrapFlags = [\n ['ary', WRAP_ARY_FLAG],\n ['bind', WRAP_BIND_FLAG],\n ['bindKey', WRAP_BIND_KEY_FLAG],\n ['curry', WRAP_CURRY_FLAG],\n ['curryRight', WRAP_CURRY_RIGHT_FLAG],\n ['flip', WRAP_FLIP_FLAG],\n ['partial', WRAP_PARTIAL_FLAG],\n ['partialRight', WRAP_PARTIAL_RIGHT_FLAG],\n ['rearg', WRAP_REARG_FLAG]\n ];\n\n /** `Object#toString` result references. */\n var argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n domExcTag = '[object DOMException]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]',\n weakSetTag = '[object WeakSet]';\n\n var arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n /** Used to match empty string literals in compiled template source. */\n var reEmptyStringLeading = /\\b__p \\+= '';/g,\n reEmptyStringMiddle = /\\b(__p \\+=) '' \\+/g,\n reEmptyStringTrailing = /(__e\\(.*?\\)|\\b__t\\)) \\+\\n'';/g;\n\n /** Used to match HTML entities and HTML characters. */\n var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g,\n reUnescapedHtml = /[&<>\"']/g,\n reHasEscapedHtml = RegExp(reEscapedHtml.source),\n reHasUnescapedHtml = RegExp(reUnescapedHtml.source);\n\n /** Used to match template delimiters. */\n var reEscape = /<%-([\\s\\S]+?)%>/g,\n reEvaluate = /<%([\\s\\S]+?)%>/g,\n reInterpolate = /<%=([\\s\\S]+?)%>/g;\n\n /** Used to match property names within property paths. */\n var reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/,\n rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n /**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\n var reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g,\n reHasRegExpChar = RegExp(reRegExpChar.source);\n\n /** Used to match leading and trailing whitespace. */\n var reTrim = /^\\s+|\\s+$/g,\n reTrimStart = /^\\s+/,\n reTrimEnd = /\\s+$/;\n\n /** Used to match wrap detail comments. */\n var reWrapComment = /\\{(?:\\n\\/\\* \\[wrapped with .+\\] \\*\\/)?\\n?/,\n reWrapDetails = /\\{\\n\\/\\* \\[wrapped with (.+)\\] \\*/,\n reSplitDetails = /,? & /;\n\n /** Used to match words composed of alphanumeric characters. */\n var reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n /** Used to match backslashes in property paths. */\n var reEscapeChar = /\\\\(\\\\)?/g;\n\n /**\n * Used to match\n * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components).\n */\n var reEsTemplate = /\\$\\{([^\\\\}]*(?:\\\\.[^\\\\}]*)*)\\}/g;\n\n /** Used to match `RegExp` flags from their coerced string values. */\n var reFlags = /\\w*$/;\n\n /** Used to detect bad signed hexadecimal string values. */\n var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n /** Used to detect binary string values. */\n var reIsBinary = /^0b[01]+$/i;\n\n /** Used to detect host constructors (Safari). */\n var reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n /** Used to detect octal string values. */\n var reIsOctal = /^0o[0-7]+$/i;\n\n /** Used to detect unsigned integer values. */\n var reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n /** Used to match Latin Unicode letters (excluding mathematical operators). */\n var reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n /** Used to ensure capturing order of template delimiters. */\n var reNoMatch = /($^)/;\n\n /** Used to match unescaped characters in compiled string literals. */\n var reUnescapedString = /['\\n\\r\\u2028\\u2029\\\\]/g;\n\n /** Used to compose unicode character classes. */\n var rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n /** Used to compose unicode capture groups. */\n var rsApos = \"['\\u2019]\",\n rsAstral = '[' + rsAstralRange + ']',\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n /** Used to compose unicode regexes. */\n var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq,\n rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';\n\n /** Used to match apostrophes. */\n var reApos = RegExp(rsApos, 'g');\n\n /**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\n var reComboMark = RegExp(rsCombo, 'g');\n\n /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */\n var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');\n\n /** Used to match complex or compound words. */\n var reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n ].join('|'), 'g');\n\n /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */\n var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');\n\n /** Used to detect strings that need a more robust regexp to match words. */\n var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n /** Used to assign default `context` object properties. */\n var contextProps = [\n 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array',\n 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object',\n 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array',\n 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap',\n '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout'\n ];\n\n /** Used to make template sourceURLs easier to identify. */\n var templateCounter = -1;\n\n /** Used to identify `toStringTag` values of typed arrays. */\n var typedArrayTags = {};\n typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\n typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\n typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\n typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\n typedArrayTags[uint32Tag] = true;\n typedArrayTags[argsTag] = typedArrayTags[arrayTag] =\n typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\n typedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\n typedArrayTags[errorTag] = typedArrayTags[funcTag] =\n typedArrayTags[mapTag] = typedArrayTags[numberTag] =\n typedArrayTags[objectTag] = typedArrayTags[regexpTag] =\n typedArrayTags[setTag] = typedArrayTags[stringTag] =\n typedArrayTags[weakMapTag] = false;\n\n /** Used to identify `toStringTag` values supported by `_.clone`. */\n var cloneableTags = {};\n cloneableTags[argsTag] = cloneableTags[arrayTag] =\n cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =\n cloneableTags[boolTag] = cloneableTags[dateTag] =\n cloneableTags[float32Tag] = cloneableTags[float64Tag] =\n cloneableTags[int8Tag] = cloneableTags[int16Tag] =\n cloneableTags[int32Tag] = cloneableTags[mapTag] =\n cloneableTags[numberTag] = cloneableTags[objectTag] =\n cloneableTags[regexpTag] = cloneableTags[setTag] =\n cloneableTags[stringTag] = cloneableTags[symbolTag] =\n cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =\n cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;\n cloneableTags[errorTag] = cloneableTags[funcTag] =\n cloneableTags[weakMapTag] = false;\n\n /** Used to map Latin Unicode letters to basic Latin letters. */\n var deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n };\n\n /** Used to map characters to HTML entities. */\n var htmlEscapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n };\n\n /** Used to map HTML entities to characters. */\n var htmlUnescapes = {\n '&': '&',\n '<': '<',\n '>': '>',\n '"': '\"',\n ''': \"'\"\n };\n\n /** Used to escape characters for inclusion in compiled string literals. */\n var stringEscapes = {\n '\\\\': '\\\\',\n \"'\": \"'\",\n '\\n': 'n',\n '\\r': 'r',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n /** Built-in method references without a dependency on `root`. */\n var freeParseFloat = parseFloat,\n freeParseInt = parseInt;\n\n /** Detect free variable `global` from Node.js. */\n var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n /** Detect free variable `self`. */\n var freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n /** Used as a reference to the global object. */\n var root = freeGlobal || freeSelf || Function('return this')();\n\n /** Detect free variable `exports`. */\n var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n /** Detect free variable `module`. */\n var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n /** Detect the popular CommonJS extension `module.exports`. */\n var moduleExports = freeModule && freeModule.exports === freeExports;\n\n /** Detect free variable `process` from Node.js. */\n var freeProcess = moduleExports && freeGlobal.process;\n\n /** Used to access faster Node.js helpers. */\n var nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n }());\n\n /* Node.js helper references. */\n var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer,\n nodeIsDate = nodeUtil && nodeUtil.isDate,\n nodeIsMap = nodeUtil && nodeUtil.isMap,\n nodeIsRegExp = nodeUtil && nodeUtil.isRegExp,\n nodeIsSet = nodeUtil && nodeUtil.isSet,\n nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\n function apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n }\n\n /**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.forEach` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEach(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (iteratee(array[index], index, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.forEachRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns `array`.\n */\n function arrayEachRight(array, iteratee) {\n var length = array == null ? 0 : array.length;\n\n while (length--) {\n if (iteratee(array[length], length, array) === false) {\n break;\n }\n }\n return array;\n }\n\n /**\n * A specialized version of `_.every` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n */\n function arrayEvery(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (!predicate(array[index], index, array)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.includes` for arrays without support for\n * specifying an index to search from.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludes(array, value) {\n var length = array == null ? 0 : array.length;\n return !!length && baseIndexOf(array, value, 0) > -1;\n }\n\n /**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\n function arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n }\n\n /**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\n function arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n }\n\n /**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.reduceRight` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the last element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\n function arrayReduceRight(array, iteratee, accumulator, initAccum) {\n var length = array == null ? 0 : array.length;\n if (initAccum && length) {\n accumulator = array[--length];\n }\n while (length--) {\n accumulator = iteratee(accumulator, array[length], length, array);\n }\n return accumulator;\n }\n\n /**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Gets the size of an ASCII `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n var asciiSize = baseProperty('length');\n\n /**\n * Converts an ASCII `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function asciiToArray(string) {\n return string.split('');\n }\n\n /**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function asciiWords(string) {\n return string.match(reAsciiWord) || [];\n }\n\n /**\n * The base implementation of methods like `_.findKey` and `_.findLastKey`,\n * without support for iteratee shorthands, which iterates over `collection`\n * using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the found element or its key, else `undefined`.\n */\n function baseFindKey(collection, predicate, eachFunc) {\n var result;\n eachFunc(collection, function(value, key, collection) {\n if (predicate(value, key, collection)) {\n result = key;\n return false;\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.findIndex` and `_.findLastIndex` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} predicate The function invoked per iteration.\n * @param {number} fromIndex The index to search from.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseFindIndex(array, predicate, fromIndex, fromRight) {\n var length = array.length,\n index = fromIndex + (fromRight ? 1 : -1);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (predicate(array[index], index, array)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.indexOf` without `fromIndex` bounds checks.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOf(array, value, fromIndex) {\n return value === value\n ? strictIndexOf(array, value, fromIndex)\n : baseFindIndex(array, baseIsNaN, fromIndex);\n }\n\n /**\n * This function is like `baseIndexOf` except that it accepts a comparator.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function baseIndexOfWith(array, value, fromIndex, comparator) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (comparator(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * The base implementation of `_.isNaN` without support for number objects.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n */\n function baseIsNaN(value) {\n return value !== value;\n }\n\n /**\n * The base implementation of `_.mean` and `_.meanBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the mean.\n */\n function baseMean(array, iteratee) {\n var length = array == null ? 0 : array.length;\n return length ? (baseSum(array, iteratee) / length) : NAN;\n }\n\n /**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n }\n\n /**\n * The base implementation of `_.reduce` and `_.reduceRight`, without support\n * for iteratee shorthands, which iterates over `collection` using `eachFunc`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} accumulator The initial value.\n * @param {boolean} initAccum Specify using the first or last element of\n * `collection` as the initial value.\n * @param {Function} eachFunc The function to iterate over `collection`.\n * @returns {*} Returns the accumulated value.\n */\n function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) {\n eachFunc(collection, function(value, index, collection) {\n accumulator = initAccum\n ? (initAccum = false, value)\n : iteratee(accumulator, value, index, collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.sortBy` which uses `comparer` to define the\n * sort order of `array` and replaces criteria objects with their corresponding\n * values.\n *\n * @private\n * @param {Array} array The array to sort.\n * @param {Function} comparer The function to define sort order.\n * @returns {Array} Returns `array`.\n */\n function baseSortBy(array, comparer) {\n var length = array.length;\n\n array.sort(comparer);\n while (length--) {\n array[length] = array[length].value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.sum` and `_.sumBy` without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {number} Returns the sum.\n */\n function baseSum(array, iteratee) {\n var result,\n index = -1,\n length = array.length;\n\n while (++index < length) {\n var current = iteratee(array[index]);\n if (current !== undefined) {\n result = result === undefined ? current : (result + current);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\n function baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array\n * of key-value pairs for `object` corresponding to the property names of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the key-value pairs.\n */\n function baseToPairs(object, props) {\n return arrayMap(props, function(key) {\n return [key, object[key]];\n });\n }\n\n /**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n function baseUnary(func) {\n return function(value) {\n return func(value);\n };\n }\n\n /**\n * The base implementation of `_.values` and `_.valuesIn` which creates an\n * array of `object` property values corresponding to the property names\n * of `props`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} props The property names to get values for.\n * @returns {Object} Returns the array of property values.\n */\n function baseValues(object, props) {\n return arrayMap(props, function(key) {\n return object[key];\n });\n }\n\n /**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function cacheHas(cache, key) {\n return cache.has(key);\n }\n\n /**\n * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the first unmatched string symbol.\n */\n function charsStartIndex(strSymbols, chrSymbols) {\n var index = -1,\n length = strSymbols.length;\n\n while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol\n * that is not found in the character symbols.\n *\n * @private\n * @param {Array} strSymbols The string symbols to inspect.\n * @param {Array} chrSymbols The character symbols to find.\n * @returns {number} Returns the index of the last unmatched string symbol.\n */\n function charsEndIndex(strSymbols, chrSymbols) {\n var index = strSymbols.length;\n\n while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {}\n return index;\n }\n\n /**\n * Gets the number of `placeholder` occurrences in `array`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} placeholder The placeholder to search for.\n * @returns {number} Returns the placeholder count.\n */\n function countHolders(array, placeholder) {\n var length = array.length,\n result = 0;\n\n while (length--) {\n if (array[length] === placeholder) {\n ++result;\n }\n }\n return result;\n }\n\n /**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\n var deburrLetter = basePropertyOf(deburredLetters);\n\n /**\n * Used by `_.escape` to convert characters to HTML entities.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n var escapeHtmlChar = basePropertyOf(htmlEscapes);\n\n /**\n * Used by `_.template` to escape characters for inclusion in compiled string literals.\n *\n * @private\n * @param {string} chr The matched character to escape.\n * @returns {string} Returns the escaped character.\n */\n function escapeStringChar(chr) {\n return '\\\\' + stringEscapes[chr];\n }\n\n /**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function getValue(object, key) {\n return object == null ? undefined : object[key];\n }\n\n /**\n * Checks if `string` contains Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a symbol is found, else `false`.\n */\n function hasUnicode(string) {\n return reHasUnicode.test(string);\n }\n\n /**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\n function hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n }\n\n /**\n * Converts `iterator` to an array.\n *\n * @private\n * @param {Object} iterator The iterator to convert.\n * @returns {Array} Returns the converted array.\n */\n function iteratorToArray(iterator) {\n var data,\n result = [];\n\n while (!(data = iterator.next()).done) {\n result.push(data.value);\n }\n return result;\n }\n\n /**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\n function mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n }\n\n /**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\n function overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n }\n\n /**\n * Replaces all `placeholder` elements in `array` with an internal placeholder\n * and returns an array of their indexes.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {*} placeholder The placeholder to replace.\n * @returns {Array} Returns the new array of placeholder indexes.\n */\n function replaceHolders(array, placeholder) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value === placeholder || value === PLACEHOLDER) {\n array[index] = PLACEHOLDER;\n result[resIndex++] = index;\n }\n }\n return result;\n }\n\n /**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\n function setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n }\n\n /**\n * Converts `set` to its value-value pairs.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the value-value pairs.\n */\n function setToPairs(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = [value, value];\n });\n return result;\n }\n\n /**\n * A specialized version of `_.indexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictIndexOf(array, value, fromIndex) {\n var index = fromIndex - 1,\n length = array.length;\n\n while (++index < length) {\n if (array[index] === value) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * A specialized version of `_.lastIndexOf` which performs strict equality\n * comparisons of values, i.e. `===`.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} fromIndex The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function strictLastIndexOf(array, value, fromIndex) {\n var index = fromIndex + 1;\n while (index--) {\n if (array[index] === value) {\n return index;\n }\n }\n return index;\n }\n\n /**\n * Gets the number of symbols in `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the string size.\n */\n function stringSize(string) {\n return hasUnicode(string)\n ? unicodeSize(string)\n : asciiSize(string);\n }\n\n /**\n * Converts `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function stringToArray(string) {\n return hasUnicode(string)\n ? unicodeToArray(string)\n : asciiToArray(string);\n }\n\n /**\n * Used by `_.unescape` to convert HTML entities to characters.\n *\n * @private\n * @param {string} chr The matched character to unescape.\n * @returns {string} Returns the unescaped character.\n */\n var unescapeHtmlChar = basePropertyOf(htmlUnescapes);\n\n /**\n * Gets the size of a Unicode `string`.\n *\n * @private\n * @param {string} string The string inspect.\n * @returns {number} Returns the string size.\n */\n function unicodeSize(string) {\n var result = reUnicode.lastIndex = 0;\n while (reUnicode.test(string)) {\n ++result;\n }\n return result;\n }\n\n /**\n * Converts a Unicode `string` to an array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the converted array.\n */\n function unicodeToArray(string) {\n return string.match(reUnicode) || [];\n }\n\n /**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\n function unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n }\n\n /*--------------------------------------------------------------------------*/\n\n /**\n * Create a new pristine `lodash` function using the `context` object.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Util\n * @param {Object} [context=root] The context object.\n * @returns {Function} Returns a new `lodash` function.\n * @example\n *\n * _.mixin({ 'foo': _.constant('foo') });\n *\n * var lodash = _.runInContext();\n * lodash.mixin({ 'bar': lodash.constant('bar') });\n *\n * _.isFunction(_.foo);\n * // => true\n * _.isFunction(_.bar);\n * // => false\n *\n * lodash.isFunction(lodash.foo);\n * // => false\n * lodash.isFunction(lodash.bar);\n * // => true\n *\n * // Create a suped-up `defer` in Node.js.\n * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;\n */\n var runInContext = (function runInContext(context) {\n context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps));\n\n /** Built-in constructor references. */\n var Array = context.Array,\n Date = context.Date,\n Error = context.Error,\n Function = context.Function,\n Math = context.Math,\n Object = context.Object,\n RegExp = context.RegExp,\n String = context.String,\n TypeError = context.TypeError;\n\n /** Used for built-in method references. */\n var arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n /** Used to detect overreaching core-js shims. */\n var coreJsData = context['__core-js_shared__'];\n\n /** Used to resolve the decompiled source of functions. */\n var funcToString = funcProto.toString;\n\n /** Used to check objects for own properties. */\n var hasOwnProperty = objectProto.hasOwnProperty;\n\n /** Used to generate unique IDs. */\n var idCounter = 0;\n\n /** Used to detect methods masquerading as native. */\n var maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n }());\n\n /**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n var nativeObjectToString = objectProto.toString;\n\n /** Used to infer the `Object` constructor. */\n var objectCtorString = funcToString.call(Object);\n\n /** Used to restore the original `_` reference in `_.noConflict`. */\n var oldDash = root._;\n\n /** Used to detect if a method is native. */\n var reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n );\n\n /** Built-in value references. */\n var Buffer = moduleExports ? context.Buffer : undefined,\n Symbol = context.Symbol,\n Uint8Array = context.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined,\n symIterator = Symbol ? Symbol.iterator : undefined,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n var defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n }());\n\n /** Mocked built-ins. */\n var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout,\n ctxNow = Date && Date.now !== root.Date.now && Date.now,\n ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout;\n\n /* Built-in method references for those with the same name as other `lodash` methods. */\n var nativeCeil = Math.ceil,\n nativeFloor = Math.floor,\n nativeGetSymbols = Object.getOwnPropertySymbols,\n nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeIsFinite = context.isFinite,\n nativeJoin = arrayProto.join,\n nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max,\n nativeMin = Math.min,\n nativeNow = Date.now,\n nativeParseInt = context.parseInt,\n nativeRandom = Math.random,\n nativeReverse = arrayProto.reverse;\n\n /* Built-in method references that are verified to be native. */\n var DataView = getNative(context, 'DataView'),\n Map = getNative(context, 'Map'),\n Promise = getNative(context, 'Promise'),\n Set = getNative(context, 'Set'),\n WeakMap = getNative(context, 'WeakMap'),\n nativeCreate = getNative(Object, 'create');\n\n /** Used to store function metadata. */\n var metaMap = WeakMap && new WeakMap;\n\n /** Used to lookup unminified function names. */\n var realNames = {};\n\n /** Used to detect maps, sets, and weakmaps. */\n var dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n /** Used to convert symbols to primitives and strings. */\n var symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` object which wraps `value` to enable implicit method\n * chain sequences. Methods that operate on and return arrays, collections,\n * and functions can be chained together. Methods that retrieve a single value\n * or may return a primitive value will automatically end the chain sequence\n * and return the unwrapped value. Otherwise, the value must be unwrapped\n * with `_#value`.\n *\n * Explicit chain sequences, which must be unwrapped with `_#value`, may be\n * enabled using `_.chain`.\n *\n * The execution of chained methods is lazy, that is, it's deferred until\n * `_#value` is implicitly or explicitly called.\n *\n * Lazy evaluation allows several methods to support shortcut fusion.\n * Shortcut fusion is an optimization to merge iteratee calls; this avoids\n * the creation of intermediate arrays and can greatly reduce the number of\n * iteratee executions. Sections of a chain sequence qualify for shortcut\n * fusion if the section is applied to an array and iteratees accept only\n * one argument. The heuristic for whether a section qualifies for shortcut\n * fusion is subject to change.\n *\n * Chaining is supported in custom builds as long as the `_#value` method is\n * directly or indirectly included in the build.\n *\n * In addition to lodash methods, wrappers have `Array` and `String` methods.\n *\n * The wrapper `Array` methods are:\n * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift`\n *\n * The wrapper `String` methods are:\n * `replace` and `split`\n *\n * The wrapper methods that support shortcut fusion are:\n * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`,\n * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`,\n * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray`\n *\n * The chainable wrapper methods are:\n * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`,\n * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`,\n * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`,\n * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`,\n * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`,\n * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`,\n * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`,\n * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`,\n * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`,\n * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`,\n * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`,\n * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`,\n * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`,\n * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`,\n * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`,\n * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`,\n * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`,\n * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`,\n * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`,\n * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`,\n * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`,\n * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`,\n * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`,\n * `zipObject`, `zipObjectDeep`, and `zipWith`\n *\n * The wrapper methods that are **not** chainable by default are:\n * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`,\n * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`,\n * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`,\n * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`,\n * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`,\n * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`,\n * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`,\n * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`,\n * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`,\n * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`,\n * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`,\n * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`,\n * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`,\n * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`,\n * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`,\n * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`,\n * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`,\n * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`,\n * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`,\n * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`,\n * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`,\n * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`,\n * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`,\n * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`,\n * `upperFirst`, `value`, and `words`\n *\n * @name _\n * @constructor\n * @category Seq\n * @param {*} value The value to wrap in a `lodash` instance.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2, 3]);\n *\n * // Returns an unwrapped value.\n * wrapped.reduce(_.add);\n * // => 6\n *\n * // Returns a wrapped value.\n * var squares = wrapped.map(square);\n *\n * _.isArray(squares);\n * // => false\n *\n * _.isArray(squares.value());\n * // => true\n */\n function lodash(value) {\n if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {\n if (value instanceof LodashWrapper) {\n return value;\n }\n if (hasOwnProperty.call(value, '__wrapped__')) {\n return wrapperClone(value);\n }\n }\n return new LodashWrapper(value);\n }\n\n /**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\n var baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n }());\n\n /**\n * The function whose prototype chain sequence wrappers inherit from.\n *\n * @private\n */\n function baseLodash() {\n // No operation performed.\n }\n\n /**\n * The base constructor for creating `lodash` wrapper objects.\n *\n * @private\n * @param {*} value The value to wrap.\n * @param {boolean} [chainAll] Enable explicit method chain sequences.\n */\n function LodashWrapper(value, chainAll) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__chain__ = !!chainAll;\n this.__index__ = 0;\n this.__values__ = undefined;\n }\n\n /**\n * By default, the template delimiters used by lodash are like those in\n * embedded Ruby (ERB) as well as ES2015 template strings. Change the\n * following template settings to use alternative delimiters.\n *\n * @static\n * @memberOf _\n * @type {Object}\n */\n lodash.templateSettings = {\n\n /**\n * Used to detect `data` property values to be HTML-escaped.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'escape': reEscape,\n\n /**\n * Used to detect code to be evaluated.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'evaluate': reEvaluate,\n\n /**\n * Used to detect `data` property values to inject.\n *\n * @memberOf _.templateSettings\n * @type {RegExp}\n */\n 'interpolate': reInterpolate,\n\n /**\n * Used to reference the data object in the template text.\n *\n * @memberOf _.templateSettings\n * @type {string}\n */\n 'variable': '',\n\n /**\n * Used to import variables into the compiled template.\n *\n * @memberOf _.templateSettings\n * @type {Object}\n */\n 'imports': {\n\n /**\n * A reference to the `lodash` function.\n *\n * @memberOf _.templateSettings.imports\n * @type {Function}\n */\n '_': lodash\n }\n };\n\n // Ensure wrappers are instances of `baseLodash`.\n lodash.prototype = baseLodash.prototype;\n lodash.prototype.constructor = lodash;\n\n LodashWrapper.prototype = baseCreate(baseLodash.prototype);\n LodashWrapper.prototype.constructor = LodashWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.\n *\n * @private\n * @constructor\n * @param {*} value The value to wrap.\n */\n function LazyWrapper(value) {\n this.__wrapped__ = value;\n this.__actions__ = [];\n this.__dir__ = 1;\n this.__filtered__ = false;\n this.__iteratees__ = [];\n this.__takeCount__ = MAX_ARRAY_LENGTH;\n this.__views__ = [];\n }\n\n /**\n * Creates a clone of the lazy wrapper object.\n *\n * @private\n * @name clone\n * @memberOf LazyWrapper\n * @returns {Object} Returns the cloned `LazyWrapper` object.\n */\n function lazyClone() {\n var result = new LazyWrapper(this.__wrapped__);\n result.__actions__ = copyArray(this.__actions__);\n result.__dir__ = this.__dir__;\n result.__filtered__ = this.__filtered__;\n result.__iteratees__ = copyArray(this.__iteratees__);\n result.__takeCount__ = this.__takeCount__;\n result.__views__ = copyArray(this.__views__);\n return result;\n }\n\n /**\n * Reverses the direction of lazy iteration.\n *\n * @private\n * @name reverse\n * @memberOf LazyWrapper\n * @returns {Object} Returns the new reversed `LazyWrapper` object.\n */\n function lazyReverse() {\n if (this.__filtered__) {\n var result = new LazyWrapper(this);\n result.__dir__ = -1;\n result.__filtered__ = true;\n } else {\n result = this.clone();\n result.__dir__ *= -1;\n }\n return result;\n }\n\n /**\n * Extracts the unwrapped value from its lazy wrapper.\n *\n * @private\n * @name value\n * @memberOf LazyWrapper\n * @returns {*} Returns the unwrapped value.\n */\n function lazyValue() {\n var array = this.__wrapped__.value(),\n dir = this.__dir__,\n isArr = isArray(array),\n isRight = dir < 0,\n arrLength = isArr ? array.length : 0,\n view = getView(0, arrLength, this.__views__),\n start = view.start,\n end = view.end,\n length = end - start,\n index = isRight ? end : (start - 1),\n iteratees = this.__iteratees__,\n iterLength = iteratees.length,\n resIndex = 0,\n takeCount = nativeMin(length, this.__takeCount__);\n\n if (!isArr || (!isRight && arrLength == length && takeCount == length)) {\n return baseWrapperValue(array, this.__actions__);\n }\n var result = [];\n\n outer:\n while (length-- && resIndex < takeCount) {\n index += dir;\n\n var iterIndex = -1,\n value = array[index];\n\n while (++iterIndex < iterLength) {\n var data = iteratees[iterIndex],\n iteratee = data.iteratee,\n type = data.type,\n computed = iteratee(value);\n\n if (type == LAZY_MAP_FLAG) {\n value = computed;\n } else if (!computed) {\n if (type == LAZY_FILTER_FLAG) {\n continue outer;\n } else {\n break outer;\n }\n }\n }\n result[resIndex++] = value;\n }\n return result;\n }\n\n // Ensure `LazyWrapper` is an instance of `baseLodash`.\n LazyWrapper.prototype = baseCreate(baseLodash.prototype);\n LazyWrapper.prototype.constructor = LazyWrapper;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\n function hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n }\n\n /**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n }\n\n /**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\n function hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n }\n\n // Add methods to `Hash`.\n Hash.prototype.clear = hashClear;\n Hash.prototype['delete'] = hashDelete;\n Hash.prototype.get = hashGet;\n Hash.prototype.has = hashHas;\n Hash.prototype.set = hashSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\n function listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n }\n\n /**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n }\n\n /**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n }\n\n /**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\n function listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n }\n\n // Add methods to `ListCache`.\n ListCache.prototype.clear = listCacheClear;\n ListCache.prototype['delete'] = listCacheDelete;\n ListCache.prototype.get = listCacheGet;\n ListCache.prototype.has = listCacheHas;\n ListCache.prototype.set = listCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n }\n\n /**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\n function mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n }\n\n /**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n }\n\n /**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function mapCacheGet(key) {\n return getMapData(this, key).get(key);\n }\n\n /**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function mapCacheHas(key) {\n return getMapData(this, key).has(key);\n }\n\n /**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\n function mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n }\n\n // Add methods to `MapCache`.\n MapCache.prototype.clear = mapCacheClear;\n MapCache.prototype['delete'] = mapCacheDelete;\n MapCache.prototype.get = mapCacheGet;\n MapCache.prototype.has = mapCacheHas;\n MapCache.prototype.set = mapCacheSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\n function SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n }\n\n /**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\n function setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n }\n\n /**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\n function setCacheHas(value) {\n return this.__data__.has(value);\n }\n\n // Add methods to `SetCache`.\n SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\n SetCache.prototype.has = setCacheHas;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\n function Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n }\n\n /**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\n function stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n }\n\n /**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\n function stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n }\n\n /**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\n function stackGet(key) {\n return this.__data__.get(key);\n }\n\n /**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\n function stackHas(key) {\n return this.__data__.has(key);\n }\n\n /**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\n function stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n }\n\n // Add methods to `Stack`.\n Stack.prototype.clear = stackClear;\n Stack.prototype['delete'] = stackDelete;\n Stack.prototype.get = stackGet;\n Stack.prototype.has = stackHas;\n Stack.prototype.set = stackSet;\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\n function arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `_.sample` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @returns {*} Returns the random element.\n */\n function arraySample(array) {\n var length = array.length;\n return length ? array[baseRandom(0, length - 1)] : undefined;\n }\n\n /**\n * A specialized version of `_.sampleSize` for arrays.\n *\n * @private\n * @param {Array} array The array to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function arraySampleSize(array, n) {\n return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));\n }\n\n /**\n * A specialized version of `_.shuffle` for arrays.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function arrayShuffle(array) {\n return shuffleSelf(copyArray(array));\n }\n\n /**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n }\n\n /**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\n function assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n }\n\n /**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n }\n\n /**\n * The base implementation of `_.assignIn` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\n function baseAssignIn(object, source) {\n return object && copyObject(source, keysIn(source), object);\n }\n\n /**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\n function baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n }\n\n /**\n * The base implementation of `_.at` without support for individual paths.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {string[]} paths The property paths to pick.\n * @returns {Array} Returns the picked elements.\n */\n function baseAt(object, paths) {\n var index = -1,\n length = paths.length,\n result = Array(length),\n skip = object == null;\n\n while (++index < length) {\n result[index] = skip ? undefined : get(object, paths[index]);\n }\n return result;\n }\n\n /**\n * The base implementation of `_.clamp` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n */\n function baseClamp(number, lower, upper) {\n if (number === number) {\n if (upper !== undefined) {\n number = number <= upper ? number : upper;\n }\n if (lower !== undefined) {\n number = number >= lower ? number : lower;\n }\n }\n return number;\n }\n\n /**\n * The base implementation of `_.clone` and `_.cloneDeep` which tracks\n * traversed objects.\n *\n * @private\n * @param {*} value The value to clone.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Deep clone\n * 2 - Flatten inherited properties\n * 4 - Clone symbols\n * @param {Function} [customizer] The function to customize cloning.\n * @param {string} [key] The key of `value`.\n * @param {Object} [object] The parent object of `value`.\n * @param {Object} [stack] Tracks traversed objects and their clone counterparts.\n * @returns {*} Returns the cloned value.\n */\n function baseClone(value, bitmask, customizer, key, object, stack) {\n var result,\n isDeep = bitmask & CLONE_DEEP_FLAG,\n isFlat = bitmask & CLONE_FLAT_FLAG,\n isFull = bitmask & CLONE_SYMBOLS_FLAG;\n\n if (customizer) {\n result = object ? customizer(value, key, object, stack) : customizer(value);\n }\n if (result !== undefined) {\n return result;\n }\n if (!isObject(value)) {\n return value;\n }\n var isArr = isArray(value);\n if (isArr) {\n result = initCloneArray(value);\n if (!isDeep) {\n return copyArray(value, result);\n }\n } else {\n var tag = getTag(value),\n isFunc = tag == funcTag || tag == genTag;\n\n if (isBuffer(value)) {\n return cloneBuffer(value, isDeep);\n }\n if (tag == objectTag || tag == argsTag || (isFunc && !object)) {\n result = (isFlat || isFunc) ? {} : initCloneObject(value);\n if (!isDeep) {\n return isFlat\n ? copySymbolsIn(value, baseAssignIn(result, value))\n : copySymbols(value, baseAssign(result, value));\n }\n } else {\n if (!cloneableTags[tag]) {\n return object ? value : {};\n }\n result = initCloneByTag(value, tag, isDeep);\n }\n }\n // Check for circular references and return its corresponding clone.\n stack || (stack = new Stack);\n var stacked = stack.get(value);\n if (stacked) {\n return stacked;\n }\n stack.set(value, result);\n\n if (isSet(value)) {\n value.forEach(function(subValue) {\n result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));\n });\n } else if (isMap(value)) {\n value.forEach(function(subValue, key) {\n result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n }\n\n var keysFunc = isFull\n ? (isFlat ? getAllKeysIn : getAllKeys)\n : (isFlat ? keysIn : keys);\n\n var props = isArr ? undefined : keysFunc(value);\n arrayEach(props || value, function(subValue, key) {\n if (props) {\n key = subValue;\n subValue = value[key];\n }\n // Recursively populate clone (susceptible to call stack limits).\n assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));\n });\n return result;\n }\n\n /**\n * The base implementation of `_.conforms` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property predicates to conform to.\n * @returns {Function} Returns the new spec function.\n */\n function baseConforms(source) {\n var props = keys(source);\n return function(object) {\n return baseConformsTo(object, source, props);\n };\n }\n\n /**\n * The base implementation of `_.conformsTo` which accepts `props` to check.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n */\n function baseConformsTo(object, source, props) {\n var length = props.length;\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (length--) {\n var key = props[length],\n predicate = source[key],\n value = object[key];\n\n if ((value === undefined && !(key in object)) || !predicate(value)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.delay` and `_.defer` which accepts `args`\n * to provide to `func`.\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {Array} args The arguments to provide to `func`.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n function baseDelay(func, wait, args) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return setTimeout(function() { func.apply(undefined, args); }, wait);\n }\n\n /**\n * The base implementation of methods like `_.difference` without support\n * for excluding multiple arrays or iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Array} values The values to exclude.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n */\n function baseDifference(array, values, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n isCommon = true,\n length = array.length,\n result = [],\n valuesLength = values.length;\n\n if (!length) {\n return result;\n }\n if (iteratee) {\n values = arrayMap(values, baseUnary(iteratee));\n }\n if (comparator) {\n includes = arrayIncludesWith;\n isCommon = false;\n }\n else if (values.length >= LARGE_ARRAY_SIZE) {\n includes = cacheHas;\n isCommon = false;\n values = new SetCache(values);\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee == null ? value : iteratee(value);\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var valuesIndex = valuesLength;\n while (valuesIndex--) {\n if (values[valuesIndex] === computed) {\n continue outer;\n }\n }\n result.push(value);\n }\n else if (!includes(values, computed, comparator)) {\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.forEach` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEach = createBaseEach(baseForOwn);\n\n /**\n * The base implementation of `_.forEachRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n */\n var baseEachRight = createBaseEach(baseForOwnRight, true);\n\n /**\n * The base implementation of `_.every` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`\n */\n function baseEvery(collection, predicate) {\n var result = true;\n baseEach(collection, function(value, index, collection) {\n result = !!predicate(value, index, collection);\n return result;\n });\n return result;\n }\n\n /**\n * The base implementation of methods like `_.max` and `_.min` which accepts a\n * `comparator` to determine the extremum value.\n *\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} iteratee The iteratee invoked per iteration.\n * @param {Function} comparator The comparator used to compare values.\n * @returns {*} Returns the extremum value.\n */\n function baseExtremum(array, iteratee, comparator) {\n var index = -1,\n length = array.length;\n\n while (++index < length) {\n var value = array[index],\n current = iteratee(value);\n\n if (current != null && (computed === undefined\n ? (current === current && !isSymbol(current))\n : comparator(current, computed)\n )) {\n var computed = current,\n result = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.fill` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n */\n function baseFill(array, value, start, end) {\n var length = array.length;\n\n start = toInteger(start);\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = (end === undefined || end > length) ? length : toInteger(end);\n if (end < 0) {\n end += length;\n }\n end = start > end ? 0 : toLength(end);\n while (start < end) {\n array[start++] = value;\n }\n return array;\n }\n\n /**\n * The base implementation of `_.filter` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\n function baseFilter(collection, predicate) {\n var result = [];\n baseEach(collection, function(value, index, collection) {\n if (predicate(value, index, collection)) {\n result.push(value);\n }\n });\n return result;\n }\n\n /**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\n function baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseFor = createBaseFor();\n\n /**\n * This function is like `baseFor` except that it iterates over properties\n * in the opposite order.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\n var baseForRight = createBaseFor(true);\n\n /**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.forOwnRight` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\n function baseForOwnRight(object, iteratee) {\n return object && baseForRight(object, iteratee, keys);\n }\n\n /**\n * The base implementation of `_.functions` which creates an array of\n * `object` function property names filtered from `props`.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Array} props The property names to filter.\n * @returns {Array} Returns the function names.\n */\n function baseFunctions(object, props) {\n return arrayFilter(props, function(key) {\n return isFunction(object[key]);\n });\n }\n\n /**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\n function baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n }\n\n /**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n }\n\n /**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n function baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n }\n\n /**\n * The base implementation of `_.gt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n */\n function baseGt(value, other) {\n return value > other;\n }\n\n /**\n * The base implementation of `_.has` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHas(object, key) {\n return object != null && hasOwnProperty.call(object, key);\n }\n\n /**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\n function baseHasIn(object, key) {\n return object != null && key in Object(object);\n }\n\n /**\n * The base implementation of `_.inRange` which doesn't coerce arguments.\n *\n * @private\n * @param {number} number The number to check.\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n */\n function baseInRange(number, start, end) {\n return number >= nativeMin(start, end) && number < nativeMax(start, end);\n }\n\n /**\n * The base implementation of methods like `_.intersection`, without support\n * for iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of shared values.\n */\n function baseIntersection(arrays, iteratee, comparator) {\n var includes = comparator ? arrayIncludesWith : arrayIncludes,\n length = arrays[0].length,\n othLength = arrays.length,\n othIndex = othLength,\n caches = Array(othLength),\n maxLength = Infinity,\n result = [];\n\n while (othIndex--) {\n var array = arrays[othIndex];\n if (othIndex && iteratee) {\n array = arrayMap(array, baseUnary(iteratee));\n }\n maxLength = nativeMin(array.length, maxLength);\n caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120))\n ? new SetCache(othIndex && array)\n : undefined;\n }\n array = arrays[0];\n\n var index = -1,\n seen = caches[0];\n\n outer:\n while (++index < length && result.length < maxLength) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (!(seen\n ? cacheHas(seen, computed)\n : includes(result, computed, comparator)\n )) {\n othIndex = othLength;\n while (--othIndex) {\n var cache = caches[othIndex];\n if (!(cache\n ? cacheHas(cache, computed)\n : includes(arrays[othIndex], computed, comparator))\n ) {\n continue outer;\n }\n }\n if (seen) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.invert` and `_.invertBy` which inverts\n * `object` with values transformed by `iteratee` and set by `setter`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform values.\n * @param {Object} accumulator The initial inverted object.\n * @returns {Function} Returns `accumulator`.\n */\n function baseInverter(object, setter, iteratee, accumulator) {\n baseForOwn(object, function(value, key, object) {\n setter(accumulator, iteratee(value), key, object);\n });\n return accumulator;\n }\n\n /**\n * The base implementation of `_.invoke` without support for individual\n * method arguments.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {Array} args The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n */\n function baseInvoke(object, path, args) {\n path = castPath(path, object);\n object = parent(object, path);\n var func = object == null ? object : object[toKey(last(path))];\n return func == null ? undefined : apply(func, object, args);\n }\n\n /**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\n function baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n }\n\n /**\n * The base implementation of `_.isArrayBuffer` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n */\n function baseIsArrayBuffer(value) {\n return isObjectLike(value) && baseGetTag(value) == arrayBufferTag;\n }\n\n /**\n * The base implementation of `_.isDate` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n */\n function baseIsDate(value) {\n return isObjectLike(value) && baseGetTag(value) == dateTag;\n }\n\n /**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\n function baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n }\n\n /**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n }\n\n /**\n * The base implementation of `_.isMap` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n */\n function baseIsMap(value) {\n return isObjectLike(value) && getTag(value) == mapTag;\n }\n\n /**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\n function baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n }\n\n /**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\n function baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n }\n\n /**\n * The base implementation of `_.isRegExp` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n */\n function baseIsRegExp(value) {\n return isObjectLike(value) && baseGetTag(value) == regexpTag;\n }\n\n /**\n * The base implementation of `_.isSet` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n */\n function baseIsSet(value) {\n return isObjectLike(value) && getTag(value) == setTag;\n }\n\n /**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n function baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n }\n\n /**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\n function baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n }\n\n /**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.lt` which doesn't coerce arguments.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n */\n function baseLt(value, other) {\n return value < other;\n }\n\n /**\n * The base implementation of `_.map` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\n function baseMap(collection, iteratee) {\n var index = -1,\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value, key, collection) {\n result[++index] = iteratee(value, key, collection);\n });\n return result;\n }\n\n /**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n }\n\n /**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n }\n\n /**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n }\n\n /**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\n function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n }\n\n /**\n * The base implementation of `_.nth` which doesn't coerce arguments.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {number} n The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n */\n function baseNth(array, n) {\n var length = array.length;\n if (!length) {\n return;\n }\n n += n < 0 ? length : 0;\n return isIndex(n, length) ? array[n] : undefined;\n }\n\n /**\n * The base implementation of `_.orderBy` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.\n * @param {string[]} orders The sort orders of `iteratees`.\n * @returns {Array} Returns the new sorted array.\n */\n function baseOrderBy(collection, iteratees, orders) {\n var index = -1;\n iteratees = arrayMap(iteratees.length ? iteratees : [identity], baseUnary(getIteratee()));\n\n var result = baseMap(collection, function(value, key, collection) {\n var criteria = arrayMap(iteratees, function(iteratee) {\n return iteratee(value);\n });\n return { 'criteria': criteria, 'index': ++index, 'value': value };\n });\n\n return baseSortBy(result, function(object, other) {\n return compareMultiple(object, other, orders);\n });\n }\n\n /**\n * The base implementation of `_.pick` without support for individual\n * property identifiers.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @returns {Object} Returns the new object.\n */\n function basePick(object, paths) {\n return basePickBy(object, paths, function(value, path) {\n return hasIn(object, path);\n });\n }\n\n /**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\n function basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n }\n\n /**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\n function basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n }\n\n /**\n * The base implementation of `_.pullAllBy` without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n */\n function basePullAll(array, values, iteratee, comparator) {\n var indexOf = comparator ? baseIndexOfWith : baseIndexOf,\n index = -1,\n length = values.length,\n seen = array;\n\n if (array === values) {\n values = copyArray(values);\n }\n if (iteratee) {\n seen = arrayMap(array, baseUnary(iteratee));\n }\n while (++index < length) {\n var fromIndex = 0,\n value = values[index],\n computed = iteratee ? iteratee(value) : value;\n\n while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) {\n if (seen !== array) {\n splice.call(seen, fromIndex, 1);\n }\n splice.call(array, fromIndex, 1);\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.pullAt` without support for individual\n * indexes or capturing the removed elements.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {number[]} indexes The indexes of elements to remove.\n * @returns {Array} Returns `array`.\n */\n function basePullAt(array, indexes) {\n var length = array ? indexes.length : 0,\n lastIndex = length - 1;\n\n while (length--) {\n var index = indexes[length];\n if (length == lastIndex || index !== previous) {\n var previous = index;\n if (isIndex(index)) {\n splice.call(array, index, 1);\n } else {\n baseUnset(array, index);\n }\n }\n }\n return array;\n }\n\n /**\n * The base implementation of `_.random` without support for returning\n * floating-point numbers.\n *\n * @private\n * @param {number} lower The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the random number.\n */\n function baseRandom(lower, upper) {\n return lower + nativeFloor(nativeRandom() * (upper - lower + 1));\n }\n\n /**\n * The base implementation of `_.range` and `_.rangeRight` which doesn't\n * coerce arguments.\n *\n * @private\n * @param {number} start The start of the range.\n * @param {number} end The end of the range.\n * @param {number} step The value to increment or decrement by.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the range of numbers.\n */\n function baseRange(start, end, step, fromRight) {\n var index = -1,\n length = nativeMax(nativeCeil((end - start) / (step || 1)), 0),\n result = Array(length);\n\n while (length--) {\n result[fromRight ? length : ++index] = start;\n start += step;\n }\n return result;\n }\n\n /**\n * The base implementation of `_.repeat` which doesn't coerce arguments.\n *\n * @private\n * @param {string} string The string to repeat.\n * @param {number} n The number of times to repeat the string.\n * @returns {string} Returns the repeated string.\n */\n function baseRepeat(string, n) {\n var result = '';\n if (!string || n < 1 || n > MAX_SAFE_INTEGER) {\n return result;\n }\n // Leverage the exponentiation by squaring algorithm for a faster repeat.\n // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.\n do {\n if (n % 2) {\n result += string;\n }\n n = nativeFloor(n / 2);\n if (n) {\n string += string;\n }\n } while (n);\n\n return result;\n }\n\n /**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\n function baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n }\n\n /**\n * The base implementation of `_.sample`.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n */\n function baseSample(collection) {\n return arraySample(values(collection));\n }\n\n /**\n * The base implementation of `_.sampleSize` without param guards.\n *\n * @private\n * @param {Array|Object} collection The collection to sample.\n * @param {number} n The number of elements to sample.\n * @returns {Array} Returns the random elements.\n */\n function baseSampleSize(collection, n) {\n var array = values(collection);\n return shuffleSelf(array, baseClamp(n, 0, array.length));\n }\n\n /**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n }\n\n /**\n * The base implementation of `setData` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var baseSetData = !metaMap ? identity : function(func, data) {\n metaMap.set(func, data);\n return func;\n };\n\n /**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n };\n\n /**\n * The base implementation of `_.shuffle`.\n *\n * @private\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n */\n function baseShuffle(collection) {\n return shuffleSelf(values(collection));\n }\n\n /**\n * The base implementation of `_.slice` without an iteratee call guard.\n *\n * @private\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseSlice(array, start, end) {\n var index = -1,\n length = array.length;\n\n if (start < 0) {\n start = -start > length ? 0 : (length + start);\n }\n end = end > length ? length : end;\n if (end < 0) {\n end += length;\n }\n length = start > end ? 0 : ((end - start) >>> 0);\n start >>>= 0;\n\n var result = Array(length);\n while (++index < length) {\n result[index] = array[index + start];\n }\n return result;\n }\n\n /**\n * The base implementation of `_.some` without support for iteratee shorthands.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\n function baseSome(collection, predicate) {\n var result;\n\n baseEach(collection, function(value, index, collection) {\n result = predicate(value, index, collection);\n return !result;\n });\n return !!result;\n }\n\n /**\n * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which\n * performs a binary search of `array` to determine the index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndex(array, value, retHighest) {\n var low = 0,\n high = array == null ? low : array.length;\n\n if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {\n while (low < high) {\n var mid = (low + high) >>> 1,\n computed = array[mid];\n\n if (computed !== null && !isSymbol(computed) &&\n (retHighest ? (computed <= value) : (computed < value))) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return high;\n }\n return baseSortedIndexBy(array, value, identity, retHighest);\n }\n\n /**\n * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy`\n * which invokes `iteratee` for `value` and each element of `array` to compute\n * their sort ranking. The iteratee is invoked with one argument; (value).\n *\n * @private\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} iteratee The iteratee invoked per element.\n * @param {boolean} [retHighest] Specify returning the highest qualified index.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n */\n function baseSortedIndexBy(array, value, iteratee, retHighest) {\n value = iteratee(value);\n\n var low = 0,\n high = array == null ? 0 : array.length,\n valIsNaN = value !== value,\n valIsNull = value === null,\n valIsSymbol = isSymbol(value),\n valIsUndefined = value === undefined;\n\n while (low < high) {\n var mid = nativeFloor((low + high) / 2),\n computed = iteratee(array[mid]),\n othIsDefined = computed !== undefined,\n othIsNull = computed === null,\n othIsReflexive = computed === computed,\n othIsSymbol = isSymbol(computed);\n\n if (valIsNaN) {\n var setLow = retHighest || othIsReflexive;\n } else if (valIsUndefined) {\n setLow = othIsReflexive && (retHighest || othIsDefined);\n } else if (valIsNull) {\n setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);\n } else if (valIsSymbol) {\n setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);\n } else if (othIsNull || othIsSymbol) {\n setLow = false;\n } else {\n setLow = retHighest ? (computed <= value) : (computed < value);\n }\n if (setLow) {\n low = mid + 1;\n } else {\n high = mid;\n }\n }\n return nativeMin(high, MAX_ARRAY_INDEX);\n }\n\n /**\n * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without\n * support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseSortedUniq(array, iteratee) {\n var index = -1,\n length = array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n if (!index || !eq(computed, seen)) {\n var seen = computed;\n result[resIndex++] = value === 0 ? 0 : value;\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.toNumber` which doesn't ensure correct\n * conversions of binary, hexadecimal, or octal string values.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n */\n function baseToNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n return +value;\n }\n\n /**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\n function baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * The base implementation of `_.uniqBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n */\n function baseUniq(array, iteratee, comparator) {\n var index = -1,\n includes = arrayIncludes,\n length = array.length,\n isCommon = true,\n result = [],\n seen = result;\n\n if (comparator) {\n isCommon = false;\n includes = arrayIncludesWith;\n }\n else if (length >= LARGE_ARRAY_SIZE) {\n var set = iteratee ? null : createSet(array);\n if (set) {\n return setToArray(set);\n }\n isCommon = false;\n includes = cacheHas;\n seen = new SetCache;\n }\n else {\n seen = iteratee ? [] : result;\n }\n outer:\n while (++index < length) {\n var value = array[index],\n computed = iteratee ? iteratee(value) : value;\n\n value = (comparator || value !== 0) ? value : 0;\n if (isCommon && computed === computed) {\n var seenIndex = seen.length;\n while (seenIndex--) {\n if (seen[seenIndex] === computed) {\n continue outer;\n }\n }\n if (iteratee) {\n seen.push(computed);\n }\n result.push(value);\n }\n else if (!includes(seen, computed, comparator)) {\n if (seen !== result) {\n seen.push(computed);\n }\n result.push(value);\n }\n }\n return result;\n }\n\n /**\n * The base implementation of `_.unset`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The property path to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n */\n function baseUnset(object, path) {\n path = castPath(path, object);\n object = parent(object, path);\n return object == null || delete object[toKey(last(path))];\n }\n\n /**\n * The base implementation of `_.update`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to update.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\n function baseUpdate(object, path, updater, customizer) {\n return baseSet(object, path, updater(baseGet(object, path)), customizer);\n }\n\n /**\n * The base implementation of methods like `_.dropWhile` and `_.takeWhile`\n * without support for iteratee shorthands.\n *\n * @private\n * @param {Array} array The array to query.\n * @param {Function} predicate The function invoked per iteration.\n * @param {boolean} [isDrop] Specify dropping elements instead of taking them.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Array} Returns the slice of `array`.\n */\n function baseWhile(array, predicate, isDrop, fromRight) {\n var length = array.length,\n index = fromRight ? length : -1;\n\n while ((fromRight ? index-- : ++index < length) &&\n predicate(array[index], index, array)) {}\n\n return isDrop\n ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length))\n : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index));\n }\n\n /**\n * The base implementation of `wrapperValue` which returns the result of\n * performing a sequence of actions on the unwrapped `value`, where each\n * successive action is supplied the return value of the previous.\n *\n * @private\n * @param {*} value The unwrapped value.\n * @param {Array} actions Actions to perform to resolve the unwrapped value.\n * @returns {*} Returns the resolved value.\n */\n function baseWrapperValue(value, actions) {\n var result = value;\n if (result instanceof LazyWrapper) {\n result = result.value();\n }\n return arrayReduce(actions, function(result, action) {\n return action.func.apply(action.thisArg, arrayPush([result], action.args));\n }, result);\n }\n\n /**\n * The base implementation of methods like `_.xor`, without support for\n * iteratee shorthands, that accepts an array of arrays to inspect.\n *\n * @private\n * @param {Array} arrays The arrays to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of values.\n */\n function baseXor(arrays, iteratee, comparator) {\n var length = arrays.length;\n if (length < 2) {\n return length ? baseUniq(arrays[0]) : [];\n }\n var index = -1,\n result = Array(length);\n\n while (++index < length) {\n var array = arrays[index],\n othIndex = -1;\n\n while (++othIndex < length) {\n if (othIndex != index) {\n result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator);\n }\n }\n }\n return baseUniq(baseFlatten(result, 1), iteratee, comparator);\n }\n\n /**\n * This base implementation of `_.zipObject` which assigns values using `assignFunc`.\n *\n * @private\n * @param {Array} props The property identifiers.\n * @param {Array} values The property values.\n * @param {Function} assignFunc The function to assign values.\n * @returns {Object} Returns the new object.\n */\n function baseZipObject(props, values, assignFunc) {\n var index = -1,\n length = props.length,\n valsLength = values.length,\n result = {};\n\n while (++index < length) {\n var value = index < valsLength ? values[index] : undefined;\n assignFunc(result, props[index], value);\n }\n return result;\n }\n\n /**\n * Casts `value` to an empty array if it's not an array like object.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Array|Object} Returns the cast array-like object.\n */\n function castArrayLikeObject(value) {\n return isArrayLikeObject(value) ? value : [];\n }\n\n /**\n * Casts `value` to `identity` if it's not a function.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {Function} Returns cast function.\n */\n function castFunction(value) {\n return typeof value == 'function' ? value : identity;\n }\n\n /**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\n function castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n }\n\n /**\n * A `baseRest` alias which can be replaced with `identity` by module\n * replacement plugins.\n *\n * @private\n * @type {Function}\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n var castRest = baseRest;\n\n /**\n * Casts `array` to a slice if it's needed.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {number} start The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the cast slice.\n */\n function castSlice(array, start, end) {\n var length = array.length;\n end = end === undefined ? length : end;\n return (!start && end >= length) ? array : baseSlice(array, start, end);\n }\n\n /**\n * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout).\n *\n * @private\n * @param {number|Object} id The timer id or timeout object of the timer to clear.\n */\n var clearTimeout = ctxClearTimeout || function(id) {\n return root.clearTimeout(id);\n };\n\n /**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\n function cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n }\n\n /**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\n function cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n }\n\n /**\n * Creates a clone of `dataView`.\n *\n * @private\n * @param {Object} dataView The data view to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned data view.\n */\n function cloneDataView(dataView, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;\n return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);\n }\n\n /**\n * Creates a clone of `regexp`.\n *\n * @private\n * @param {Object} regexp The regexp to clone.\n * @returns {Object} Returns the cloned regexp.\n */\n function cloneRegExp(regexp) {\n var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));\n result.lastIndex = regexp.lastIndex;\n return result;\n }\n\n /**\n * Creates a clone of the `symbol` object.\n *\n * @private\n * @param {Object} symbol The symbol object to clone.\n * @returns {Object} Returns the cloned symbol object.\n */\n function cloneSymbol(symbol) {\n return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};\n }\n\n /**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\n function cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n }\n\n /**\n * Compares values to sort them in ascending order.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {number} Returns the sort order indicator for `value`.\n */\n function compareAscending(value, other) {\n if (value !== other) {\n var valIsDefined = value !== undefined,\n valIsNull = value === null,\n valIsReflexive = value === value,\n valIsSymbol = isSymbol(value);\n\n var othIsDefined = other !== undefined,\n othIsNull = other === null,\n othIsReflexive = other === other,\n othIsSymbol = isSymbol(other);\n\n if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||\n (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||\n (valIsNull && othIsDefined && othIsReflexive) ||\n (!valIsDefined && othIsReflexive) ||\n !valIsReflexive) {\n return 1;\n }\n if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||\n (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||\n (othIsNull && valIsDefined && valIsReflexive) ||\n (!othIsDefined && valIsReflexive) ||\n !othIsReflexive) {\n return -1;\n }\n }\n return 0;\n }\n\n /**\n * Used by `_.orderBy` to compare multiple properties of a value to another\n * and stable sort them.\n *\n * If `orders` is unspecified, all values are sorted in ascending order. Otherwise,\n * specify an order of \"desc\" for descending or \"asc\" for ascending sort order\n * of corresponding values.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {boolean[]|string[]} orders The order to sort by for each property.\n * @returns {number} Returns the sort order indicator for `object`.\n */\n function compareMultiple(object, other, orders) {\n var index = -1,\n objCriteria = object.criteria,\n othCriteria = other.criteria,\n length = objCriteria.length,\n ordersLength = orders.length;\n\n while (++index < length) {\n var result = compareAscending(objCriteria[index], othCriteria[index]);\n if (result) {\n if (index >= ordersLength) {\n return result;\n }\n var order = orders[index];\n return result * (order == 'desc' ? -1 : 1);\n }\n }\n // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications\n // that causes it, under certain circumstances, to provide the same value for\n // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247\n // for more details.\n //\n // This also ensures a stable sort in V8 and other engines.\n // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details.\n return object.index - other.index;\n }\n\n /**\n * Creates an array that is the composition of partially applied arguments,\n * placeholders, and provided arguments into a single array of arguments.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to prepend to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgs(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersLength = holders.length,\n leftIndex = -1,\n leftLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(leftLength + rangeLength),\n isUncurried = !isCurried;\n\n while (++leftIndex < leftLength) {\n result[leftIndex] = partials[leftIndex];\n }\n while (++argsIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[holders[argsIndex]] = args[argsIndex];\n }\n }\n while (rangeLength--) {\n result[leftIndex++] = args[argsIndex++];\n }\n return result;\n }\n\n /**\n * This function is like `composeArgs` except that the arguments composition\n * is tailored for `_.partialRight`.\n *\n * @private\n * @param {Array} args The provided arguments.\n * @param {Array} partials The arguments to append to those provided.\n * @param {Array} holders The `partials` placeholder indexes.\n * @params {boolean} [isCurried] Specify composing for a curried function.\n * @returns {Array} Returns the new array of composed arguments.\n */\n function composeArgsRight(args, partials, holders, isCurried) {\n var argsIndex = -1,\n argsLength = args.length,\n holdersIndex = -1,\n holdersLength = holders.length,\n rightIndex = -1,\n rightLength = partials.length,\n rangeLength = nativeMax(argsLength - holdersLength, 0),\n result = Array(rangeLength + rightLength),\n isUncurried = !isCurried;\n\n while (++argsIndex < rangeLength) {\n result[argsIndex] = args[argsIndex];\n }\n var offset = argsIndex;\n while (++rightIndex < rightLength) {\n result[offset + rightIndex] = partials[rightIndex];\n }\n while (++holdersIndex < holdersLength) {\n if (isUncurried || argsIndex < argsLength) {\n result[offset + holders[holdersIndex]] = args[argsIndex++];\n }\n }\n return result;\n }\n\n /**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\n function copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n }\n\n /**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\n function copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n }\n\n /**\n * Copies own symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbols(source, object) {\n return copyObject(source, getSymbols(source), object);\n }\n\n /**\n * Copies own and inherited symbols of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy symbols from.\n * @param {Object} [object={}] The object to copy symbols to.\n * @returns {Object} Returns `object`.\n */\n function copySymbolsIn(source, object) {\n return copyObject(source, getSymbolsIn(source), object);\n }\n\n /**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\n function createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, getIteratee(iteratee, 2), accumulator);\n };\n }\n\n /**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\n function createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n }\n\n /**\n * Creates a `baseEach` or `baseEachRight` function.\n *\n * @private\n * @param {Function} eachFunc The function to iterate over a collection.\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseEach(eachFunc, fromRight) {\n return function(collection, iteratee) {\n if (collection == null) {\n return collection;\n }\n if (!isArrayLike(collection)) {\n return eachFunc(collection, iteratee);\n }\n var length = collection.length,\n index = fromRight ? length : -1,\n iterable = Object(collection);\n\n while ((fromRight ? index-- : ++index < length)) {\n if (iteratee(iterable[index], index, iterable) === false) {\n break;\n }\n }\n return collection;\n };\n }\n\n /**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\n function createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the optional `this`\n * binding of `thisArg`.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createBind(func, bitmask, thisArg) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return fn.apply(isBind ? thisArg : this, arguments);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.lowerFirst`.\n *\n * @private\n * @param {string} methodName The name of the `String` case method to use.\n * @returns {Function} Returns the new case function.\n */\n function createCaseFirst(methodName) {\n return function(string) {\n string = toString(string);\n\n var strSymbols = hasUnicode(string)\n ? stringToArray(string)\n : undefined;\n\n var chr = strSymbols\n ? strSymbols[0]\n : string.charAt(0);\n\n var trailing = strSymbols\n ? castSlice(strSymbols, 1).join('')\n : string.slice(1);\n\n return chr[methodName]() + trailing;\n };\n }\n\n /**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\n function createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n }\n\n /**\n * Creates a function that produces an instance of `Ctor` regardless of\n * whether it was invoked as part of a `new` expression or by `call` or `apply`.\n *\n * @private\n * @param {Function} Ctor The constructor to wrap.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCtor(Ctor) {\n return function() {\n // Use a `switch` statement to work with class constructors. See\n // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist\n // for more details.\n var args = arguments;\n switch (args.length) {\n case 0: return new Ctor;\n case 1: return new Ctor(args[0]);\n case 2: return new Ctor(args[0], args[1]);\n case 3: return new Ctor(args[0], args[1], args[2]);\n case 4: return new Ctor(args[0], args[1], args[2], args[3]);\n case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]);\n case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);\n case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);\n }\n var thisBinding = baseCreate(Ctor.prototype),\n result = Ctor.apply(thisBinding, args);\n\n // Mimic the constructor's `return` behavior.\n // See https://es5.github.io/#x13.2.2 for more details.\n return isObject(result) ? result : thisBinding;\n };\n }\n\n /**\n * Creates a function that wraps `func` to enable currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {number} arity The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createCurry(func, bitmask, arity) {\n var Ctor = createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length,\n placeholder = getHolder(wrapper);\n\n while (index--) {\n args[index] = arguments[index];\n }\n var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder)\n ? []\n : replaceHolders(args, placeholder);\n\n length -= holders.length;\n if (length < arity) {\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, undefined,\n args, holders, undefined, undefined, arity - length);\n }\n var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n return apply(fn, this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.find` or `_.findLast` function.\n *\n * @private\n * @param {Function} findIndexFunc The function to find the collection index.\n * @returns {Function} Returns the new find function.\n */\n function createFind(findIndexFunc) {\n return function(collection, predicate, fromIndex) {\n var iterable = Object(collection);\n if (!isArrayLike(collection)) {\n var iteratee = getIteratee(predicate, 3);\n collection = keys(collection);\n predicate = function(key) { return iteratee(iterable[key], key, iterable); };\n }\n var index = findIndexFunc(collection, predicate, fromIndex);\n return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined;\n };\n }\n\n /**\n * Creates a `_.flow` or `_.flowRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new flow function.\n */\n function createFlow(fromRight) {\n return flatRest(function(funcs) {\n var length = funcs.length,\n index = length,\n prereq = LodashWrapper.prototype.thru;\n\n if (fromRight) {\n funcs.reverse();\n }\n while (index--) {\n var func = funcs[index];\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (prereq && !wrapper && getFuncName(func) == 'wrapper') {\n var wrapper = new LodashWrapper([], true);\n }\n }\n index = wrapper ? index : length;\n while (++index < length) {\n func = funcs[index];\n\n var funcName = getFuncName(func),\n data = funcName == 'wrapper' ? getData(func) : undefined;\n\n if (data && isLaziable(data[0]) &&\n data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) &&\n !data[4].length && data[9] == 1\n ) {\n wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);\n } else {\n wrapper = (func.length == 1 && isLaziable(func))\n ? wrapper[funcName]()\n : wrapper.thru(func);\n }\n }\n return function() {\n var args = arguments,\n value = args[0];\n\n if (wrapper && args.length == 1 && isArray(value)) {\n return wrapper.plant(value).value();\n }\n var index = 0,\n result = length ? funcs[index].apply(this, args) : value;\n\n while (++index < length) {\n result = funcs[index].call(this, result);\n }\n return result;\n };\n });\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with optional `this`\n * binding of `thisArg`, partial application, and currying.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [partialsRight] The arguments to append to those provided\n * to the new function.\n * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {\n var isAry = bitmask & WRAP_ARY_FLAG,\n isBind = bitmask & WRAP_BIND_FLAG,\n isBindKey = bitmask & WRAP_BIND_KEY_FLAG,\n isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG),\n isFlip = bitmask & WRAP_FLIP_FLAG,\n Ctor = isBindKey ? undefined : createCtor(func);\n\n function wrapper() {\n var length = arguments.length,\n args = Array(length),\n index = length;\n\n while (index--) {\n args[index] = arguments[index];\n }\n if (isCurried) {\n var placeholder = getHolder(wrapper),\n holdersCount = countHolders(args, placeholder);\n }\n if (partials) {\n args = composeArgs(args, partials, holders, isCurried);\n }\n if (partialsRight) {\n args = composeArgsRight(args, partialsRight, holdersRight, isCurried);\n }\n length -= holdersCount;\n if (isCurried && length < arity) {\n var newHolders = replaceHolders(args, placeholder);\n return createRecurry(\n func, bitmask, createHybrid, wrapper.placeholder, thisArg,\n args, newHolders, argPos, ary, arity - length\n );\n }\n var thisBinding = isBind ? thisArg : this,\n fn = isBindKey ? thisBinding[func] : func;\n\n length = args.length;\n if (argPos) {\n args = reorder(args, argPos);\n } else if (isFlip && length > 1) {\n args.reverse();\n }\n if (isAry && ary < length) {\n args.length = ary;\n }\n if (this && this !== root && this instanceof wrapper) {\n fn = Ctor || createCtor(fn);\n }\n return fn.apply(thisBinding, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a function like `_.invertBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} toIteratee The function to resolve iteratees.\n * @returns {Function} Returns the new inverter function.\n */\n function createInverter(setter, toIteratee) {\n return function(object, iteratee) {\n return baseInverter(object, setter, toIteratee(iteratee), {});\n };\n }\n\n /**\n * Creates a function that performs a mathematical operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @param {number} [defaultValue] The value used for `undefined` arguments.\n * @returns {Function} Returns the new mathematical operation function.\n */\n function createMathOperation(operator, defaultValue) {\n return function(value, other) {\n var result;\n if (value === undefined && other === undefined) {\n return defaultValue;\n }\n if (value !== undefined) {\n result = value;\n }\n if (other !== undefined) {\n if (result === undefined) {\n return other;\n }\n if (typeof value == 'string' || typeof other == 'string') {\n value = baseToString(value);\n other = baseToString(other);\n } else {\n value = baseToNumber(value);\n other = baseToNumber(other);\n }\n result = operator(value, other);\n }\n return result;\n };\n }\n\n /**\n * Creates a function like `_.over`.\n *\n * @private\n * @param {Function} arrayFunc The function to iterate over iteratees.\n * @returns {Function} Returns the new over function.\n */\n function createOver(arrayFunc) {\n return flatRest(function(iteratees) {\n iteratees = arrayMap(iteratees, baseUnary(getIteratee()));\n return baseRest(function(args) {\n var thisArg = this;\n return arrayFunc(iteratees, function(iteratee) {\n return apply(iteratee, thisArg, args);\n });\n });\n });\n }\n\n /**\n * Creates the padding for `string` based on `length`. The `chars` string\n * is truncated if the number of characters exceeds `length`.\n *\n * @private\n * @param {number} length The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padding for `string`.\n */\n function createPadding(length, chars) {\n chars = chars === undefined ? ' ' : baseToString(chars);\n\n var charsLength = chars.length;\n if (charsLength < 2) {\n return charsLength ? baseRepeat(chars, length) : chars;\n }\n var result = baseRepeat(chars, nativeCeil(length / stringSize(chars)));\n return hasUnicode(chars)\n ? castSlice(stringToArray(result), 0, length).join('')\n : result.slice(0, length);\n }\n\n /**\n * Creates a function that wraps `func` to invoke it with the `this` binding\n * of `thisArg` and `partials` prepended to the arguments it receives.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} partials The arguments to prepend to those provided to\n * the new function.\n * @returns {Function} Returns the new wrapped function.\n */\n function createPartial(func, bitmask, thisArg, partials) {\n var isBind = bitmask & WRAP_BIND_FLAG,\n Ctor = createCtor(func);\n\n function wrapper() {\n var argsIndex = -1,\n argsLength = arguments.length,\n leftIndex = -1,\n leftLength = partials.length,\n args = Array(leftLength + argsLength),\n fn = (this && this !== root && this instanceof wrapper) ? Ctor : func;\n\n while (++leftIndex < leftLength) {\n args[leftIndex] = partials[leftIndex];\n }\n while (argsLength--) {\n args[leftIndex++] = arguments[++argsIndex];\n }\n return apply(fn, isBind ? thisArg : this, args);\n }\n return wrapper;\n }\n\n /**\n * Creates a `_.range` or `_.rangeRight` function.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new range function.\n */\n function createRange(fromRight) {\n return function(start, end, step) {\n if (step && typeof step != 'number' && isIterateeCall(start, end, step)) {\n end = step = undefined;\n }\n // Ensure the sign of `-0` is preserved.\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n step = step === undefined ? (start < end ? 1 : -1) : toFinite(step);\n return baseRange(start, end, step, fromRight);\n };\n }\n\n /**\n * Creates a function that performs a relational operation on two values.\n *\n * @private\n * @param {Function} operator The function to perform the operation.\n * @returns {Function} Returns the new relational operation function.\n */\n function createRelationalOperation(operator) {\n return function(value, other) {\n if (!(typeof value == 'string' && typeof other == 'string')) {\n value = toNumber(value);\n other = toNumber(other);\n }\n return operator(value, other);\n };\n }\n\n /**\n * Creates a function that wraps `func` to continue currying.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @param {Function} wrapFunc The function to create the `func` wrapper.\n * @param {*} placeholder The placeholder value.\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to prepend to those provided to\n * the new function.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) {\n var isCurry = bitmask & WRAP_CURRY_FLAG,\n newHolders = isCurry ? holders : undefined,\n newHoldersRight = isCurry ? undefined : holders,\n newPartials = isCurry ? partials : undefined,\n newPartialsRight = isCurry ? undefined : partials;\n\n bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG);\n bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG);\n\n if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) {\n bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG);\n }\n var newData = [\n func, bitmask, thisArg, newPartials, newHolders, newPartialsRight,\n newHoldersRight, argPos, ary, arity\n ];\n\n var result = wrapFunc.apply(undefined, newData);\n if (isLaziable(func)) {\n setData(result, newData);\n }\n result.placeholder = placeholder;\n return setWrapToString(result, func, bitmask);\n }\n\n /**\n * Creates a function like `_.round`.\n *\n * @private\n * @param {string} methodName The name of the `Math` method to use when rounding.\n * @returns {Function} Returns the new round function.\n */\n function createRound(methodName) {\n var func = Math[methodName];\n return function(number, precision) {\n number = toNumber(number);\n precision = precision == null ? 0 : nativeMin(toInteger(precision), 292);\n if (precision && nativeIsFinite(number)) {\n // Shift with exponential notation to avoid floating-point issues.\n // See [MDN](https://mdn.io/round#Examples) for more details.\n var pair = (toString(number) + 'e').split('e'),\n value = func(pair[0] + 'e' + (+pair[1] + precision));\n\n pair = (toString(value) + 'e').split('e');\n return +(pair[0] + 'e' + (+pair[1] - precision));\n }\n return func(number);\n };\n }\n\n /**\n * Creates a set object of `values`.\n *\n * @private\n * @param {Array} values The values to add to the set.\n * @returns {Object} Returns the new set.\n */\n var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {\n return new Set(values);\n };\n\n /**\n * Creates a `_.toPairs` or `_.toPairsIn` function.\n *\n * @private\n * @param {Function} keysFunc The function to get the keys of a given object.\n * @returns {Function} Returns the new pairs function.\n */\n function createToPairs(keysFunc) {\n return function(object) {\n var tag = getTag(object);\n if (tag == mapTag) {\n return mapToArray(object);\n }\n if (tag == setTag) {\n return setToPairs(object);\n }\n return baseToPairs(object, keysFunc(object));\n };\n }\n\n /**\n * Creates a function that either curries or invokes `func` with optional\n * `this` binding and partially applied arguments.\n *\n * @private\n * @param {Function|string} func The function or method name to wrap.\n * @param {number} bitmask The bitmask flags.\n * 1 - `_.bind`\n * 2 - `_.bindKey`\n * 4 - `_.curry` or `_.curryRight` of a bound function\n * 8 - `_.curry`\n * 16 - `_.curryRight`\n * 32 - `_.partial`\n * 64 - `_.partialRight`\n * 128 - `_.rearg`\n * 256 - `_.ary`\n * 512 - `_.flip`\n * @param {*} [thisArg] The `this` binding of `func`.\n * @param {Array} [partials] The arguments to be partially applied.\n * @param {Array} [holders] The `partials` placeholder indexes.\n * @param {Array} [argPos] The argument positions of the new function.\n * @param {number} [ary] The arity cap of `func`.\n * @param {number} [arity] The arity of `func`.\n * @returns {Function} Returns the new wrapped function.\n */\n function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {\n var isBindKey = bitmask & WRAP_BIND_KEY_FLAG;\n if (!isBindKey && typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var length = partials ? partials.length : 0;\n if (!length) {\n bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);\n partials = holders = undefined;\n }\n ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0);\n arity = arity === undefined ? arity : toInteger(arity);\n length -= holders ? holders.length : 0;\n\n if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {\n var partialsRight = partials,\n holdersRight = holders;\n\n partials = holders = undefined;\n }\n var data = isBindKey ? undefined : getData(func);\n\n var newData = [\n func, bitmask, thisArg, partials, holders, partialsRight, holdersRight,\n argPos, ary, arity\n ];\n\n if (data) {\n mergeData(newData, data);\n }\n func = newData[0];\n bitmask = newData[1];\n thisArg = newData[2];\n partials = newData[3];\n holders = newData[4];\n arity = newData[9] = newData[9] === undefined\n ? (isBindKey ? 0 : func.length)\n : nativeMax(newData[9] - length, 0);\n\n if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {\n bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);\n }\n if (!bitmask || bitmask == WRAP_BIND_FLAG) {\n var result = createBind(func, bitmask, thisArg);\n } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) {\n result = createCurry(func, bitmask, arity);\n } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) {\n result = createPartial(func, bitmask, thisArg, partials);\n } else {\n result = createHybrid.apply(undefined, newData);\n }\n var setter = data ? baseSetData : setData;\n return setWrapToString(setter(result, newData), func, bitmask);\n }\n\n /**\n * Used by `_.defaults` to customize its `_.assignIn` use to assign properties\n * of source objects to the destination object for all destination properties\n * that resolve to `undefined`.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to assign.\n * @param {Object} object The parent object of `objValue`.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsAssignIn(objValue, srcValue, key, object) {\n if (objValue === undefined ||\n (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n return srcValue;\n }\n return objValue;\n }\n\n /**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\n function customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n }\n\n /**\n * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain\n * objects.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {string} key The key of the property to inspect.\n * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`.\n */\n function customOmitClone(value) {\n return isPlainObject(value) ? undefined : value;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\n function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(array);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n }\n\n /**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\n function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked && stack.get(other)) {\n return stacked == other;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n }\n\n /**\n * A specialized version of `baseRest` which flattens the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @returns {Function} Returns the new function.\n */\n function flatRest(func) {\n return setToString(overRest(func, undefined, flatten), func + '');\n }\n\n /**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n }\n\n /**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\n function getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n }\n\n /**\n * Gets metadata for `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {*} Returns the metadata for `func`.\n */\n var getData = !metaMap ? noop : function(func) {\n return metaMap.get(func);\n };\n\n /**\n * Gets the name of `func`.\n *\n * @private\n * @param {Function} func The function to query.\n * @returns {string} Returns the function name.\n */\n function getFuncName(func) {\n var result = (func.name + ''),\n array = realNames[result],\n length = hasOwnProperty.call(realNames, result) ? array.length : 0;\n\n while (length--) {\n var data = array[length],\n otherFunc = data.func;\n if (otherFunc == null || otherFunc == func) {\n return data.name;\n }\n }\n return result;\n }\n\n /**\n * Gets the argument placeholder value for `func`.\n *\n * @private\n * @param {Function} func The function to inspect.\n * @returns {*} Returns the placeholder value.\n */\n function getHolder(func) {\n var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func;\n return object.placeholder;\n }\n\n /**\n * Gets the appropriate \"iteratee\" function. If `_.iteratee` is customized,\n * this function returns the custom method, otherwise it returns `baseIteratee`.\n * If arguments are provided, the chosen function is invoked with them and\n * its result is returned.\n *\n * @private\n * @param {*} [value] The value to convert to an iteratee.\n * @param {number} [arity] The arity of the created iteratee.\n * @returns {Function} Returns the chosen function or its result.\n */\n function getIteratee() {\n var result = lodash.iteratee || iteratee;\n result = result === iteratee ? baseIteratee : result;\n return arguments.length ? result(arguments[0], arguments[1]) : result;\n }\n\n /**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\n function getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n }\n\n /**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\n function getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n }\n\n /**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\n function getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n }\n\n /**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\n function getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n }\n\n /**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n };\n\n /**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\n var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n };\n\n /**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\n var getTag = baseGetTag;\n\n // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\n if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n }\n\n /**\n * Gets the view, applying any `transforms` to the `start` and `end` positions.\n *\n * @private\n * @param {number} start The start of the view.\n * @param {number} end The end of the view.\n * @param {Array} transforms The transformations to apply to the view.\n * @returns {Object} Returns an object containing the `start` and `end`\n * positions of the view.\n */\n function getView(start, end, transforms) {\n var index = -1,\n length = transforms.length;\n\n while (++index < length) {\n var data = transforms[index],\n size = data.size;\n\n switch (data.type) {\n case 'drop': start += size; break;\n case 'dropRight': end -= size; break;\n case 'take': end = nativeMin(end, start + size); break;\n case 'takeRight': start = nativeMax(start, end - size); break;\n }\n }\n return { 'start': start, 'end': end };\n }\n\n /**\n * Extracts wrapper details from the `source` body comment.\n *\n * @private\n * @param {string} source The source to inspect.\n * @returns {Array} Returns the wrapper details.\n */\n function getWrapDetails(source) {\n var match = source.match(reWrapDetails);\n return match ? match[1].split(reSplitDetails) : [];\n }\n\n /**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\n function hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n }\n\n /**\n * Initializes an array clone.\n *\n * @private\n * @param {Array} array The array to clone.\n * @returns {Array} Returns the initialized clone.\n */\n function initCloneArray(array) {\n var length = array.length,\n result = new array.constructor(length);\n\n // Add properties assigned by `RegExp#exec`.\n if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {\n result.index = array.index;\n result.input = array.input;\n }\n return result;\n }\n\n /**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n }\n\n /**\n * Initializes an object clone based on its `toStringTag`.\n *\n * **Note:** This function only supports cloning values with tags of\n * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.\n *\n * @private\n * @param {Object} object The object to clone.\n * @param {string} tag The `toStringTag` of the object to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the initialized clone.\n */\n function initCloneByTag(object, tag, isDeep) {\n var Ctor = object.constructor;\n switch (tag) {\n case arrayBufferTag:\n return cloneArrayBuffer(object);\n\n case boolTag:\n case dateTag:\n return new Ctor(+object);\n\n case dataViewTag:\n return cloneDataView(object, isDeep);\n\n case float32Tag: case float64Tag:\n case int8Tag: case int16Tag: case int32Tag:\n case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag:\n return cloneTypedArray(object, isDeep);\n\n case mapTag:\n return new Ctor;\n\n case numberTag:\n case stringTag:\n return new Ctor(object);\n\n case regexpTag:\n return cloneRegExp(object);\n\n case setTag:\n return new Ctor;\n\n case symbolTag:\n return cloneSymbol(object);\n }\n }\n\n /**\n * Inserts wrapper `details` in a comment at the top of the `source` body.\n *\n * @private\n * @param {string} source The source to modify.\n * @returns {Array} details The details to insert.\n * @returns {string} Returns the modified source.\n */\n function insertWrapDetails(source, details) {\n var length = details.length;\n if (!length) {\n return source;\n }\n var lastIndex = length - 1;\n details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex];\n details = details.join(length > 2 ? ', ' : ' ');\n return source.replace(reWrapComment, '{\\n/* [wrapped with ' + details + '] */\\n');\n }\n\n /**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\n function isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n }\n\n /**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\n function isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n }\n\n /**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\n function isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n }\n\n /**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\n function isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n }\n\n /**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\n function isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n }\n\n /**\n * Checks if `func` has a lazy counterpart.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` has a lazy counterpart,\n * else `false`.\n */\n function isLaziable(func) {\n var funcName = getFuncName(func),\n other = lodash[funcName];\n\n if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {\n return false;\n }\n if (func === other) {\n return true;\n }\n var data = getData(other);\n return !!data && func === data[0];\n }\n\n /**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\n function isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n }\n\n /**\n * Checks if `func` is capable of being masked.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `func` is maskable, else `false`.\n */\n var isMaskable = coreJsData ? isFunction : stubFalse;\n\n /**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\n function isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n }\n\n /**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\n function isStrictComparable(value) {\n return value === value && !isObject(value);\n }\n\n /**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\n function matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n }\n\n /**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\n function memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n }\n\n /**\n * Merges the function metadata of `source` into `data`.\n *\n * Merging metadata reduces the number of wrappers used to invoke a function.\n * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`\n * may be applied regardless of execution order. Methods like `_.ary` and\n * `_.rearg` modify function arguments, making the order in which they are\n * executed important, preventing the merging of metadata. However, we make\n * an exception for a safe combined case where curried functions have `_.ary`\n * and or `_.rearg` applied.\n *\n * @private\n * @param {Array} data The destination metadata.\n * @param {Array} source The source metadata.\n * @returns {Array} Returns `data`.\n */\n function mergeData(data, source) {\n var bitmask = data[1],\n srcBitmask = source[1],\n newBitmask = bitmask | srcBitmask,\n isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG);\n\n var isCombo =\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) ||\n ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) ||\n ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG));\n\n // Exit early if metadata can't be merged.\n if (!(isCommon || isCombo)) {\n return data;\n }\n // Use source `thisArg` if available.\n if (srcBitmask & WRAP_BIND_FLAG) {\n data[2] = source[2];\n // Set when currying a bound function.\n newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG;\n }\n // Compose partial arguments.\n var value = source[3];\n if (value) {\n var partials = data[3];\n data[3] = partials ? composeArgs(partials, value, source[4]) : value;\n data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4];\n }\n // Compose partial right arguments.\n value = source[5];\n if (value) {\n partials = data[5];\n data[5] = partials ? composeArgsRight(partials, value, source[6]) : value;\n data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6];\n }\n // Use source `argPos` if available.\n value = source[7];\n if (value) {\n data[7] = value;\n }\n // Use source `ary` if it's smaller.\n if (srcBitmask & WRAP_ARY_FLAG) {\n data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);\n }\n // Use source `arity` if one is not provided.\n if (data[9] == null) {\n data[9] = source[9];\n }\n // Use source `func` and merge bitmasks.\n data[0] = source[0];\n data[1] = newBitmask;\n\n return data;\n }\n\n /**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\n function nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n }\n\n /**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\n function objectToString(value) {\n return nativeObjectToString.call(value);\n }\n\n /**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\n function overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n }\n\n /**\n * Gets the parent value at `path` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array} path The path to get the parent value of.\n * @returns {*} Returns the parent value.\n */\n function parent(object, path) {\n return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));\n }\n\n /**\n * Reorder `array` according to the specified indexes where the element at\n * the first index is assigned as the first element, the element at\n * the second index is assigned as the second element, and so on.\n *\n * @private\n * @param {Array} array The array to reorder.\n * @param {Array} indexes The arranged array indexes.\n * @returns {Array} Returns `array`.\n */\n function reorder(array, indexes) {\n var arrLength = array.length,\n length = nativeMin(indexes.length, arrLength),\n oldArray = copyArray(array);\n\n while (length--) {\n var index = indexes[length];\n array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;\n }\n return array;\n }\n\n /**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\n function safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n }\n\n /**\n * Sets metadata for `func`.\n *\n * **Note:** If this function becomes hot, i.e. is invoked a lot in a short\n * period of time, it will trip its breaker and transition to an identity\n * function to avoid garbage collection pauses in V8. See\n * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070)\n * for more details.\n *\n * @private\n * @param {Function} func The function to associate metadata with.\n * @param {*} data The metadata.\n * @returns {Function} Returns `func`.\n */\n var setData = shortOut(baseSetData);\n\n /**\n * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout).\n *\n * @private\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @returns {number|Object} Returns the timer id or timeout object.\n */\n var setTimeout = ctxSetTimeout || function(func, wait) {\n return root.setTimeout(func, wait);\n };\n\n /**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\n var setToString = shortOut(baseSetToString);\n\n /**\n * Sets the `toString` method of `wrapper` to mimic the source of `reference`\n * with wrapper details in a comment at the top of the source body.\n *\n * @private\n * @param {Function} wrapper The function to modify.\n * @param {Function} reference The reference function.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Function} Returns `wrapper`.\n */\n function setWrapToString(wrapper, reference, bitmask) {\n var source = (reference + '');\n return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask)));\n }\n\n /**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\n function shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n }\n\n /**\n * A specialized version of `_.shuffle` which mutates and sets the size of `array`.\n *\n * @private\n * @param {Array} array The array to shuffle.\n * @param {number} [size=array.length] The size of `array`.\n * @returns {Array} Returns `array`.\n */\n function shuffleSelf(array, size) {\n var index = -1,\n length = array.length,\n lastIndex = length - 1;\n\n size = size === undefined ? length : size;\n while (++index < size) {\n var rand = baseRandom(index, lastIndex),\n value = array[rand];\n\n array[rand] = array[index];\n array[index] = value;\n }\n array.length = size;\n return array;\n }\n\n /**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\n var stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n });\n\n /**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\n function toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n }\n\n /**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\n function toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n }\n\n /**\n * Updates wrapper `details` based on `bitmask` flags.\n *\n * @private\n * @returns {Array} details The details to modify.\n * @param {number} bitmask The bitmask flags. See `createWrap` for more details.\n * @returns {Array} Returns `details`.\n */\n function updateWrapDetails(details, bitmask) {\n arrayEach(wrapFlags, function(pair) {\n var value = '_.' + pair[0];\n if ((bitmask & pair[1]) && !arrayIncludes(details, value)) {\n details.push(value);\n }\n });\n return details.sort();\n }\n\n /**\n * Creates a clone of `wrapper`.\n *\n * @private\n * @param {Object} wrapper The wrapper to clone.\n * @returns {Object} Returns the cloned wrapper.\n */\n function wrapperClone(wrapper) {\n if (wrapper instanceof LazyWrapper) {\n return wrapper.clone();\n }\n var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__);\n result.__actions__ = copyArray(wrapper.__actions__);\n result.__index__ = wrapper.__index__;\n result.__values__ = wrapper.__values__;\n return result;\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an array of elements split into groups the length of `size`.\n * If `array` can't be split evenly, the final chunk will be the remaining\n * elements.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to process.\n * @param {number} [size=1] The length of each chunk\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the new array of chunks.\n * @example\n *\n * _.chunk(['a', 'b', 'c', 'd'], 2);\n * // => [['a', 'b'], ['c', 'd']]\n *\n * _.chunk(['a', 'b', 'c', 'd'], 3);\n * // => [['a', 'b', 'c'], ['d']]\n */\n function chunk(array, size, guard) {\n if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) {\n size = 1;\n } else {\n size = nativeMax(toInteger(size), 0);\n }\n var length = array == null ? 0 : array.length;\n if (!length || size < 1) {\n return [];\n }\n var index = 0,\n resIndex = 0,\n result = Array(nativeCeil(length / size));\n\n while (index < length) {\n result[resIndex++] = baseSlice(array, index, (index += size));\n }\n return result;\n }\n\n /**\n * Creates an array with all falsey values removed. The values `false`, `null`,\n * `0`, `\"\"`, `undefined`, and `NaN` are falsey.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to compact.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.compact([0, 1, false, 2, '', 3]);\n * // => [1, 2, 3]\n */\n function compact(array) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (value) {\n result[resIndex++] = value;\n }\n }\n return result;\n }\n\n /**\n * Creates a new array concatenating `array` with any additional arrays\n * and/or values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to concatenate.\n * @param {...*} [values] The values to concatenate.\n * @returns {Array} Returns the new concatenated array.\n * @example\n *\n * var array = [1];\n * var other = _.concat(array, 2, [3], [[4]]);\n *\n * console.log(other);\n * // => [1, 2, 3, [4]]\n *\n * console.log(array);\n * // => [1]\n */\n function concat() {\n var length = arguments.length;\n if (!length) {\n return [];\n }\n var args = Array(length - 1),\n array = arguments[0],\n index = length;\n\n while (index--) {\n args[index - 1] = arguments[index];\n }\n return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1));\n }\n\n /**\n * Creates an array of `array` values not included in the other given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * **Note:** Unlike `_.pullAll`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.without, _.xor\n * @example\n *\n * _.difference([2, 1], [2, 3]);\n * // => [1]\n */\n var difference = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `iteratee` which\n * is invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * **Note:** Unlike `_.pullAllBy`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var differenceBy = baseRest(function(array, values) {\n var iteratee = last(values);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.difference` except that it accepts `comparator`\n * which is invoked to compare elements of `array` to `values`. The order and\n * references of result values are determined by the first array. The comparator\n * is invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.pullAllWith`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...Array} [values] The values to exclude.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n *\n * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }]\n */\n var differenceWith = baseRest(function(array, values) {\n var comparator = last(values);\n if (isArrayLikeObject(comparator)) {\n comparator = undefined;\n }\n return isArrayLikeObject(array)\n ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator)\n : [];\n });\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.drop([1, 2, 3]);\n * // => [2, 3]\n *\n * _.drop([1, 2, 3], 2);\n * // => [3]\n *\n * _.drop([1, 2, 3], 5);\n * // => []\n *\n * _.drop([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function drop(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with `n` elements dropped from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to drop.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.dropRight([1, 2, 3]);\n * // => [1, 2]\n *\n * _.dropRight([1, 2, 3], 2);\n * // => [1]\n *\n * _.dropRight([1, 2, 3], 5);\n * // => []\n *\n * _.dropRight([1, 2, 3], 0);\n * // => [1, 2, 3]\n */\n function dropRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the end.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.dropRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropRightWhile(users, ['active', false]);\n * // => objects for ['barney']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropRightWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` excluding elements dropped from the beginning.\n * Elements are dropped until `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.dropWhile(users, function(o) { return !o.active; });\n * // => objects for ['pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.dropWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.dropWhile(users, ['active', false]);\n * // => objects for ['pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.dropWhile(users, 'active');\n * // => objects for ['barney', 'fred', 'pebbles']\n */\n function dropWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), true)\n : [];\n }\n\n /**\n * Fills elements of `array` with `value` from `start` up to, but not\n * including, `end`.\n *\n * **Note:** This method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Array\n * @param {Array} array The array to fill.\n * @param {*} value The value to fill `array` with.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.fill(array, 'a');\n * console.log(array);\n * // => ['a', 'a', 'a']\n *\n * _.fill(Array(3), 2);\n * // => [2, 2, 2]\n *\n * _.fill([4, 6, 8, 10], '*', 1, 3);\n * // => [4, '*', '*', 10]\n */\n function fill(array, value, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {\n start = 0;\n end = length;\n }\n return baseFill(array, value, start, end);\n }\n\n /**\n * This method is like `_.find` except that it returns the index of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.findIndex(users, function(o) { return o.user == 'barney'; });\n * // => 0\n *\n * // The `_.matches` iteratee shorthand.\n * _.findIndex(users, { 'user': 'fred', 'active': false });\n * // => 1\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findIndex(users, ['active', false]);\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.findIndex(users, 'active');\n * // => 2\n */\n function findIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index);\n }\n\n /**\n * This method is like `_.findIndex` except that it iterates over elements\n * of `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the found element, else `-1`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; });\n * // => 2\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastIndex(users, { 'user': 'barney', 'active': true });\n * // => 0\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastIndex(users, ['active', false]);\n * // => 2\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastIndex(users, 'active');\n * // => 0\n */\n function findLastIndex(array, predicate, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length - 1;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = fromIndex < 0\n ? nativeMax(length + index, 0)\n : nativeMin(index, length - 1);\n }\n return baseFindIndex(array, getIteratee(predicate, 3), index, true);\n }\n\n /**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\n function flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n }\n\n /**\n * Recursively flattens `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flattenDeep([1, [2, [3, [4]], 5]]);\n * // => [1, 2, 3, 4, 5]\n */\n function flattenDeep(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, INFINITY) : [];\n }\n\n /**\n * Recursively flatten `array` up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * var array = [1, [2, [3, [4]], 5]];\n *\n * _.flattenDepth(array, 1);\n * // => [1, 2, [3, [4]], 5]\n *\n * _.flattenDepth(array, 2);\n * // => [1, 2, 3, [4], 5]\n */\n function flattenDepth(array, depth) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(array, depth);\n }\n\n /**\n * The inverse of `_.toPairs`; this method returns an object composed\n * from key-value `pairs`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} pairs The key-value pairs.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.fromPairs([['a', 1], ['b', 2]]);\n * // => { 'a': 1, 'b': 2 }\n */\n function fromPairs(pairs) {\n var index = -1,\n length = pairs == null ? 0 : pairs.length,\n result = {};\n\n while (++index < length) {\n var pair = pairs[index];\n result[pair[0]] = pair[1];\n }\n return result;\n }\n\n /**\n * Gets the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias first\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the first element of `array`.\n * @example\n *\n * _.head([1, 2, 3]);\n * // => 1\n *\n * _.head([]);\n * // => undefined\n */\n function head(array) {\n return (array && array.length) ? array[0] : undefined;\n }\n\n /**\n * Gets the index at which the first occurrence of `value` is found in `array`\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. If `fromIndex` is negative, it's used as the\n * offset from the end of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.indexOf([1, 2, 1, 2], 2);\n * // => 1\n *\n * // Search from the `fromIndex`.\n * _.indexOf([1, 2, 1, 2], 2, 2);\n * // => 3\n */\n function indexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = fromIndex == null ? 0 : toInteger(fromIndex);\n if (index < 0) {\n index = nativeMax(length + index, 0);\n }\n return baseIndexOf(array, value, index);\n }\n\n /**\n * Gets all but the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.initial([1, 2, 3]);\n * // => [1, 2]\n */\n function initial(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 0, -1) : [];\n }\n\n /**\n * Creates an array of unique values that are included in all given arrays\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons. The order and references of result values are\n * determined by the first array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersection([2, 1], [2, 3]);\n * // => [2]\n */\n var intersection = baseRest(function(arrays) {\n var mapped = arrayMap(arrays, castArrayLikeObject);\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped)\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `iteratee`\n * which is invoked for each element of each `arrays` to generate the criterion\n * by which they're compared. The order and references of result values are\n * determined by the first array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [2.1]\n *\n * // The `_.property` iteratee shorthand.\n * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }]\n */\n var intersectionBy = baseRest(function(arrays) {\n var iteratee = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n if (iteratee === last(mapped)) {\n iteratee = undefined;\n } else {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, getIteratee(iteratee, 2))\n : [];\n });\n\n /**\n * This method is like `_.intersection` except that it accepts `comparator`\n * which is invoked to compare elements of `arrays`. The order and references\n * of result values are determined by the first array. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of intersecting values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.intersectionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }]\n */\n var intersectionWith = baseRest(function(arrays) {\n var comparator = last(arrays),\n mapped = arrayMap(arrays, castArrayLikeObject);\n\n comparator = typeof comparator == 'function' ? comparator : undefined;\n if (comparator) {\n mapped.pop();\n }\n return (mapped.length && mapped[0] === arrays[0])\n ? baseIntersection(mapped, undefined, comparator)\n : [];\n });\n\n /**\n * Converts all elements in `array` into a string separated by `separator`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to convert.\n * @param {string} [separator=','] The element separator.\n * @returns {string} Returns the joined string.\n * @example\n *\n * _.join(['a', 'b', 'c'], '~');\n * // => 'a~b~c'\n */\n function join(array, separator) {\n return array == null ? '' : nativeJoin.call(array, separator);\n }\n\n /**\n * Gets the last element of `array`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {*} Returns the last element of `array`.\n * @example\n *\n * _.last([1, 2, 3]);\n * // => 3\n */\n function last(array) {\n var length = array == null ? 0 : array.length;\n return length ? array[length - 1] : undefined;\n }\n\n /**\n * This method is like `_.indexOf` except that it iterates over elements of\n * `array` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=array.length-1] The index to search from.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.lastIndexOf([1, 2, 1, 2], 2);\n * // => 3\n *\n * // Search from the `fromIndex`.\n * _.lastIndexOf([1, 2, 1, 2], 2, 2);\n * // => 1\n */\n function lastIndexOf(array, value, fromIndex) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return -1;\n }\n var index = length;\n if (fromIndex !== undefined) {\n index = toInteger(fromIndex);\n index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1);\n }\n return value === value\n ? strictLastIndexOf(array, value, index)\n : baseFindIndex(array, baseIsNaN, index, true);\n }\n\n /**\n * Gets the element at index `n` of `array`. If `n` is negative, the nth\n * element from the end is returned.\n *\n * @static\n * @memberOf _\n * @since 4.11.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=0] The index of the element to return.\n * @returns {*} Returns the nth element of `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n *\n * _.nth(array, 1);\n * // => 'b'\n *\n * _.nth(array, -2);\n * // => 'c';\n */\n function nth(array, n) {\n return (array && array.length) ? baseNth(array, toInteger(n)) : undefined;\n }\n\n /**\n * Removes all given values from `array` using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove`\n * to remove elements from an array by predicate.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...*} [values] The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pull(array, 'a', 'c');\n * console.log(array);\n * // => ['b', 'b']\n */\n var pull = baseRest(pullAll);\n\n /**\n * This method is like `_.pull` except that it accepts an array of values to remove.\n *\n * **Note:** Unlike `_.difference`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = ['a', 'b', 'c', 'a', 'b', 'c'];\n *\n * _.pullAll(array, ['a', 'c']);\n * console.log(array);\n * // => ['b', 'b']\n */\n function pullAll(array, values) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values)\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `iteratee` which is\n * invoked for each element of `array` and `values` to generate the criterion\n * by which they're compared. The iteratee is invoked with one argument: (value).\n *\n * **Note:** Unlike `_.differenceBy`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }];\n *\n * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x');\n * console.log(array);\n * // => [{ 'x': 2 }]\n */\n function pullAllBy(array, values, iteratee) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, getIteratee(iteratee, 2))\n : array;\n }\n\n /**\n * This method is like `_.pullAll` except that it accepts `comparator` which\n * is invoked to compare elements of `array` to `values`. The comparator is\n * invoked with two arguments: (arrVal, othVal).\n *\n * **Note:** Unlike `_.differenceWith`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Array} values The values to remove.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }];\n *\n * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual);\n * console.log(array);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }]\n */\n function pullAllWith(array, values, comparator) {\n return (array && array.length && values && values.length)\n ? basePullAll(array, values, undefined, comparator)\n : array;\n }\n\n /**\n * Removes elements from `array` corresponding to `indexes` and returns an\n * array of removed elements.\n *\n * **Note:** Unlike `_.at`, this method mutates `array`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {...(number|number[])} [indexes] The indexes of elements to remove.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = ['a', 'b', 'c', 'd'];\n * var pulled = _.pullAt(array, [1, 3]);\n *\n * console.log(array);\n * // => ['a', 'c']\n *\n * console.log(pulled);\n * // => ['b', 'd']\n */\n var pullAt = flatRest(function(array, indexes) {\n var length = array == null ? 0 : array.length,\n result = baseAt(array, indexes);\n\n basePullAt(array, arrayMap(indexes, function(index) {\n return isIndex(index, length) ? +index : index;\n }).sort(compareAscending));\n\n return result;\n });\n\n /**\n * Removes all elements from `array` that `predicate` returns truthy for\n * and returns an array of the removed elements. The predicate is invoked\n * with three arguments: (value, index, array).\n *\n * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull`\n * to pull elements from an array by value.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new array of removed elements.\n * @example\n *\n * var array = [1, 2, 3, 4];\n * var evens = _.remove(array, function(n) {\n * return n % 2 == 0;\n * });\n *\n * console.log(array);\n * // => [1, 3]\n *\n * console.log(evens);\n * // => [2, 4]\n */\n function remove(array, predicate) {\n var result = [];\n if (!(array && array.length)) {\n return result;\n }\n var index = -1,\n indexes = [],\n length = array.length;\n\n predicate = getIteratee(predicate, 3);\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result.push(value);\n indexes.push(index);\n }\n }\n basePullAt(array, indexes);\n return result;\n }\n\n /**\n * Reverses `array` so that the first element becomes the last, the second\n * element becomes the second to last, and so on.\n *\n * **Note:** This method mutates `array` and is based on\n * [`Array#reverse`](https://mdn.io/Array/reverse).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to modify.\n * @returns {Array} Returns `array`.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _.reverse(array);\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function reverse(array) {\n return array == null ? array : nativeReverse.call(array);\n }\n\n /**\n * Creates a slice of `array` from `start` up to, but not including, `end`.\n *\n * **Note:** This method is used instead of\n * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are\n * returned.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to slice.\n * @param {number} [start=0] The start position.\n * @param {number} [end=array.length] The end position.\n * @returns {Array} Returns the slice of `array`.\n */\n function slice(array, start, end) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {\n start = 0;\n end = length;\n }\n else {\n start = start == null ? 0 : toInteger(start);\n end = end === undefined ? length : toInteger(end);\n }\n return baseSlice(array, start, end);\n }\n\n /**\n * Uses a binary search to determine the lowest index at which `value`\n * should be inserted into `array` in order to maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedIndex([30, 50], 40);\n * // => 1\n */\n function sortedIndex(array, value) {\n return baseSortedIndex(array, value);\n }\n\n /**\n * This method is like `_.sortedIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 0\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedIndexBy(objects, { 'x': 4 }, 'x');\n * // => 0\n */\n function sortedIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2));\n }\n\n /**\n * This method is like `_.indexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedIndexOf([4, 5, 5, 5, 6], 5);\n * // => 1\n */\n function sortedIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value);\n if (index < length && eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.sortedIndex` except that it returns the highest\n * index at which `value` should be inserted into `array` in order to\n * maintain its sort order.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * _.sortedLastIndex([4, 5, 5, 5, 6], 5);\n * // => 4\n */\n function sortedLastIndex(array, value) {\n return baseSortedIndex(array, value, true);\n }\n\n /**\n * This method is like `_.sortedLastIndex` except that it accepts `iteratee`\n * which is invoked for `value` and each element of `array` to compute their\n * sort ranking. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The sorted array to inspect.\n * @param {*} value The value to evaluate.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {number} Returns the index at which `value` should be inserted\n * into `array`.\n * @example\n *\n * var objects = [{ 'x': 4 }, { 'x': 5 }];\n *\n * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; });\n * // => 1\n *\n * // The `_.property` iteratee shorthand.\n * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x');\n * // => 1\n */\n function sortedLastIndexBy(array, value, iteratee) {\n return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true);\n }\n\n /**\n * This method is like `_.lastIndexOf` except that it performs a binary\n * search on a sorted `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {*} value The value to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n * @example\n *\n * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5);\n * // => 3\n */\n function sortedLastIndexOf(array, value) {\n var length = array == null ? 0 : array.length;\n if (length) {\n var index = baseSortedIndex(array, value, true) - 1;\n if (eq(array[index], value)) {\n return index;\n }\n }\n return -1;\n }\n\n /**\n * This method is like `_.uniq` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniq([1, 1, 2]);\n * // => [1, 2]\n */\n function sortedUniq(array) {\n return (array && array.length)\n ? baseSortedUniq(array)\n : [];\n }\n\n /**\n * This method is like `_.uniqBy` except that it's designed and optimized\n * for sorted arrays.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor);\n * // => [1.1, 2.3]\n */\n function sortedUniqBy(array, iteratee) {\n return (array && array.length)\n ? baseSortedUniq(array, getIteratee(iteratee, 2))\n : [];\n }\n\n /**\n * Gets all but the first element of `array`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.tail([1, 2, 3]);\n * // => [2, 3]\n */\n function tail(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseSlice(array, 1, length) : [];\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the beginning.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.take([1, 2, 3]);\n * // => [1]\n *\n * _.take([1, 2, 3], 2);\n * // => [1, 2]\n *\n * _.take([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.take([1, 2, 3], 0);\n * // => []\n */\n function take(array, n, guard) {\n if (!(array && array.length)) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n return baseSlice(array, 0, n < 0 ? 0 : n);\n }\n\n /**\n * Creates a slice of `array` with `n` elements taken from the end.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {number} [n=1] The number of elements to take.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * _.takeRight([1, 2, 3]);\n * // => [3]\n *\n * _.takeRight([1, 2, 3], 2);\n * // => [2, 3]\n *\n * _.takeRight([1, 2, 3], 5);\n * // => [1, 2, 3]\n *\n * _.takeRight([1, 2, 3], 0);\n * // => []\n */\n function takeRight(array, n, guard) {\n var length = array == null ? 0 : array.length;\n if (!length) {\n return [];\n }\n n = (guard || n === undefined) ? 1 : toInteger(n);\n n = length - n;\n return baseSlice(array, n < 0 ? 0 : n, length);\n }\n\n /**\n * Creates a slice of `array` with elements taken from the end. Elements are\n * taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': false }\n * ];\n *\n * _.takeRightWhile(users, function(o) { return !o.active; });\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false });\n * // => objects for ['pebbles']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeRightWhile(users, ['active', false]);\n * // => objects for ['fred', 'pebbles']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeRightWhile(users, 'active');\n * // => []\n */\n function takeRightWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3), false, true)\n : [];\n }\n\n /**\n * Creates a slice of `array` with elements taken from the beginning. Elements\n * are taken until `predicate` returns falsey. The predicate is invoked with\n * three arguments: (value, index, array).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Array\n * @param {Array} array The array to query.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the slice of `array`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'active': false },\n * { 'user': 'fred', 'active': false },\n * { 'user': 'pebbles', 'active': true }\n * ];\n *\n * _.takeWhile(users, function(o) { return !o.active; });\n * // => objects for ['barney', 'fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.takeWhile(users, { 'user': 'barney', 'active': false });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.takeWhile(users, ['active', false]);\n * // => objects for ['barney', 'fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.takeWhile(users, 'active');\n * // => []\n */\n function takeWhile(array, predicate) {\n return (array && array.length)\n ? baseWhile(array, getIteratee(predicate, 3))\n : [];\n }\n\n /**\n * Creates an array of unique values, in order, from all given arrays using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.union([2], [1, 2]);\n * // => [2, 1]\n */\n var union = baseRest(function(arrays) {\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true));\n });\n\n /**\n * This method is like `_.union` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which uniqueness is computed. Result values are chosen from the first\n * array in which the value occurs. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * _.unionBy([2.1], [1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n var unionBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.union` except that it accepts `comparator` which\n * is invoked to compare elements of `arrays`. Result values are chosen from\n * the first array in which the value occurs. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of combined values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.unionWith(objects, others, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var unionWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator);\n });\n\n /**\n * Creates a duplicate-free version of an array, using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons, in which only the first occurrence of each element\n * is kept. The order of result values is determined by the order they occur\n * in the array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniq([2, 1, 2]);\n * // => [2, 1]\n */\n function uniq(array) {\n return (array && array.length) ? baseUniq(array) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `iteratee` which is\n * invoked for each element in `array` to generate the criterion by which\n * uniqueness is computed. The order of result values is determined by the\n * order they occur in the array. The iteratee is invoked with one argument:\n * (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * _.uniqBy([2.1, 1.2, 2.3], Math.floor);\n * // => [2.1, 1.2]\n *\n * // The `_.property` iteratee shorthand.\n * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 1 }, { 'x': 2 }]\n */\n function uniqBy(array, iteratee) {\n return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : [];\n }\n\n /**\n * This method is like `_.uniq` except that it accepts `comparator` which\n * is invoked to compare elements of `array`. The order of result values is\n * determined by the order they occur in the array.The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new duplicate free array.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.uniqWith(objects, _.isEqual);\n * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]\n */\n function uniqWith(array, comparator) {\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return (array && array.length) ? baseUniq(array, undefined, comparator) : [];\n }\n\n /**\n * This method is like `_.zip` except that it accepts an array of grouped\n * elements and creates an array regrouping the elements to their pre-zip\n * configuration.\n *\n * @static\n * @memberOf _\n * @since 1.2.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n *\n * _.unzip(zipped);\n * // => [['a', 'b'], [1, 2], [true, false]]\n */\n function unzip(array) {\n if (!(array && array.length)) {\n return [];\n }\n var length = 0;\n array = arrayFilter(array, function(group) {\n if (isArrayLikeObject(group)) {\n length = nativeMax(group.length, length);\n return true;\n }\n });\n return baseTimes(length, function(index) {\n return arrayMap(array, baseProperty(index));\n });\n }\n\n /**\n * This method is like `_.unzip` except that it accepts `iteratee` to specify\n * how regrouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {Array} array The array of grouped elements to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * regrouped values.\n * @returns {Array} Returns the new array of regrouped elements.\n * @example\n *\n * var zipped = _.zip([1, 2], [10, 20], [100, 200]);\n * // => [[1, 10, 100], [2, 20, 200]]\n *\n * _.unzipWith(zipped, _.add);\n * // => [3, 30, 300]\n */\n function unzipWith(array, iteratee) {\n if (!(array && array.length)) {\n return [];\n }\n var result = unzip(array);\n if (iteratee == null) {\n return result;\n }\n return arrayMap(result, function(group) {\n return apply(iteratee, undefined, group);\n });\n }\n\n /**\n * Creates an array excluding all given values using\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * **Note:** Unlike `_.pull`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to inspect.\n * @param {...*} [values] The values to exclude.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.xor\n * @example\n *\n * _.without([2, 1, 2, 3], 1, 2);\n * // => [3]\n */\n var without = baseRest(function(array, values) {\n return isArrayLikeObject(array)\n ? baseDifference(array, values)\n : [];\n });\n\n /**\n * Creates an array of unique values that is the\n * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)\n * of the given arrays. The order of result values is determined by the order\n * they occur in the arrays.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @returns {Array} Returns the new array of filtered values.\n * @see _.difference, _.without\n * @example\n *\n * _.xor([2, 1], [2, 3]);\n * // => [1, 3]\n */\n var xor = baseRest(function(arrays) {\n return baseXor(arrayFilter(arrays, isArrayLikeObject));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `iteratee` which is\n * invoked for each element of each `arrays` to generate the criterion by\n * which by which they're compared. The order of result values is determined\n * by the order they occur in the arrays. The iteratee is invoked with one\n * argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor);\n * // => [1.2, 3.4]\n *\n * // The `_.property` iteratee shorthand.\n * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x');\n * // => [{ 'x': 2 }]\n */\n var xorBy = baseRest(function(arrays) {\n var iteratee = last(arrays);\n if (isArrayLikeObject(iteratee)) {\n iteratee = undefined;\n }\n return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2));\n });\n\n /**\n * This method is like `_.xor` except that it accepts `comparator` which is\n * invoked to compare elements of `arrays`. The order of result values is\n * determined by the order they occur in the arrays. The comparator is invoked\n * with two arguments: (arrVal, othVal).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Array\n * @param {...Array} [arrays] The arrays to inspect.\n * @param {Function} [comparator] The comparator invoked per element.\n * @returns {Array} Returns the new array of filtered values.\n * @example\n *\n * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }];\n * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }];\n *\n * _.xorWith(objects, others, _.isEqual);\n * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }]\n */\n var xorWith = baseRest(function(arrays) {\n var comparator = last(arrays);\n comparator = typeof comparator == 'function' ? comparator : undefined;\n return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator);\n });\n\n /**\n * Creates an array of grouped elements, the first of which contains the\n * first elements of the given arrays, the second of which contains the\n * second elements of the given arrays, and so on.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zip(['a', 'b'], [1, 2], [true, false]);\n * // => [['a', 1, true], ['b', 2, false]]\n */\n var zip = baseRest(unzip);\n\n /**\n * This method is like `_.fromPairs` except that it accepts two arrays,\n * one of property identifiers and one of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 0.4.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObject(['a', 'b'], [1, 2]);\n * // => { 'a': 1, 'b': 2 }\n */\n function zipObject(props, values) {\n return baseZipObject(props || [], values || [], assignValue);\n }\n\n /**\n * This method is like `_.zipObject` except that it supports property paths.\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Array\n * @param {Array} [props=[]] The property identifiers.\n * @param {Array} [values=[]] The property values.\n * @returns {Object} Returns the new object.\n * @example\n *\n * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]);\n * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } }\n */\n function zipObjectDeep(props, values) {\n return baseZipObject(props || [], values || [], baseSet);\n }\n\n /**\n * This method is like `_.zip` except that it accepts `iteratee` to specify\n * how grouped values should be combined. The iteratee is invoked with the\n * elements of each group: (...group).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Array\n * @param {...Array} [arrays] The arrays to process.\n * @param {Function} [iteratee=_.identity] The function to combine\n * grouped values.\n * @returns {Array} Returns the new array of grouped elements.\n * @example\n *\n * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) {\n * return a + b + c;\n * });\n * // => [111, 222]\n */\n var zipWith = baseRest(function(arrays) {\n var length = arrays.length,\n iteratee = length > 1 ? arrays[length - 1] : undefined;\n\n iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined;\n return unzipWith(arrays, iteratee);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates a `lodash` wrapper instance that wraps `value` with explicit method\n * chain sequences enabled. The result of such sequences must be unwrapped\n * with `_#value`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Seq\n * @param {*} value The value to wrap.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'pebbles', 'age': 1 }\n * ];\n *\n * var youngest = _\n * .chain(users)\n * .sortBy('age')\n * .map(function(o) {\n * return o.user + ' is ' + o.age;\n * })\n * .head()\n * .value();\n * // => 'pebbles is 1'\n */\n function chain(value) {\n var result = lodash(value);\n result.__chain__ = true;\n return result;\n }\n\n /**\n * This method invokes `interceptor` and returns `value`. The interceptor\n * is invoked with one argument; (value). The purpose of this method is to\n * \"tap into\" a method chain sequence in order to modify intermediate results.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns `value`.\n * @example\n *\n * _([1, 2, 3])\n * .tap(function(array) {\n * // Mutate input array.\n * array.pop();\n * })\n * .reverse()\n * .value();\n * // => [2, 1]\n */\n function tap(value, interceptor) {\n interceptor(value);\n return value;\n }\n\n /**\n * This method is like `_.tap` except that it returns the result of `interceptor`.\n * The purpose of this method is to \"pass thru\" values replacing intermediate\n * results in a method chain sequence.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Seq\n * @param {*} value The value to provide to `interceptor`.\n * @param {Function} interceptor The function to invoke.\n * @returns {*} Returns the result of `interceptor`.\n * @example\n *\n * _(' abc ')\n * .chain()\n * .trim()\n * .thru(function(value) {\n * return [value];\n * })\n * .value();\n * // => ['abc']\n */\n function thru(value, interceptor) {\n return interceptor(value);\n }\n\n /**\n * This method is the wrapper version of `_.at`.\n *\n * @name at\n * @memberOf _\n * @since 1.0.0\n * @category Seq\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _(object).at(['a[0].b.c', 'a[1]']).value();\n * // => [3, 4]\n */\n var wrapperAt = flatRest(function(paths) {\n var length = paths.length,\n start = length ? paths[0] : 0,\n value = this.__wrapped__,\n interceptor = function(object) { return baseAt(object, paths); };\n\n if (length > 1 || this.__actions__.length ||\n !(value instanceof LazyWrapper) || !isIndex(start)) {\n return this.thru(interceptor);\n }\n value = value.slice(start, +start + (length ? 1 : 0));\n value.__actions__.push({\n 'func': thru,\n 'args': [interceptor],\n 'thisArg': undefined\n });\n return new LodashWrapper(value, this.__chain__).thru(function(array) {\n if (length && !array.length) {\n array.push(undefined);\n }\n return array;\n });\n });\n\n /**\n * Creates a `lodash` wrapper instance with explicit method chain sequences enabled.\n *\n * @name chain\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 }\n * ];\n *\n * // A sequence without explicit chaining.\n * _(users).head();\n * // => { 'user': 'barney', 'age': 36 }\n *\n * // A sequence with explicit chaining.\n * _(users)\n * .chain()\n * .head()\n * .pick('user')\n * .value();\n * // => { 'user': 'barney' }\n */\n function wrapperChain() {\n return chain(this);\n }\n\n /**\n * Executes the chain sequence and returns the wrapped result.\n *\n * @name commit\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2];\n * var wrapped = _(array).push(3);\n *\n * console.log(array);\n * // => [1, 2]\n *\n * wrapped = wrapped.commit();\n * console.log(array);\n * // => [1, 2, 3]\n *\n * wrapped.last();\n * // => 3\n *\n * console.log(array);\n * // => [1, 2, 3]\n */\n function wrapperCommit() {\n return new LodashWrapper(this.value(), this.__chain__);\n }\n\n /**\n * Gets the next value on a wrapped object following the\n * [iterator protocol](https://mdn.io/iteration_protocols#iterator).\n *\n * @name next\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the next iterator value.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 1 }\n *\n * wrapped.next();\n * // => { 'done': false, 'value': 2 }\n *\n * wrapped.next();\n * // => { 'done': true, 'value': undefined }\n */\n function wrapperNext() {\n if (this.__values__ === undefined) {\n this.__values__ = toArray(this.value());\n }\n var done = this.__index__ >= this.__values__.length,\n value = done ? undefined : this.__values__[this.__index__++];\n\n return { 'done': done, 'value': value };\n }\n\n /**\n * Enables the wrapper to be iterable.\n *\n * @name Symbol.iterator\n * @memberOf _\n * @since 4.0.0\n * @category Seq\n * @returns {Object} Returns the wrapper object.\n * @example\n *\n * var wrapped = _([1, 2]);\n *\n * wrapped[Symbol.iterator]() === wrapped;\n * // => true\n *\n * Array.from(wrapped);\n * // => [1, 2]\n */\n function wrapperToIterator() {\n return this;\n }\n\n /**\n * Creates a clone of the chain sequence planting `value` as the wrapped value.\n *\n * @name plant\n * @memberOf _\n * @since 3.2.0\n * @category Seq\n * @param {*} value The value to plant.\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var wrapped = _([1, 2]).map(square);\n * var other = wrapped.plant([3, 4]);\n *\n * other.value();\n * // => [9, 16]\n *\n * wrapped.value();\n * // => [1, 4]\n */\n function wrapperPlant(value) {\n var result,\n parent = this;\n\n while (parent instanceof baseLodash) {\n var clone = wrapperClone(parent);\n clone.__index__ = 0;\n clone.__values__ = undefined;\n if (result) {\n previous.__wrapped__ = clone;\n } else {\n result = clone;\n }\n var previous = clone;\n parent = parent.__wrapped__;\n }\n previous.__wrapped__ = value;\n return result;\n }\n\n /**\n * This method is the wrapper version of `_.reverse`.\n *\n * **Note:** This method mutates the wrapped array.\n *\n * @name reverse\n * @memberOf _\n * @since 0.1.0\n * @category Seq\n * @returns {Object} Returns the new `lodash` wrapper instance.\n * @example\n *\n * var array = [1, 2, 3];\n *\n * _(array).reverse().value()\n * // => [3, 2, 1]\n *\n * console.log(array);\n * // => [3, 2, 1]\n */\n function wrapperReverse() {\n var value = this.__wrapped__;\n if (value instanceof LazyWrapper) {\n var wrapped = value;\n if (this.__actions__.length) {\n wrapped = new LazyWrapper(this);\n }\n wrapped = wrapped.reverse();\n wrapped.__actions__.push({\n 'func': thru,\n 'args': [reverse],\n 'thisArg': undefined\n });\n return new LodashWrapper(wrapped, this.__chain__);\n }\n return this.thru(reverse);\n }\n\n /**\n * Executes the chain sequence to resolve the unwrapped value.\n *\n * @name value\n * @memberOf _\n * @since 0.1.0\n * @alias toJSON, valueOf\n * @category Seq\n * @returns {*} Returns the resolved unwrapped value.\n * @example\n *\n * _([1, 2, 3]).value();\n * // => [1, 2, 3]\n */\n function wrapperValue() {\n return baseWrapperValue(this.__wrapped__, this.__actions__);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the number of times the key was returned by `iteratee`. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.countBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': 1, '6': 2 }\n *\n * // The `_.property` iteratee shorthand.\n * _.countBy(['one', 'two', 'three'], 'length');\n * // => { '3': 2, '5': 1 }\n */\n var countBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n ++result[key];\n } else {\n baseAssignValue(result, key, 1);\n }\n });\n\n /**\n * Checks if `predicate` returns truthy for **all** elements of `collection`.\n * Iteration is stopped once `predicate` returns falsey. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * **Note:** This method returns `true` for\n * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because\n * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of\n * elements of empty collections.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if all elements pass the predicate check,\n * else `false`.\n * @example\n *\n * _.every([true, 1, null, 'yes'], Boolean);\n * // => false\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.every(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.every(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.every(users, 'active');\n * // => false\n */\n function every(collection, predicate, guard) {\n var func = isArray(collection) ? arrayEvery : baseEvery;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning an array of all elements\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * **Note:** Unlike `_.remove`, this method returns a new array.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.reject\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false }\n * ];\n *\n * _.filter(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.filter(users, { 'age': 36, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.filter(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.filter(users, 'active');\n * // => objects for ['barney']\n */\n function filter(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Iterates over elements of `collection`, returning the first element\n * `predicate` returns truthy for. The predicate is invoked with three\n * arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=0] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': true },\n * { 'user': 'fred', 'age': 40, 'active': false },\n * { 'user': 'pebbles', 'age': 1, 'active': true }\n * ];\n *\n * _.find(users, function(o) { return o.age < 40; });\n * // => object for 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.find(users, { 'age': 1, 'active': true });\n * // => object for 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.find(users, ['active', false]);\n * // => object for 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.find(users, 'active');\n * // => object for 'barney'\n */\n var find = createFind(findIndex);\n\n /**\n * This method is like `_.find` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param {number} [fromIndex=collection.length-1] The index to search from.\n * @returns {*} Returns the matched element, else `undefined`.\n * @example\n *\n * _.findLast([1, 2, 3, 4], function(n) {\n * return n % 2 == 1;\n * });\n * // => 3\n */\n var findLast = createFind(findLastIndex);\n\n /**\n * Creates a flattened array of values by running each element in `collection`\n * thru `iteratee` and flattening the mapped results. The iteratee is invoked\n * with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [n, n];\n * }\n *\n * _.flatMap([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMap(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), 1);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDeep([1, 2], duplicate);\n * // => [1, 1, 2, 2]\n */\n function flatMapDeep(collection, iteratee) {\n return baseFlatten(map(collection, iteratee), INFINITY);\n }\n\n /**\n * This method is like `_.flatMap` except that it recursively flattens the\n * mapped results up to `depth` times.\n *\n * @static\n * @memberOf _\n * @since 4.7.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {number} [depth=1] The maximum recursion depth.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * function duplicate(n) {\n * return [[[n, n]]];\n * }\n *\n * _.flatMapDepth([1, 2], duplicate, 2);\n * // => [[1, 1], [2, 2]]\n */\n function flatMapDepth(collection, iteratee, depth) {\n depth = depth === undefined ? 1 : toInteger(depth);\n return baseFlatten(map(collection, iteratee), depth);\n }\n\n /**\n * Iterates over elements of `collection` and invokes `iteratee` for each element.\n * The iteratee is invoked with three arguments: (value, index|key, collection).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * **Note:** As with other \"Collections\" methods, objects with a \"length\"\n * property are iterated like arrays. To avoid this behavior use `_.forIn`\n * or `_.forOwn` for object iteration.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @alias each\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEachRight\n * @example\n *\n * _.forEach([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `1` then `2`.\n *\n * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forEach(collection, iteratee) {\n var func = isArray(collection) ? arrayEach : baseEach;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forEach` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @alias eachRight\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array|Object} Returns `collection`.\n * @see _.forEach\n * @example\n *\n * _.forEachRight([1, 2], function(value) {\n * console.log(value);\n * });\n * // => Logs `2` then `1`.\n */\n function forEachRight(collection, iteratee) {\n var func = isArray(collection) ? arrayEachRight : baseEachRight;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\n var groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n });\n\n /**\n * Checks if `value` is in `collection`. If `collection` is a string, it's\n * checked for a substring of `value`, otherwise\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * is used for equality comparisons. If `fromIndex` is negative, it's used as\n * the offset from the end of `collection`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @param {*} value The value to search for.\n * @param {number} [fromIndex=0] The index to search from.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {boolean} Returns `true` if `value` is found, else `false`.\n * @example\n *\n * _.includes([1, 2, 3], 1);\n * // => true\n *\n * _.includes([1, 2, 3], 1, 2);\n * // => false\n *\n * _.includes({ 'a': 1, 'b': 2 }, 1);\n * // => true\n *\n * _.includes('abcd', 'bc');\n * // => true\n */\n function includes(collection, value, fromIndex, guard) {\n collection = isArrayLike(collection) ? collection : values(collection);\n fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0;\n\n var length = collection.length;\n if (fromIndex < 0) {\n fromIndex = nativeMax(length + fromIndex, 0);\n }\n return isString(collection)\n ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1)\n : (!!length && baseIndexOf(collection, value, fromIndex) > -1);\n }\n\n /**\n * Invokes the method at `path` of each element in `collection`, returning\n * an array of the results of each invoked method. Any additional arguments\n * are provided to each invoked method. If `path` is a function, it's invoked\n * for, and `this` bound to, each element in `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array|Function|string} path The path of the method to invoke or\n * the function invoked per iteration.\n * @param {...*} [args] The arguments to invoke each method with.\n * @returns {Array} Returns the array of results.\n * @example\n *\n * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort');\n * // => [[1, 5, 7], [1, 2, 3]]\n *\n * _.invokeMap([123, 456], String.prototype.split, '');\n * // => [['1', '2', '3'], ['4', '5', '6']]\n */\n var invokeMap = baseRest(function(collection, path, args) {\n var index = -1,\n isFunc = typeof path == 'function',\n result = isArrayLike(collection) ? Array(collection.length) : [];\n\n baseEach(collection, function(value) {\n result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args);\n });\n return result;\n });\n\n /**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The corresponding value of\n * each key is the last element responsible for generating the key. The\n * iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * var array = [\n * { 'dir': 'left', 'code': 97 },\n * { 'dir': 'right', 'code': 100 }\n * ];\n *\n * _.keyBy(array, function(o) {\n * return String.fromCharCode(o.code);\n * });\n * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }\n *\n * _.keyBy(array, 'dir');\n * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }\n */\n var keyBy = createAggregator(function(result, value, key) {\n baseAssignValue(result, key, value);\n });\n\n /**\n * Creates an array of values by running each element in `collection` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.\n *\n * The guarded methods are:\n * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`,\n * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`,\n * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`,\n * `template`, `trim`, `trimEnd`, `trimStart`, and `words`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n * @example\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * _.map([4, 8], square);\n * // => [16, 64]\n *\n * _.map({ 'a': 4, 'b': 8 }, square);\n * // => [16, 64] (iteration order is not guaranteed)\n *\n * var users = [\n * { 'user': 'barney' },\n * { 'user': 'fred' }\n * ];\n *\n * // The `_.property` iteratee shorthand.\n * _.map(users, 'user');\n * // => ['barney', 'fred']\n */\n function map(collection, iteratee) {\n var func = isArray(collection) ? arrayMap : baseMap;\n return func(collection, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.sortBy` except that it allows specifying the sort\n * orders of the iteratees to sort by. If `orders` is unspecified, all values\n * are sorted in ascending order. Otherwise, specify an order of \"desc\" for\n * descending or \"asc\" for ascending sort order of corresponding values.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @param {string[]} [orders] The sort orders of `iteratees`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 34 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 36 }\n * ];\n *\n * // Sort by `user` in ascending order and by `age` in descending order.\n * _.orderBy(users, ['user', 'age'], ['asc', 'desc']);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n */\n function orderBy(collection, iteratees, orders, guard) {\n if (collection == null) {\n return [];\n }\n if (!isArray(iteratees)) {\n iteratees = iteratees == null ? [] : [iteratees];\n }\n orders = guard ? undefined : orders;\n if (!isArray(orders)) {\n orders = orders == null ? [] : [orders];\n }\n return baseOrderBy(collection, iteratees, orders);\n }\n\n /**\n * Creates an array of elements split into two groups, the first of which\n * contains elements `predicate` returns truthy for, the second of which\n * contains elements `predicate` returns falsey for. The predicate is\n * invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the array of grouped elements.\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true },\n * { 'user': 'pebbles', 'age': 1, 'active': false }\n * ];\n *\n * _.partition(users, function(o) { return o.active; });\n * // => objects for [['fred'], ['barney', 'pebbles']]\n *\n * // The `_.matches` iteratee shorthand.\n * _.partition(users, { 'age': 1, 'active': false });\n * // => objects for [['pebbles'], ['barney', 'fred']]\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.partition(users, ['active', false]);\n * // => objects for [['barney', 'pebbles'], ['fred']]\n *\n * // The `_.property` iteratee shorthand.\n * _.partition(users, 'active');\n * // => objects for [['fred'], ['barney', 'pebbles']]\n */\n var partition = createAggregator(function(result, value, key) {\n result[key ? 0 : 1].push(value);\n }, function() { return [[], []]; });\n\n /**\n * Reduces `collection` to a value which is the accumulated result of running\n * each element in `collection` thru `iteratee`, where each successive\n * invocation is supplied the return value of the previous. If `accumulator`\n * is not given, the first element of `collection` is used as the initial\n * value. The iteratee is invoked with four arguments:\n * (accumulator, value, index|key, collection).\n *\n * Many lodash methods are guarded to work as iteratees for methods like\n * `_.reduce`, `_.reduceRight`, and `_.transform`.\n *\n * The guarded methods are:\n * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`,\n * and `sortBy`\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduceRight\n * @example\n *\n * _.reduce([1, 2], function(sum, n) {\n * return sum + n;\n * }, 0);\n * // => 3\n *\n * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * return result;\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed)\n */\n function reduce(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduce : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach);\n }\n\n /**\n * This method is like `_.reduce` except that it iterates over elements of\n * `collection` from right to left.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @returns {*} Returns the accumulated value.\n * @see _.reduce\n * @example\n *\n * var array = [[0, 1], [2, 3], [4, 5]];\n *\n * _.reduceRight(array, function(flattened, other) {\n * return flattened.concat(other);\n * }, []);\n * // => [4, 5, 2, 3, 0, 1]\n */\n function reduceRight(collection, iteratee, accumulator) {\n var func = isArray(collection) ? arrayReduceRight : baseReduce,\n initAccum = arguments.length < 3;\n\n return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight);\n }\n\n /**\n * The opposite of `_.filter`; this method returns the elements of `collection`\n * that `predicate` does **not** return truthy for.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n * @see _.filter\n * @example\n *\n * var users = [\n * { 'user': 'barney', 'age': 36, 'active': false },\n * { 'user': 'fred', 'age': 40, 'active': true }\n * ];\n *\n * _.reject(users, function(o) { return !o.active; });\n * // => objects for ['fred']\n *\n * // The `_.matches` iteratee shorthand.\n * _.reject(users, { 'age': 40, 'active': true });\n * // => objects for ['barney']\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.reject(users, ['active', false]);\n * // => objects for ['fred']\n *\n * // The `_.property` iteratee shorthand.\n * _.reject(users, 'active');\n * // => objects for ['barney']\n */\n function reject(collection, predicate) {\n var func = isArray(collection) ? arrayFilter : baseFilter;\n return func(collection, negate(getIteratee(predicate, 3)));\n }\n\n /**\n * Gets a random element from `collection`.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @returns {*} Returns the random element.\n * @example\n *\n * _.sample([1, 2, 3, 4]);\n * // => 2\n */\n function sample(collection) {\n var func = isArray(collection) ? arraySample : baseSample;\n return func(collection);\n }\n\n /**\n * Gets `n` random elements at unique keys from `collection` up to the\n * size of `collection`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Collection\n * @param {Array|Object} collection The collection to sample.\n * @param {number} [n=1] The number of elements to sample.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the random elements.\n * @example\n *\n * _.sampleSize([1, 2, 3], 2);\n * // => [3, 1]\n *\n * _.sampleSize([1, 2, 3], 4);\n * // => [2, 3, 1]\n */\n function sampleSize(collection, n, guard) {\n if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n var func = isArray(collection) ? arraySampleSize : baseSampleSize;\n return func(collection, n);\n }\n\n /**\n * Creates an array of shuffled values, using a version of the\n * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to shuffle.\n * @returns {Array} Returns the new shuffled array.\n * @example\n *\n * _.shuffle([1, 2, 3, 4]);\n * // => [4, 1, 3, 2]\n */\n function shuffle(collection) {\n var func = isArray(collection) ? arrayShuffle : baseShuffle;\n return func(collection);\n }\n\n /**\n * Gets the size of `collection` by returning its length for array-like\n * values or the number of own enumerable string keyed properties for objects.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object|string} collection The collection to inspect.\n * @returns {number} Returns the collection size.\n * @example\n *\n * _.size([1, 2, 3]);\n * // => 3\n *\n * _.size({ 'a': 1, 'b': 2 });\n * // => 2\n *\n * _.size('pebbles');\n * // => 7\n */\n function size(collection) {\n if (collection == null) {\n return 0;\n }\n if (isArrayLike(collection)) {\n return isString(collection) ? stringSize(collection) : collection.length;\n }\n var tag = getTag(collection);\n if (tag == mapTag || tag == setTag) {\n return collection.size;\n }\n return baseKeys(collection).length;\n }\n\n /**\n * Checks if `predicate` returns truthy for **any** element of `collection`.\n * Iteration is stopped once `predicate` returns truthy. The predicate is\n * invoked with three arguments: (value, index|key, collection).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n * @example\n *\n * _.some([null, 0, 'yes', false], Boolean);\n * // => true\n *\n * var users = [\n * { 'user': 'barney', 'active': true },\n * { 'user': 'fred', 'active': false }\n * ];\n *\n * // The `_.matches` iteratee shorthand.\n * _.some(users, { 'user': 'barney', 'active': false });\n * // => false\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.some(users, ['active', false]);\n * // => true\n *\n * // The `_.property` iteratee shorthand.\n * _.some(users, 'active');\n * // => true\n */\n function some(collection, predicate, guard) {\n var func = isArray(collection) ? arraySome : baseSome;\n if (guard && isIterateeCall(collection, predicate, guard)) {\n predicate = undefined;\n }\n return func(collection, getIteratee(predicate, 3));\n }\n\n /**\n * Creates an array of elements, sorted in ascending order by the results of\n * running each element in a collection thru each iteratee. This method\n * performs a stable sort, that is, it preserves the original sort order of\n * equal elements. The iteratees are invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {...(Function|Function[])} [iteratees=[_.identity]]\n * The iteratees to sort by.\n * @returns {Array} Returns the new sorted array.\n * @example\n *\n * var users = [\n * { 'user': 'fred', 'age': 48 },\n * { 'user': 'barney', 'age': 36 },\n * { 'user': 'fred', 'age': 40 },\n * { 'user': 'barney', 'age': 34 }\n * ];\n *\n * _.sortBy(users, [function(o) { return o.user; }]);\n * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]]\n *\n * _.sortBy(users, ['user', 'age']);\n * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]]\n */\n var sortBy = baseRest(function(collection, iteratees) {\n if (collection == null) {\n return [];\n }\n var length = iteratees.length;\n if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {\n iteratees = [];\n } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {\n iteratees = [iteratees[0]];\n }\n return baseOrderBy(collection, baseFlatten(iteratees, 1), []);\n });\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\n var now = ctxNow || function() {\n return root.Date.now();\n };\n\n /*------------------------------------------------------------------------*/\n\n /**\n * The opposite of `_.before`; this method creates a function that invokes\n * `func` once it's called `n` or more times.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {number} n The number of calls before `func` is invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var saves = ['profile', 'settings'];\n *\n * var done = _.after(saves.length, function() {\n * console.log('done saving!');\n * });\n *\n * _.forEach(saves, function(type) {\n * asyncSave({ 'type': type, 'complete': done });\n * });\n * // => Logs 'done saving!' after the two async saves have completed.\n */\n function after(n, func) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n < 1) {\n return func.apply(this, arguments);\n }\n };\n }\n\n /**\n * Creates a function that invokes `func`, with up to `n` arguments,\n * ignoring any additional arguments.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @param {number} [n=func.length] The arity cap.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.ary(parseInt, 1));\n * // => [6, 8, 10]\n */\n function ary(func, n, guard) {\n n = guard ? undefined : n;\n n = (func && n == null) ? func.length : n;\n return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n);\n }\n\n /**\n * Creates a function that invokes `func`, with the `this` binding and arguments\n * of the created function, while it's called less than `n` times. Subsequent\n * calls to the created function return the result of the last `func` invocation.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {number} n The number of calls at which `func` is no longer invoked.\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * jQuery(element).on('click', _.before(5, addContactToList));\n * // => Allows adding up to 4 contacts to the list.\n */\n function before(n, func) {\n var result;\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n n = toInteger(n);\n return function() {\n if (--n > 0) {\n result = func.apply(this, arguments);\n }\n if (n <= 1) {\n func = undefined;\n }\n return result;\n };\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of `thisArg`\n * and `partials` prepended to the arguments it receives.\n *\n * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for partially applied arguments.\n *\n * **Note:** Unlike native `Function#bind`, this method doesn't set the \"length\"\n * property of bound functions.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to bind.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * function greet(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n *\n * var object = { 'user': 'fred' };\n *\n * var bound = _.bind(greet, object, 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bind(greet, object, _, '!');\n * bound('hi');\n * // => 'hi fred!'\n */\n var bind = baseRest(function(func, thisArg, partials) {\n var bitmask = WRAP_BIND_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bind));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(func, bitmask, thisArg, partials, holders);\n });\n\n /**\n * Creates a function that invokes the method at `object[key]` with `partials`\n * prepended to the arguments it receives.\n *\n * This method differs from `_.bind` by allowing bound functions to reference\n * methods that may be redefined or don't yet exist. See\n * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)\n * for more details.\n *\n * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Function\n * @param {Object} object The object to invoke the method on.\n * @param {string} key The key of the method.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new bound function.\n * @example\n *\n * var object = {\n * 'user': 'fred',\n * 'greet': function(greeting, punctuation) {\n * return greeting + ' ' + this.user + punctuation;\n * }\n * };\n *\n * var bound = _.bindKey(object, 'greet', 'hi');\n * bound('!');\n * // => 'hi fred!'\n *\n * object.greet = function(greeting, punctuation) {\n * return greeting + 'ya ' + this.user + punctuation;\n * };\n *\n * bound('!');\n * // => 'hiya fred!'\n *\n * // Bound with placeholders.\n * var bound = _.bindKey(object, 'greet', _, '!');\n * bound('hi');\n * // => 'hiya fred!'\n */\n var bindKey = baseRest(function(object, key, partials) {\n var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG;\n if (partials.length) {\n var holders = replaceHolders(partials, getHolder(bindKey));\n bitmask |= WRAP_PARTIAL_FLAG;\n }\n return createWrap(key, bitmask, object, partials, holders);\n });\n\n /**\n * Creates a function that accepts arguments of `func` and either invokes\n * `func` returning its result, if at least `arity` number of arguments have\n * been provided, or returns a function that accepts the remaining `func`\n * arguments, and so on. The arity of `func` may be specified if `func.length`\n * is not sufficient.\n *\n * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,\n * may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curry(abc);\n *\n * curried(1)(2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2)(3);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(1)(_, 3)(2);\n * // => [1, 2, 3]\n */\n function curry(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curry.placeholder;\n return result;\n }\n\n /**\n * This method is like `_.curry` except that arguments are applied to `func`\n * in the manner of `_.partialRight` instead of `_.partial`.\n *\n * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for provided arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of curried functions.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to curry.\n * @param {number} [arity=func.length] The arity of `func`.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the new curried function.\n * @example\n *\n * var abc = function(a, b, c) {\n * return [a, b, c];\n * };\n *\n * var curried = _.curryRight(abc);\n *\n * curried(3)(2)(1);\n * // => [1, 2, 3]\n *\n * curried(2, 3)(1);\n * // => [1, 2, 3]\n *\n * curried(1, 2, 3);\n * // => [1, 2, 3]\n *\n * // Curried with placeholders.\n * curried(3)(1, _)(2);\n * // => [1, 2, 3]\n */\n function curryRight(func, arity, guard) {\n arity = guard ? undefined : arity;\n var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity);\n result.placeholder = curryRight.placeholder;\n return result;\n }\n\n /**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\n function debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n timeWaiting = wait - timeSinceLastCall;\n\n return maxing\n ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)\n : timeWaiting;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n clearTimeout(timerId);\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n }\n\n /**\n * Defers invoking the `func` until the current call stack has cleared. Any\n * additional arguments are provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to defer.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.defer(function(text) {\n * console.log(text);\n * }, 'deferred');\n * // => Logs 'deferred' after one millisecond.\n */\n var defer = baseRest(function(func, args) {\n return baseDelay(func, 1, args);\n });\n\n /**\n * Invokes `func` after `wait` milliseconds. Any additional arguments are\n * provided to `func` when it's invoked.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to delay.\n * @param {number} wait The number of milliseconds to delay invocation.\n * @param {...*} [args] The arguments to invoke `func` with.\n * @returns {number} Returns the timer id.\n * @example\n *\n * _.delay(function(text) {\n * console.log(text);\n * }, 1000, 'later');\n * // => Logs 'later' after one second.\n */\n var delay = baseRest(function(func, wait, args) {\n return baseDelay(func, toNumber(wait) || 0, args);\n });\n\n /**\n * Creates a function that invokes `func` with arguments reversed.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to flip arguments for.\n * @returns {Function} Returns the new flipped function.\n * @example\n *\n * var flipped = _.flip(function() {\n * return _.toArray(arguments);\n * });\n *\n * flipped('a', 'b', 'c', 'd');\n * // => ['d', 'c', 'b', 'a']\n */\n function flip(func) {\n return createWrap(func, WRAP_FLIP_FLAG);\n }\n\n /**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\n function memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n }\n\n // Expose `MapCache`.\n memoize.Cache = MapCache;\n\n /**\n * Creates a function that negates the result of the predicate `func`. The\n * `func` predicate is invoked with the `this` binding and arguments of the\n * created function.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} predicate The predicate to negate.\n * @returns {Function} Returns the new negated function.\n * @example\n *\n * function isEven(n) {\n * return n % 2 == 0;\n * }\n *\n * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));\n * // => [1, 3, 5]\n */\n function negate(predicate) {\n if (typeof predicate != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n return function() {\n var args = arguments;\n switch (args.length) {\n case 0: return !predicate.call(this);\n case 1: return !predicate.call(this, args[0]);\n case 2: return !predicate.call(this, args[0], args[1]);\n case 3: return !predicate.call(this, args[0], args[1], args[2]);\n }\n return !predicate.apply(this, args);\n };\n }\n\n /**\n * Creates a function that is restricted to invoking `func` once. Repeat calls\n * to the function return the value of the first invocation. The `func` is\n * invoked with the `this` binding and arguments of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new restricted function.\n * @example\n *\n * var initialize = _.once(createApplication);\n * initialize();\n * initialize();\n * // => `createApplication` is invoked once\n */\n function once(func) {\n return before(2, func);\n }\n\n /**\n * Creates a function that invokes `func` with its arguments transformed.\n *\n * @static\n * @since 4.0.0\n * @memberOf _\n * @category Function\n * @param {Function} func The function to wrap.\n * @param {...(Function|Function[])} [transforms=[_.identity]]\n * The argument transforms.\n * @returns {Function} Returns the new function.\n * @example\n *\n * function doubled(n) {\n * return n * 2;\n * }\n *\n * function square(n) {\n * return n * n;\n * }\n *\n * var func = _.overArgs(function(x, y) {\n * return [x, y];\n * }, [square, doubled]);\n *\n * func(9, 3);\n * // => [81, 6]\n *\n * func(10, 5);\n * // => [100, 10]\n */\n var overArgs = castRest(function(func, transforms) {\n transforms = (transforms.length == 1 && isArray(transforms[0]))\n ? arrayMap(transforms[0], baseUnary(getIteratee()))\n : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));\n\n var funcsLength = transforms.length;\n return baseRest(function(args) {\n var index = -1,\n length = nativeMin(args.length, funcsLength);\n\n while (++index < length) {\n args[index] = transforms[index].call(this, args[index]);\n }\n return apply(func, this, args);\n });\n });\n\n /**\n * Creates a function that invokes `func` with `partials` prepended to the\n * arguments it receives. This method is like `_.bind` except it does **not**\n * alter the `this` binding.\n *\n * The `_.partial.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 0.2.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var sayHelloTo = _.partial(greet, 'hello');\n * sayHelloTo('fred');\n * // => 'hello fred'\n *\n * // Partially applied with placeholders.\n * var greetFred = _.partial(greet, _, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n */\n var partial = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partial));\n return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders);\n });\n\n /**\n * This method is like `_.partial` except that partially applied arguments\n * are appended to the arguments it receives.\n *\n * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic\n * builds, may be used as a placeholder for partially applied arguments.\n *\n * **Note:** This method doesn't set the \"length\" property of partially\n * applied functions.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Function\n * @param {Function} func The function to partially apply arguments to.\n * @param {...*} [partials] The arguments to be partially applied.\n * @returns {Function} Returns the new partially applied function.\n * @example\n *\n * function greet(greeting, name) {\n * return greeting + ' ' + name;\n * }\n *\n * var greetFred = _.partialRight(greet, 'fred');\n * greetFred('hi');\n * // => 'hi fred'\n *\n * // Partially applied with placeholders.\n * var sayHelloTo = _.partialRight(greet, 'hello', _);\n * sayHelloTo('fred');\n * // => 'hello fred'\n */\n var partialRight = baseRest(function(func, partials) {\n var holders = replaceHolders(partials, getHolder(partialRight));\n return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders);\n });\n\n /**\n * Creates a function that invokes `func` with arguments arranged according\n * to the specified `indexes` where the argument value at the first index is\n * provided as the first argument, the argument value at the second index is\n * provided as the second argument, and so on.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Function\n * @param {Function} func The function to rearrange arguments for.\n * @param {...(number|number[])} indexes The arranged argument indexes.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var rearged = _.rearg(function(a, b, c) {\n * return [a, b, c];\n * }, [2, 0, 1]);\n *\n * rearged('b', 'c', 'a')\n * // => ['a', 'b', 'c']\n */\n var rearg = flatRest(function(func, indexes) {\n return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes);\n });\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * created function and arguments from `start` and beyond provided as\n * an array.\n *\n * **Note:** This method is based on the\n * [rest parameter](https://mdn.io/rest_parameters).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.rest(function(what, names) {\n * return what + ' ' + _.initial(names).join(', ') +\n * (_.size(names) > 1 ? ', & ' : '') + _.last(names);\n * });\n *\n * say('hello', 'fred', 'barney', 'pebbles');\n * // => 'hello fred, barney, & pebbles'\n */\n function rest(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start === undefined ? start : toInteger(start);\n return baseRest(func, start);\n }\n\n /**\n * Creates a function that invokes `func` with the `this` binding of the\n * create function and an array of arguments much like\n * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply).\n *\n * **Note:** This method is based on the\n * [spread operator](https://mdn.io/spread_operator).\n *\n * @static\n * @memberOf _\n * @since 3.2.0\n * @category Function\n * @param {Function} func The function to spread arguments over.\n * @param {number} [start=0] The start position of the spread.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var say = _.spread(function(who, what) {\n * return who + ' says ' + what;\n * });\n *\n * say(['fred', 'hello']);\n * // => 'fred says hello'\n *\n * var numbers = Promise.all([\n * Promise.resolve(40),\n * Promise.resolve(36)\n * ]);\n *\n * numbers.then(_.spread(function(x, y) {\n * return x + y;\n * }));\n * // => a Promise of 76\n */\n function spread(func, start) {\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n start = start == null ? 0 : nativeMax(toInteger(start), 0);\n return baseRest(function(args) {\n var array = args[start],\n otherArgs = castSlice(args, 0, start);\n\n if (array) {\n arrayPush(otherArgs, array);\n }\n return apply(func, this, otherArgs);\n });\n }\n\n /**\n * Creates a throttled function that only invokes `func` at most once per\n * every `wait` milliseconds. The throttled function comes with a `cancel`\n * method to cancel delayed `func` invocations and a `flush` method to\n * immediately invoke them. Provide `options` to indicate whether `func`\n * should be invoked on the leading and/or trailing edge of the `wait`\n * timeout. The `func` is invoked with the last arguments provided to the\n * throttled function. Subsequent calls to the throttled function return the\n * result of the last `func` invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the throttled function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.throttle` and `_.debounce`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to throttle.\n * @param {number} [wait=0] The number of milliseconds to throttle invocations to.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=true]\n * Specify invoking on the leading edge of the timeout.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new throttled function.\n * @example\n *\n * // Avoid excessively updating the position while scrolling.\n * jQuery(window).on('scroll', _.throttle(updatePosition, 100));\n *\n * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.\n * var throttled = _.throttle(renewToken, 300000, { 'trailing': false });\n * jQuery(element).on('click', throttled);\n *\n * // Cancel the trailing throttled invocation.\n * jQuery(window).on('popstate', throttled.cancel);\n */\n function throttle(func, wait, options) {\n var leading = true,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n if (isObject(options)) {\n leading = 'leading' in options ? !!options.leading : leading;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n return debounce(func, wait, {\n 'leading': leading,\n 'maxWait': wait,\n 'trailing': trailing\n });\n }\n\n /**\n * Creates a function that accepts up to one argument, ignoring any\n * additional arguments.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Function\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n * @example\n *\n * _.map(['6', '8', '10'], _.unary(parseInt));\n * // => [6, 8, 10]\n */\n function unary(func) {\n return ary(func, 1);\n }\n\n /**\n * Creates a function that provides `value` to `wrapper` as its first\n * argument. Any additional arguments provided to the function are appended\n * to those provided to the `wrapper`. The wrapper is invoked with the `this`\n * binding of the created function.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {*} value The value to wrap.\n * @param {Function} [wrapper=identity] The wrapper function.\n * @returns {Function} Returns the new function.\n * @example\n *\n * var p = _.wrap(_.escape, function(func, text) {\n * return '

      ' + func(text) + '

      ';\n * });\n *\n * p('fred, barney, & pebbles');\n * // => '

      fred, barney, & pebbles

      '\n */\n function wrap(value, wrapper) {\n return partial(castFunction(wrapper), value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Casts `value` as an array if it's not one.\n *\n * @static\n * @memberOf _\n * @since 4.4.0\n * @category Lang\n * @param {*} value The value to inspect.\n * @returns {Array} Returns the cast array.\n * @example\n *\n * _.castArray(1);\n * // => [1]\n *\n * _.castArray({ 'a': 1 });\n * // => [{ 'a': 1 }]\n *\n * _.castArray('abc');\n * // => ['abc']\n *\n * _.castArray(null);\n * // => [null]\n *\n * _.castArray(undefined);\n * // => [undefined]\n *\n * _.castArray();\n * // => []\n *\n * var array = [1, 2, 3];\n * console.log(_.castArray(array) === array);\n * // => true\n */\n function castArray() {\n if (!arguments.length) {\n return [];\n }\n var value = arguments[0];\n return isArray(value) ? value : [value];\n }\n\n /**\n * Creates a shallow clone of `value`.\n *\n * **Note:** This method is loosely based on the\n * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm)\n * and supports cloning arrays, array buffers, booleans, date objects, maps,\n * numbers, `Object` objects, regexes, sets, strings, symbols, and typed\n * arrays. The own enumerable properties of `arguments` objects are cloned\n * as plain objects. An empty object is returned for uncloneable values such\n * as error objects, functions, DOM nodes, and WeakMaps.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to clone.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeep\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var shallow = _.clone(objects);\n * console.log(shallow[0] === objects[0]);\n * // => true\n */\n function clone(value) {\n return baseClone(value, CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.clone` except that it accepts `customizer` which\n * is invoked to produce the cloned value. If `customizer` returns `undefined`,\n * cloning is handled by the method instead. The `customizer` is invoked with\n * up to four arguments; (value [, index|key, object, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the cloned value.\n * @see _.cloneDeepWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(false);\n * }\n * }\n *\n * var el = _.cloneWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 0\n */\n function cloneWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * This method is like `_.clone` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @returns {*} Returns the deep cloned value.\n * @see _.clone\n * @example\n *\n * var objects = [{ 'a': 1 }, { 'b': 2 }];\n *\n * var deep = _.cloneDeep(objects);\n * console.log(deep[0] === objects[0]);\n * // => false\n */\n function cloneDeep(value) {\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG);\n }\n\n /**\n * This method is like `_.cloneWith` except that it recursively clones `value`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to recursively clone.\n * @param {Function} [customizer] The function to customize cloning.\n * @returns {*} Returns the deep cloned value.\n * @see _.cloneWith\n * @example\n *\n * function customizer(value) {\n * if (_.isElement(value)) {\n * return value.cloneNode(true);\n * }\n * }\n *\n * var el = _.cloneDeepWith(document.body, customizer);\n *\n * console.log(el === document.body);\n * // => false\n * console.log(el.nodeName);\n * // => 'BODY'\n * console.log(el.childNodes.length);\n * // => 20\n */\n function cloneDeepWith(value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);\n }\n\n /**\n * Checks if `object` conforms to `source` by invoking the predicate\n * properties of `source` with the corresponding property values of `object`.\n *\n * **Note:** This method is equivalent to `_.conforms` when `source` is\n * partially applied.\n *\n * @static\n * @memberOf _\n * @since 4.14.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property predicates to conform to.\n * @returns {boolean} Returns `true` if `object` conforms, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 1; } });\n * // => true\n *\n * _.conformsTo(object, { 'b': function(n) { return n > 2; } });\n * // => false\n */\n function conformsTo(object, source) {\n return source == null || baseConformsTo(object, source, keys(source));\n }\n\n /**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\n function eq(value, other) {\n return value === other || (value !== value && other !== other);\n }\n\n /**\n * Checks if `value` is greater than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than `other`,\n * else `false`.\n * @see _.lt\n * @example\n *\n * _.gt(3, 1);\n * // => true\n *\n * _.gt(3, 3);\n * // => false\n *\n * _.gt(1, 3);\n * // => false\n */\n var gt = createRelationalOperation(baseGt);\n\n /**\n * Checks if `value` is greater than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is greater than or equal to\n * `other`, else `false`.\n * @see _.lte\n * @example\n *\n * _.gte(3, 1);\n * // => true\n *\n * _.gte(3, 3);\n * // => true\n *\n * _.gte(1, 3);\n * // => false\n */\n var gte = createRelationalOperation(function(value, other) {\n return value >= other;\n });\n\n /**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\n var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n };\n\n /**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\n var isArray = Array.isArray;\n\n /**\n * Checks if `value` is classified as an `ArrayBuffer` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`.\n * @example\n *\n * _.isArrayBuffer(new ArrayBuffer(2));\n * // => true\n *\n * _.isArrayBuffer(new Array(2));\n * // => false\n */\n var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer;\n\n /**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\n function isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n }\n\n /**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\n function isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n }\n\n /**\n * Checks if `value` is classified as a boolean primitive or object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a boolean, else `false`.\n * @example\n *\n * _.isBoolean(false);\n * // => true\n *\n * _.isBoolean(null);\n * // => false\n */\n function isBoolean(value) {\n return value === true || value === false ||\n (isObjectLike(value) && baseGetTag(value) == boolTag);\n }\n\n /**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\n var isBuffer = nativeIsBuffer || stubFalse;\n\n /**\n * Checks if `value` is classified as a `Date` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a date object, else `false`.\n * @example\n *\n * _.isDate(new Date);\n * // => true\n *\n * _.isDate('Mon April 23 2012');\n * // => false\n */\n var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate;\n\n /**\n * Checks if `value` is likely a DOM element.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.\n * @example\n *\n * _.isElement(document.body);\n * // => true\n *\n * _.isElement('');\n * // => false\n */\n function isElement(value) {\n return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value);\n }\n\n /**\n * Checks if `value` is an empty object, collection, map, or set.\n *\n * Objects are considered empty if they have no own enumerable string keyed\n * properties.\n *\n * Array-like values such as `arguments` objects, arrays, buffers, strings, or\n * jQuery-like collections are considered empty if they have a `length` of `0`.\n * Similarly, maps and sets are considered empty if they have a `size` of `0`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is empty, else `false`.\n * @example\n *\n * _.isEmpty(null);\n * // => true\n *\n * _.isEmpty(true);\n * // => true\n *\n * _.isEmpty(1);\n * // => true\n *\n * _.isEmpty([1, 2, 3]);\n * // => false\n *\n * _.isEmpty({ 'a': 1 });\n * // => false\n */\n function isEmpty(value) {\n if (value == null) {\n return true;\n }\n if (isArrayLike(value) &&\n (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' ||\n isBuffer(value) || isTypedArray(value) || isArguments(value))) {\n return !value.length;\n }\n var tag = getTag(value);\n if (tag == mapTag || tag == setTag) {\n return !value.size;\n }\n if (isPrototype(value)) {\n return !baseKeys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\n function isEqual(value, other) {\n return baseIsEqual(value, other);\n }\n\n /**\n * This method is like `_.isEqual` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with up to\n * six arguments: (objValue, othValue [, index|key, object, other, stack]).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * _.isEqualWith(array, other, customizer);\n * // => true\n */\n function isEqualWith(value, other, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n var result = customizer ? customizer(value, other) : undefined;\n return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result;\n }\n\n /**\n * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,\n * `SyntaxError`, `TypeError`, or `URIError` object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an error object, else `false`.\n * @example\n *\n * _.isError(new Error);\n * // => true\n *\n * _.isError(Error);\n * // => false\n */\n function isError(value) {\n if (!isObjectLike(value)) {\n return false;\n }\n var tag = baseGetTag(value);\n return tag == errorTag || tag == domExcTag ||\n (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value));\n }\n\n /**\n * Checks if `value` is a finite primitive number.\n *\n * **Note:** This method is based on\n * [`Number.isFinite`](https://mdn.io/Number/isFinite).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.\n * @example\n *\n * _.isFinite(3);\n * // => true\n *\n * _.isFinite(Number.MIN_VALUE);\n * // => true\n *\n * _.isFinite(Infinity);\n * // => false\n *\n * _.isFinite('3');\n * // => false\n */\n function isFinite(value) {\n return typeof value == 'number' && nativeIsFinite(value);\n }\n\n /**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\n function isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n }\n\n /**\n * Checks if `value` is an integer.\n *\n * **Note:** This method is based on\n * [`Number.isInteger`](https://mdn.io/Number/isInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an integer, else `false`.\n * @example\n *\n * _.isInteger(3);\n * // => true\n *\n * _.isInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isInteger(Infinity);\n * // => false\n *\n * _.isInteger('3');\n * // => false\n */\n function isInteger(value) {\n return typeof value == 'number' && value == toInteger(value);\n }\n\n /**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\n function isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\n function isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n }\n\n /**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\n function isObjectLike(value) {\n return value != null && typeof value == 'object';\n }\n\n /**\n * Checks if `value` is classified as a `Map` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a map, else `false`.\n * @example\n *\n * _.isMap(new Map);\n * // => true\n *\n * _.isMap(new WeakMap);\n * // => false\n */\n var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap;\n\n /**\n * Performs a partial deep comparison between `object` and `source` to\n * determine if `object` contains equivalent property values.\n *\n * **Note:** This method is equivalent to `_.matches` when `source` is\n * partially applied.\n *\n * Partial comparisons will match empty array and empty object `source`\n * values against any array or object value, respectively. See `_.isEqual`\n * for a list of supported value comparisons.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n *\n * _.isMatch(object, { 'b': 2 });\n * // => true\n *\n * _.isMatch(object, { 'b': 1 });\n * // => false\n */\n function isMatch(object, source) {\n return object === source || baseIsMatch(object, source, getMatchData(source));\n }\n\n /**\n * This method is like `_.isMatch` except that it accepts `customizer` which\n * is invoked to compare values. If `customizer` returns `undefined`, comparisons\n * are handled by the method instead. The `customizer` is invoked with five\n * arguments: (objValue, srcValue, index|key, object, source).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, srcValue) {\n * if (isGreeting(objValue) && isGreeting(srcValue)) {\n * return true;\n * }\n * }\n *\n * var object = { 'greeting': 'hello' };\n * var source = { 'greeting': 'hi' };\n *\n * _.isMatchWith(object, source, customizer);\n * // => true\n */\n function isMatchWith(object, source, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return baseIsMatch(object, source, getMatchData(source), customizer);\n }\n\n /**\n * Checks if `value` is `NaN`.\n *\n * **Note:** This method is based on\n * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as\n * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for\n * `undefined` and other non-number values.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.\n * @example\n *\n * _.isNaN(NaN);\n * // => true\n *\n * _.isNaN(new Number(NaN));\n * // => true\n *\n * isNaN(undefined);\n * // => true\n *\n * _.isNaN(undefined);\n * // => false\n */\n function isNaN(value) {\n // An `NaN` primitive is the only value that is not equal to itself.\n // Perform the `toStringTag` check first to avoid errors with some\n // ActiveX objects in IE.\n return isNumber(value) && value != +value;\n }\n\n /**\n * Checks if `value` is a pristine native function.\n *\n * **Note:** This method can't reliably detect native functions in the presence\n * of the core-js package because core-js circumvents this kind of detection.\n * Despite multiple requests, the core-js maintainer has made it clear: any\n * attempt to fix the detection will be obstructed. As a result, we're left\n * with little choice but to throw an error. Unfortunately, this also affects\n * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill),\n * which rely on core-js.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n * @example\n *\n * _.isNative(Array.prototype.push);\n * // => true\n *\n * _.isNative(_);\n * // => false\n */\n function isNative(value) {\n if (isMaskable(value)) {\n throw new Error(CORE_ERROR_TEXT);\n }\n return baseIsNative(value);\n }\n\n /**\n * Checks if `value` is `null`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `null`, else `false`.\n * @example\n *\n * _.isNull(null);\n * // => true\n *\n * _.isNull(void 0);\n * // => false\n */\n function isNull(value) {\n return value === null;\n }\n\n /**\n * Checks if `value` is `null` or `undefined`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is nullish, else `false`.\n * @example\n *\n * _.isNil(null);\n * // => true\n *\n * _.isNil(void 0);\n * // => true\n *\n * _.isNil(NaN);\n * // => false\n */\n function isNil(value) {\n return value == null;\n }\n\n /**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\n function isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n }\n\n /**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\n function isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n }\n\n /**\n * Checks if `value` is classified as a `RegExp` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a regexp, else `false`.\n * @example\n *\n * _.isRegExp(/abc/);\n * // => true\n *\n * _.isRegExp('/abc/');\n * // => false\n */\n var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp;\n\n /**\n * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754\n * double precision number which isn't the result of a rounded unsafe integer.\n *\n * **Note:** This method is based on\n * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`.\n * @example\n *\n * _.isSafeInteger(3);\n * // => true\n *\n * _.isSafeInteger(Number.MIN_VALUE);\n * // => false\n *\n * _.isSafeInteger(Infinity);\n * // => false\n *\n * _.isSafeInteger('3');\n * // => false\n */\n function isSafeInteger(value) {\n return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;\n }\n\n /**\n * Checks if `value` is classified as a `Set` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a set, else `false`.\n * @example\n *\n * _.isSet(new Set);\n * // => true\n *\n * _.isSet(new WeakSet);\n * // => false\n */\n var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet;\n\n /**\n * Checks if `value` is classified as a `String` primitive or object.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a string, else `false`.\n * @example\n *\n * _.isString('abc');\n * // => true\n *\n * _.isString(1);\n * // => false\n */\n function isString(value) {\n return typeof value == 'string' ||\n (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag);\n }\n\n /**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\n function isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n }\n\n /**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n /**\n * Checks if `value` is `undefined`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.\n * @example\n *\n * _.isUndefined(void 0);\n * // => true\n *\n * _.isUndefined(null);\n * // => false\n */\n function isUndefined(value) {\n return value === undefined;\n }\n\n /**\n * Checks if `value` is classified as a `WeakMap` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak map, else `false`.\n * @example\n *\n * _.isWeakMap(new WeakMap);\n * // => true\n *\n * _.isWeakMap(new Map);\n * // => false\n */\n function isWeakMap(value) {\n return isObjectLike(value) && getTag(value) == weakMapTag;\n }\n\n /**\n * Checks if `value` is classified as a `WeakSet` object.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a weak set, else `false`.\n * @example\n *\n * _.isWeakSet(new WeakSet);\n * // => true\n *\n * _.isWeakSet(new Set);\n * // => false\n */\n function isWeakSet(value) {\n return isObjectLike(value) && baseGetTag(value) == weakSetTag;\n }\n\n /**\n * Checks if `value` is less than `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than `other`,\n * else `false`.\n * @see _.gt\n * @example\n *\n * _.lt(1, 3);\n * // => true\n *\n * _.lt(3, 3);\n * // => false\n *\n * _.lt(3, 1);\n * // => false\n */\n var lt = createRelationalOperation(baseLt);\n\n /**\n * Checks if `value` is less than or equal to `other`.\n *\n * @static\n * @memberOf _\n * @since 3.9.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if `value` is less than or equal to\n * `other`, else `false`.\n * @see _.gte\n * @example\n *\n * _.lte(1, 3);\n * // => true\n *\n * _.lte(3, 3);\n * // => true\n *\n * _.lte(3, 1);\n * // => false\n */\n var lte = createRelationalOperation(function(value, other) {\n return value <= other;\n });\n\n /**\n * Converts `value` to an array.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Array} Returns the converted array.\n * @example\n *\n * _.toArray({ 'a': 1, 'b': 2 });\n * // => [1, 2]\n *\n * _.toArray('abc');\n * // => ['a', 'b', 'c']\n *\n * _.toArray(1);\n * // => []\n *\n * _.toArray(null);\n * // => []\n */\n function toArray(value) {\n if (!value) {\n return [];\n }\n if (isArrayLike(value)) {\n return isString(value) ? stringToArray(value) : copyArray(value);\n }\n if (symIterator && value[symIterator]) {\n return iteratorToArray(value[symIterator]());\n }\n var tag = getTag(value),\n func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values);\n\n return func(value);\n }\n\n /**\n * Converts `value` to a finite number.\n *\n * @static\n * @memberOf _\n * @since 4.12.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted number.\n * @example\n *\n * _.toFinite(3.2);\n * // => 3.2\n *\n * _.toFinite(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toFinite(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toFinite('3.2');\n * // => 3.2\n */\n function toFinite(value) {\n if (!value) {\n return value === 0 ? value : 0;\n }\n value = toNumber(value);\n if (value === INFINITY || value === -INFINITY) {\n var sign = (value < 0 ? -1 : 1);\n return sign * MAX_INTEGER;\n }\n return value === value ? value : 0;\n }\n\n /**\n * Converts `value` to an integer.\n *\n * **Note:** This method is loosely based on\n * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toInteger(3.2);\n * // => 3\n *\n * _.toInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toInteger(Infinity);\n * // => 1.7976931348623157e+308\n *\n * _.toInteger('3.2');\n * // => 3\n */\n function toInteger(value) {\n var result = toFinite(value),\n remainder = result % 1;\n\n return result === result ? (remainder ? result - remainder : result) : 0;\n }\n\n /**\n * Converts `value` to an integer suitable for use as the length of an\n * array-like object.\n *\n * **Note:** This method is based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toLength(3.2);\n * // => 3\n *\n * _.toLength(Number.MIN_VALUE);\n * // => 0\n *\n * _.toLength(Infinity);\n * // => 4294967295\n *\n * _.toLength('3.2');\n * // => 3\n */\n function toLength(value) {\n return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0;\n }\n\n /**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\n function toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n }\n\n /**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\n function toPlainObject(value) {\n return copyObject(value, keysIn(value));\n }\n\n /**\n * Converts `value` to a safe integer. A safe integer can be compared and\n * represented correctly.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.toSafeInteger(3.2);\n * // => 3\n *\n * _.toSafeInteger(Number.MIN_VALUE);\n * // => 0\n *\n * _.toSafeInteger(Infinity);\n * // => 9007199254740991\n *\n * _.toSafeInteger('3.2');\n * // => 3\n */\n function toSafeInteger(value) {\n return value\n ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)\n : (value === 0 ? value : 0);\n }\n\n /**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\n function toString(value) {\n return value == null ? '' : baseToString(value);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\n var assign = createAssigner(function(object, source) {\n if (isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n });\n\n /**\n * This method is like `_.assign` except that it iterates over own and\n * inherited source properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extend\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assign\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assignIn({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 }\n */\n var assignIn = createAssigner(function(object, source) {\n copyObject(source, keysIn(source), object);\n });\n\n /**\n * This method is like `_.assignIn` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias extendWith\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignInWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignInWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keysIn(source), object, customizer);\n });\n\n /**\n * This method is like `_.assign` except that it accepts `customizer`\n * which is invoked to produce the assigned values. If `customizer` returns\n * `undefined`, assignment is handled by the method instead. The `customizer`\n * is invoked with five arguments: (objValue, srcValue, key, object, source).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @see _.assignInWith\n * @example\n *\n * function customizer(objValue, srcValue) {\n * return _.isUndefined(objValue) ? srcValue : objValue;\n * }\n *\n * var defaults = _.partialRight(_.assignWith, customizer);\n *\n * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var assignWith = createAssigner(function(object, source, srcIndex, customizer) {\n copyObject(source, keys(source), object, customizer);\n });\n\n /**\n * Creates an array of values corresponding to `paths` of `object`.\n *\n * @static\n * @memberOf _\n * @since 1.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Array} Returns the picked values.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] };\n *\n * _.at(object, ['a[0].b.c', 'a[1]']);\n * // => [3, 4]\n */\n var at = flatRest(baseAt);\n\n /**\n * Creates an object that inherits from the `prototype` object. If a\n * `properties` object is given, its own enumerable string keyed properties\n * are assigned to the created object.\n *\n * @static\n * @memberOf _\n * @since 2.3.0\n * @category Object\n * @param {Object} prototype The object to inherit from.\n * @param {Object} [properties] The properties to assign to the object.\n * @returns {Object} Returns the new object.\n * @example\n *\n * function Shape() {\n * this.x = 0;\n * this.y = 0;\n * }\n *\n * function Circle() {\n * Shape.call(this);\n * }\n *\n * Circle.prototype = _.create(Shape.prototype, {\n * 'constructor': Circle\n * });\n *\n * var circle = new Circle;\n * circle instanceof Circle;\n * // => true\n *\n * circle instanceof Shape;\n * // => true\n */\n function create(prototype, properties) {\n var result = baseCreate(prototype);\n return properties == null ? result : baseAssign(result, properties);\n }\n\n /**\n * Assigns own and inherited enumerable string keyed properties of source\n * objects to the destination object for all destination properties that\n * resolve to `undefined`. Source objects are applied from left to right.\n * Once a property is set, additional values of the same property are ignored.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaultsDeep\n * @example\n *\n * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 });\n * // => { 'a': 1, 'b': 2 }\n */\n var defaults = baseRest(function(object, sources) {\n object = Object(object);\n\n var index = -1;\n var length = sources.length;\n var guard = length > 2 ? sources[2] : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n length = 1;\n }\n\n while (++index < length) {\n var source = sources[index];\n var props = keysIn(source);\n var propsIndex = -1;\n var propsLength = props.length;\n\n while (++propsIndex < propsLength) {\n var key = props[propsIndex];\n var value = object[key];\n\n if (value === undefined ||\n (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) {\n object[key] = source[key];\n }\n }\n }\n\n return object;\n });\n\n /**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\n var defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n });\n\n /**\n * This method is like `_.find` except that it returns the key of the first\n * element `predicate` returns truthy for instead of the element itself.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findKey(users, function(o) { return o.age < 40; });\n * // => 'barney' (iteration order is not guaranteed)\n *\n * // The `_.matches` iteratee shorthand.\n * _.findKey(users, { 'age': 1, 'active': true });\n * // => 'pebbles'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findKey(users, 'active');\n * // => 'barney'\n */\n function findKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwn);\n }\n\n /**\n * This method is like `_.findKey` except that it iterates over elements of\n * a collection in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @param {Function} [predicate=_.identity] The function invoked per iteration.\n * @returns {string|undefined} Returns the key of the matched element,\n * else `undefined`.\n * @example\n *\n * var users = {\n * 'barney': { 'age': 36, 'active': true },\n * 'fred': { 'age': 40, 'active': false },\n * 'pebbles': { 'age': 1, 'active': true }\n * };\n *\n * _.findLastKey(users, function(o) { return o.age < 40; });\n * // => returns 'pebbles' assuming `_.findKey` returns 'barney'\n *\n * // The `_.matches` iteratee shorthand.\n * _.findLastKey(users, { 'age': 36, 'active': true });\n * // => 'barney'\n *\n * // The `_.matchesProperty` iteratee shorthand.\n * _.findLastKey(users, ['active', false]);\n * // => 'fred'\n *\n * // The `_.property` iteratee shorthand.\n * _.findLastKey(users, 'active');\n * // => 'pebbles'\n */\n function findLastKey(object, predicate) {\n return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight);\n }\n\n /**\n * Iterates over own and inherited enumerable string keyed properties of an\n * object and invokes `iteratee` for each property. The iteratee is invoked\n * with three arguments: (value, key, object). Iteratee functions may exit\n * iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forInRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forIn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed).\n */\n function forIn(object, iteratee) {\n return object == null\n ? object\n : baseFor(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * This method is like `_.forIn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forInRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'.\n */\n function forInRight(object, iteratee) {\n return object == null\n ? object\n : baseForRight(object, getIteratee(iteratee, 3), keysIn);\n }\n\n /**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\n function forOwn(object, iteratee) {\n return object && baseForOwn(object, getIteratee(iteratee, 3));\n }\n\n /**\n * This method is like `_.forOwn` except that it iterates over properties of\n * `object` in the opposite order.\n *\n * @static\n * @memberOf _\n * @since 2.0.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwnRight(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'.\n */\n function forOwnRight(object, iteratee) {\n return object && baseForOwnRight(object, getIteratee(iteratee, 3));\n }\n\n /**\n * Creates an array of function property names from own enumerable properties\n * of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functionsIn\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functions(new Foo);\n * // => ['a', 'b']\n */\n function functions(object) {\n return object == null ? [] : baseFunctions(object, keys(object));\n }\n\n /**\n * Creates an array of function property names from own and inherited\n * enumerable properties of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to inspect.\n * @returns {Array} Returns the function names.\n * @see _.functions\n * @example\n *\n * function Foo() {\n * this.a = _.constant('a');\n * this.b = _.constant('b');\n * }\n *\n * Foo.prototype.c = _.constant('c');\n *\n * _.functionsIn(new Foo);\n * // => ['a', 'b', 'c']\n */\n function functionsIn(object) {\n return object == null ? [] : baseFunctions(object, keysIn(object));\n }\n\n /**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\n function get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n }\n\n /**\n * Checks if `path` is a direct property of `object`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = { 'a': { 'b': 2 } };\n * var other = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.has(object, 'a');\n * // => true\n *\n * _.has(object, 'a.b');\n * // => true\n *\n * _.has(object, ['a', 'b']);\n * // => true\n *\n * _.has(other, 'a');\n * // => false\n */\n function has(object, path) {\n return object != null && hasPath(object, path, baseHas);\n }\n\n /**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\n function hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n }\n\n /**\n * Creates an object composed of the inverted keys and values of `object`.\n * If `object` contains duplicate values, subsequent values overwrite\n * property assignments of previous values.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Object\n * @param {Object} object The object to invert.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invert(object);\n * // => { '1': 'c', '2': 'b' }\n */\n var invert = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n result[value] = key;\n }, constant(identity));\n\n /**\n * This method is like `_.invert` except that the inverted object is generated\n * from the results of running each element of `object` thru `iteratee`. The\n * corresponding inverted value of each inverted key is an array of keys\n * responsible for generating the inverted value. The iteratee is invoked\n * with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 4.1.0\n * @category Object\n * @param {Object} object The object to invert.\n * @param {Function} [iteratee=_.identity] The iteratee invoked per element.\n * @returns {Object} Returns the new inverted object.\n * @example\n *\n * var object = { 'a': 1, 'b': 2, 'c': 1 };\n *\n * _.invertBy(object);\n * // => { '1': ['a', 'c'], '2': ['b'] }\n *\n * _.invertBy(object, function(value) {\n * return 'group' + value;\n * });\n * // => { 'group1': ['a', 'c'], 'group2': ['b'] }\n */\n var invertBy = createInverter(function(result, value, key) {\n if (value != null &&\n typeof value.toString != 'function') {\n value = nativeObjectToString.call(value);\n }\n\n if (hasOwnProperty.call(result, value)) {\n result[value].push(key);\n } else {\n result[value] = [key];\n }\n }, getIteratee);\n\n /**\n * Invokes the method at `path` of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the method to invoke.\n * @param {...*} [args] The arguments to invoke the method with.\n * @returns {*} Returns the result of the invoked method.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] };\n *\n * _.invoke(object, 'a[0].b.c.slice', 1, 3);\n * // => [2, 3]\n */\n var invoke = baseRest(baseInvoke);\n\n /**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\n function keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n }\n\n /**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\n function keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n }\n\n /**\n * The opposite of `_.mapValues`; this method creates an object with the\n * same values as `object` and keys generated by running each own enumerable\n * string keyed property of `object` thru `iteratee`. The iteratee is invoked\n * with three arguments: (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 3.8.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapValues\n * @example\n *\n * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {\n * return key + value;\n * });\n * // => { 'a1': 1, 'b2': 2 }\n */\n function mapKeys(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, iteratee(value, key, object), value);\n });\n return result;\n }\n\n /**\n * Creates an object with the same keys as `object` and values generated\n * by running each own enumerable string keyed property of `object` thru\n * `iteratee`. The iteratee is invoked with three arguments:\n * (value, key, object).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns the new mapped object.\n * @see _.mapKeys\n * @example\n *\n * var users = {\n * 'fred': { 'user': 'fred', 'age': 40 },\n * 'pebbles': { 'user': 'pebbles', 'age': 1 }\n * };\n *\n * _.mapValues(users, function(o) { return o.age; });\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n *\n * // The `_.property` iteratee shorthand.\n * _.mapValues(users, 'age');\n * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)\n */\n function mapValues(object, iteratee) {\n var result = {};\n iteratee = getIteratee(iteratee, 3);\n\n baseForOwn(object, function(value, key, object) {\n baseAssignValue(result, key, iteratee(value, key, object));\n });\n return result;\n }\n\n /**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\n var merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n });\n\n /**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\n var mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n });\n\n /**\n * The opposite of `_.pick`; this method creates an object composed of the\n * own and inherited enumerable property paths of `object` that are not omitted.\n *\n * **Note:** This method is considerably slower than `_.pick`.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to omit.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omit(object, ['a', 'c']);\n * // => { 'b': '2' }\n */\n var omit = flatRest(function(object, paths) {\n var result = {};\n if (object == null) {\n return result;\n }\n var isDeep = false;\n paths = arrayMap(paths, function(path) {\n path = castPath(path, object);\n isDeep || (isDeep = path.length > 1);\n return path;\n });\n copyObject(object, getAllKeysIn(object), result);\n if (isDeep) {\n result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);\n }\n var length = paths.length;\n while (length--) {\n baseUnset(result, paths[length]);\n }\n return result;\n });\n\n /**\n * The opposite of `_.pickBy`; this method creates an object composed of\n * the own and inherited enumerable string keyed properties of `object` that\n * `predicate` doesn't return truthy for. The predicate is invoked with two\n * arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.omitBy(object, _.isNumber);\n * // => { 'b': '2' }\n */\n function omitBy(object, predicate) {\n return pickBy(object, negate(getIteratee(predicate)));\n }\n\n /**\n * Creates an object composed of the picked `object` properties.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The source object.\n * @param {...(string|string[])} [paths] The property paths to pick.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pick(object, ['a', 'c']);\n * // => { 'a': 1, 'c': 3 }\n */\n var pick = flatRest(function(object, paths) {\n return object == null ? {} : basePick(object, paths);\n });\n\n /**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\n function pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = getIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n }\n\n /**\n * This method is like `_.get` except that if the resolved value is a\n * function it's invoked with the `this` binding of its parent object and\n * its result is returned.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to resolve.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };\n *\n * _.result(object, 'a[0].b.c1');\n * // => 3\n *\n * _.result(object, 'a[0].b.c2');\n * // => 4\n *\n * _.result(object, 'a[0].b.c3', 'default');\n * // => 'default'\n *\n * _.result(object, 'a[0].b.c3', _.constant('default'));\n * // => 'default'\n */\n function result(object, path, defaultValue) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length;\n\n // Ensure the loop is entered when path is empty.\n if (!length) {\n length = 1;\n object = undefined;\n }\n while (++index < length) {\n var value = object == null ? undefined : object[toKey(path[index])];\n if (value === undefined) {\n index = length;\n value = defaultValue;\n }\n object = isFunction(value) ? value.call(object) : value;\n }\n return object;\n }\n\n /**\n * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,\n * it's created. Arrays are created for missing index properties while objects\n * are created for all other missing properties. Use `_.setWith` to customize\n * `path` creation.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.set(object, 'a[0].b.c', 4);\n * console.log(object.a[0].b.c);\n * // => 4\n *\n * _.set(object, ['x', '0', 'y', 'z'], 5);\n * console.log(object.x[0].y.z);\n * // => 5\n */\n function set(object, path, value) {\n return object == null ? object : baseSet(object, path, value);\n }\n\n /**\n * This method is like `_.set` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.setWith(object, '[0][1]', 'a', Object);\n * // => { '0': { '1': 'a' } }\n */\n function setWith(object, path, value, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseSet(object, path, value, customizer);\n }\n\n /**\n * Creates an array of own enumerable string keyed-value pairs for `object`\n * which can be consumed by `_.fromPairs`. If `object` is a map or set, its\n * entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entries\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairs(new Foo);\n * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed)\n */\n var toPairs = createToPairs(keys);\n\n /**\n * Creates an array of own and inherited enumerable string keyed-value pairs\n * for `object` which can be consumed by `_.fromPairs`. If `object` is a map\n * or set, its entries are returned.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @alias entriesIn\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the key-value pairs.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.toPairsIn(new Foo);\n * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed)\n */\n var toPairsIn = createToPairs(keysIn);\n\n /**\n * An alternative to `_.reduce`; this method transforms `object` to a new\n * `accumulator` object which is the result of running each of its own\n * enumerable string keyed properties thru `iteratee`, with each invocation\n * potentially mutating the `accumulator` object. If `accumulator` is not\n * provided, a new object with the same `[[Prototype]]` will be used. The\n * iteratee is invoked with four arguments: (accumulator, value, key, object).\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 1.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @param {*} [accumulator] The custom accumulator value.\n * @returns {*} Returns the accumulated value.\n * @example\n *\n * _.transform([2, 3, 4], function(result, n) {\n * result.push(n *= n);\n * return n % 2 == 0;\n * }, []);\n * // => [4, 9]\n *\n * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) {\n * (result[value] || (result[value] = [])).push(key);\n * }, {});\n * // => { '1': ['a', 'c'], '2': ['b'] }\n */\n function transform(object, iteratee, accumulator) {\n var isArr = isArray(object),\n isArrLike = isArr || isBuffer(object) || isTypedArray(object);\n\n iteratee = getIteratee(iteratee, 4);\n if (accumulator == null) {\n var Ctor = object && object.constructor;\n if (isArrLike) {\n accumulator = isArr ? new Ctor : [];\n }\n else if (isObject(object)) {\n accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {};\n }\n else {\n accumulator = {};\n }\n }\n (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) {\n return iteratee(accumulator, value, index, object);\n });\n return accumulator;\n }\n\n /**\n * Removes the property at `path` of `object`.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to unset.\n * @returns {boolean} Returns `true` if the property is deleted, else `false`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 7 } }] };\n * _.unset(object, 'a[0].b.c');\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n *\n * _.unset(object, ['a', '0', 'b', 'c']);\n * // => true\n *\n * console.log(object);\n * // => { 'a': [{ 'b': {} }] };\n */\n function unset(object, path) {\n return object == null ? true : baseUnset(object, path);\n }\n\n /**\n * This method is like `_.set` except that accepts `updater` to produce the\n * value to set. Use `_.updateWith` to customize `path` creation. The `updater`\n * is invoked with one argument: (value).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.update(object, 'a[0].b.c', function(n) { return n * n; });\n * console.log(object.a[0].b.c);\n * // => 9\n *\n * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; });\n * console.log(object.x[0].y.z);\n * // => 0\n */\n function update(object, path, updater) {\n return object == null ? object : baseUpdate(object, path, castFunction(updater));\n }\n\n /**\n * This method is like `_.update` except that it accepts `customizer` which is\n * invoked to produce the objects of `path`. If `customizer` returns `undefined`\n * path creation is handled by the method instead. The `customizer` is invoked\n * with three arguments: (nsValue, key, nsObject).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.6.0\n * @category Object\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {Function} updater The function to produce the updated value.\n * @param {Function} [customizer] The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {};\n *\n * _.updateWith(object, '[0][1]', _.constant('a'), Object);\n * // => { '0': { '1': 'a' } }\n */\n function updateWith(object, path, updater, customizer) {\n customizer = typeof customizer == 'function' ? customizer : undefined;\n return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer);\n }\n\n /**\n * Creates an array of the own enumerable string keyed property values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.values(new Foo);\n * // => [1, 2] (iteration order is not guaranteed)\n *\n * _.values('hi');\n * // => ['h', 'i']\n */\n function values(object) {\n return object == null ? [] : baseValues(object, keys(object));\n }\n\n /**\n * Creates an array of the own and inherited enumerable string keyed property\n * values of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property values.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.valuesIn(new Foo);\n * // => [1, 2, 3] (iteration order is not guaranteed)\n */\n function valuesIn(object) {\n return object == null ? [] : baseValues(object, keysIn(object));\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Clamps `number` within the inclusive `lower` and `upper` bounds.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Number\n * @param {number} number The number to clamp.\n * @param {number} [lower] The lower bound.\n * @param {number} upper The upper bound.\n * @returns {number} Returns the clamped number.\n * @example\n *\n * _.clamp(-10, -5, 5);\n * // => -5\n *\n * _.clamp(10, -5, 5);\n * // => 5\n */\n function clamp(number, lower, upper) {\n if (upper === undefined) {\n upper = lower;\n lower = undefined;\n }\n if (upper !== undefined) {\n upper = toNumber(upper);\n upper = upper === upper ? upper : 0;\n }\n if (lower !== undefined) {\n lower = toNumber(lower);\n lower = lower === lower ? lower : 0;\n }\n return baseClamp(toNumber(number), lower, upper);\n }\n\n /**\n * Checks if `n` is between `start` and up to, but not including, `end`. If\n * `end` is not specified, it's set to `start` with `start` then set to `0`.\n * If `start` is greater than `end` the params are swapped to support\n * negative ranges.\n *\n * @static\n * @memberOf _\n * @since 3.3.0\n * @category Number\n * @param {number} number The number to check.\n * @param {number} [start=0] The start of the range.\n * @param {number} end The end of the range.\n * @returns {boolean} Returns `true` if `number` is in the range, else `false`.\n * @see _.range, _.rangeRight\n * @example\n *\n * _.inRange(3, 2, 4);\n * // => true\n *\n * _.inRange(4, 8);\n * // => true\n *\n * _.inRange(4, 2);\n * // => false\n *\n * _.inRange(2, 2);\n * // => false\n *\n * _.inRange(1.2, 2);\n * // => true\n *\n * _.inRange(5.2, 4);\n * // => false\n *\n * _.inRange(-3, -2, -6);\n * // => true\n */\n function inRange(number, start, end) {\n start = toFinite(start);\n if (end === undefined) {\n end = start;\n start = 0;\n } else {\n end = toFinite(end);\n }\n number = toNumber(number);\n return baseInRange(number, start, end);\n }\n\n /**\n * Produces a random number between the inclusive `lower` and `upper` bounds.\n * If only one argument is provided a number between `0` and the given number\n * is returned. If `floating` is `true`, or either `lower` or `upper` are\n * floats, a floating-point number is returned instead of an integer.\n *\n * **Note:** JavaScript follows the IEEE-754 standard for resolving\n * floating-point values which can produce unexpected results.\n *\n * @static\n * @memberOf _\n * @since 0.7.0\n * @category Number\n * @param {number} [lower=0] The lower bound.\n * @param {number} [upper=1] The upper bound.\n * @param {boolean} [floating] Specify returning a floating-point number.\n * @returns {number} Returns the random number.\n * @example\n *\n * _.random(0, 5);\n * // => an integer between 0 and 5\n *\n * _.random(5);\n * // => also an integer between 0 and 5\n *\n * _.random(5, true);\n * // => a floating-point number between 0 and 5\n *\n * _.random(1.2, 5.2);\n * // => a floating-point number between 1.2 and 5.2\n */\n function random(lower, upper, floating) {\n if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) {\n upper = floating = undefined;\n }\n if (floating === undefined) {\n if (typeof upper == 'boolean') {\n floating = upper;\n upper = undefined;\n }\n else if (typeof lower == 'boolean') {\n floating = lower;\n lower = undefined;\n }\n }\n if (lower === undefined && upper === undefined) {\n lower = 0;\n upper = 1;\n }\n else {\n lower = toFinite(lower);\n if (upper === undefined) {\n upper = lower;\n lower = 0;\n } else {\n upper = toFinite(upper);\n }\n }\n if (lower > upper) {\n var temp = lower;\n lower = upper;\n upper = temp;\n }\n if (floating || lower % 1 || upper % 1) {\n var rand = nativeRandom();\n return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper);\n }\n return baseRandom(lower, upper);\n }\n\n /*------------------------------------------------------------------------*/\n\n /**\n * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the camel cased string.\n * @example\n *\n * _.camelCase('Foo Bar');\n * // => 'fooBar'\n *\n * _.camelCase('--foo-bar--');\n * // => 'fooBar'\n *\n * _.camelCase('__FOO_BAR__');\n * // => 'fooBar'\n */\n var camelCase = createCompounder(function(result, word, index) {\n word = word.toLowerCase();\n return result + (index ? capitalize(word) : word);\n });\n\n /**\n * Converts the first character of `string` to upper case and the remaining\n * to lower case.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to capitalize.\n * @returns {string} Returns the capitalized string.\n * @example\n *\n * _.capitalize('FRED');\n * // => 'Fred'\n */\n function capitalize(string) {\n return upperFirst(toString(string).toLowerCase());\n }\n\n /**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\n function deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n }\n\n /**\n * Checks if `string` ends with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=string.length] The position to search up to.\n * @returns {boolean} Returns `true` if `string` ends with `target`,\n * else `false`.\n * @example\n *\n * _.endsWith('abc', 'c');\n * // => true\n *\n * _.endsWith('abc', 'b');\n * // => false\n *\n * _.endsWith('abc', 'b', 2);\n * // => true\n */\n function endsWith(string, target, position) {\n string = toString(string);\n target = baseToString(target);\n\n var length = string.length;\n position = position === undefined\n ? length\n : baseClamp(toInteger(position), 0, length);\n\n var end = position;\n position -= target.length;\n return position >= 0 && string.slice(position, end) == target;\n }\n\n /**\n * Converts the characters \"&\", \"<\", \">\", '\"', and \"'\" in `string` to their\n * corresponding HTML entities.\n *\n * **Note:** No other characters are escaped. To escape additional\n * characters use a third-party library like [_he_](https://mths.be/he).\n *\n * Though the \">\" character is escaped for symmetry, characters like\n * \">\" and \"/\" don't need escaping in HTML and have no special meaning\n * unless they're part of a tag or unquoted attribute value. See\n * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)\n * (under \"semi-related fun fact\") for more details.\n *\n * When working with HTML you should always\n * [quote attribute values](http://wonko.com/post/html-escaping) to reduce\n * XSS vectors.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escape('fred, barney, & pebbles');\n * // => 'fred, barney, & pebbles'\n */\n function escape(string) {\n string = toString(string);\n return (string && reHasUnescapedHtml.test(string))\n ? string.replace(reUnescapedHtml, escapeHtmlChar)\n : string;\n }\n\n /**\n * Escapes the `RegExp` special characters \"^\", \"$\", \"\\\", \".\", \"*\", \"+\",\n * \"?\", \"(\", \")\", \"[\", \"]\", \"{\", \"}\", and \"|\" in `string`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to escape.\n * @returns {string} Returns the escaped string.\n * @example\n *\n * _.escapeRegExp('[lodash](https://lodash.com/)');\n * // => '\\[lodash\\]\\(https://lodash\\.com/\\)'\n */\n function escapeRegExp(string) {\n string = toString(string);\n return (string && reHasRegExpChar.test(string))\n ? string.replace(reRegExpChar, '\\\\$&')\n : string;\n }\n\n /**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\n var kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n });\n\n /**\n * Converts `string`, as space separated words, to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the lower cased string.\n * @example\n *\n * _.lowerCase('--Foo-Bar--');\n * // => 'foo bar'\n *\n * _.lowerCase('fooBar');\n * // => 'foo bar'\n *\n * _.lowerCase('__FOO_BAR__');\n * // => 'foo bar'\n */\n var lowerCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + word.toLowerCase();\n });\n\n /**\n * Converts the first character of `string` to lower case.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.lowerFirst('Fred');\n * // => 'fred'\n *\n * _.lowerFirst('FRED');\n * // => 'fRED'\n */\n var lowerFirst = createCaseFirst('toLowerCase');\n\n /**\n * Pads `string` on the left and right sides if it's shorter than `length`.\n * Padding characters are truncated if they can't be evenly divided by `length`.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.pad('abc', 8);\n * // => ' abc '\n *\n * _.pad('abc', 8, '_-');\n * // => '_-abc_-_'\n *\n * _.pad('abc', 3);\n * // => 'abc'\n */\n function pad(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n if (!length || strLength >= length) {\n return string;\n }\n var mid = (length - strLength) / 2;\n return (\n createPadding(nativeFloor(mid), chars) +\n string +\n createPadding(nativeCeil(mid), chars)\n );\n }\n\n /**\n * Pads `string` on the right side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padEnd('abc', 6);\n * // => 'abc '\n *\n * _.padEnd('abc', 6, '_-');\n * // => 'abc_-_'\n *\n * _.padEnd('abc', 3);\n * // => 'abc'\n */\n function padEnd(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (string + createPadding(length - strLength, chars))\n : string;\n }\n\n /**\n * Pads `string` on the left side if it's shorter than `length`. Padding\n * characters are truncated if they exceed `length`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to pad.\n * @param {number} [length=0] The padding length.\n * @param {string} [chars=' '] The string used as padding.\n * @returns {string} Returns the padded string.\n * @example\n *\n * _.padStart('abc', 6);\n * // => ' abc'\n *\n * _.padStart('abc', 6, '_-');\n * // => '_-_abc'\n *\n * _.padStart('abc', 3);\n * // => 'abc'\n */\n function padStart(string, length, chars) {\n string = toString(string);\n length = toInteger(length);\n\n var strLength = length ? stringSize(string) : 0;\n return (length && strLength < length)\n ? (createPadding(length - strLength, chars) + string)\n : string;\n }\n\n /**\n * Converts `string` to an integer of the specified radix. If `radix` is\n * `undefined` or `0`, a `radix` of `10` is used unless `value` is a\n * hexadecimal, in which case a `radix` of `16` is used.\n *\n * **Note:** This method aligns with the\n * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`.\n *\n * @static\n * @memberOf _\n * @since 1.1.0\n * @category String\n * @param {string} string The string to convert.\n * @param {number} [radix=10] The radix to interpret `value` by.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {number} Returns the converted integer.\n * @example\n *\n * _.parseInt('08');\n * // => 8\n *\n * _.map(['6', '08', '10'], _.parseInt);\n * // => [6, 8, 10]\n */\n function parseInt(string, radix, guard) {\n if (guard || radix == null) {\n radix = 0;\n } else if (radix) {\n radix = +radix;\n }\n return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0);\n }\n\n /**\n * Repeats the given string `n` times.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to repeat.\n * @param {number} [n=1] The number of times to repeat the string.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {string} Returns the repeated string.\n * @example\n *\n * _.repeat('*', 3);\n * // => '***'\n *\n * _.repeat('abc', 2);\n * // => 'abcabc'\n *\n * _.repeat('abc', 0);\n * // => ''\n */\n function repeat(string, n, guard) {\n if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) {\n n = 1;\n } else {\n n = toInteger(n);\n }\n return baseRepeat(toString(string), n);\n }\n\n /**\n * Replaces matches for `pattern` in `string` with `replacement`.\n *\n * **Note:** This method is based on\n * [`String#replace`](https://mdn.io/String/replace).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to modify.\n * @param {RegExp|string} pattern The pattern to replace.\n * @param {Function|string} replacement The match replacement.\n * @returns {string} Returns the modified string.\n * @example\n *\n * _.replace('Hi Fred', 'Fred', 'Barney');\n * // => 'Hi Barney'\n */\n function replace() {\n var args = arguments,\n string = toString(args[0]);\n\n return args.length < 3 ? string : string.replace(args[1], args[2]);\n }\n\n /**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\n var snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n });\n\n /**\n * Splits `string` by `separator`.\n *\n * **Note:** This method is based on\n * [`String#split`](https://mdn.io/String/split).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category String\n * @param {string} [string=''] The string to split.\n * @param {RegExp|string} separator The separator pattern to split by.\n * @param {number} [limit] The length to truncate results to.\n * @returns {Array} Returns the string segments.\n * @example\n *\n * _.split('a-b-c', '-', 2);\n * // => ['a', 'b']\n */\n function split(string, separator, limit) {\n if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) {\n separator = limit = undefined;\n }\n limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0;\n if (!limit) {\n return [];\n }\n string = toString(string);\n if (string && (\n typeof separator == 'string' ||\n (separator != null && !isRegExp(separator))\n )) {\n separator = baseToString(separator);\n if (!separator && hasUnicode(string)) {\n return castSlice(stringToArray(string), 0, limit);\n }\n }\n return string.split(separator, limit);\n }\n\n /**\n * Converts `string` to\n * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).\n *\n * @static\n * @memberOf _\n * @since 3.1.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the start cased string.\n * @example\n *\n * _.startCase('--foo-bar--');\n * // => 'Foo Bar'\n *\n * _.startCase('fooBar');\n * // => 'Foo Bar'\n *\n * _.startCase('__FOO_BAR__');\n * // => 'FOO BAR'\n */\n var startCase = createCompounder(function(result, word, index) {\n return result + (index ? ' ' : '') + upperFirst(word);\n });\n\n /**\n * Checks if `string` starts with the given target string.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {string} [target] The string to search for.\n * @param {number} [position=0] The position to search from.\n * @returns {boolean} Returns `true` if `string` starts with `target`,\n * else `false`.\n * @example\n *\n * _.startsWith('abc', 'a');\n * // => true\n *\n * _.startsWith('abc', 'b');\n * // => false\n *\n * _.startsWith('abc', 'b', 1);\n * // => true\n */\n function startsWith(string, target, position) {\n string = toString(string);\n position = position == null\n ? 0\n : baseClamp(toInteger(position), 0, string.length);\n\n target = baseToString(target);\n return string.slice(position, position + target.length) == target;\n }\n\n /**\n * Creates a compiled template function that can interpolate data properties\n * in \"interpolate\" delimiters, HTML-escape interpolated data properties in\n * \"escape\" delimiters, and execute JavaScript in \"evaluate\" delimiters. Data\n * properties may be accessed as free variables in the template. If a setting\n * object is given, it takes precedence over `_.templateSettings` values.\n *\n * **Note:** In the development build `_.template` utilizes\n * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)\n * for easier debugging.\n *\n * For more information on precompiling templates see\n * [lodash's custom builds documentation](https://lodash.com/custom-builds).\n *\n * For more information on Chrome extension sandboxes see\n * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category String\n * @param {string} [string=''] The template string.\n * @param {Object} [options={}] The options object.\n * @param {RegExp} [options.escape=_.templateSettings.escape]\n * The HTML \"escape\" delimiter.\n * @param {RegExp} [options.evaluate=_.templateSettings.evaluate]\n * The \"evaluate\" delimiter.\n * @param {Object} [options.imports=_.templateSettings.imports]\n * An object to import into the template as free variables.\n * @param {RegExp} [options.interpolate=_.templateSettings.interpolate]\n * The \"interpolate\" delimiter.\n * @param {string} [options.sourceURL='lodash.templateSources[n]']\n * The sourceURL of the compiled template.\n * @param {string} [options.variable='obj']\n * The data object variable name.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Function} Returns the compiled template function.\n * @example\n *\n * // Use the \"interpolate\" delimiter to create a compiled template.\n * var compiled = _.template('hello <%= user %>!');\n * compiled({ 'user': 'fred' });\n * // => 'hello fred!'\n *\n * // Use the HTML \"escape\" delimiter to escape data property values.\n * var compiled = _.template('<%- value %>');\n * compiled({ 'value': '