dsql-admin/dsql-app/.local_dist/static/chunks/1335-9b647f464da8b044.js

1 line
10 KiB
JavaScript
Raw Normal View History

2025-01-14 15:27:08 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1335],{489:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({clientId:e,redirectUrl:t,setLoading:n,scopes:i}){n&&n(!0);let o=i?i.join("%20"):"read:user",r=`https://github.com/login/oauth/authorize?client_id=${e}&scope=${o}&redirect_uri=${t}`;window.location.assign(r)}},8557:function(e,t){let n;var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{u(i.next(e))}catch(e){r(e)}}function l(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}u((i=i.apply(e,t||[])).next())})};function o({google:e,clientId:t,setLoading:n,triggerPrompt:i}){return setTimeout(()=>{null==n||n(!1)},3e3),new Promise((n,o)=>{e.accounts.oauth2.initTokenClient({client_id:t,scope:"email profile",callback:function(e){n(e.access_token)}}).requestAccessToken(),i&&e.accounts.id.prompt(function(e){console.log(e)})})}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return i(this,void 0,void 0,function*(){var t,i;null===(t=e.setLoading)||void 0===t||t.call(e,!0);let r=yield new Promise((t,i)=>{n=setInterval(()=>{let i=window.google;i&&(window.clearInterval(n),t(o(Object.assign(Object.assign({},e),{google:i}))))},500)});return null===(i=e.setLoading)||void 0===i||i.call(e,!1),r})},t.googleLogin=o},7946:function(e,t,n){var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{u(i.next(e))}catch(e){r(e)}}function l(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,l)}u((i=i.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return i(this,void 0,void 0,function*(){try{let t;let n=localStorage.getItem("user");try{t=JSON.parse(n||"")}catch(e){console.log(e)}if(!t)return!1;let i=(0,r.default)(),o=(null==i?void 0:i.datasquirel_social_id)&&"string"==typeof i.datasquirel_social_id&&!i.datasquirel_social_id.match(/^null$/i)?i.datasquirel_social_id:null;return localStorage.setItem("user","{}"),localStorage.removeItem("csrf"),document.cookie="datasquirel_social_id=null;samesite=strict;path=/",yield new Promise((t,n)=>{if(!o||(null==o?void 0:o.match(/^null$/i)))t(!0);else{let n=null==e?void 0:e.googleClientId;if(n){let e=document.createElement("script");e.src="https://accounts.google.com/gsi/client",e.className="social-script-tag",document.body.appendChild(e),e.onload=function(e){let i=window.google;i&&(i.accounts.id.initialize({client_id:n}),i.accounts.id.revoke(o,e=>{console.log(e.error),t(!0)}))}}else t(!0)}})}catch(e){return!1}})};let r=o(n(2406))},4490:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){try{if(!e.payload||!e.payload.csrf_k)return!1;return localStorage.setItem("csrf",e.payload.csrf_k),localStorage.setItem("user",JSON.stringify(e.payload)),!0}catch(e){return!1}}},1335:function(e,t,n){var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let o=i(n(8753)),r=i(n(4715)),a=i(n(1168)),l=i(n(8557)),u=i(n(489)),c=i(n(7946)),s=i(n(1028)),d=i(n(1028)),f=i(n(4727)),g=i(n(8168)),h=i(n(834)),p=i(n(8226)),m=i(n(4567)),y=i(n(4490)),v={imageInputToBase64:r.default,imageInputFileToBase64:o.default,inputFileToBase64:a.default},_={google:{getAccessToken:l.default},github:{getAccessToken:u.default},logout:c.default,postLogin:y.default},w={serializeQuery:f.default,serializeCookies:g.default,EJSON:h.default,numberfy:p.default,slugify:m.default},b={fetchApi:s.default,clientFetch:d.default};t.default={media:v,auth:_,fetch:b,utils:w}},8753:function(e,t){var n=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,r){function a(e){try{u(i.next(e))}catch(e){r(e)}}function l(e){try{u(i.throw(e))}catch(e){r(e)}}function u(e){var t;e.done?o(e.value):((t=e