merge devel
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"316.prod.js","mappings":"8KASA,MAAMA,UAA6BC,IAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,UAAY,GACjB,MAAM,kBAAEC,GAAsBJ,EAAMK,KACpCC,EAAeC,SAAQC,IACPA,EAAGC,KAAKC,MAAM,KACtBH,SAAQI,IACZT,KAAKC,UAAUS,KAAK,CAClBH,KAAME,EAAKE,OACXC,KAAMN,EAAGM,KACTC,MAAMC,EAAAA,EAAAA,IAAUR,EAAGM,MACnBG,KAAMb,EAAkBI,EAAGM,KAAM,CAACI,KAAM,YACxC,GACF,IAGJhB,KAAKC,UAAUgB,MAAK,CAACC,EAAGC,IAAMD,EAAEH,KAAKK,cAAcD,EAAEJ,OACvD,CAEAM,iBAAAA,GACMrB,KAAKsB,aACPtB,KAAKsB,YAAYC,eAAe,CAACC,MAAO,SAAUC,OAAQ,WAE9D,CAEAC,MAAAA,GACE,MAAMzB,EAAY,GACZ0B,EAAW3B,KAAKF,MAAM6B,UAAY,KAYxC,OAXA3B,KAAKC,UAAUI,SAAQ,CAACuB,EAAGC,KACzB,MAAMC,EAASF,EAAEhB,MAAQe,EAAW,YAAc,GAClD1B,EAAUS,KAAKd,IAAAA,cAAA,MAAImC,UAAWD,EAAOE,IAAKH,EACxCI,IAAKA,IAAYL,EAAEhB,MAAQe,IAAW3B,KAAKsB,YAAcW,EAAG,EAC5DC,QAASC,GAAKnC,KAAKF,MAAMsC,SAASR,EAAEhB,KAAMgB,EAAErB,OAC5CX,IAAAA,cAAA,QAAMmC,UAAU,gBAAgBH,EAAEf,MAClCjB,IAAAA,cAAA,QAAMmC,UAAU,WAAU,IAAOH,EAAEb,MACnCnB,IAAAA,cAAA,QAAMmC,UAAU,aAAY,KAAQH,EAAErB,OAClC,IAINX,IAAAA,cAAA,OAAKmC,UAAU,mBAAmBD,MAAO,CAACO,OAAQ,UAChDzC,IAAAA,cAAA,MAAImC,UAAU,0BACX9B,GAIT,EAGF,WAAeqC,EAAAA,EAAAA,YAAW3C,E","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["PhoneCountrySelector","React","constructor","props","super","this","countries","formatDisplayName","intl","dcodes","forEach","dc","dial","split","part","push","trim","code","flag","flagEmoji","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","className","key","ref","onClick","_","onSubmit","height","injectIntl"],"sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"884.prod.js","mappings":"4MASA,MAAMA,UAA6BC,IAAAA,cACjCC,WAAAA,CAAYC,GACVC,MAAMD,GAENE,KAAKC,UAAY,GACjB,MAAM,kBAAEC,GAAsBJ,EAAMK,KACpCC,EAAeC,SAAQC,IACPA,EAAGC,KAAKC,MAAM,KACtBH,SAAQI,IACZT,KAAKC,UAAUS,KAAK,CAClBH,KAAME,EAAKE,OACXC,KAAMN,EAAGM,KACTC,MAAMC,EAAAA,EAAAA,IAAUR,EAAGM,MACnBG,KAAMb,EAAkBI,EAAGM,KAAM,CAACI,KAAM,YACxC,GACF,IAGJhB,KAAKC,UAAUgB,MAAK,CAACC,EAAGC,IAAMD,EAAEH,KAAKK,cAAcD,EAAEJ,OACvD,CAEAM,iBAAAA,GACMrB,KAAKsB,aACPtB,KAAKsB,YAAYC,eAAe,CAACC,MAAO,SAAUC,OAAQ,WAE9D,CAEAC,MAAAA,GACE,MAAMzB,EAAY,GACZ0B,EAAW3B,KAAKF,MAAM6B,UAAY,KAYxC,OAXA3B,KAAKC,UAAUI,SAAQ,CAACuB,EAAGC,KACzB,MAAMC,EAASF,EAAEhB,MAAQe,EAAW,YAAc,GAClD1B,EAAUS,KAAKd,IAAAA,cAAA,MAAImC,UAAWD,EAAOE,IAAKH,EACxCI,IAAKA,IAAYL,EAAEhB,MAAQe,IAAW3B,KAAKsB,YAAcW,EAAG,EAC5DC,QAASC,GAAKnC,KAAKF,MAAMsC,SAASR,EAAEhB,KAAMgB,EAAErB,OAC5CX,IAAAA,cAAA,QAAMmC,UAAU,gBAAgBH,EAAEf,MAClCjB,IAAAA,cAAA,QAAMmC,UAAU,WAAU,IAAOH,EAAEb,MACnCnB,IAAAA,cAAA,QAAMmC,UAAU,aAAY,KAAQH,EAAErB,OAClC,IAINX,IAAAA,cAAA,OAAKmC,UAAU,mBAAmBD,MAAO,CAACO,OAAQ,UAChDzC,IAAAA,cAAA,MAAImC,UAAU,0BACX9B,GAIT,EAGF,SAAeqC,EAAAA,EAAAA,YAAW3C,E","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["PhoneCountrySelector","React","constructor","props","super","this","countries","formatDisplayName","intl","dcodes","forEach","dc","dial","split","part","push","trim","code","flag","flagEmoji","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","className","key","ref","onClick","_","onSubmit","height","injectIntl"],"sourceRoot":""}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1059
-694
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,16 +1,13 @@
|
||||
"use strict";
|
||||
(globalThis["webpackChunktinode_webapp"] = globalThis["webpackChunktinode_webapp"] || []).push([["src_widgets_audio-recorder_jsx"],{
|
||||
(self["webpackChunktinode_webapp"] = self["webpackChunktinode_webapp"] || []).push([["src_widgets_audio-recorder_jsx"],{
|
||||
|
||||
/***/ "./src/widgets/audio-recorder.jsx":
|
||||
/*!****************************************!*\
|
||||
!*** ./src/widgets/audio-recorder.jsx ***!
|
||||
\****************************************/
|
||||
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
||||
|
||||
__webpack_require__.r(__webpack_exports__);
|
||||
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||||
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
|
||||
/* harmony export */ });
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "react");
|
||||
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);
|
||||
/* harmony import */ var react_intl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-intl */ "react-intl");
|
||||
@@ -385,7 +382,7 @@ class AudioRecorder extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
|
||||
}, "send")));
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,react_intl__WEBPACK_IMPORTED_MODULE_1__.injectIntl)(AudioRecorder));
|
||||
/* harmony default export */ __webpack_exports__["default"] = ((0,react_intl__WEBPACK_IMPORTED_MODULE_1__.injectIntl)(AudioRecorder));
|
||||
|
||||
/***/ })
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
{"version":3,"file":"src_widgets_phone-country-selector_jsx.dev.js","mappings":";;;;;;;;;;;;;;;;;;;AAE0B;AACc;AAEC;AAEI;AAE7C,MAAMI,oBAAoB,SAASJ,4DAAmB,CAAC;EACrDM,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,MAAM;MAAEC;IAAkB,CAAC,GAAGF,KAAK,CAACG,IAAI;IACxCR,iDAAsB,CAACW,EAAE,IAAI;MAC3B,MAAMC,KAAK,GAAGD,EAAE,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC;MAChCF,KAAK,CAACF,OAAO,CAACK,IAAI,IAAI;QACpB,IAAI,CAACT,SAAS,CAACU,IAAI,CAAC;UAClBH,IAAI,EAAEE,IAAI,CAACE,IAAI,EAAE;UACjBC,IAAI,EAAEP,EAAE,CAACO,IAAI;UACbC,IAAI,EAAElB,yDAAS,CAACU,EAAE,CAACO,IAAI,CAAC;UACxBE,IAAI,EAAEb,iBAAiB,CAACI,EAAE,CAACO,IAAI,EAAE;YAACG,IAAI,EAAE;UAAQ,CAAC;QACnD,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAACf,SAAS,CAACgB,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACH,IAAI,CAACK,aAAa,CAACD,CAAC,CAACJ,IAAI,CAAC,CAAC;EAC7D;EAEAM,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACC,WAAW,EAAE;MACpB,IAAI,CAACA,WAAW,CAACC,cAAc,CAAC;QAACC,KAAK,EAAE,QAAQ;QAAEC,MAAM,EAAE;MAAS,CAAC,CAAC;IACvE;EACF;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAMzB,SAAS,GAAG,EAAE;IACpB,MAAM0B,QAAQ,GAAG,IAAI,CAAC3B,KAAK,CAAC2B,QAAQ,IAAI,IAAI;IAC5C,IAAI,CAAC1B,SAAS,CAACI,OAAO,CAAC,CAACuB,CAAC,EAAEC,GAAG,KAAK;MACjC,MAAMC,KAAK,GAAIF,CAAC,CAACf,IAAI,IAAIc,QAAQ,GAAG,WAAW,GAAG,EAAG;MACrD1B,SAAS,CAACU,IAAI,CAAClB,0DAAA;QAAIuC,SAAS,EAAEF,KAAM;QAACG,GAAG,EAAEJ,GAAI;QAC5CK,GAAG,EAAEA,GAAG,IAAI;UAAC,IAAIN,CAAC,CAACf,IAAI,IAAIc,QAAQ,EAAE;YAAC,IAAI,CAACL,WAAW,GAAGY,GAAG;UAAA;QAAC,CAAE;QAC/DC,OAAO,EAAEC,CAAC,IAAI,IAAI,CAACpC,KAAK,CAACqC,QAAQ,CAACT,CAAC,CAACf,IAAI,EAAEe,CAAC,CAACpB,IAAI;MAAE,GAClDf,0DAAA;QAAMuC,SAAS,EAAC;MAAc,GAAEJ,CAAC,CAACd,IAAI,CAAQ,EAC9CrB,0DAAA;QAAMuC,SAAS,EAAC;MAAS,GAAC,MAAM,EAACJ,CAAC,CAACb,IAAI,CAAQ,EAC/CtB,0DAAA;QAAMuC,SAAS,EAAC;MAAW,GAAC,OAAO,EAACJ,CAAC,CAACpB,IAAI,CAAQ,CAC/C,CAAC;IACR,CAAC,CAAC;IAEF,OACEf,0DAAA;MAAKuC,SAAS,EAAC,kBAAkB;MAACF,KAAK,EAAE;QAACQ,MAAM,EAAE;MAAO;IAAE,GACzD7C,0DAAA;MAAIuC,SAAS,EAAC;IAAwB,GACnC/B,SAAS,CACP,CACD;EAEV;AACF;AAEA,iEAAeP,sDAAU,CAACG,oBAAoB,CAAC","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["React","injectIntl","dcodes","flagEmoji","PhoneCountrySelector","PureComponent","constructor","props","countries","formatDisplayName","intl","default","forEach","dc","parts","dial","split","part","push","trim","code","flag","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","createElement","className","key","ref","onClick","_","onSubmit","height"],"sourceRoot":""}
|
||||
{"version":3,"file":"src_widgets_phone-country-selector_jsx.dev.js","mappings":";;;;;;;;;;;;;;;;AAE0B;AACc;AAEC;AAEI;AAE7C,MAAMI,oBAAoB,SAASJ,4DAAmB,CAAC;EACrDM,WAAWA,CAACC,KAAK,EAAE;IACjB,KAAK,CAACA,KAAK,CAAC;IAEZ,IAAI,CAACC,SAAS,GAAG,EAAE;IACnB,MAAM;MAAEC;IAAkB,CAAC,GAAGF,KAAK,CAACG,IAAI;IACxCR,yCAAc,CAACU,OAAO,CAACC,EAAE,IAAI;MAC3B,MAAMC,KAAK,GAAGD,EAAE,CAACE,IAAI,CAACC,KAAK,CAAC,GAAG,CAAC;MAChCF,KAAK,CAACF,OAAO,CAACK,IAAI,IAAI;QACpB,IAAI,CAACT,SAAS,CAACU,IAAI,CAAC;UAClBH,IAAI,EAAEE,IAAI,CAACE,IAAI,CAAC,CAAC;UACjBC,IAAI,EAAEP,EAAE,CAACO,IAAI;UACbC,IAAI,EAAElB,yDAAS,CAACU,EAAE,CAACO,IAAI,CAAC;UACxBE,IAAI,EAAEb,iBAAiB,CAACI,EAAE,CAACO,IAAI,EAAE;YAACG,IAAI,EAAE;UAAQ,CAAC;QACnD,CAAC,CAAC;MACJ,CAAC,CAAC;IACJ,CAAC,CAAC;IAEF,IAAI,CAACf,SAAS,CAACgB,IAAI,CAAC,CAACC,CAAC,EAAEC,CAAC,KAAKD,CAAC,CAACH,IAAI,CAACK,aAAa,CAACD,CAAC,CAACJ,IAAI,CAAC,CAAC;EAC7D;EAEAM,iBAAiBA,CAAA,EAAG;IAClB,IAAI,IAAI,CAACC,WAAW,EAAE;MACpB,IAAI,CAACA,WAAW,CAACC,cAAc,CAAC;QAACC,KAAK,EAAE,QAAQ;QAAEC,MAAM,EAAE;MAAS,CAAC,CAAC;IACvE;EACF;EAEAC,MAAMA,CAAA,EAAG;IACP,MAAMzB,SAAS,GAAG,EAAE;IACpB,MAAM0B,QAAQ,GAAG,IAAI,CAAC3B,KAAK,CAAC2B,QAAQ,IAAI,IAAI;IAC5C,IAAI,CAAC1B,SAAS,CAACI,OAAO,CAAC,CAACuB,CAAC,EAAEC,GAAG,KAAK;MACjC,MAAMC,KAAK,GAAIF,CAAC,CAACf,IAAI,IAAIc,QAAQ,GAAG,WAAW,GAAG,EAAG;MACrD1B,SAAS,CAACU,IAAI,CAAClB,0DAAA;QAAIuC,SAAS,EAAEF,KAAM;QAACG,GAAG,EAAEJ,GAAI;QAC5CK,GAAG,EAAEA,GAAG,IAAI;UAAC,IAAIN,CAAC,CAACf,IAAI,IAAIc,QAAQ,EAAE;YAAC,IAAI,CAACL,WAAW,GAAGY,GAAG;UAAA;QAAC,CAAE;QAC/DC,OAAO,EAAEC,CAAC,IAAI,IAAI,CAACpC,KAAK,CAACqC,QAAQ,CAACT,CAAC,CAACf,IAAI,EAAEe,CAAC,CAACpB,IAAI;MAAE,GAClDf,0DAAA;QAAMuC,SAAS,EAAC;MAAc,GAAEJ,CAAC,CAACd,IAAW,CAAC,EAC9CrB,0DAAA;QAAMuC,SAAS,EAAC;MAAS,GAAC,MAAM,EAACJ,CAAC,CAACb,IAAW,CAAC,EAC/CtB,0DAAA;QAAMuC,SAAS,EAAC;MAAW,GAAC,OAAO,EAACJ,CAAC,CAACpB,IAAW,CAC/C,CAAC,CAAC;IACR,CAAC,CAAC;IAEF,OACEf,0DAAA;MAAKuC,SAAS,EAAC,kBAAkB;MAACF,KAAK,EAAE;QAACQ,MAAM,EAAE;MAAO;IAAE,GACzD7C,0DAAA;MAAIuC,SAAS,EAAC;IAAwB,GACnC/B,SACC,CACD,CAAC;EAEV;AACF;AAEA,+DAAeP,sDAAU,CAACG,oBAAoB,CAAC","sources":["webpack://tinode-webapp/./src/widgets/phone-country-selector.jsx"],"sourcesContent":["// Selector for country dialing code.\n\nimport React from 'react';\nimport { injectIntl } from 'react-intl';\n\nimport * as dcodes from '../dcodes.json';\n\nimport { flagEmoji } from '../lib/strformat';\n\nclass PhoneCountrySelector extends React.PureComponent {\n constructor(props) {\n super(props);\n\n this.countries = [];\n const { formatDisplayName } = props.intl;\n dcodes.default.forEach(dc => {\n const parts = dc.dial.split(',');\n parts.forEach(part => {\n this.countries.push({\n dial: part.trim(),\n code: dc.code,\n flag: flagEmoji(dc.code),\n name: formatDisplayName(dc.code, {type: 'region'})\n });\n });\n });\n\n this.countries.sort((a, b) => a.name.localeCompare(b.name));\n }\n\n componentDidMount() {\n if (this.selectedRef) {\n this.selectedRef.scrollIntoView({block: 'center', inline: 'nearest'});\n }\n }\n\n render() {\n const countries = [];\n const selected = this.props.selected || 'US';\n this.countries.forEach((c, idx) => {\n const style = (c.code == selected ? 'selected ' : '');\n countries.push(<li className={style} key={idx}\n ref={ref => {if (c.code == selected) {this.selectedRef = ref}}}\n onClick={_ => this.props.onSubmit(c.code, c.dial)}>\n <span className=\"country-flag\">{c.flag}</span>\n <span className=\"country\"> {c.name}</span>\n <span className=\"dial-code\"> +{c.dial}</span>\n </li>);\n });\n\n return (\n <div className=\"scrollable-panel\" style={{height: '30rem'}}>\n <ul className=\"phone-country-selector\">\n {countries}\n </ul>\n </div>\n );\n }\n}\n\nexport default injectIntl(PhoneCountrySelector);\n"],"names":["React","injectIntl","dcodes","flagEmoji","PhoneCountrySelector","PureComponent","constructor","props","countries","formatDisplayName","intl","default","forEach","dc","parts","dial","split","part","push","trim","code","flag","name","type","sort","a","b","localeCompare","componentDidMount","selectedRef","scrollIntoView","block","inline","render","selected","c","idx","style","createElement","className","key","ref","onClick","_","onSubmit","height"],"sourceRoot":""}
|
||||
+609
-884
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+576
-220
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
@@ -1,10 +1,10 @@
|
||||
(globalThis["webpackChunktinode_webapp"] = globalThis["webpackChunktinode_webapp"] || []).push([["vendors-node_modules_webm-duration-fix_lib_index_js"],{
|
||||
(self["webpackChunktinode_webapp"] = self["webpackChunktinode_webapp"] || []).push([["vendors-node_modules_webm-duration-fix_lib_index_js"],{
|
||||
|
||||
/***/ "./node_modules/base64-js/index.js":
|
||||
/*!*****************************************!*\
|
||||
!*** ./node_modules/base64-js/index.js ***!
|
||||
\*****************************************/
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -165,7 +165,7 @@ function fromByteArray (uint8) {
|
||||
/*!**************************************!*\
|
||||
!*** ./node_modules/buffer/index.js ***!
|
||||
\**************************************/
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
/*!
|
||||
@@ -2282,7 +2282,7 @@ function BufferBigIntNotDefined () {
|
||||
/*!******************************************!*\
|
||||
!*** ./node_modules/ebml-block/index.js ***!
|
||||
\******************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||||
|
||||
var BufferReader = __webpack_require__(/*! ./lib/buffer-reader */ "./node_modules/ebml-block/lib/buffer-reader.js")
|
||||
|
||||
@@ -2371,7 +2371,7 @@ function readLacedData (reader, lacing) {
|
||||
/*!******************************************************!*\
|
||||
!*** ./node_modules/ebml-block/lib/buffer-reader.js ***!
|
||||
\******************************************************/
|
||||
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
||||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
||||
|
||||
var vint = __webpack_require__(/*! ./vint */ "./node_modules/ebml-block/lib/vint.js")
|
||||
|
||||
@@ -2429,7 +2429,7 @@ module.exports = BufferReader
|
||||
/*!*********************************************!*\
|
||||
!*** ./node_modules/ebml-block/lib/vint.js ***!
|
||||
\*********************************************/
|
||||
/***/ ((module) => {
|
||||
/***/ (function(module) {
|
||||
|
||||
// https://github.com/themasch/node-ebml/blob/master/lib/ebml/tools.js
|
||||
module.exports = function (buffer, start, signed) {
|
||||
@@ -2476,7 +2476,7 @@ module.exports = function (buffer, start, signed) {
|
||||
/*!***************************************!*\
|
||||
!*** ./node_modules/events/events.js ***!
|
||||
\***************************************/
|
||||
/***/ ((module) => {
|
||||
/***/ (function(module) {
|
||||
|
||||
"use strict";
|
||||
// Copyright Joyent, Inc. and other Node contributors.
|
||||
@@ -2984,7 +2984,7 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
|
||||
/*!***************************************!*\
|
||||
!*** ./node_modules/ieee754/index.js ***!
|
||||
\***************************************/
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
||||
exports.read = function (buffer, offset, isLE, mLen, nBytes) {
|
||||
@@ -3073,329 +3073,13 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
|
||||
}
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/int64-buffer/int64-buffer.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/int64-buffer/int64-buffer.js ***!
|
||||
\***************************************************/
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
// int64-buffer.js
|
||||
|
||||
/*jshint -W018 */ // Confusing use of '!'.
|
||||
/*jshint -W030 */ // Expected an assignment or function call and instead saw an expression.
|
||||
/*jshint -W093 */ // Did you mean to return a conditional instead of an assignment?
|
||||
|
||||
var Uint64BE, Int64BE, Uint64LE, Int64LE;
|
||||
|
||||
!function(exports) {
|
||||
// constants
|
||||
|
||||
var UNDEFINED = "undefined";
|
||||
var BUFFER = (UNDEFINED !== typeof Buffer) && Buffer;
|
||||
var UINT8ARRAY = (UNDEFINED !== typeof Uint8Array) && Uint8Array;
|
||||
var ARRAYBUFFER = (UNDEFINED !== typeof ArrayBuffer) && ArrayBuffer;
|
||||
var ZERO = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
var isArray = Array.isArray || _isArray;
|
||||
var BIT32 = 4294967296;
|
||||
var BIT24 = 16777216;
|
||||
|
||||
// storage class
|
||||
|
||||
var storage; // Array;
|
||||
|
||||
// generate classes
|
||||
|
||||
Uint64BE = factory("Uint64BE", true, true);
|
||||
Int64BE = factory("Int64BE", true, false);
|
||||
Uint64LE = factory("Uint64LE", false, true);
|
||||
Int64LE = factory("Int64LE", false, false);
|
||||
|
||||
// class factory
|
||||
|
||||
function factory(name, bigendian, unsigned) {
|
||||
var posH = bigendian ? 0 : 4;
|
||||
var posL = bigendian ? 4 : 0;
|
||||
var pos0 = bigendian ? 0 : 3;
|
||||
var pos1 = bigendian ? 1 : 2;
|
||||
var pos2 = bigendian ? 2 : 1;
|
||||
var pos3 = bigendian ? 3 : 0;
|
||||
var fromPositive = bigendian ? fromPositiveBE : fromPositiveLE;
|
||||
var fromNegative = bigendian ? fromNegativeBE : fromNegativeLE;
|
||||
var proto = Int64.prototype;
|
||||
var isName = "is" + name;
|
||||
var _isInt64 = "_" + isName;
|
||||
|
||||
// properties
|
||||
proto.buffer = void 0;
|
||||
proto.offset = 0;
|
||||
proto[_isInt64] = true;
|
||||
|
||||
// methods
|
||||
proto.toNumber = toNumber;
|
||||
proto.toString = toString;
|
||||
proto.toJSON = toNumber;
|
||||
proto.toArray = toArray;
|
||||
|
||||
// add .toBuffer() method only when Buffer available
|
||||
if (BUFFER) proto.toBuffer = toBuffer;
|
||||
|
||||
// add .toArrayBuffer() method only when Uint8Array available
|
||||
if (UINT8ARRAY) proto.toArrayBuffer = toArrayBuffer;
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
Int64[isName] = isInt64;
|
||||
|
||||
// CommonJS
|
||||
exports[name] = Int64;
|
||||
|
||||
return Int64;
|
||||
|
||||
// constructor
|
||||
function Int64(buffer, offset, value, raddix) {
|
||||
if (!(this instanceof Int64)) return new Int64(buffer, offset, value, raddix);
|
||||
return init(this, buffer, offset, value, raddix);
|
||||
}
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
function isInt64(b) {
|
||||
return !!(b && b[_isInt64]);
|
||||
}
|
||||
|
||||
// initializer
|
||||
function init(that, buffer, offset, value, raddix) {
|
||||
if (UINT8ARRAY && ARRAYBUFFER) {
|
||||
if (buffer instanceof ARRAYBUFFER) buffer = new UINT8ARRAY(buffer);
|
||||
if (value instanceof ARRAYBUFFER) value = new UINT8ARRAY(value);
|
||||
}
|
||||
|
||||
// Int64BE() style
|
||||
if (!buffer && !offset && !value && !storage) {
|
||||
// shortcut to initialize with zero
|
||||
that.buffer = newArray(ZERO, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Int64BE(value, raddix) style
|
||||
if (!isValidBuffer(buffer, offset)) {
|
||||
var _storage = storage || Array;
|
||||
raddix = offset;
|
||||
value = buffer;
|
||||
offset = 0;
|
||||
buffer = (storage === BUFFER) ? BUFFER.alloc(8) : new _storage(8);
|
||||
}
|
||||
|
||||
that.buffer = buffer;
|
||||
that.offset = offset |= 0;
|
||||
|
||||
// Int64BE(buffer, offset) style
|
||||
if (UNDEFINED === typeof value) return;
|
||||
|
||||
// Int64BE(buffer, offset, value, raddix) style
|
||||
if ("string" === typeof value) {
|
||||
fromString(buffer, offset, value, raddix || 10);
|
||||
} else if (isValidBuffer(value, raddix)) {
|
||||
fromArray(buffer, offset, value, raddix);
|
||||
} else if ("number" === typeof raddix) {
|
||||
writeInt32(buffer, offset + posH, value); // high
|
||||
writeInt32(buffer, offset + posL, raddix); // low
|
||||
} else if (value > 0) {
|
||||
fromPositive(buffer, offset, value); // positive
|
||||
} else if (value < 0) {
|
||||
fromNegative(buffer, offset, value); // negative
|
||||
} else {
|
||||
fromArray(buffer, offset, ZERO, 0); // zero, NaN and others
|
||||
}
|
||||
}
|
||||
|
||||
function fromString(buffer, offset, str, raddix) {
|
||||
var pos = 0;
|
||||
var len = str.length;
|
||||
var high = 0;
|
||||
var low = 0;
|
||||
if (str[0] === "-") pos++;
|
||||
var sign = pos;
|
||||
while (pos < len) {
|
||||
var chr = parseInt(str[pos++], raddix);
|
||||
if (!(chr >= 0)) break; // NaN
|
||||
low = low * raddix + chr;
|
||||
high = high * raddix + Math.floor(low / BIT32);
|
||||
low %= BIT32;
|
||||
}
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
if (low) {
|
||||
low = BIT32 - low;
|
||||
} else {
|
||||
high++;
|
||||
}
|
||||
}
|
||||
writeInt32(buffer, offset + posH, high);
|
||||
writeInt32(buffer, offset + posL, low);
|
||||
}
|
||||
|
||||
function toNumber() {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
if (!unsigned) high |= 0; // a trick to get signed
|
||||
return high ? (high * BIT32 + low) : low;
|
||||
}
|
||||
|
||||
function toString(radix) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
var str = "";
|
||||
var sign = !unsigned && (high & 0x80000000);
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
low = BIT32 - low;
|
||||
}
|
||||
radix = radix || 10;
|
||||
while (1) {
|
||||
var mod = (high % radix) * BIT32 + low;
|
||||
high = Math.floor(high / radix);
|
||||
low = Math.floor(mod / radix);
|
||||
str = (mod % radix).toString(radix) + str;
|
||||
if (!high && !low) break;
|
||||
}
|
||||
if (sign) {
|
||||
str = "-" + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function writeInt32(buffer, offset, value) {
|
||||
buffer[offset + pos3] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos2] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos1] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos0] = value & 255;
|
||||
}
|
||||
|
||||
function readInt32(buffer, offset) {
|
||||
return (buffer[offset + pos0] * BIT24) +
|
||||
(buffer[offset + pos1] << 16) +
|
||||
(buffer[offset + pos2] << 8) +
|
||||
buffer[offset + pos3];
|
||||
}
|
||||
}
|
||||
|
||||
function toArray(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = null; // Array
|
||||
|
||||
if (raw !== false && isArray(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
return newArray(buffer, offset);
|
||||
}
|
||||
|
||||
function toBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = BUFFER;
|
||||
|
||||
if (raw !== false && BUFFER.isBuffer(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
// Buffer.from(arraybuffer) available since Node v4.5.0
|
||||
// https://nodejs.org/en/blog/release/v4.5.0/
|
||||
return BUFFER.from(toArrayBuffer.call(this, raw));
|
||||
}
|
||||
|
||||
function toArrayBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var arrbuf = buffer.buffer;
|
||||
storage = UINT8ARRAY;
|
||||
|
||||
// arrbuf.slice() ignores buffer.offset until Node v8.0.0
|
||||
if (raw !== false && !buffer.offset && (arrbuf instanceof ARRAYBUFFER)) {
|
||||
return (arrbuf.byteLength === 8) ? arrbuf : arrbuf.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
var dest = new UINT8ARRAY(8);
|
||||
fromArray(dest, 0, buffer, offset);
|
||||
return dest.buffer;
|
||||
}
|
||||
|
||||
function isValidBuffer(buffer, offset) {
|
||||
var len = buffer && buffer.length;
|
||||
offset |= 0;
|
||||
return len && (offset + 8 <= len) && ("string" !== typeof buffer[offset]);
|
||||
}
|
||||
|
||||
function fromArray(destbuf, destoff, srcbuf, srcoff) {
|
||||
destoff |= 0;
|
||||
srcoff |= 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
destbuf[destoff++] = srcbuf[srcoff++] & 255;
|
||||
}
|
||||
}
|
||||
|
||||
function newArray(buffer, offset) {
|
||||
return Array.prototype.slice.call(buffer, offset, offset + 8);
|
||||
}
|
||||
|
||||
function fromPositiveBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
value++;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromPositiveLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
value++;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/retrofox/is-array
|
||||
function _isArray(val) {
|
||||
return !!val && "[object Array]" == Object.prototype.toString.call(val);
|
||||
}
|
||||
|
||||
}( true && typeof exports.nodeName !== 'string' ? exports : (this || {}));
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/webm-duration-fix/lib/ebml/EBML.js":
|
||||
/*!*********************************************************!*\
|
||||
!*** ./node_modules/webm-duration-fix/lib/ebml/EBML.js ***!
|
||||
\*********************************************************/
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -3408,7 +3092,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||
/*!****************************************************************!*\
|
||||
!*** ./node_modules/webm-duration-fix/lib/ebml/EBMLDecoder.js ***!
|
||||
\****************************************************************/
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -3658,7 +3342,7 @@ exports["default"] = EBMLDecoder;
|
||||
/*!****************************************************************!*\
|
||||
!*** ./node_modules/webm-duration-fix/lib/ebml/EBMLEncoder.js ***!
|
||||
\****************************************************************/
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -4166,7 +3850,7 @@ exports["default"] = EBMLReader;
|
||||
/*!***********************************************************!*\
|
||||
!*** ./node_modules/webm-duration-fix/lib/ebml/ebmlID.js ***!
|
||||
\***********************************************************/
|
||||
/***/ ((__unused_webpack_module, exports) => {
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -6578,7 +6262,7 @@ exports["default"] = Tools;
|
||||
/*!**********************************************************!*\
|
||||
!*** ./node_modules/webm-duration-fix/lib/ebml/tools.js ***!
|
||||
\**********************************************************/
|
||||
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
||||
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
||||
|
||||
"use strict";
|
||||
|
||||
@@ -7351,6 +7035,322 @@ function fixWebmDuration(blob) {
|
||||
exports["default"] = fixWebmDuration;
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
||||
/***/ "./node_modules/int64-buffer/int64-buffer.js":
|
||||
/*!***************************************************!*\
|
||||
!*** ./node_modules/int64-buffer/int64-buffer.js ***!
|
||||
\***************************************************/
|
||||
/***/ (function(__unused_webpack_module, exports) {
|
||||
|
||||
// int64-buffer.js
|
||||
|
||||
/*jshint -W018 */ // Confusing use of '!'.
|
||||
/*jshint -W030 */ // Expected an assignment or function call and instead saw an expression.
|
||||
/*jshint -W093 */ // Did you mean to return a conditional instead of an assignment?
|
||||
|
||||
var Uint64BE, Int64BE, Uint64LE, Int64LE;
|
||||
|
||||
!function(exports) {
|
||||
// constants
|
||||
|
||||
var UNDEFINED = "undefined";
|
||||
var BUFFER = (UNDEFINED !== typeof Buffer) && Buffer;
|
||||
var UINT8ARRAY = (UNDEFINED !== typeof Uint8Array) && Uint8Array;
|
||||
var ARRAYBUFFER = (UNDEFINED !== typeof ArrayBuffer) && ArrayBuffer;
|
||||
var ZERO = [0, 0, 0, 0, 0, 0, 0, 0];
|
||||
var isArray = Array.isArray || _isArray;
|
||||
var BIT32 = 4294967296;
|
||||
var BIT24 = 16777216;
|
||||
|
||||
// storage class
|
||||
|
||||
var storage; // Array;
|
||||
|
||||
// generate classes
|
||||
|
||||
Uint64BE = factory("Uint64BE", true, true);
|
||||
Int64BE = factory("Int64BE", true, false);
|
||||
Uint64LE = factory("Uint64LE", false, true);
|
||||
Int64LE = factory("Int64LE", false, false);
|
||||
|
||||
// class factory
|
||||
|
||||
function factory(name, bigendian, unsigned) {
|
||||
var posH = bigendian ? 0 : 4;
|
||||
var posL = bigendian ? 4 : 0;
|
||||
var pos0 = bigendian ? 0 : 3;
|
||||
var pos1 = bigendian ? 1 : 2;
|
||||
var pos2 = bigendian ? 2 : 1;
|
||||
var pos3 = bigendian ? 3 : 0;
|
||||
var fromPositive = bigendian ? fromPositiveBE : fromPositiveLE;
|
||||
var fromNegative = bigendian ? fromNegativeBE : fromNegativeLE;
|
||||
var proto = Int64.prototype;
|
||||
var isName = "is" + name;
|
||||
var _isInt64 = "_" + isName;
|
||||
|
||||
// properties
|
||||
proto.buffer = void 0;
|
||||
proto.offset = 0;
|
||||
proto[_isInt64] = true;
|
||||
|
||||
// methods
|
||||
proto.toNumber = toNumber;
|
||||
proto.toString = toString;
|
||||
proto.toJSON = toNumber;
|
||||
proto.toArray = toArray;
|
||||
|
||||
// add .toBuffer() method only when Buffer available
|
||||
if (BUFFER) proto.toBuffer = toBuffer;
|
||||
|
||||
// add .toArrayBuffer() method only when Uint8Array available
|
||||
if (UINT8ARRAY) proto.toArrayBuffer = toArrayBuffer;
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
Int64[isName] = isInt64;
|
||||
|
||||
// CommonJS
|
||||
exports[name] = Int64;
|
||||
|
||||
return Int64;
|
||||
|
||||
// constructor
|
||||
function Int64(buffer, offset, value, raddix) {
|
||||
if (!(this instanceof Int64)) return new Int64(buffer, offset, value, raddix);
|
||||
return init(this, buffer, offset, value, raddix);
|
||||
}
|
||||
|
||||
// isUint64BE, isInt64BE
|
||||
function isInt64(b) {
|
||||
return !!(b && b[_isInt64]);
|
||||
}
|
||||
|
||||
// initializer
|
||||
function init(that, buffer, offset, value, raddix) {
|
||||
if (UINT8ARRAY && ARRAYBUFFER) {
|
||||
if (buffer instanceof ARRAYBUFFER) buffer = new UINT8ARRAY(buffer);
|
||||
if (value instanceof ARRAYBUFFER) value = new UINT8ARRAY(value);
|
||||
}
|
||||
|
||||
// Int64BE() style
|
||||
if (!buffer && !offset && !value && !storage) {
|
||||
// shortcut to initialize with zero
|
||||
that.buffer = newArray(ZERO, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// Int64BE(value, raddix) style
|
||||
if (!isValidBuffer(buffer, offset)) {
|
||||
var _storage = storage || Array;
|
||||
raddix = offset;
|
||||
value = buffer;
|
||||
offset = 0;
|
||||
buffer = (storage === BUFFER) ? BUFFER.alloc(8) : new _storage(8);
|
||||
}
|
||||
|
||||
that.buffer = buffer;
|
||||
that.offset = offset |= 0;
|
||||
|
||||
// Int64BE(buffer, offset) style
|
||||
if (UNDEFINED === typeof value) return;
|
||||
|
||||
// Int64BE(buffer, offset, value, raddix) style
|
||||
if ("string" === typeof value) {
|
||||
fromString(buffer, offset, value, raddix || 10);
|
||||
} else if (isValidBuffer(value, raddix)) {
|
||||
fromArray(buffer, offset, value, raddix);
|
||||
} else if ("number" === typeof raddix) {
|
||||
writeInt32(buffer, offset + posH, value); // high
|
||||
writeInt32(buffer, offset + posL, raddix); // low
|
||||
} else if (value > 0) {
|
||||
fromPositive(buffer, offset, value); // positive
|
||||
} else if (value < 0) {
|
||||
fromNegative(buffer, offset, value); // negative
|
||||
} else {
|
||||
fromArray(buffer, offset, ZERO, 0); // zero, NaN and others
|
||||
}
|
||||
}
|
||||
|
||||
function fromString(buffer, offset, str, raddix) {
|
||||
var pos = 0;
|
||||
var len = str.length;
|
||||
var high = 0;
|
||||
var low = 0;
|
||||
if (str[0] === "-") pos++;
|
||||
var sign = pos;
|
||||
while (pos < len) {
|
||||
var chr = parseInt(str[pos++], raddix);
|
||||
if (!(chr >= 0)) break; // NaN
|
||||
low = low * raddix + chr;
|
||||
high = high * raddix + Math.floor(low / BIT32);
|
||||
low %= BIT32;
|
||||
}
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
if (low) {
|
||||
low = BIT32 - low;
|
||||
} else {
|
||||
high++;
|
||||
}
|
||||
}
|
||||
writeInt32(buffer, offset + posH, high);
|
||||
writeInt32(buffer, offset + posL, low);
|
||||
}
|
||||
|
||||
function toNumber() {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
if (!unsigned) high |= 0; // a trick to get signed
|
||||
return high ? (high * BIT32 + low) : low;
|
||||
}
|
||||
|
||||
function toString(radix) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var high = readInt32(buffer, offset + posH);
|
||||
var low = readInt32(buffer, offset + posL);
|
||||
var str = "";
|
||||
var sign = !unsigned && (high & 0x80000000);
|
||||
if (sign) {
|
||||
high = ~high;
|
||||
low = BIT32 - low;
|
||||
}
|
||||
radix = radix || 10;
|
||||
while (1) {
|
||||
var mod = (high % radix) * BIT32 + low;
|
||||
high = Math.floor(high / radix);
|
||||
low = Math.floor(mod / radix);
|
||||
str = (mod % radix).toString(radix) + str;
|
||||
if (!high && !low) break;
|
||||
}
|
||||
if (sign) {
|
||||
str = "-" + str;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
function writeInt32(buffer, offset, value) {
|
||||
buffer[offset + pos3] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos2] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos1] = value & 255;
|
||||
value = value >> 8;
|
||||
buffer[offset + pos0] = value & 255;
|
||||
}
|
||||
|
||||
function readInt32(buffer, offset) {
|
||||
return (buffer[offset + pos0] * BIT24) +
|
||||
(buffer[offset + pos1] << 16) +
|
||||
(buffer[offset + pos2] << 8) +
|
||||
buffer[offset + pos3];
|
||||
}
|
||||
}
|
||||
|
||||
function toArray(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = null; // Array
|
||||
|
||||
if (raw !== false && isArray(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
return newArray(buffer, offset);
|
||||
}
|
||||
|
||||
function toBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
storage = BUFFER;
|
||||
|
||||
if (raw !== false && BUFFER.isBuffer(buffer)) {
|
||||
return (buffer.length === 8) ? buffer : buffer.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
// Buffer.from(arraybuffer) available since Node v4.5.0
|
||||
// https://nodejs.org/en/blog/release/v4.5.0/
|
||||
return BUFFER.from(toArrayBuffer.call(this, raw));
|
||||
}
|
||||
|
||||
function toArrayBuffer(raw) {
|
||||
var buffer = this.buffer;
|
||||
var offset = this.offset;
|
||||
var arrbuf = buffer.buffer;
|
||||
storage = UINT8ARRAY;
|
||||
|
||||
// arrbuf.slice() ignores buffer.offset until Node v8.0.0
|
||||
if (raw !== false && !buffer.offset && (arrbuf instanceof ARRAYBUFFER)) {
|
||||
return (arrbuf.byteLength === 8) ? arrbuf : arrbuf.slice(offset, offset + 8);
|
||||
}
|
||||
|
||||
var dest = new UINT8ARRAY(8);
|
||||
fromArray(dest, 0, buffer, offset);
|
||||
return dest.buffer;
|
||||
}
|
||||
|
||||
function isValidBuffer(buffer, offset) {
|
||||
var len = buffer && buffer.length;
|
||||
offset |= 0;
|
||||
return len && (offset + 8 <= len) && ("string" !== typeof buffer[offset]);
|
||||
}
|
||||
|
||||
function fromArray(destbuf, destoff, srcbuf, srcoff) {
|
||||
destoff |= 0;
|
||||
srcoff |= 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
destbuf[destoff++] = srcbuf[srcoff++] & 255;
|
||||
}
|
||||
}
|
||||
|
||||
function newArray(buffer, offset) {
|
||||
return Array.prototype.slice.call(buffer, offset, offset + 8);
|
||||
}
|
||||
|
||||
function fromPositiveBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeBE(buffer, offset, value) {
|
||||
var pos = offset + 8;
|
||||
value++;
|
||||
while (pos > offset) {
|
||||
buffer[--pos] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromPositiveLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = value & 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
function fromNegativeLE(buffer, offset, value) {
|
||||
var end = offset + 8;
|
||||
value++;
|
||||
while (offset < end) {
|
||||
buffer[offset++] = ((-value) & 255) ^ 255;
|
||||
value /= 256;
|
||||
}
|
||||
}
|
||||
|
||||
// https://github.com/retrofox/is-array
|
||||
function _isArray(val) {
|
||||
return !!val && "[object Array]" == Object.prototype.toString.call(val);
|
||||
}
|
||||
|
||||
}( true && typeof exports.nodeName !== 'string' ? exports : (this || {}));
|
||||
|
||||
|
||||
/***/ })
|
||||
|
||||
}]);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user