????
Current Path : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/ |
Current File : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/core-utils-0772e185dc8b9536788d.js |
/*! For license information please see ../license.txt */ "use strict";(self.webpackChunk_cloudbeaver_product_default=self.webpackChunk_cloudbeaver_product_default||[]).push([[7542],{10752:(e,t,n)=>{n.d(t,{u:()=>OrderedMap});var r=n(94866);class OrderedMap{get keys(){return this.indexes}get values(){return this.indexes.map((e=>this.map.get(e)))}constructor(e){this.toKey=e,this.indexes=r.sH.array([],{deep:!1}),this.map=new Map,(0,r.Gn)(this,{map:r.sH.shallow,keys:r.EW,values:r.EW,add:r.XI,addValue:r.XI,remove:r.XI,removeAll:r.XI,bulkUpdate:r.XI,bulkRewrite:r.XI,sort:r.XI})}get(e){return this.map.get(e)}has(e){return this.map.has(e)}add(e,t){this.map.has(e)||(this.indexes.push(e),this.map.set(e,t))}addValue(e){if(!this.toKey)throw Error("no toKey method");this.add(this.toKey(e),e)}remove(e){this.map.has(e)&&(this.map.delete(e),this.indexes.remove(e))}removeAll(){this.indexes.clear(),this.map.clear()}bulkUpdate(e){if(!this.toKey)throw Error("no toKey method");e.forEach((e=>this.add(this.toKey(e),e)))}bulkRewrite(e){this.removeAll(),this.bulkUpdate(e)}sort(e){const t=this.indexes.slice().sort(((t,n)=>e(this.map.get(t),this.map.get(n))));this.indexes.replace(t)}}},77726:(e,t,n)=>{n.d(t,{cY:()=>Deferred,_W:()=>r});var r,o=n(94866);n(87518),n(96410);class PromiseExecutor{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}!function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED",e.CANCELLING="CANCELLING",e.CANCELLED="CANCELLED"}(r||(r={}));class Deferred{constructor(){this.state=r.PENDING,this.promiseExecutor=new PromiseExecutor,this.payload=void 0,this.rejectionReason=void 0,(0,o.Gn)(this,{payload:o.sH,rejectionReason:o.sH,state:o.sH,isInProgress:o.EW,isFinished:o.EW,toResolved:o.XI,toRejected:o.XI,toCancelled:o.XI,toCancelling:o.XI,toPending:o.XI})}get promise(){return this.promiseExecutor.promise}get isInProgress(){return this.state===r.PENDING||this.state===r.CANCELLING}get isFinished(){return!this.isInProgress}getPayload(e){return this.state===r.RESOLVED?this.payload:e}getState(){return this.state}getRejectionReason(){return this.rejectionReason}cancel(){}toResolved(e){this.state=r.RESOLVED,this.payload=e,this.promiseExecutor.resolve(e)}toRejected(e){this.state=r.REJECTED,this.rejectionReason=e,this.promiseExecutor.reject(e)}toCancelled(e){this.state=r.CANCELLED,this.rejectionReason=e,this.promiseExecutor.reject(e)}toCancelling(){this.state===r.PENDING&&(this.state=r.CANCELLING)}toPending(){this.state===r.CANCELLING&&(this.state=r.PENDING)}}},96410:(e,t,n)=>{n.d(t,{N:()=>PromiseCancelledError});class PromiseCancelledError extends Error{constructor(e,t){super(e,t)}}},98988:(e,t,n)=>{n.d(t,{S:()=>cancellableTimeout});var r=n(96410);class CancellablePromise extends Promise{constructor(e){let t,n;super(((e,r)=>{t=e,n=r})),this._resolve=t,this._reject=n;try{this._cancel=e(this._resolve,this._reject)}catch(e){this._reject(e)}}cancel(){this._cancel&&this._cancel(),this._reject(new r.N)}}function cancellableTimeout(e){return new CancellablePromise((t=>{const n=setTimeout((()=>t()),e);return()=>{clearTimeout(n)}}))}},6919:(e,t,n)=>{n.d(t,{B:()=>r});const r={getWidth({font:e,container:t,text:n}){if(t){const n=["font-weight","font-size","font-family"],r=window.getComputedStyle(t),o=n.map((e=>"font-family"===e?r.getPropertyValue(e).split(",")[0]:r.getPropertyValue(e)));o.filter((e=>""!==e)).length===n.length&&(e=o.join(" "))}const r=document.createElement("canvas").getContext("2d");return r.font=e,n.map((e=>r.measureText(e).width+.4*(e.length-1)))}}},60612:(e,t,n)=>{function blobToBase64(e,t){return new Promise(((n,r)=>{const o=new FileReader;o.onload=()=>{n(o.result)},o.onerror=()=>{r(o.error)},t&&(e=e.slice(0,t)),o.readAsDataURL(e)}))}n.d(t,{S:()=>blobToBase64})},42:(e,t,n)=>{function bytesToSize(e){const t=["Bytes","KB","MB","GB","TB"];if(0===e)return"n/a";const n=parseInt(Math.floor(Math.log(e)/Math.log(1024)).toString());return 0===n?`${e} ${t[n]}`:`${(e/Math.pow(1024,n)).toFixed(1)} ${t[n]}`}n.d(t,{C:()=>bytesToSize})},6019:(e,t,n)=>{function copyToClipboard(e){const t=document.activeElement,n=document.createElement("textarea");n.value=e,n.style.position="absolute",n.style.overflow="hidden",n.style.width="0",n.style.height="0",n.style.top="0",n.style.left="0",document.body.appendChild(n),n.select(),document.execCommand("copy"),document.body.removeChild(n),t instanceof HTMLElement&&t.focus({preventScroll:!0})}n.d(t,{l:()=>copyToClipboard})},90639:(e,t,n)=>{function createLastPromiseGetter(){let e,t;return async(n,r,o)=>{const s=JSON.stringify(n);o&&(e=void 0);return s!==(e?JSON.stringify(e):void 0)&&(e=n,t=r()),t}}n.d(t,{h:()=>createLastPromiseGetter})},45934:(e,t,n)=>{function createPath(...e){return e.filter(Boolean).map(((e,t)=>0===t?e.replace(/\/$/,""):e.replace(/^\/|\/$/g,""))).join("/")}n.d(t,{A:()=>createPath})},69326:(e,t,n)=>{function debounce(e,t){let n;return function(...r){n&&clearTimeout(n),n=setTimeout((()=>{e.apply(this,r)}),t)}}function debounceAsync(e,t){let n;return function(...r){const o=this;return new Promise(((s,i)=>{n&&clearTimeout(n),n=setTimeout((async()=>{try{const t=await e.apply(o,r);s(t)}catch(e){i(e)}}),t)}))}}n.d(t,{A:()=>debounceAsync,s:()=>debounce})},49083:(e,t,n)=>{function declensionOfNumber(e,t){const n=(e=Math.abs(e)%100)%10;return e>10&&e<20?t[2]:n>1&&n<5?t[1]:1===n?t[0]:t[2]}n.d(t,{h:()=>declensionOfNumber})},36221:(e,t,n)=>{function download(e,t="",n){const r=document.createElement("a");r.tabIndex=-1,r.download=t,n&&(r.target="_blank",r.rel="noopener"),r.style.display="none",document.body.appendChild(r);try{const t="string"==typeof e?e:URL.createObjectURL(e);r.href=t,r.onclick=()=>requestAnimationFrame((()=>URL.revokeObjectURL(t)))}catch(e){console.error(e),console.warn("Error while getting object URL.")}r.click(),document.body.removeChild(r)}n.d(t,{R:()=>download})},77580:(e,t,n)=>{function downloadFromURL(e){const t=new XMLHttpRequest;let n,r;t.open("GET",e,!0),t.responseType="blob";const o=new Promise(((e,t)=>{n=e,r=t}));return t.onload=()=>{n(t.response)},t.onerror=e=>{r(e)},t.send(),o}n.d(t,{W:()=>downloadFromURL})},86393:(e,t,n)=>{function getMIME(e){if(0===e.length)return"application/octet-stream";switch(e[0]){case"/":return"image/jpeg";case"i":return"image/png";case"R":return"image/gif";case"U":return"image/webp";default:return"application/octet-stream"}}n.d(t,{f:()=>getMIME})},40279:(e,t,n)=>{var r;function getOS(){const e=[["Win",r.windowsOS],["like Mac",r.iOS],["Mac",r.macOS],["Android",r.androidOS],["Linux",r.linuxOS],["X11",r.unixOS]],t=window.navigator.userAgent;return e.find((([e])=>t.toLowerCase().includes(e.toLowerCase())))?.[1]??r.windowsOS}n.d(t,{R:()=>getOS,f:()=>r}),function(e){e[e.windowsOS=0]="windowsOS",e[e.macOS=1]="macOS",e[e.linuxOS=2]="linuxOS",e[e.unixOS=3]="unixOS",e[e.iOS=4]="iOS",e[e.androidOS=5]="androidOS"}(r||(r={}))},45633:(e,t,n)=>{n.d(t,{L:()=>getPathName});var r=n(81374);function getPathName(e){const t=(0,r.u)(e);return t[t.length-1]}},58158:(e,t,n)=>{n.d(t,{U:()=>getPathParent});var r=n(45934),o=n(81374);function getPathParent(e){const t=(0,o.u)(e);return(0,r.A)(...t.slice(0,t.length-1))}},15589:(e,t,n)=>{n.d(t,{j:()=>getPathParents});var r=n(45934),o=n(81374);function getPathParents(e){return(0,o.u)(e).map(((e,t,n)=>(0,r.A)(...n.slice(0,t)))).filter((t=>t!==e))}},81374:(e,t,n)=>{function getPathParts(e){return e.replace("//","[\\\\]").split("/").map((e=>e.replace(/\[\\\\\]/,"//")))}n.d(t,{u:()=>getPathParts})},20185:(e,t,n)=>{function getProgressPercent(e,t){const n=Math.round(100*e/t);return Math.min(100,Math.max(0,n))}n.d(t,{R:()=>getProgressPercent})},31793:(e,t,n)=>{function getTextFileReadingProcess(e){const t=new FileReader;return{promise:new Promise(((n,r)=>{t.readAsText(e),t.onload=t=>{const o=t.target?.result;o?n(o):r(new Error(`No data for the file: "${e.name}"`))},t.onerror=t=>{r(new Error(`Error occurred reading file: "${e.name}"`,{cause:t.target?.error})),t.target?.error&&console.error(t.target.error)},t.onabort=()=>r(new Error(`Reading "${e.name}" is aborted`))})),reader:t}}n.d(t,{N:()=>getTextFileReadingProcess})},14509:(e,t,n)=>{function getUniqueName(e,t){let n=1,r=e;for(;t.includes(r);)r=`${e} (${n})`,n++;return r}n.d(t,{l:()=>getUniqueName})},94203:(e,t,n)=>{function isImageFormat(e){return null!=e.match(/\.(jpeg|jpg|gif|png|svg|bmp|ico)$/)}n.d(t,{v:()=>isImageFormat})},61077:(e,t,n)=>{n.d(t,{n:()=>o});const r=navigator.userAgent.toLowerCase(),o=r.includes("safari")&&!r.includes("chrome")},19389:(e,t,n)=>{function isSameDay(e,t){return e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}n.d(t,{r:()=>isSameDay})},42891:(e,t,n)=>{function isValuesEqual(e,t,n){return(e??n)===(t??n)}n.d(t,{V:()=>isValuesEqual})},26263:(e,t,n)=>{function openCenteredPopup({url:e,target:t,width:n=500,height:r=500,features:o}){if(null===window.top)return null;const s=window.top.outerWidth/window.screen.availWidth,i=`toolbar=no, menubar=no, width=${n/s}, height=${r/s}, top=${(window.top.outerHeight-r)/2/s+window.top.screenY}, left=${(window.top.outerWidth-n)/2/s+window.top.screenX}${o}`;return window.open(e,t,i)}n.d(t,{F:()=>openCenteredPopup})},83094:(e,t,n)=>{n.d(t,{G:()=>parseMIME});var r=n(41949),o=n.n(r);function parseMIME(e){return new(o())(e)}},98207:(e,t,n)=>{n.d(t,{v:()=>removeMetadataFromDataURL});const r=/data:(.*?)\/(.*?);base64,(.*)/;function removeMetadataFromDataURL(e){const t=e.match(r);return t?t[3]:e}},81992:(e,t,n)=>{function replaceMiddle(e,t,n,r){return e.length<r?e:e.substr(0,n)+t+e.substr(e.length-n)}n.d(t,{c:()=>replaceMiddle})},99553:(e,t,n)=>{function staticImplements(){return e=>{}}n.d(t,{V:()=>staticImplements})},37550:(e,t,n)=>{function textToHex(e){let t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n).toString(16);t+=2===r.length?r:`0${r}`}return t.toUpperCase()}n.d(t,{E:()=>textToHex})},8385:(e,t,n)=>{function throttle(e,t,n=!0){let r,o=!1,s=!1,i=[];return function exec(...a){if(o)n&&(i=a,r=this,s=!0);else{o=!0;try{e.apply(this,a)}finally{setTimeout((()=>{if(o=!1,s)try{e.apply(r,i)}finally{r=null,i=[],s=!1}}),t)}}}}function throttleAsync(e,t){let n,r=!1,o=null,s=null,i=null;return async function exec(...a){if(r)return i=a,n=this,s&&s(),new Promise(((e,t)=>{o=e,s=t}));r=!0;try{return e.apply(this,a)}finally{setTimeout((()=>{r=!1,i&&(e.apply(n,i).then(o).catch(s),o=null,s=null,n=null,i=null)}),t)}}}n.d(t,{l:()=>throttleAsync,n:()=>throttle})},19617:(e,t,n)=>{function withTimestamp(e){const t=new Date;return`${e} ${t.toISOString().slice(0,10)} ${("0"+t.getHours()).slice(-2)}-${("0"+t.getMinutes()).slice(-2)}-${("0"+t.getSeconds()).slice(-2)}`}n.d(t,{h:()=>withTimestamp})}}]);