oauth0-js-lib 2.2.4 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.es.js +169 -169
- package/dist/index.umd.js +169 -169
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
oauth0-js-lib
|
|
1
|
+
oauth0-js-lib
|
package/dist/index.es.js
CHANGED
|
@@ -1786,174 +1786,174 @@ const {
|
|
|
1786
1786
|
formToJSON: si,
|
|
1787
1787
|
getAdapter: ai,
|
|
1788
1788
|
mergeConfig: ui
|
|
1789
|
-
} = U, mo = `.oauth-modal-overlay {
|
|
1790
|
-
position: fixed
|
|
1791
|
-
top: 0
|
|
1792
|
-
left: 0
|
|
1793
|
-
width: 100
|
|
1794
|
-
height: 100
|
|
1795
|
-
background-color: rgba(0, 0, 0, 0.6)
|
|
1796
|
-
display: flex
|
|
1797
|
-
justify-content: center
|
|
1798
|
-
align-items: flex-end
|
|
1799
|
-
z-index: 1000
|
|
1800
|
-
opacity: 0
|
|
1801
|
-
visibility: hidden
|
|
1802
|
-
transition: opacity 0.3s ease, visibility 0.3s ease
|
|
1803
|
-
padding: 0
|
|
1804
|
-
}
|
|
1805
|
-
|
|
1806
|
-
.oauth-modal-overlay.active {
|
|
1807
|
-
opacity: 1
|
|
1808
|
-
visibility: visible
|
|
1809
|
-
}
|
|
1810
|
-
|
|
1811
|
-
.oauth-modal-content {
|
|
1812
|
-
background: white
|
|
1813
|
-
text-align: center
|
|
1814
|
-
position: relative
|
|
1815
|
-
width: 100
|
|
1816
|
-
border-radius: 20px 20px 0 0
|
|
1817
|
-
padding: 35px 20px 20px 20px; /* Возвращаем исходный padding
|
|
1818
|
-
box-sizing: border-box
|
|
1819
|
-
max-height: 90vh
|
|
1820
|
-
overflow-y: auto
|
|
1821
|
-
transform: translateY(100%)
|
|
1822
|
-
transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)
|
|
1823
|
-
}
|
|
1824
|
-
|
|
1825
|
-
.oauth-modal-content::before {
|
|
1826
|
-
content: ''
|
|
1827
|
-
position: absolute
|
|
1828
|
-
top: 8px
|
|
1829
|
-
left: 50
|
|
1830
|
-
transform: translateX(-50%)
|
|
1831
|
-
width: 36px
|
|
1832
|
-
height: 4px
|
|
1833
|
-
background-color: #c4c4c4
|
|
1834
|
-
border-radius: 4px
|
|
1835
|
-
}
|
|
1836
|
-
|
|
1837
|
-
.oauth-modal-overlay.active .oauth-modal-content {
|
|
1838
|
-
transform: translateY(0)
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
|
-
.oauth-modal-content h3 {
|
|
1842
|
-
margin-top: 0; /* Возвращаем исходный margin
|
|
1843
|
-
margin-bottom: 16px
|
|
1844
|
-
color: #333
|
|
1845
|
-
font-size: 1.2rem
|
|
1846
|
-
}
|
|
1847
|
-
|
|
1848
|
-
.oauth-qrcode-container {
|
|
1849
|
-
margin: 20px 0
|
|
1850
|
-
display: flex
|
|
1851
|
-
justify-content: center
|
|
1852
|
-
}
|
|
1853
|
-
|
|
1854
|
-
.oauth-qrcode-container canvas {
|
|
1855
|
-
border: 1px solid #eee
|
|
1856
|
-
max-width: 100
|
|
1857
|
-
height: auto
|
|
1858
|
-
}
|
|
1859
|
-
|
|
1860
|
-
.oauth-modal-separator {
|
|
1861
|
-
margin: 24px 0
|
|
1862
|
-
color: #888
|
|
1863
|
-
font-size: 0.9rem
|
|
1864
|
-
font-weight: 500
|
|
1865
|
-
}
|
|
1866
|
-
|
|
1867
|
-
.oauth-login-button {
|
|
1868
|
-
background-color: #007bff
|
|
1869
|
-
color: white
|
|
1870
|
-
border: none
|
|
1871
|
-
padding: 16px 24px
|
|
1872
|
-
border-radius: 8px
|
|
1873
|
-
font-size: 18px
|
|
1874
|
-
font-weight: 600
|
|
1875
|
-
cursor: pointer
|
|
1876
|
-
transition: background-color 0.2s
|
|
1877
|
-
width: 100
|
|
1878
|
-
box-sizing: border-box
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
.oauth-login-button:hover {
|
|
1882
|
-
background-color: #0056b3
|
|
1883
|
-
}
|
|
1884
|
-
|
|
1885
|
-
/* --- Стили для десктопов ---
|
|
1886
|
-
@media (min-width: 768px) {
|
|
1887
|
-
.oauth-modal-overlay {
|
|
1888
|
-
align-items: center
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
.oauth-modal-content {
|
|
1892
|
-
width: 90
|
|
1893
|
-
max-width: 500px
|
|
1894
|
-
margin: 0 16px
|
|
1895
|
-
border-radius: 12px
|
|
1896
|
-
padding: 32px
|
|
1897
|
-
transform: scale(0.8)
|
|
1898
|
-
transition: transform 0.3s ease
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
.oauth-modal-content::before {
|
|
1902
|
-
display: none
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1905
|
-
.oauth-modal-overlay.active .oauth-modal-content {
|
|
1906
|
-
transform: scale(1)
|
|
1907
|
-
}
|
|
1908
|
-
}
|
|
1909
|
-
|
|
1910
|
-
/* Лоадер
|
|
1911
|
-
.oauth-loader {
|
|
1912
|
-
display: none
|
|
1913
|
-
justify-content: center
|
|
1914
|
-
align-items: center
|
|
1915
|
-
padding: 40px 0
|
|
1916
|
-
}
|
|
1917
|
-
.oauth-spinner {
|
|
1918
|
-
width: 40px; height: 40px
|
|
1919
|
-
border: 4px solid rgba(0, 0, 0, 0.1)
|
|
1920
|
-
border-radius: 50
|
|
1921
|
-
border-top-color: #007bff
|
|
1922
|
-
animation: spin 1s ease-in-out infinite
|
|
1923
|
-
}
|
|
1924
|
-
@keyframes spin { to { transform: rotate(360deg); } }
|
|
1925
|
-
|
|
1926
|
-
/* Контейнер для ошибки
|
|
1927
|
-
.oauth-error-container {
|
|
1928
|
-
text-align: center
|
|
1929
|
-
padding: 20px 0
|
|
1930
|
-
display: none; /* Изначально скрыт
|
|
1931
|
-
}
|
|
1932
|
-
.oauth-error-message {
|
|
1933
|
-
color: #d9534f
|
|
1934
|
-
margin-bottom: 16px
|
|
1935
|
-
}
|
|
1936
|
-
.oauth-retry-button {
|
|
1937
|
-
background-color: #f0ad4e
|
|
1938
|
-
color: white
|
|
1939
|
-
border: none
|
|
1940
|
-
padding: 12px 20px
|
|
1941
|
-
border-radius: 8px
|
|
1942
|
-
font-size: 16px
|
|
1943
|
-
cursor: pointer
|
|
1944
|
-
transition: background-color 0.2s
|
|
1945
|
-
}
|
|
1946
|
-
.oauth-retry-button:hover {
|
|
1947
|
-
background-color: #ec971f
|
|
1948
|
-
}
|
|
1949
|
-
|
|
1950
|
-
/* Таймер
|
|
1951
|
-
.oauth-timer-container {
|
|
1952
|
-
display: none; /* Изначально скрыт
|
|
1953
|
-
font-size: 0.9rem
|
|
1954
|
-
color: #555
|
|
1955
|
-
margin-top: -10px
|
|
1956
|
-
margin-bottom: 10px
|
|
1789
|
+
} = U, mo = `.oauth-modal-overlay {\r
|
|
1790
|
+
position: fixed;\r
|
|
1791
|
+
top: 0;\r
|
|
1792
|
+
left: 0;\r
|
|
1793
|
+
width: 100%;\r
|
|
1794
|
+
height: 100%;\r
|
|
1795
|
+
background-color: rgba(0, 0, 0, 0.6);\r
|
|
1796
|
+
display: flex;\r
|
|
1797
|
+
justify-content: center;\r
|
|
1798
|
+
align-items: flex-end;\r
|
|
1799
|
+
z-index: 1000;\r
|
|
1800
|
+
opacity: 0;\r
|
|
1801
|
+
visibility: hidden;\r
|
|
1802
|
+
transition: opacity 0.3s ease, visibility 0.3s ease;\r
|
|
1803
|
+
padding: 0;\r
|
|
1804
|
+
}\r
|
|
1805
|
+
\r
|
|
1806
|
+
.oauth-modal-overlay.active {\r
|
|
1807
|
+
opacity: 1;\r
|
|
1808
|
+
visibility: visible;\r
|
|
1809
|
+
}\r
|
|
1810
|
+
\r
|
|
1811
|
+
.oauth-modal-content {\r
|
|
1812
|
+
background: white;\r
|
|
1813
|
+
text-align: center;\r
|
|
1814
|
+
position: relative;\r
|
|
1815
|
+
width: 100%;\r
|
|
1816
|
+
border-radius: 20px 20px 0 0;\r
|
|
1817
|
+
padding: 35px 20px 20px 20px; /* Возвращаем исходный padding */\r
|
|
1818
|
+
box-sizing: border-box;\r
|
|
1819
|
+
max-height: 90vh;\r
|
|
1820
|
+
overflow-y: auto;\r
|
|
1821
|
+
transform: translateY(100%);\r
|
|
1822
|
+
transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);\r
|
|
1823
|
+
}\r
|
|
1824
|
+
\r
|
|
1825
|
+
.oauth-modal-content::before {\r
|
|
1826
|
+
content: '';\r
|
|
1827
|
+
position: absolute;\r
|
|
1828
|
+
top: 8px;\r
|
|
1829
|
+
left: 50%;\r
|
|
1830
|
+
transform: translateX(-50%);\r
|
|
1831
|
+
width: 36px;\r
|
|
1832
|
+
height: 4px;\r
|
|
1833
|
+
background-color: #c4c4c4;\r
|
|
1834
|
+
border-radius: 4px;\r
|
|
1835
|
+
}\r
|
|
1836
|
+
\r
|
|
1837
|
+
.oauth-modal-overlay.active .oauth-modal-content {\r
|
|
1838
|
+
transform: translateY(0);\r
|
|
1839
|
+
}\r
|
|
1840
|
+
\r
|
|
1841
|
+
.oauth-modal-content h3 {\r
|
|
1842
|
+
margin-top: 0; /* Возвращаем исходный margin */\r
|
|
1843
|
+
margin-bottom: 16px;\r
|
|
1844
|
+
color: #333;\r
|
|
1845
|
+
font-size: 1.2rem;\r
|
|
1846
|
+
}\r
|
|
1847
|
+
\r
|
|
1848
|
+
.oauth-qrcode-container {\r
|
|
1849
|
+
margin: 20px 0;\r
|
|
1850
|
+
display: flex;\r
|
|
1851
|
+
justify-content: center;\r
|
|
1852
|
+
}\r
|
|
1853
|
+
\r
|
|
1854
|
+
.oauth-qrcode-container canvas {\r
|
|
1855
|
+
border: 1px solid #eee;\r
|
|
1856
|
+
max-width: 100%;\r
|
|
1857
|
+
height: auto;\r
|
|
1858
|
+
}\r
|
|
1859
|
+
\r
|
|
1860
|
+
.oauth-modal-separator {\r
|
|
1861
|
+
margin: 24px 0;\r
|
|
1862
|
+
color: #888;\r
|
|
1863
|
+
font-size: 0.9rem;\r
|
|
1864
|
+
font-weight: 500;\r
|
|
1865
|
+
}\r
|
|
1866
|
+
\r
|
|
1867
|
+
.oauth-login-button {\r
|
|
1868
|
+
background-color: #007bff;\r
|
|
1869
|
+
color: white;\r
|
|
1870
|
+
border: none;\r
|
|
1871
|
+
padding: 16px 24px;\r
|
|
1872
|
+
border-radius: 8px;\r
|
|
1873
|
+
font-size: 18px;\r
|
|
1874
|
+
font-weight: 600;\r
|
|
1875
|
+
cursor: pointer;\r
|
|
1876
|
+
transition: background-color 0.2s;\r
|
|
1877
|
+
width: 100%;\r
|
|
1878
|
+
box-sizing: border-box;\r
|
|
1879
|
+
}\r
|
|
1880
|
+
\r
|
|
1881
|
+
.oauth-login-button:hover {\r
|
|
1882
|
+
background-color: #0056b3;\r
|
|
1883
|
+
}\r
|
|
1884
|
+
\r
|
|
1885
|
+
/* --- Стили для десктопов --- */\r
|
|
1886
|
+
@media (min-width: 768px) {\r
|
|
1887
|
+
.oauth-modal-overlay {\r
|
|
1888
|
+
align-items: center;\r
|
|
1889
|
+
}\r
|
|
1890
|
+
\r
|
|
1891
|
+
.oauth-modal-content {\r
|
|
1892
|
+
width: 90%;\r
|
|
1893
|
+
max-width: 500px;\r
|
|
1894
|
+
margin: 0 16px;\r
|
|
1895
|
+
border-radius: 12px;\r
|
|
1896
|
+
padding: 32px;\r
|
|
1897
|
+
transform: scale(0.8);\r
|
|
1898
|
+
transition: transform 0.3s ease;\r
|
|
1899
|
+
}\r
|
|
1900
|
+
\r
|
|
1901
|
+
.oauth-modal-content::before {\r
|
|
1902
|
+
display: none;\r
|
|
1903
|
+
}\r
|
|
1904
|
+
\r
|
|
1905
|
+
.oauth-modal-overlay.active .oauth-modal-content {\r
|
|
1906
|
+
transform: scale(1);\r
|
|
1907
|
+
}\r
|
|
1908
|
+
}\r
|
|
1909
|
+
\r
|
|
1910
|
+
/* Лоадер */\r
|
|
1911
|
+
.oauth-loader {\r
|
|
1912
|
+
display: none;\r
|
|
1913
|
+
justify-content: center;\r
|
|
1914
|
+
align-items: center;\r
|
|
1915
|
+
padding: 40px 0;\r
|
|
1916
|
+
}\r
|
|
1917
|
+
.oauth-spinner {\r
|
|
1918
|
+
width: 40px; height: 40px;\r
|
|
1919
|
+
border: 4px solid rgba(0, 0, 0, 0.1);\r
|
|
1920
|
+
border-radius: 50%;\r
|
|
1921
|
+
border-top-color: #007bff;\r
|
|
1922
|
+
animation: spin 1s ease-in-out infinite;\r
|
|
1923
|
+
}\r
|
|
1924
|
+
@keyframes spin { to { transform: rotate(360deg); } }\r
|
|
1925
|
+
\r
|
|
1926
|
+
/* Контейнер для ошибки */\r
|
|
1927
|
+
.oauth-error-container {\r
|
|
1928
|
+
text-align: center;\r
|
|
1929
|
+
padding: 20px 0;\r
|
|
1930
|
+
display: none; /* Изначально скрыт */\r
|
|
1931
|
+
}\r
|
|
1932
|
+
.oauth-error-message {\r
|
|
1933
|
+
color: #d9534f;\r
|
|
1934
|
+
margin-bottom: 16px;\r
|
|
1935
|
+
}\r
|
|
1936
|
+
.oauth-retry-button {\r
|
|
1937
|
+
background-color: #f0ad4e;\r
|
|
1938
|
+
color: white;\r
|
|
1939
|
+
border: none;\r
|
|
1940
|
+
padding: 12px 20px;\r
|
|
1941
|
+
border-radius: 8px;\r
|
|
1942
|
+
font-size: 16px;\r
|
|
1943
|
+
cursor: pointer;\r
|
|
1944
|
+
transition: background-color 0.2s;\r
|
|
1945
|
+
}\r
|
|
1946
|
+
.oauth-retry-button:hover {\r
|
|
1947
|
+
background-color: #ec971f;\r
|
|
1948
|
+
}\r
|
|
1949
|
+
\r
|
|
1950
|
+
/* Таймер */\r
|
|
1951
|
+
.oauth-timer-container {\r
|
|
1952
|
+
display: none; /* Изначально скрыт */\r
|
|
1953
|
+
font-size: 0.9rem;\r
|
|
1954
|
+
color: #555;\r
|
|
1955
|
+
margin-top: -10px;\r
|
|
1956
|
+
margin-bottom: 10px;\r
|
|
1957
1957
|
}`;
|
|
1958
1958
|
var oe = {}, Ue, Lt;
|
|
1959
1959
|
function yo() {
|
|
@@ -3511,7 +3511,7 @@ class Do {
|
|
|
3511
3511
|
startTimer(t) {
|
|
3512
3512
|
this.timerInterval && clearInterval(this.timerInterval);
|
|
3513
3513
|
const r = () => {
|
|
3514
|
-
const n = (/* @__PURE__ */ new Date()).getTime(), i = new Date(t).getTime() - n;
|
|
3514
|
+
const n = (/* @__PURE__ */ new Date()).getTime(), i = (/* @__PURE__ */ new Date(t + "Z")).getTime() - n;
|
|
3515
3515
|
if (i > 0) {
|
|
3516
3516
|
const s = Math.floor(i % 36e5 / 6e4), a = Math.floor(i % (1e3 * 60) / 1e3);
|
|
3517
3517
|
this.timerContainer.textContent = `Ссылка действительна еще: ${String(s).padStart(2, "0")}:${String(a).padStart(2, "0")}`;
|
package/dist/index.umd.js
CHANGED
|
@@ -3,174 +3,174 @@
|
|
|
3
3
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const n=new this(t);return r.forEach(o=>n.set(o)),n}static accessor(t){const n=(this[Mt]=this[Mt]={accessors:{}}).accessors,o=this.prototype;function i(s){const a=ge(s);n[a]||(zr(o,s),n[a]=!0)}return c.isArray(t)?t.forEach(i):i(t),this}};k.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),c.reduceDescriptors(k.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(n){this[r]=n}}}),c.freezeMethods(k);function qe(e,t){const r=this||pe,n=t||r,o=k.from(n.headers);let i=n.data;return c.forEach(e,function(a){i=a.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function xt(e){return!!(e&&e.__CANCEL__)}function se(e,t,r){I.call(this,e??"canceled",I.ERR_CANCELED,t,r),this.name="CanceledError"}c.inherits(se,I,{__CANCEL__:!0});function kt(e,t,r){const n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function $r(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Vr(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o=0,i=0,s;return t=t!==void 0?t:1e3,function(u){const l=Date.now(),f=n[i];s||(s=l),r[o]=u,n[o]=l;let h=i,m=0;for(;h!==o;)m+=r[h++],h=h%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),l-s<t)return;const y=f&&l-f;return y?Math.round(m*1e3/y):void 0}}function Jr(e,t){let r=0,n=1e3/t,o,i;const s=(l,f=Date.now())=>{r=f,o=null,i&&(clearTimeout(i),i=null),e(...l)};return[(...l)=>{const f=Date.now(),h=f-r;h>=n?s(l,f):(o=l,i||(i=setTimeout(()=>{i=null,s(o)},n-h)))},()=>o&&s(o)]}const Ae=(e,t,r=3)=>{let n=0;const o=Vr(50,250);return Jr(i=>{const s=i.loaded,a=i.lengthComputable?i.total:void 0,u=s-n,l=o(u),f=s<=a;n=s;const h={loaded:s,total:a,progress:a?s/a:void 0,bytes:u,rate:l||void 0,estimated:l&&a&&f?(a-s)/l:void 0,event:i,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(h)},r)},Dt=(e,t)=>{const r=e!=null;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},qt=e=>(...t)=>c.asap(()=>e(...t)),Kr=F.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,F.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(F.origin),F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent)):()=>!0,Qr=F.hasStandardBrowserEnv?{write(e,t,r,n,o,i,s){if(typeof document>"u")return;const a=[`${e}=${encodeURIComponent(t)}`];c.isNumber(r)&&a.push(`expires=${new Date(r).toUTCString()}`),c.isString(n)&&a.push(`path=${n}`),c.isString(o)&&a.push(`domain=${o}`),i===!0&&a.push("secure"),c.isString(s)&&a.push(`SameSite=${s}`),document.cookie=a.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Wr(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function Gr(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jt(e,t,r){let n=!Wr(t);return e&&(n||r==!1)?Gr(e,t):t}const Ht=e=>e instanceof k?{...e}:e;function X(e,t){t=t||{};const r={};function n(l,f,h,m){return c.isPlainObject(l)&&c.isPlainObject(f)?c.merge.call({caseless:m},l,f):c.isPlainObject(f)?c.merge({},f):c.isArray(f)?f.slice():f}function o(l,f,h,m){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l,h,m)}else return n(l,f,h,m)}function i(l,f){if(!c.isUndefined(f))return n(void 0,f)}function s(l,f){if(c.isUndefined(f)){if(!c.isUndefined(l))return n(void 0,l)}else return n(void 0,f)}function a(l,f,h){if(h in t)return n(l,f);if(h in e)return n(void 0,l)}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(l,f,h)=>o(Ht(l),Ht(f),h,!0)};return c.forEach(Object.keys({...e,...t}),function(f){const h=u[f]||o,m=h(e[f],t[f],f);c.isUndefined(m)&&h!==a||(r[f]=m)}),r}const zt=e=>{const t=X({},e);let{data:r,withXSRFToken:n,xsrfHeaderName:o,xsrfCookieName:i,headers:s,auth:a}=t;if(t.headers=s=k.from(s),t.url=_t(jt(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(r)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(r.getHeaders)){const u=r.getHeaders(),l=["content-type","content-length"];Object.entries(u).forEach(([f,h])=>{l.includes(f.toLowerCase())&&s.set(f,h)})}}if(F.hasStandardBrowserEnv&&(n&&c.isFunction(n)&&(n=n(t)),n||n!==!1&&Kr(t.url))){const u=o&&i&&Qr.read(i);u&&s.set(o,u)}return t},Yr=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,n){const o=zt(e);let i=o.data;const s=k.from(o.headers).normalize();let{responseType:a,onUploadProgress:u,onDownloadProgress:l}=o,f,h,m,y,d;function p(){y&&y(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(f),o.signal&&o.signal.removeEventListener("abort",f)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function w(){if(!g)return;const E=k.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),_={data:!a||a==="text"||a==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:E,config:e,request:g};kt(function(S){r(S),p()},function(S){n(S),p()},_),g=null}"onloadend"in g?g.onloadend=w:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(w)},g.onabort=function(){g&&(n(new I("Request aborted",I.ECONNABORTED,e,g)),g=null)},g.onerror=function(R){const _=R&&R.message?R.message:"Network Error",b=new I(_,I.ERR_NETWORK,e,g);b.event=R||null,n(b),g=null},g.ontimeout=function(){let R=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const _=o.transitional||vt;o.timeoutErrorMessage&&(R=o.timeoutErrorMessage),n(new I(R,_.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,g)),g=null},i===void 0&&s.setContentType(null),"setRequestHeader"in g&&c.forEach(s.toJSON(),function(R,_){g.setRequestHeader(_,R)}),c.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),a&&a!=="json"&&(g.responseType=o.responseType),l&&([m,d]=Ae(l,!0),g.addEventListener("progress",m)),u&&g.upload&&([h,y]=Ae(u),g.upload.addEventListener("progress",h),g.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(f=E=>{g&&(n(!E||E.type?new se(null,e,g):E),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(f),o.signal&&(o.signal.aborted?f():o.signal.addEventListener("abort",f)));const P=$r(o.url);if(P&&F.protocols.indexOf(P)===-1){n(new I("Unsupported protocol "+P+":",I.ERR_BAD_REQUEST,e));return}g.send(i||null)})},Xr=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let n=new AbortController,o;const i=function(l){if(!o){o=!0,a();const f=l instanceof Error?l:this.reason;n.abort(f instanceof I?f:new se(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,i(new I(`timeout ${t} of ms exceeded`,I.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:u}=n;return u.unsubscribe=()=>c.asap(a),u}},Zr=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let n=0,o;for(;n<r;)o=n+t,yield e.slice(n,o),n=o},eo=async function*(e,t){for await(const r of to(e))yield*Zr(r,t)},to=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:n}=await t.read();if(r)break;yield n}}finally{await t.cancel()}},$t=(e,t,r,n)=>{const o=eo(e,t);let i=0,s,a=u=>{s||(s=!0,n&&n(u))};return new ReadableStream({async pull(u){try{const{done:l,value:f}=await o.next();if(l){a(),u.close();return}let h=f.byteLength;if(r){let m=i+=h;r(m)}u.enqueue(new Uint8Array(f))}catch(l){throw a(l),l}},cancel(u){return a(u),o.return()}},{highWaterMark:2})},Vt=64*1024,{isFunction:Be}=c,no=(({Request:e,Response:t})=>({Request:e,Response:t}))(c.global),{ReadableStream:Jt,TextEncoder:Kt}=c.global,Qt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ro=e=>{e=c.merge.call({skipUndefined:!0},no,e);const{fetch:t,Request:r,Response:n}=e,o=t?Be(t):typeof fetch=="function",i=Be(r),s=Be(n);if(!o)return!1;const a=o&&Be(Jt),u=o&&(typeof Kt=="function"?(d=>p=>d.encode(p))(new Kt):async d=>new Uint8Array(await new r(d).arrayBuffer())),l=i&&a&&Qt(()=>{let d=!1;const p=new r(F.origin,{body:new Jt,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!p}),f=s&&a&&Qt(()=>c.isReadableStream(new n("").body)),h={stream:f&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!h[d]&&(h[d]=(p,g)=>{let w=p&&p[d];if(w)return w.call(p);throw new I(`Response type '${d}' is not supported`,I.ERR_NOT_SUPPORT,g)})});const m=async d=>{if(d==null)return 0;if(c.isBlob(d))return d.size;if(c.isSpecCompliantForm(d))return(await new r(F.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(c.isArrayBufferView(d)||c.isArrayBuffer(d))return d.byteLength;if(c.isURLSearchParams(d)&&(d=d+""),c.isString(d))return(await u(d)).byteLength},y=async(d,p)=>{const g=c.toFiniteNumber(d.getContentLength());return g??m(p)};return async d=>{let{url:p,method:g,data:w,signal:P,cancelToken:E,timeout:R,onDownloadProgress:_,onUploadProgress:b,responseType:S,headers:A,withCredentials:C="same-origin",fetchOptions:L}=zt(d),B=t||fetch;S=S?(S+"").toLowerCase():"text";let N=Xr([P,E&&E.toAbortSignal()],R),T=null;const O=N&&N.unsubscribe&&(()=>{N.unsubscribe()});let z;try{if(b&&l&&g!=="get"&&g!=="head"&&(z=await y(A,w))!==0){let j=new r(p,{method:"POST",body:w,duplex:"half"}),K;if(c.isFormData(w)&&(K=j.headers.get("content-type"))&&A.setContentType(K),j.body){const[ne,ue]=Dt(z,Ae(qt(b)));w=$t(j.body,Vt,ne,ue)}}c.isString(C)||(C=C?"include":"omit");const M=i&&"credentials"in r.prototype,Le={...L,signal:N,method:g.toUpperCase(),headers:A.normalize().toJSON(),body:w,duplex:"half",credentials:M?C:void 0};T=i&&new r(p,Le);let $=await(i?B(T,L):B(p,Le));const Ie=f&&(S==="stream"||S==="response");if(f&&(_||Ie&&O)){const j={};["status","statusText","headers"].forEach(le=>{j[le]=$[le]});const K=c.toFiniteNumber($.headers.get("content-length")),[ne,ue]=_&&Dt(K,Ae(qt(_),!0))||[];$=new n($t($.body,Vt,ne,()=>{ue&&ue(),O&&O()}),j)}S=S||"text";let we=await h[c.findKey(h,S)||"text"]($,d);return!Ie&&O&&O(),await new Promise((j,K)=>{kt(j,K,{data:we,headers:k.from($.headers),status:$.status,statusText:$.statusText,config:d,request:T})})}catch(M){throw O&&O(),M&&M.name==="TypeError"&&/Load failed|fetch/i.test(M.message)?Object.assign(new I("Network Error",I.ERR_NETWORK,d,T),{cause:M.cause||M}):I.from(M,M&&M.code,d,T)}}},oo=new Map,Wt=e=>{let t=e&&e.env||{};const{fetch:r,Request:n,Response:o}=t,i=[n,o,r];let s=i.length,a=s,u,l,f=oo;for(;a--;)u=i[a],l=f.get(u),l===void 0&&f.set(u,l=a?new Map:ro(t)),f=l;return l};Wt();const je={http:Br,xhr:Yr,fetch:{get:Wt}};c.forEach(je,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Gt=e=>`- ${e}`,io=e=>c.isFunction(e)||e===null||e===!1;function so(e,t){e=c.isArray(e)?e:[e];const{length:r}=e;let n,o;const i={};for(let s=0;s<r;s++){n=e[s];let a;if(o=n,!io(n)&&(o=je[(a=String(n)).toLowerCase()],o===void 0))throw new I(`Unknown adapter '${a}'`);if(o&&(c.isFunction(o)||(o=o.get(t))))break;i[a||"#"+s]=o}if(!o){const s=Object.entries(i).map(([u,l])=>`adapter ${u} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=r?s.length>1?`since :
|
|
4
4
|
`+s.map(Gt).join(`
|
|
5
5
|
`):" "+Gt(s[0]):"as no adapter specified";throw new I("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}const Yt={getAdapter:so,adapters:je};function He(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new se(null,e)}function Xt(e){return He(e),e.headers=k.from(e.headers),e.data=qe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Yt.getAdapter(e.adapter||pe.adapter,e)(e).then(function(n){return He(e),n.data=qe.call(e,e.transformResponse,n),n.headers=k.from(n.headers),n},function(n){return xt(n)||(He(e),n&&n.response&&(n.response.data=qe.call(e,e.transformResponse,n.response),n.response.headers=k.from(n.response.headers))),Promise.reject(n)})}const Zt="1.13.1",Ne={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ne[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const en={};Ne.transitional=function(t,r,n){function o(i,s){return"[Axios v"+Zt+"] Transitional option '"+i+"'"+s+(n?". "+n:"")}return(i,s,a)=>{if(t===!1)throw new I(o(s," has been removed"+(r?" in "+r:"")),I.ERR_DEPRECATED);return r&&!en[s]&&(en[s]=!0,console.warn(o(s," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,s,a):!0}},Ne.spelling=function(t){return(r,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};function ao(e,t,r){if(typeof e!="object")throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const i=n[o],s=t[i];if(s){const a=e[i],u=a===void 0||s(a,i,e);if(u!==!0)throw new I("option "+i+" must be "+u,I.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new I("Unknown option "+i,I.ERR_BAD_OPTION)}}const Pe={assertOptions:ao,validators:Ne},V=Pe.validators;let Z=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Ut,response:new Ut}}async request(t,r){try{return await this._request(t,r)}catch(n){if(n instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{n.stack?i&&!String(n.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(n.stack+=`
|
|
6
|
-
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Pe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:V.function,serialize:V.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Pe.assertOptions(r,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=k.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Xt.bind(this),void 0];for(d.unshift(...a),d.push(...l),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Xt.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=l.length;h<m;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=X(this.defaults,t);const r=jt(t.baseURL,t.url,t.allowAbsoluteUrls);return _t(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,n){return this.request(X(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(X(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});let uo=class Dn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new se(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Dn(function(o){t=o}),cancel:t}}};function lo(e){return function(r){return e.apply(null,r)}}function co(e){return c.isObject(e)&&e.isAxiosError===!0}const ze={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ze).forEach(([e,t])=>{ze[t]=e});function tn(e){const t=new Z(e),r=yt(Z.prototype.request,t);return c.extend(r,Z.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return tn(X(e,o))},r}const U=tn(pe);U.Axios=Z,U.CanceledError=se,U.CancelToken=uo,U.isCancel=xt,U.VERSION=Zt,U.toFormData=Re,U.AxiosError=I,U.Cancel=U.CanceledError,U.all=function(t){return Promise.all(t)},U.spread=lo,U.isAxiosError=co,U.mergeConfig=X,U.AxiosHeaders=k,U.formToJSON=e=>Ft(c.isHTMLForm(e)?new FormData(e):e),U.getAdapter=Yt.getAdapter,U.HttpStatusCode=ze,U.default=U;const{Axios:Ko,AxiosError:Qo,CanceledError:Wo,isCancel:Go,CancelToken:Yo,VERSION:Xo,all:Zo,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:ri,AxiosHeaders:oi,HttpStatusCode:ii,formToJSON:si,getAdapter:ai,mergeConfig:ui}=U,fo=`.oauth-modal-overlay {
|
|
7
|
-
position: fixed
|
|
8
|
-
top: 0
|
|
9
|
-
left: 0
|
|
10
|
-
width: 100
|
|
11
|
-
height: 100
|
|
12
|
-
background-color: rgba(0, 0, 0, 0.6)
|
|
13
|
-
display: flex
|
|
14
|
-
justify-content: center
|
|
15
|
-
align-items: flex-end
|
|
16
|
-
z-index: 1000
|
|
17
|
-
opacity: 0
|
|
18
|
-
visibility: hidden
|
|
19
|
-
transition: opacity 0.3s ease, visibility 0.3s ease
|
|
20
|
-
padding: 0
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.oauth-modal-overlay.active {
|
|
24
|
-
opacity: 1
|
|
25
|
-
visibility: visible
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.oauth-modal-content {
|
|
29
|
-
background: white
|
|
30
|
-
text-align: center
|
|
31
|
-
position: relative
|
|
32
|
-
width: 100
|
|
33
|
-
border-radius: 20px 20px 0 0
|
|
34
|
-
padding: 35px 20px 20px 20px; /* Возвращаем исходный padding
|
|
35
|
-
box-sizing: border-box
|
|
36
|
-
max-height: 90vh
|
|
37
|
-
overflow-y: auto
|
|
38
|
-
transform: translateY(100%)
|
|
39
|
-
transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.oauth-modal-content::before {
|
|
43
|
-
content: ''
|
|
44
|
-
position: absolute
|
|
45
|
-
top: 8px
|
|
46
|
-
left: 50
|
|
47
|
-
transform: translateX(-50%)
|
|
48
|
-
width: 36px
|
|
49
|
-
height: 4px
|
|
50
|
-
background-color: #c4c4c4
|
|
51
|
-
border-radius: 4px
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.oauth-modal-overlay.active .oauth-modal-content {
|
|
55
|
-
transform: translateY(0)
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.oauth-modal-content h3 {
|
|
59
|
-
margin-top: 0; /* Возвращаем исходный margin
|
|
60
|
-
margin-bottom: 16px
|
|
61
|
-
color: #333
|
|
62
|
-
font-size: 1.2rem
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
.oauth-qrcode-container {
|
|
66
|
-
margin: 20px 0
|
|
67
|
-
display: flex
|
|
68
|
-
justify-content: center
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.oauth-qrcode-container canvas {
|
|
72
|
-
border: 1px solid #eee
|
|
73
|
-
max-width: 100
|
|
74
|
-
height: auto
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.oauth-modal-separator {
|
|
78
|
-
margin: 24px 0
|
|
79
|
-
color: #888
|
|
80
|
-
font-size: 0.9rem
|
|
81
|
-
font-weight: 500
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.oauth-login-button {
|
|
85
|
-
background-color: #007bff
|
|
86
|
-
color: white
|
|
87
|
-
border: none
|
|
88
|
-
padding: 16px 24px
|
|
89
|
-
border-radius: 8px
|
|
90
|
-
font-size: 18px
|
|
91
|
-
font-weight: 600
|
|
92
|
-
cursor: pointer
|
|
93
|
-
transition: background-color 0.2s
|
|
94
|
-
width: 100
|
|
95
|
-
box-sizing: border-box
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
.oauth-login-button:hover {
|
|
99
|
-
background-color: #0056b3
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/* --- Стили для десктопов ---
|
|
103
|
-
@media (min-width: 768px) {
|
|
104
|
-
.oauth-modal-overlay {
|
|
105
|
-
align-items: center
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.oauth-modal-content {
|
|
109
|
-
width: 90
|
|
110
|
-
max-width: 500px
|
|
111
|
-
margin: 0 16px
|
|
112
|
-
border-radius: 12px
|
|
113
|
-
padding: 32px
|
|
114
|
-
transform: scale(0.8)
|
|
115
|
-
transition: transform 0.3s ease
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
.oauth-modal-content::before {
|
|
119
|
-
display: none
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
.oauth-modal-overlay.active .oauth-modal-content {
|
|
123
|
-
transform: scale(1)
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
/* Лоадер
|
|
128
|
-
.oauth-loader {
|
|
129
|
-
display: none
|
|
130
|
-
justify-content: center
|
|
131
|
-
align-items: center
|
|
132
|
-
padding: 40px 0
|
|
133
|
-
}
|
|
134
|
-
.oauth-spinner {
|
|
135
|
-
width: 40px; height: 40px
|
|
136
|
-
border: 4px solid rgba(0, 0, 0, 0.1)
|
|
137
|
-
border-radius: 50
|
|
138
|
-
border-top-color: #007bff
|
|
139
|
-
animation: spin 1s ease-in-out infinite
|
|
140
|
-
}
|
|
141
|
-
@keyframes spin { to { transform: rotate(360deg); } }
|
|
142
|
-
|
|
143
|
-
/* Контейнер для ошибки
|
|
144
|
-
.oauth-error-container {
|
|
145
|
-
text-align: center
|
|
146
|
-
padding: 20px 0
|
|
147
|
-
display: none; /* Изначально скрыт
|
|
148
|
-
}
|
|
149
|
-
.oauth-error-message {
|
|
150
|
-
color: #d9534f
|
|
151
|
-
margin-bottom: 16px
|
|
152
|
-
}
|
|
153
|
-
.oauth-retry-button {
|
|
154
|
-
background-color: #f0ad4e
|
|
155
|
-
color: white
|
|
156
|
-
border: none
|
|
157
|
-
padding: 12px 20px
|
|
158
|
-
border-radius: 8px
|
|
159
|
-
font-size: 16px
|
|
160
|
-
cursor: pointer
|
|
161
|
-
transition: background-color 0.2s
|
|
162
|
-
}
|
|
163
|
-
.oauth-retry-button:hover {
|
|
164
|
-
background-color: #ec971f
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/* Таймер
|
|
168
|
-
.oauth-timer-container {
|
|
169
|
-
display: none; /* Изначально скрыт
|
|
170
|
-
font-size: 0.9rem
|
|
171
|
-
color: #555
|
|
172
|
-
margin-top: -10px
|
|
173
|
-
margin-bottom: 10px
|
|
6
|
+
`+i):n.stack=i}catch{}}throw n}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=X(this.defaults,r);const{transitional:n,paramsSerializer:o,headers:i}=r;n!==void 0&&Pe.assertOptions(n,{silentJSONParsing:V.transitional(V.boolean),forcedJSONParsing:V.transitional(V.boolean),clarifyTimeoutError:V.transitional(V.boolean)},!1),o!=null&&(c.isFunction(o)?r.paramsSerializer={serialize:o}:Pe.assertOptions(o,{encode:V.function,serialize:V.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Pe.assertOptions(r,{baseUrl:V.spelling("baseURL"),withXsrfToken:V.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let s=i&&c.merge(i.common,i[r.method]);i&&c.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=k.concat(s,i);const a=[];let u=!0;this.interceptors.request.forEach(function(p){typeof p.runWhen=="function"&&p.runWhen(r)===!1||(u=u&&p.synchronous,a.unshift(p.fulfilled,p.rejected))});const l=[];this.interceptors.response.forEach(function(p){l.push(p.fulfilled,p.rejected)});let f,h=0,m;if(!u){const d=[Xt.bind(this),void 0];for(d.unshift(...a),d.push(...l),m=d.length,f=Promise.resolve(r);h<m;)f=f.then(d[h++],d[h++]);return f}m=a.length;let y=r;for(;h<m;){const d=a[h++],p=a[h++];try{y=d(y)}catch(g){p.call(this,g);break}}try{f=Xt.call(this,y)}catch(d){return Promise.reject(d)}for(h=0,m=l.length;h<m;)f=f.then(l[h++],l[h++]);return f}getUri(t){t=X(this.defaults,t);const r=jt(t.baseURL,t.url,t.allowAbsoluteUrls);return _t(r,t.params,t.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(t){Z.prototype[t]=function(r,n){return this.request(X(n||{},{method:t,url:r,data:(n||{}).data}))}}),c.forEach(["post","put","patch"],function(t){function r(n){return function(i,s,a){return this.request(X(a||{},{method:t,headers:n?{"Content-Type":"multipart/form-data"}:{},url:i,data:s}))}}Z.prototype[t]=r(),Z.prototype[t+"Form"]=r(!0)});let uo=class Dn{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const n=this;this.promise.then(o=>{if(!n._listeners)return;let i=n._listeners.length;for(;i-- >0;)n._listeners[i](o);n._listeners=null}),this.promise.then=o=>{let i;const s=new Promise(a=>{n.subscribe(a),i=a}).then(o);return s.cancel=function(){n.unsubscribe(i)},s},t(function(i,s,a){n.reason||(n.reason=new se(i,s,a),r(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=n=>{t.abort(n)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new Dn(function(o){t=o}),cancel:t}}};function lo(e){return function(r){return e.apply(null,r)}}function co(e){return c.isObject(e)&&e.isAxiosError===!0}const ze={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(ze).forEach(([e,t])=>{ze[t]=e});function tn(e){const t=new Z(e),r=yt(Z.prototype.request,t);return c.extend(r,Z.prototype,t,{allOwnKeys:!0}),c.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return tn(X(e,o))},r}const U=tn(pe);U.Axios=Z,U.CanceledError=se,U.CancelToken=uo,U.isCancel=xt,U.VERSION=Zt,U.toFormData=Re,U.AxiosError=I,U.Cancel=U.CanceledError,U.all=function(t){return Promise.all(t)},U.spread=lo,U.isAxiosError=co,U.mergeConfig=X,U.AxiosHeaders=k,U.formToJSON=e=>Ft(c.isHTMLForm(e)?new FormData(e):e),U.getAdapter=Yt.getAdapter,U.HttpStatusCode=ze,U.default=U;const{Axios:Ko,AxiosError:Qo,CanceledError:Wo,isCancel:Go,CancelToken:Yo,VERSION:Xo,all:Zo,Cancel:ei,isAxiosError:ti,spread:ni,toFormData:ri,AxiosHeaders:oi,HttpStatusCode:ii,formToJSON:si,getAdapter:ai,mergeConfig:ui}=U,fo=`.oauth-modal-overlay {\r
|
|
7
|
+
position: fixed;\r
|
|
8
|
+
top: 0;\r
|
|
9
|
+
left: 0;\r
|
|
10
|
+
width: 100%;\r
|
|
11
|
+
height: 100%;\r
|
|
12
|
+
background-color: rgba(0, 0, 0, 0.6);\r
|
|
13
|
+
display: flex;\r
|
|
14
|
+
justify-content: center;\r
|
|
15
|
+
align-items: flex-end;\r
|
|
16
|
+
z-index: 1000;\r
|
|
17
|
+
opacity: 0;\r
|
|
18
|
+
visibility: hidden;\r
|
|
19
|
+
transition: opacity 0.3s ease, visibility 0.3s ease;\r
|
|
20
|
+
padding: 0;\r
|
|
21
|
+
}\r
|
|
22
|
+
\r
|
|
23
|
+
.oauth-modal-overlay.active {\r
|
|
24
|
+
opacity: 1;\r
|
|
25
|
+
visibility: visible;\r
|
|
26
|
+
}\r
|
|
27
|
+
\r
|
|
28
|
+
.oauth-modal-content {\r
|
|
29
|
+
background: white;\r
|
|
30
|
+
text-align: center;\r
|
|
31
|
+
position: relative;\r
|
|
32
|
+
width: 100%;\r
|
|
33
|
+
border-radius: 20px 20px 0 0;\r
|
|
34
|
+
padding: 35px 20px 20px 20px; /* Возвращаем исходный padding */\r
|
|
35
|
+
box-sizing: border-box;\r
|
|
36
|
+
max-height: 90vh;\r
|
|
37
|
+
overflow-y: auto;\r
|
|
38
|
+
transform: translateY(100%);\r
|
|
39
|
+
transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);\r
|
|
40
|
+
}\r
|
|
41
|
+
\r
|
|
42
|
+
.oauth-modal-content::before {\r
|
|
43
|
+
content: '';\r
|
|
44
|
+
position: absolute;\r
|
|
45
|
+
top: 8px;\r
|
|
46
|
+
left: 50%;\r
|
|
47
|
+
transform: translateX(-50%);\r
|
|
48
|
+
width: 36px;\r
|
|
49
|
+
height: 4px;\r
|
|
50
|
+
background-color: #c4c4c4;\r
|
|
51
|
+
border-radius: 4px;\r
|
|
52
|
+
}\r
|
|
53
|
+
\r
|
|
54
|
+
.oauth-modal-overlay.active .oauth-modal-content {\r
|
|
55
|
+
transform: translateY(0);\r
|
|
56
|
+
}\r
|
|
57
|
+
\r
|
|
58
|
+
.oauth-modal-content h3 {\r
|
|
59
|
+
margin-top: 0; /* Возвращаем исходный margin */\r
|
|
60
|
+
margin-bottom: 16px;\r
|
|
61
|
+
color: #333;\r
|
|
62
|
+
font-size: 1.2rem;\r
|
|
63
|
+
}\r
|
|
64
|
+
\r
|
|
65
|
+
.oauth-qrcode-container {\r
|
|
66
|
+
margin: 20px 0;\r
|
|
67
|
+
display: flex;\r
|
|
68
|
+
justify-content: center;\r
|
|
69
|
+
}\r
|
|
70
|
+
\r
|
|
71
|
+
.oauth-qrcode-container canvas {\r
|
|
72
|
+
border: 1px solid #eee;\r
|
|
73
|
+
max-width: 100%;\r
|
|
74
|
+
height: auto;\r
|
|
75
|
+
}\r
|
|
76
|
+
\r
|
|
77
|
+
.oauth-modal-separator {\r
|
|
78
|
+
margin: 24px 0;\r
|
|
79
|
+
color: #888;\r
|
|
80
|
+
font-size: 0.9rem;\r
|
|
81
|
+
font-weight: 500;\r
|
|
82
|
+
}\r
|
|
83
|
+
\r
|
|
84
|
+
.oauth-login-button {\r
|
|
85
|
+
background-color: #007bff;\r
|
|
86
|
+
color: white;\r
|
|
87
|
+
border: none;\r
|
|
88
|
+
padding: 16px 24px;\r
|
|
89
|
+
border-radius: 8px;\r
|
|
90
|
+
font-size: 18px;\r
|
|
91
|
+
font-weight: 600;\r
|
|
92
|
+
cursor: pointer;\r
|
|
93
|
+
transition: background-color 0.2s;\r
|
|
94
|
+
width: 100%;\r
|
|
95
|
+
box-sizing: border-box;\r
|
|
96
|
+
}\r
|
|
97
|
+
\r
|
|
98
|
+
.oauth-login-button:hover {\r
|
|
99
|
+
background-color: #0056b3;\r
|
|
100
|
+
}\r
|
|
101
|
+
\r
|
|
102
|
+
/* --- Стили для десктопов --- */\r
|
|
103
|
+
@media (min-width: 768px) {\r
|
|
104
|
+
.oauth-modal-overlay {\r
|
|
105
|
+
align-items: center;\r
|
|
106
|
+
}\r
|
|
107
|
+
\r
|
|
108
|
+
.oauth-modal-content {\r
|
|
109
|
+
width: 90%;\r
|
|
110
|
+
max-width: 500px;\r
|
|
111
|
+
margin: 0 16px;\r
|
|
112
|
+
border-radius: 12px;\r
|
|
113
|
+
padding: 32px;\r
|
|
114
|
+
transform: scale(0.8);\r
|
|
115
|
+
transition: transform 0.3s ease;\r
|
|
116
|
+
}\r
|
|
117
|
+
\r
|
|
118
|
+
.oauth-modal-content::before {\r
|
|
119
|
+
display: none;\r
|
|
120
|
+
}\r
|
|
121
|
+
\r
|
|
122
|
+
.oauth-modal-overlay.active .oauth-modal-content {\r
|
|
123
|
+
transform: scale(1);\r
|
|
124
|
+
}\r
|
|
125
|
+
}\r
|
|
126
|
+
\r
|
|
127
|
+
/* Лоадер */\r
|
|
128
|
+
.oauth-loader {\r
|
|
129
|
+
display: none;\r
|
|
130
|
+
justify-content: center;\r
|
|
131
|
+
align-items: center;\r
|
|
132
|
+
padding: 40px 0;\r
|
|
133
|
+
}\r
|
|
134
|
+
.oauth-spinner {\r
|
|
135
|
+
width: 40px; height: 40px;\r
|
|
136
|
+
border: 4px solid rgba(0, 0, 0, 0.1);\r
|
|
137
|
+
border-radius: 50%;\r
|
|
138
|
+
border-top-color: #007bff;\r
|
|
139
|
+
animation: spin 1s ease-in-out infinite;\r
|
|
140
|
+
}\r
|
|
141
|
+
@keyframes spin { to { transform: rotate(360deg); } }\r
|
|
142
|
+
\r
|
|
143
|
+
/* Контейнер для ошибки */\r
|
|
144
|
+
.oauth-error-container {\r
|
|
145
|
+
text-align: center;\r
|
|
146
|
+
padding: 20px 0;\r
|
|
147
|
+
display: none; /* Изначально скрыт */\r
|
|
148
|
+
}\r
|
|
149
|
+
.oauth-error-message {\r
|
|
150
|
+
color: #d9534f;\r
|
|
151
|
+
margin-bottom: 16px;\r
|
|
152
|
+
}\r
|
|
153
|
+
.oauth-retry-button {\r
|
|
154
|
+
background-color: #f0ad4e;\r
|
|
155
|
+
color: white;\r
|
|
156
|
+
border: none;\r
|
|
157
|
+
padding: 12px 20px;\r
|
|
158
|
+
border-radius: 8px;\r
|
|
159
|
+
font-size: 16px;\r
|
|
160
|
+
cursor: pointer;\r
|
|
161
|
+
transition: background-color 0.2s;\r
|
|
162
|
+
}\r
|
|
163
|
+
.oauth-retry-button:hover {\r
|
|
164
|
+
background-color: #ec971f;\r
|
|
165
|
+
}\r
|
|
166
|
+
\r
|
|
167
|
+
/* Таймер */\r
|
|
168
|
+
.oauth-timer-container {\r
|
|
169
|
+
display: none; /* Изначально скрыт */\r
|
|
170
|
+
font-size: 0.9rem;\r
|
|
171
|
+
color: #555;\r
|
|
172
|
+
margin-top: -10px;\r
|
|
173
|
+
margin-bottom: 10px;\r
|
|
174
174
|
}`;var ae={},$e,nn;function ho(){return nn||(nn=1,$e=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),$e}var Ve={},G={},rn;function ee(){if(rn)return G;rn=1;let e;const t=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return G.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},G.getSymbolTotalCodewords=function(n){return t[n]},G.getBCHDigit=function(r){let n=0;for(;r!==0;)n++,r>>>=1;return n},G.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');e=n},G.isKanjiModeEnabled=function(){return typeof e<"u"},G.toSJIS=function(n){return e(n)},G}var Je={},on;function Ke(){return on||(on=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+r)}}e.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},e.from=function(n,o){if(e.isValid(n))return n;try{return t(n)}catch{return o}}})(Je)),Je}var Qe,sn;function po(){if(sn)return Qe;sn=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(t){const r=Math.floor(t/8);return(this.buffer[r]>>>7-t%8&1)===1},put:function(t,r){for(let n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),t&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Qe=e,Qe}var We,an;function go(){if(an)return We;an=1;function e(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}return e.prototype.set=function(t,r,n,o){const i=t*this.size+r;this.data[i]=n,o&&(this.reservedBit[i]=!0)},e.prototype.get=function(t,r){return this.data[t*this.size+r]},e.prototype.xor=function(t,r,n){this.data[t*this.size+r]^=n},e.prototype.isReserved=function(t,r){return this.reservedBit[t*this.size+r]},We=e,We}var Ge={},un;function mo(){return un||(un=1,(function(e){const t=ee().getSymbolSize;e.getRowColCoords=function(n){if(n===1)return[];const o=Math.floor(n/7)+2,i=t(n),s=i===145?26:Math.ceil((i-13)/(2*o-2))*2,a=[i-7];for(let u=1;u<o-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(n){const o=[],i=e.getRowColCoords(n),s=i.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||o.push([i[a],i[u]]);return o}})(Ge)),Ge}var Ye={},ln;function yo(){if(ln)return Ye;ln=1;const e=ee().getSymbolSize,t=7;return Ye.getPositions=function(n){const o=e(n);return[[0,0],[o-t,0],[0,o-t]]},Ye}var Xe={},cn;function wo(){return cn||(cn=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(o){return o!=null&&o!==""&&!isNaN(o)&&o>=0&&o<=7},e.from=function(o){return e.isValid(o)?parseInt(o,10):void 0},e.getPenaltyN1=function(o){const i=o.size;let s=0,a=0,u=0,l=null,f=null;for(let h=0;h<i;h++){a=u=0,l=f=null;for(let m=0;m<i;m++){let y=o.get(h,m);y===l?a++:(a>=5&&(s+=t.N1+(a-5)),l=y,a=1),y=o.get(m,h),y===f?u++:(u>=5&&(s+=t.N1+(u-5)),f=y,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(o){const i=o.size;let s=0;for(let a=0;a<i-1;a++)for(let u=0;u<i-1;u++){const l=o.get(a,u)+o.get(a,u+1)+o.get(a+1,u)+o.get(a+1,u+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(o){const i=o.size;let s=0,a=0,u=0;for(let l=0;l<i;l++){a=u=0;for(let f=0;f<i;f++)a=a<<1&2047|o.get(l,f),f>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|o.get(f,l),f>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(o){let i=0;const s=o.data.length;for(let u=0;u<s;u++)i+=o.data[u];return Math.abs(Math.ceil(i*100/s/5)-10)*t.N4};function r(n,o,i){switch(n){case e.Patterns.PATTERN000:return(o+i)%2===0;case e.Patterns.PATTERN001:return o%2===0;case e.Patterns.PATTERN010:return i%3===0;case e.Patterns.PATTERN011:return(o+i)%3===0;case e.Patterns.PATTERN100:return(Math.floor(o/2)+Math.floor(i/3))%2===0;case e.Patterns.PATTERN101:return o*i%2+o*i%3===0;case e.Patterns.PATTERN110:return(o*i%2+o*i%3)%2===0;case e.Patterns.PATTERN111:return(o*i%3+(o+i)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}e.applyMask=function(o,i){const s=i.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)i.isReserved(u,a)||i.xor(u,a,r(o,u,a))},e.getBestMask=function(o,i){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let l=0;l<s;l++){i(l),e.applyMask(l,o);const f=e.getPenaltyN1(o)+e.getPenaltyN2(o)+e.getPenaltyN3(o)+e.getPenaltyN4(o);e.applyMask(l,o),f<u&&(u=f,a=l)}return a}})(Xe)),Xe}var Oe={},fn;function dn(){if(fn)return Oe;fn=1;const e=Ke(),t=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Oe.getBlocksCount=function(o,i){switch(i){case e.L:return t[(o-1)*4+0];case e.M:return t[(o-1)*4+1];case e.Q:return t[(o-1)*4+2];case e.H:return t[(o-1)*4+3];default:return}},Oe.getTotalCodewordsCount=function(o,i){switch(i){case e.L:return r[(o-1)*4+0];case e.M:return r[(o-1)*4+1];case e.Q:return r[(o-1)*4+2];case e.H:return r[(o-1)*4+3];default:return}},Oe}var Ze={},me={},hn;function bo(){if(hn)return me;hn=1;const e=new Uint8Array(512),t=new Uint8Array(256);return(function(){let n=1;for(let o=0;o<255;o++)e[o]=n,t[n]=o,n<<=1,n&256&&(n^=285);for(let o=255;o<512;o++)e[o]=e[o-255]})(),me.log=function(n){if(n<1)throw new Error("log("+n+")");return t[n]},me.exp=function(n){return e[n]},me.mul=function(n,o){return n===0||o===0?0:e[t[n]+t[o]]},me}var pn;function Eo(){return pn||(pn=1,(function(e){const t=bo();e.mul=function(n,o){const i=new Uint8Array(n.length+o.length-1);for(let s=0;s<n.length;s++)for(let a=0;a<o.length;a++)i[s+a]^=t.mul(n[s],o[a]);return i},e.mod=function(n,o){let i=new Uint8Array(n);for(;i.length-o.length>=0;){const s=i[0];for(let u=0;u<o.length;u++)i[u]^=t.mul(o[u],s);let a=0;for(;a<i.length&&i[a]===0;)a++;i=i.slice(a)}return i},e.generateECPolynomial=function(n){let o=new Uint8Array([1]);for(let i=0;i<n;i++)o=e.mul(o,new Uint8Array([1,t.exp(i)]));return o}})(Ze)),Ze}var et,gn;function Co(){if(gn)return et;gn=1;const e=Eo();function t(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return t.prototype.initialize=function(n){this.degree=n,this.genPoly=e.generateECPolynomial(this.degree)},t.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const o=new Uint8Array(n.length+this.degree);o.set(n);const i=e.mod(o,this.genPoly),s=this.degree-i.length;if(s>0){const a=new Uint8Array(this.degree);return a.set(i,s),a}return i},et=t,et}var tt={},nt={},rt={},mn;function yn(){return mn||(mn=1,rt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40}),rt}var J={},wn;function bn(){if(wn)return J;wn=1;const e="[0-9]+",t="[A-Z $%*+\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+r+`)(?:.|[\r
|
|
175
175
|
]))+`;J.KANJI=new RegExp(r,"g"),J.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),J.BYTE=new RegExp(n,"g"),J.NUMERIC=new RegExp(e,"g"),J.ALPHANUMERIC=new RegExp(t,"g");const o=new RegExp("^"+r+"$"),i=new RegExp("^"+e+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return J.testKanji=function(u){return o.test(u)},J.testNumeric=function(u){return i.test(u)},J.testAlphanumeric=function(u){return s.test(u)},J}var En;function te(){return En||(En=1,(function(e){const t=yn(),r=bn();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,s){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?i.ccBits[0]:s<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return r.testNumeric(i)?e.NUMERIC:r.testAlphanumeric(i)?e.ALPHANUMERIC:r.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function n(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+o)}}e.from=function(i,s){if(e.isValid(i))return i;try{return n(i)}catch{return s}}})(nt)),nt}var Cn;function So(){return Cn||(Cn=1,(function(e){const t=ee(),r=dn(),n=Ke(),o=te(),i=yn(),s=7973,a=t.getBCHDigit(s);function u(m,y,d){for(let p=1;p<=40;p++)if(y<=e.getCapacity(p,d,m))return p}function l(m,y){return o.getCharCountIndicator(m,y)+4}function f(m,y){let d=0;return m.forEach(function(p){const g=l(p.mode,y);d+=g+p.getBitsLength()}),d}function h(m,y){for(let d=1;d<=40;d++)if(f(m,d)<=e.getCapacity(d,y,o.MIXED))return d}e.from=function(y,d){return i.isValid(y)?parseInt(y,10):d},e.getCapacity=function(y,d,p){if(!i.isValid(y))throw new Error("Invalid QR Code version");typeof p>"u"&&(p=o.BYTE);const g=t.getSymbolTotalCodewords(y),w=r.getTotalCodewordsCount(y,d),P=(g-w)*8;if(p===o.MIXED)return P;const E=P-l(p,y);switch(p){case o.NUMERIC:return Math.floor(E/10*3);case o.ALPHANUMERIC:return Math.floor(E/11*2);case o.KANJI:return Math.floor(E/13);case o.BYTE:default:return Math.floor(E/8)}},e.getBestVersionForData=function(y,d){let p;const g=n.from(d,n.M);if(Array.isArray(y)){if(y.length>1)return h(y,g);if(y.length===0)return 1;p=y[0]}else p=y;return u(p.mode,p.getLength(),g)},e.getEncodedBits=function(y){if(!i.isValid(y)||y<7)throw new Error("Invalid QR Code version");let d=y<<12;for(;t.getBCHDigit(d)-a>=0;)d^=s<<t.getBCHDigit(d)-a;return y<<12|d}})(tt)),tt}var ot={},Sn;function Ro(){if(Sn)return ot;Sn=1;const e=ee(),t=1335,r=21522,n=e.getBCHDigit(t);return ot.getEncodedBits=function(i,s){const a=i.bit<<3|s;let u=a<<10;for(;e.getBCHDigit(u)-n>=0;)u^=t<<e.getBCHDigit(u)-n;return(a<<10|u)^r},ot}var it={},st,Rn;function To(){if(Rn)return st;Rn=1;const e=te();function t(r){this.mode=e.NUMERIC,this.data=r.toString()}return t.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(n){let o,i,s;for(o=0;o+3<=this.data.length;o+=3)i=this.data.substr(o,3),s=parseInt(i,10),n.put(s,10);const a=this.data.length-o;a>0&&(i=this.data.substr(o),s=parseInt(i,10),n.put(s,a*3+1))},st=t,st}var at,Tn;function Ao(){if(Tn)return at;Tn=1;const e=te(),t=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(n){this.mode=e.ALPHANUMERIC,this.data=n}return r.getBitsLength=function(o){return 11*Math.floor(o/2)+6*(o%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(o){let i;for(i=0;i+2<=this.data.length;i+=2){let s=t.indexOf(this.data[i])*45;s+=t.indexOf(this.data[i+1]),o.put(s,11)}this.data.length%2&&o.put(t.indexOf(this.data[i]),6)},at=r,at}var ut,An;function Bo(){if(An)return ut;An=1;const e=te();function t(r){this.mode=e.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return t.getBitsLength=function(n){return n*8},t.prototype.getLength=function(){return this.data.length},t.prototype.getBitsLength=function(){return t.getBitsLength(this.data.length)},t.prototype.write=function(r){for(let n=0,o=this.data.length;n<o;n++)r.put(this.data[n],8)},ut=t,ut}var lt,Bn;function No(){if(Bn)return lt;Bn=1;const e=te(),t=ee();function r(n){this.mode=e.KANJI,this.data=n}return r.getBitsLength=function(o){return o*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(n){let o;for(o=0;o<this.data.length;o++){let i=t.toSJIS(this.data[o]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[o]+`
|
|
176
176
|
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13)}},lt=r,lt}var ct={exports:{}},Nn;function Po(){return Nn||(Nn=1,(function(e){var t={single_source_shortest_paths:function(r,n,o){var i={},s={};s[n]=0;var a=t.PriorityQueue.make();a.push(n,0);for(var u,l,f,h,m,y,d,p,g;!a.empty();){u=a.pop(),l=u.value,h=u.cost,m=r[l]||{};for(f in m)m.hasOwnProperty(f)&&(y=m[f],d=h+y,p=s[f],g=typeof s[f]>"u",(g||p>d)&&(s[f]=d,a.push(f,d),i[f]=l))}if(typeof o<"u"&&typeof s[o]>"u"){var w=["Could not find a path from ",n," to ",o,"."].join("");throw new Error(w)}return i},extract_shortest_path_from_predecessor_list:function(r,n){for(var o=[],i=n;i;)o.push(i),r[i],i=r[i];return o.reverse(),o},find_path:function(r,n,o){var i=t.single_source_shortest_paths(r,n,o);return t.extract_shortest_path_from_predecessor_list(i,o)},PriorityQueue:{make:function(r){var n=t.PriorityQueue,o={},i;r=r||{};for(i in n)n.hasOwnProperty(i)&&(o[i]=n[i]);return o.queue=[],o.sorter=r.sorter||n.default_sorter,o},default_sorter:function(r,n){return r.cost-n.cost},push:function(r,n){var o={value:r,cost:n};this.queue.push(o),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(ct)),ct.exports}var Pn;function Oo(){return Pn||(Pn=1,(function(e){const t=te(),r=To(),n=Ao(),o=Bo(),i=No(),s=bn(),a=ee(),u=Po();function l(w){return unescape(encodeURIComponent(w)).length}function f(w,P,E){const R=[];let _;for(;(_=w.exec(E))!==null;)R.push({data:_[0],index:_.index,mode:P,length:_[0].length});return R}function h(w){const P=f(s.NUMERIC,t.NUMERIC,w),E=f(s.ALPHANUMERIC,t.ALPHANUMERIC,w);let R,_;return a.isKanjiModeEnabled()?(R=f(s.BYTE,t.BYTE,w),_=f(s.KANJI,t.KANJI,w)):(R=f(s.BYTE_KANJI,t.BYTE,w),_=[]),P.concat(E,R,_).sort(function(S,A){return S.index-A.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function m(w,P){switch(P){case t.NUMERIC:return r.getBitsLength(w);case t.ALPHANUMERIC:return n.getBitsLength(w);case t.KANJI:return i.getBitsLength(w);case t.BYTE:return o.getBitsLength(w)}}function y(w){return w.reduce(function(P,E){const R=P.length-1>=0?P[P.length-1]:null;return R&&R.mode===E.mode?(P[P.length-1].data+=E.data,P):(P.push(E),P)},[])}function d(w){const P=[];for(let E=0;E<w.length;E++){const R=w[E];switch(R.mode){case t.NUMERIC:P.push([R,{data:R.data,mode:t.ALPHANUMERIC,length:R.length},{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.ALPHANUMERIC:P.push([R,{data:R.data,mode:t.BYTE,length:R.length}]);break;case t.KANJI:P.push([R,{data:R.data,mode:t.BYTE,length:l(R.data)}]);break;case t.BYTE:P.push([{data:R.data,mode:t.BYTE,length:l(R.data)}])}}return P}function p(w,P){const E={},R={start:{}};let _=["start"];for(let b=0;b<w.length;b++){const S=w[b],A=[];for(let C=0;C<S.length;C++){const L=S[C],B=""+b+C;A.push(B),E[B]={node:L,lastCount:0},R[B]={};for(let N=0;N<_.length;N++){const T=_[N];E[T]&&E[T].node.mode===L.mode?(R[T][B]=m(E[T].lastCount+L.length,L.mode)-m(E[T].lastCount,L.mode),E[T].lastCount+=L.length):(E[T]&&(E[T].lastCount=L.length),R[T][B]=m(L.length,L.mode)+4+t.getCharCountIndicator(L.mode,P))}}_=A}for(let b=0;b<_.length;b++)R[_[b]].end=0;return{map:R,table:E}}function g(w,P){let E;const R=t.getBestModeForData(w);if(E=t.from(P,R),E!==t.BYTE&&E.bit<R.bit)throw new Error('"'+w+'" cannot be encoded with mode '+t.toString(E)+`.
|
|
@@ -178,7 +178,7 @@ Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),n.put(i,13)}},lt=r,l
|
|
|
178
178
|
The chosen QR Code version cannot contain this amount of data.
|
|
179
179
|
Minimum version required to store current data is: `+B+`.
|
|
180
180
|
`);const N=E(S,A,L),T=e.getSymbolSize(S),O=new n(T);return y(O,S),d(O),p(O,S),w(O,A,0),S>=7&&g(O,S),P(O,N),isNaN(C)&&(C=s.getBestMask(O,w.bind(null,O,A))),s.applyMask(C,O),w(O,A,C),{modules:O,version:S,errorCorrectionLevel:A,maskPattern:C,segments:L}}return Ve.create=function(S,A){if(typeof S>"u"||S==="")throw new Error("No input text");let C=t.M,L,B;return typeof A<"u"&&(C=t.from(A.errorCorrectionLevel,t.M),L=l.from(A.version),B=s.from(A.maskPattern),A.toSJISFunc&&e.setToSJISFunction(A.toSJISFunc)),_(S,L,C,B)},Ve}var ft={},dt={},Ln;function In(){return Ln||(Ln=1,(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(i){return[i,i]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,i=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:i,scale:i?4:s,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const i=e.getScale(n,o);return Math.floor((n+o.margin*2)*i)},e.qrToImageData=function(n,o,i){const s=o.modules.size,a=o.modules.data,u=e.getScale(s,i),l=Math.floor((s+i.margin*2)*u),f=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m<l;m++)for(let y=0;y<l;y++){let d=(m*l+y)*4,p=i.color.light;if(m>=f&&y>=f&&m<l-f&&y<l-f){const g=Math.floor((m-f)/u),w=Math.floor((y-f)/u);p=h[a[g*s+w]?1:0]}n[d++]=p.r,n[d++]=p.g,n[d++]=p.b,n[d]=p.a}}})(dt)),dt}var _n;function Io(){return _n||(_n=1,(function(e){const t=In();function r(o,i,s){o.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=s,i.width=s,i.style.height=s+"px",i.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(i,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=n()),u=t.getOptions(u);const f=t.getImageWidth(i.modules.size,u),h=l.getContext("2d"),m=h.createImageData(f,f);return t.qrToImageData(m.data,i,u),r(h,l,f),h.putImageData(m,0,0),l},e.renderToDataURL=function(i,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(i,s,u),f=u.type||"image/png",h=u.rendererOpts||{};return l.toDataURL(f,h.quality)}})(ft)),ft}var ht={},Un;function _o(){if(Un)return ht;Un=1;const e=In();function t(o,i){const s=o.a/255,a=i+'="'+o.hex+'"';return s<1?a+" "+i+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function r(o,i,s){let a=o+i;return typeof s<"u"&&(a+=" "+s),a}function n(o,i,s){let a="",u=0,l=!1,f=0;for(let h=0;h<o.length;h++){const m=Math.floor(h%i),y=Math.floor(h/i);!m&&!l&&(l=!0),o[h]?(f++,h>0&&m>0&&o[h-1]||(a+=l?r("M",m+s,.5+y+s):r("m",u,0),u=0,l=!1),m+1<i&&o[h+1]||(a+=r("h",f),f=0)):u++}return a}return ht.render=function(i,s,a){const u=e.getOptions(s),l=i.modules.size,f=i.modules.data,h=l+u.margin*2,m=u.color.light.a?"<path "+t(u.color.light,"fill")+' d="M0 0h'+h+"v"+h+'H0z"/>':"",y="<path "+t(u.color.dark,"stroke")+' d="'+n(f,l,u.margin)+'"/>',d='viewBox="0 0 '+h+" "+h+'"',g='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+d+' shape-rendering="crispEdges">'+m+y+`</svg>
|
|
181
|
-
`;return typeof a=="function"&&a(null,g),g},ht}var vn;function Uo(){if(vn)return ae;vn=1;const e=ho(),t=Lo(),r=Io(),n=_o();function o(i,s,a,u,l){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof l>"u"?(l=u,u=void 0):(l=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);l(null,i(y,s,u))}catch(y){l(y)}}return ae.create=t.create,ae.toCanvas=o.bind(null,r.render),ae.toDataURL=o.bind(null,r.renderToDataURL),ae.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),ae}var vo=Uo();class Fo{constructor(){D(this,"overlay",null);D(this,"isOpen",!1);D(this,"errorCallback",null);D(this,"authEvent",null);D(this,"contentContainer",null);D(this,"loader",null);D(this,"qrContainer",null);D(this,"separator",null);D(this,"loginButton",null);D(this,"errorContainer",null);D(this,"timerContainer",null);D(this,"timerInterval",null);D(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{r.target===this.overlay&&this.close()}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await vo.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t).getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=t.links[0].link;this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=xn(()=>this.close(),n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
|
|
181
|
+
`;return typeof a=="function"&&a(null,g),g},ht}var vn;function Uo(){if(vn)return ae;vn=1;const e=ho(),t=Lo(),r=Io(),n=_o();function o(i,s,a,u,l){const f=[].slice.call(arguments,1),h=f.length,m=typeof f[h-1]=="function";if(!m&&!e())throw new Error("Callback required as last argument");if(m){if(h<2)throw new Error("Too few arguments provided");h===2?(l=a,a=s,s=u=void 0):h===3&&(s.getContext&&typeof l>"u"?(l=u,u=void 0):(l=u,u=a,a=s,s=void 0))}else{if(h<1)throw new Error("Too few arguments provided");return h===1?(a=s,s=u=void 0):h===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(y,d){try{const p=t.create(a,u);y(i(p,s,u))}catch(p){d(p)}})}try{const y=t.create(a,u);l(null,i(y,s,u))}catch(y){l(y)}}return ae.create=t.create,ae.toCanvas=o.bind(null,r.render),ae.toDataURL=o.bind(null,r.renderToDataURL),ae.toString=o.bind(null,function(i,s,a){return n.render(i,a)}),ae}var vo=Uo();class Fo{constructor(){D(this,"overlay",null);D(this,"isOpen",!1);D(this,"errorCallback",null);D(this,"authEvent",null);D(this,"contentContainer",null);D(this,"loader",null);D(this,"qrContainer",null);D(this,"separator",null);D(this,"loginButton",null);D(this,"errorContainer",null);D(this,"timerContainer",null);D(this,"timerInterval",null);D(this,"requestData",null)}createElement(t,r,n){const o=document.createElement(t);return o.className=r,n&&(o.textContent=n),o}createModal(){this.overlay=this.createElement("div","oauth-modal-overlay"),this.contentContainer=this.createElement("div","oauth-modal-content");const t=this.createElement("h3","","Отсканируйте QR-код");this.contentContainer.appendChild(t),this.loader=this.createElement("div","oauth-loader"),this.loader.innerHTML='<div class="oauth-spinner"></div>',this.contentContainer.appendChild(this.loader),this.qrContainer=this.createElement("div","oauth-qrcode-container"),this.contentContainer.appendChild(this.qrContainer),this.timerContainer=this.createElement("div","oauth-timer-container"),this.contentContainer.appendChild(this.timerContainer),this.separator=this.createElement("p","oauth-modal-separator","ИЛИ"),this.contentContainer.appendChild(this.separator),this.loginButton=this.createElement("button","oauth-login-button","Войдите с текущего устройства"),this.contentContainer.appendChild(this.loginButton),this.errorContainer=this.createElement("div","oauth-error-container"),this.errorContainer.style.display="none",this.contentContainer.appendChild(this.errorContainer),this.overlay.appendChild(this.contentContainer),this.overlay.addEventListener("click",r=>{r.target===this.overlay&&this.close()}),document.body.appendChild(this.overlay)}async generateQR(t,r){try{t.innerHTML="";const n=document.createElement("canvas");await vo.toCanvas(n,r,{width:200,margin:1}),t.appendChild(n)}catch(n){console.error("Ошибка при генерации QR-кода:",n),t.innerHTML="<p>Не удалось загрузить QR-код</p>"}}startTimer(t){this.timerInterval&&clearInterval(this.timerInterval);const r=()=>{const n=new Date().getTime(),i=new Date(t+"Z").getTime()-n;if(i>0){const s=Math.floor(i%36e5/6e4),a=Math.floor(i%(1e3*60)/1e3);this.timerContainer.textContent=`Ссылка действительна еще: ${String(s).padStart(2,"0")}:${String(a).padStart(2,"0")}`}else clearInterval(this.timerInterval),this.timerInterval=null,this.renderExpiredState()};r(),this.timerInterval=window.setInterval(r,1e3)}setLoadingState(){this.loader.style.display="flex",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="none",this.timerContainer.style.display="none"}renderSuccessState(t){this.loader.style.display="none",this.errorContainer.style.display="none",this.qrContainer.style.display="flex",this.separator.style.display="block",this.loginButton.style.display="block";const r=t.links[0].link;this.generateQR(this.qrContainer,r),this.loginButton.onclick=()=>window.open(r),this.authEvent=xn(()=>this.close(),n=>this.renderErrorState(n)),t.validUntil?(this.timerContainer.style.display="block",this.startTimer(t.validUntil)):this.timerContainer.style.display="none"}renderErrorState(t){this.loader.style.display="none",this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.timerContainer.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
|
|
182
182
|
<p class="oauth-error-message">Ошибка: ${t.message||"Неизвестная ошибка"}</p>
|
|
183
183
|
<button class="oauth-retry-button">Повторить</button>
|
|
184
184
|
`,this.errorContainer.querySelector(".oauth-retry-button").addEventListener("click",()=>{this.startAuthFlow()})}renderExpiredState(){this.qrContainer.style.display="none",this.separator.style.display="none",this.loginButton.style.display="none",this.errorContainer.style.display="block",this.errorContainer.innerHTML=`
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "oauth0-js-lib",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./dist/index.umd.js",
|
|
6
|
-
"module": "./dist/index.es.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"files": [
|
|
9
|
-
"dist",
|
|
10
|
-
"README.md"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "vite build"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [],
|
|
16
|
-
"author": "Egor Korepin",
|
|
17
|
-
"license": "ISC",
|
|
18
|
-
"description": "Simplify integration with the Oauth0 service",
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/node": "^24.9.1",
|
|
21
|
-
"@types/qrcode": "^1.5.6",
|
|
22
|
-
"typescript": "^5.9.3",
|
|
23
|
-
"vite": "^6.4.1",
|
|
24
|
-
"vite-plugin-dts": "^4.5.4"
|
|
25
|
-
},
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"-": "^0.0.1",
|
|
28
|
-
"@vitest/coverage-v8": "^4.0.4",
|
|
29
|
-
"axios": "^1.13.1",
|
|
30
|
-
"qrcode": "^1.5.4",
|
|
31
|
-
"vitest": "^4.0.4"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "oauth0-js-lib",
|
|
3
|
+
"version": "2.2.5",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.umd.js",
|
|
6
|
+
"module": "./dist/index.es.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "vite build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [],
|
|
16
|
+
"author": "Egor Korepin",
|
|
17
|
+
"license": "ISC",
|
|
18
|
+
"description": "Simplify integration with the Oauth0 service",
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@types/node": "^24.9.1",
|
|
21
|
+
"@types/qrcode": "^1.5.6",
|
|
22
|
+
"typescript": "^5.9.3",
|
|
23
|
+
"vite": "^6.4.1",
|
|
24
|
+
"vite-plugin-dts": "^4.5.4"
|
|
25
|
+
},
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"-": "^0.0.1",
|
|
28
|
+
"@vitest/coverage-v8": "^4.0.4",
|
|
29
|
+
"axios": "^1.13.1",
|
|
30
|
+
"qrcode": "^1.5.4",
|
|
31
|
+
"vitest": "^4.0.4"
|
|
32
|
+
}
|
|
33
|
+
}
|