image-salon-sdk 1.0.73 → 1.0.74

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.
@@ -4,7 +4,7 @@ import { RpcOptions } from '@protobuf-ts/runtime-rpc/build/types/rpc-options';
4
4
 
5
5
  export declare const createFileReq: (name: string, nestedFolderName: string, url: string, type: FileType, folderName: string, options: RpcOptions) => Promise<any>;
6
6
  export declare const createFileReqForUser: (url: string, type: FileType, options: RpcOptions) => Promise<any>;
7
- export declare const createFileReqForUserV2: (url: string, type: FileType, accessToken: string, mode: "development" | "production") => Promise<any>;
7
+ export declare const createFileReqForUserV2: (url: string, type: FileType, accessToken: string) => Promise<any>;
8
8
  export declare const getFilesByFolder: (folderName: string, cursor: string, limit: number, options: RpcOptions) => Promise<import('@protobuf-ts/runtime-rpc').FinishedUnaryCall<GetFilesByFolderRequest, import('../grpc/generated/exposed-file-service').GetFilesByFolderResponse>>;
9
9
  export declare const searchFiles: (query: string, cursor: string, limit: number, options: RpcOptions) => Promise<import('@protobuf-ts/runtime-rpc').FinishedUnaryCall<SearchRequest, import('../grpc/generated/exposed-file-service').SearchResult>>;
10
10
  export declare const updateFileReq: (key: string, name: string, nestedFolderName: string, url: string, thumborUrl: string, proxyUrl: string, type: FileType, folderName: string, options: RpcOptions) => Promise<any>;
@@ -1,4 +1,4 @@
1
1
  import { RpcOptions } from '@protobuf-ts/runtime-rpc/build/types/rpc-options';
2
2
 
3
3
  export declare const imageUploadReq: (mimeType: string, options: RpcOptions, isAdmin?: boolean) => Promise<any>;
4
- export declare const imageUploadReqUser: (mimeType: string, accessToken: string, isAdmin: boolean, mode: "development" | "production") => Promise<any>;
4
+ export declare const imageUploadReqUser: (mimeType: string, accessToken: string) => Promise<any>;
@@ -3325,7 +3325,7 @@ const ns = new ts(), _n = new Kn("com.hamropatro.grpc.common.FileService", [
3325
3325
  { name: "createUserFile", options: {}, I: zn, O: et },
3326
3326
  { name: "search", options: {}, I: Or, O: Zi }
3327
3327
  ]);
3328
- class Dt {
3328
+ class Rt {
3329
3329
  constructor(e) {
3330
3330
  he(this, "typeName", _n.typeName);
3331
3331
  he(this, "methods", _n.methods);
@@ -3380,7 +3380,7 @@ class Dt {
3380
3380
  const rs = async (s, e, t, n, r, i) => {
3381
3381
  var o;
3382
3382
  try {
3383
- const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, c = new Dt(a), d = Sr.create();
3383
+ const a = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, c = new Rt(a), d = Sr.create();
3384
3384
  return d.name = s, d.nestedFolderName = e, d.url = t, d.type = n, d.folderName = r, await c.createFile(
3385
3385
  d,
3386
3386
  i
@@ -3391,7 +3391,7 @@ const rs = async (s, e, t, n, r, i) => {
3391
3391
  }, is = async (s, e, t) => {
3392
3392
  var n;
3393
3393
  try {
3394
- const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new Dt(r), o = zn.create();
3394
+ const r = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, i = new Rt(r), o = zn.create();
3395
3395
  return o.url = s, o.type = e, await i.createUserFile(
3396
3396
  o,
3397
3397
  t
@@ -3399,16 +3399,16 @@ const rs = async (s, e, t, n, r, i) => {
3399
3399
  } catch (r) {
3400
3400
  throw r;
3401
3401
  }
3402
- }, ss = async (s, e, t, n) => {
3403
- var r;
3402
+ }, ss = async (s, e, t) => {
3403
+ var n, r;
3404
3404
  try {
3405
- const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new Dt(i), a = zn.create();
3406
- return a.url = s, a.type = e, await o.createUserFile(
3407
- a,
3405
+ const i = (n = window.ImageSalonSDK) == null ? void 0 : n.grpcConfig, o = (r = window.ImageSalonSDK) == null ? void 0 : r.mode, a = new Rt(i), c = zn.create();
3406
+ return c.url = s, c.type = e, await a.createUserFile(
3407
+ c,
3408
3408
  {
3409
3409
  meta: {
3410
3410
  Authorization: t,
3411
- "app-id": n === "production" ? "hamropatro" : "hamropatro-android"
3411
+ "app-id": o === "production" ? "hamropatro" : "hamropatro-android"
3412
3412
  }
3413
3413
  }
3414
3414
  );
@@ -3418,7 +3418,7 @@ const rs = async (s, e, t, n, r, i) => {
3418
3418
  }, os = async (s, e, t, n) => {
3419
3419
  var r;
3420
3420
  try {
3421
- const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new Dt(i), a = Dr.create();
3421
+ const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new Rt(i), a = Dr.create();
3422
3422
  return a.folderName = s, a.cursor = e, a.limit = t, await o.getFilesByFolder(
3423
3423
  a,
3424
3424
  n
@@ -3429,7 +3429,7 @@ const rs = async (s, e, t, n, r, i) => {
3429
3429
  }, as = async (s, e, t = 20, n) => {
3430
3430
  var r;
3431
3431
  try {
3432
- const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new Dt(i), a = Or.create();
3432
+ const i = (r = window.ImageSalonSDK) == null ? void 0 : r.grpcConfig, o = new Rt(i), a = Or.create();
3433
3433
  return a.searchValue = s, a.cursor = e, a.limit = t, await o.search(
3434
3434
  a,
3435
3435
  n
@@ -3440,7 +3440,7 @@ const rs = async (s, e, t, n, r, i) => {
3440
3440
  }, ls = async (s, e, t, n, r, i, o, a, c) => {
3441
3441
  var d;
3442
3442
  try {
3443
- const l = (d = window.ImageSalonSDK) == null ? void 0 : d.grpcConfig, u = new Dt(l), h = et.create();
3443
+ const l = (d = window.ImageSalonSDK) == null ? void 0 : d.grpcConfig, u = new Rt(l), h = et.create();
3444
3444
  return h.key = s, h.name = e, h.nestedFolderName = t, h.url = n, h.thumborUrl = r, h.proxyUrl = i, h.type = o, h.folderName = a, await u.updateFile(
3445
3445
  h,
3446
3446
  c
@@ -3451,7 +3451,7 @@ const rs = async (s, e, t, n, r, i) => {
3451
3451
  }, cs = async (s, e) => {
3452
3452
  var t;
3453
3453
  try {
3454
- const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new Dt(n), i = Rr.create();
3454
+ const n = (t = window.ImageSalonSDK) == null ? void 0 : t.grpcConfig, r = new Rt(n), i = Rr.create();
3455
3455
  return i.key = s, await r.deleteFile(
3456
3456
  i,
3457
3457
  e
@@ -4078,29 +4078,29 @@ function Q(s, e, t, n, r) {
4078
4078
  let i = document.createElement(s);
4079
4079
  return e && (i.className += e), t && (i.style.cssText = t), n && (i.textContent = n), r && r.appendChild(i), i;
4080
4080
  }
4081
- var ft, ze, Pt;
4081
+ var ft, ze, $t;
4082
4082
  class Ts {
4083
4083
  constructor() {
4084
4084
  z(this, ft);
4085
4085
  z(this, ze);
4086
4086
  // Store the circle element as a private property
4087
- z(this, Pt, "#fff");
4087
+ z(this, $t, "#fff");
4088
4088
  H(this, ft, document.createElementNS(
4089
4089
  "http://www.w3.org/2000/svg",
4090
4090
  "svg"
4091
4091
  )), E(this, ft).setAttribute("viewBox", "25 25 50 50"), E(this, ft).classList.add("loader-svg"), H(this, ze, document.createElementNS(
4092
4092
  "http://www.w3.org/2000/svg",
4093
4093
  "circle"
4094
- )), E(this, ze).setAttribute("r", "20"), E(this, ze).setAttribute("cy", "50"), E(this, ze).setAttribute("cx", "50"), E(this, ze).setAttribute("stroke", E(this, Pt)), E(this, ze).classList.add("loader-circle"), E(this, ft).appendChild(E(this, ze));
4094
+ )), E(this, ze).setAttribute("r", "20"), E(this, ze).setAttribute("cy", "50"), E(this, ze).setAttribute("cx", "50"), E(this, ze).setAttribute("stroke", E(this, $t)), E(this, ze).classList.add("loader-circle"), E(this, ft).appendChild(E(this, ze));
4095
4095
  }
4096
4096
  show(e, t) {
4097
- t && (H(this, Pt, t), E(this, ze).setAttribute("stroke", E(this, Pt))), e.appendChild(E(this, ft));
4097
+ t && (H(this, $t, t), E(this, ze).setAttribute("stroke", E(this, $t))), e.appendChild(E(this, ft));
4098
4098
  }
4099
4099
  hide() {
4100
4100
  E(this, ft).remove();
4101
4101
  }
4102
4102
  }
4103
- ft = new WeakMap(), ze = new WeakMap(), Pt = new WeakMap();
4103
+ ft = new WeakMap(), ze = new WeakMap(), $t = new WeakMap();
4104
4104
  const wr = new Ts(), fn = document.body;
4105
4105
  class $r {
4106
4106
  constructor() {
@@ -5331,23 +5331,23 @@ const Ke = function() {
5331
5331
  for (var ee = 0; ee < le.length; ee++) {
5332
5332
  const Le = new Uint8Array(le[ee]), De = new Uint32Array(Le.buffer);
5333
5333
  var Re;
5334
- let xe = 0, _e = 0, Ze = ne, rt = pe, Mt = Ne ? 1 : 0;
5334
+ let xe = 0, _e = 0, Ze = ne, rt = pe, Dt = Ne ? 1 : 0;
5335
5335
  if (ee != 0) {
5336
5336
  const cn = Te || Ne || ee == 1 || fe[ee - 2].dispose != 0 ? 1 : 2;
5337
- let Vt = 0, ce = 1e9;
5337
+ let Mt = 0, ce = 1e9;
5338
5338
  for (let We = 0; We < cn; We++) {
5339
5339
  var Ue = new Uint8Array(le[ee - 1 - We]);
5340
5340
  const it = new Uint32Array(le[ee - 1 - We]);
5341
- let Ct = ne, Et = pe, Ht = -1, Qt = -1;
5342
- for (let _t = 0; _t < pe; _t++) for (let Bt = 0; Bt < ne; Bt++)
5343
- De[Ae = _t * ne + Bt] != it[Ae] && (Bt < Ct && (Ct = Bt), Bt > Ht && (Ht = Bt), _t < Et && (Et = _t), _t > Qt && (Qt = _t));
5344
- Ht == -1 && (Ct = Et = Ht = Qt = 0), me && ((1 & Ct) == 1 && Ct--, (1 & Et) == 1 && Et--);
5345
- const Jn = (Ht - Ct + 1) * (Qt - Et + 1);
5346
- Jn < ce && (ce = Jn, Vt = We, xe = Ct, _e = Et, Ze = Ht - Ct + 1, rt = Qt - Et + 1);
5341
+ let Ct = ne, Et = pe, Vt = -1, Qt = -1;
5342
+ for (let xt = 0; xt < pe; xt++) for (let _t = 0; _t < ne; _t++)
5343
+ De[Ae = xt * ne + _t] != it[Ae] && (_t < Ct && (Ct = _t), _t > Vt && (Vt = _t), xt < Et && (Et = xt), xt > Qt && (Qt = xt));
5344
+ Vt == -1 && (Ct = Et = Vt = Qt = 0), me && ((1 & Ct) == 1 && Ct--, (1 & Et) == 1 && Et--);
5345
+ const Jn = (Vt - Ct + 1) * (Qt - Et + 1);
5346
+ Jn < ce && (ce = Jn, Mt = We, xe = Ct, _e = Et, Ze = Vt - Ct + 1, rt = Qt - Et + 1);
5347
5347
  }
5348
- Ue = new Uint8Array(le[ee - 1 - Vt]), Vt == 1 && (fe[ee - 1].dispose = 2), Re = new Uint8Array(Ze * rt * 4), s(Ue, ne, pe, Re, Ze, rt, -xe, -_e, 0), Mt = s(Le, ne, pe, Re, Ze, rt, -xe, -_e, 3) ? 1 : 0, Mt == 1 ? h(Le, ne, pe, Re, { x: xe, y: _e, width: Ze, height: rt }) : s(Le, ne, pe, Re, Ze, rt, -xe, -_e, 0);
5348
+ Ue = new Uint8Array(le[ee - 1 - Mt]), Mt == 1 && (fe[ee - 1].dispose = 2), Re = new Uint8Array(Ze * rt * 4), s(Ue, ne, pe, Re, Ze, rt, -xe, -_e, 0), Dt = s(Le, ne, pe, Re, Ze, rt, -xe, -_e, 3) ? 1 : 0, Dt == 1 ? h(Le, ne, pe, Re, { x: xe, y: _e, width: Ze, height: rt }) : s(Le, ne, pe, Re, Ze, rt, -xe, -_e, 0);
5349
5349
  } else Re = Le.slice(0);
5350
- fe.push({ rect: { x: xe, y: _e, width: Ze, height: rt }, img: Re, blend: Mt, dispose: 0 });
5350
+ fe.push({ rect: { x: xe, y: _e, width: Ze, height: rt }, img: Re, blend: Dt, dispose: 0 });
5351
5351
  }
5352
5352
  if (Ne) for (ee = 0; ee < fe.length; ee++) {
5353
5353
  if ((nt = fe[ee]).blend == 1) continue;
@@ -5630,14 +5630,14 @@ function Kr(s) {
5630
5630
  n.onload = () => e(n), n.onerror = (r) => t(r), n.src = s;
5631
5631
  });
5632
5632
  }
5633
- function Ot() {
5634
- if (Ot.cachedResult !== void 0) return Ot.cachedResult;
5633
+ function Bt() {
5634
+ if (Bt.cachedResult !== void 0) return Bt.cachedResult;
5635
5635
  let s = Me.ETC;
5636
5636
  const { userAgent: e } = navigator;
5637
- return /Chrom(e|ium)/i.test(e) ? s = Me.CHROME : /iP(ad|od|hone)/i.test(e) && /WebKit/i.test(e) ? s = Me.IOS : /Safari/i.test(e) ? s = Me.DESKTOP_SAFARI : /Firefox/i.test(e) ? s = Me.FIREFOX : (/MSIE/i.test(e) || document.documentMode) && (s = Me.IE), Ot.cachedResult = s, Ot.cachedResult;
5637
+ return /Chrom(e|ium)/i.test(e) ? s = Me.CHROME : /iP(ad|od|hone)/i.test(e) && /WebKit/i.test(e) ? s = Me.IOS : /Safari/i.test(e) ? s = Me.DESKTOP_SAFARI : /Firefox/i.test(e) ? s = Me.FIREFOX : (/MSIE/i.test(e) || document.documentMode) && (s = Me.IE), Bt.cachedResult = s, Bt.cachedResult;
5638
5638
  }
5639
5639
  function zr(s, e) {
5640
- const t = Ot(), n = Vs[t];
5640
+ const t = Bt(), n = Vs[t];
5641
5641
  let r = s, i = e, o = r * i;
5642
5642
  const a = r > i ? i / r : r / i;
5643
5643
  for (; o > n * n; ) {
@@ -5709,7 +5709,7 @@ function vn(s, e = {}) {
5709
5709
  }
5710
5710
  };
5711
5711
  try {
5712
- if (gn() || [Me.DESKTOP_SAFARI, Me.MOBILE_SAFARI].includes(Ot())) throw new Error("Skip createImageBitmap on IOS and Safari");
5712
+ if (gn() || [Me.DESKTOP_SAFARI, Me.MOBILE_SAFARI].includes(Bt())) throw new Error("Skip createImageBitmap on IOS and Safari");
5713
5713
  return createImageBitmap(s).then(function(c) {
5714
5714
  try {
5715
5715
  return r = c, o();
@@ -5771,10 +5771,10 @@ function An(s, e, t, n, r = 1) {
5771
5771
  function dt(s) {
5772
5772
  s.width = 0, s.height = 0;
5773
5773
  }
5774
- function $t() {
5774
+ function Ht() {
5775
5775
  return new Promise(function(s, e) {
5776
5776
  let t, n, r, i;
5777
- return $t.cachedResult !== void 0 ? s($t.cachedResult) : Gn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==", "test.jpg", Date.now()).then(function(o) {
5777
+ return Ht.cachedResult !== void 0 ? s(Ht.cachedResult) : Gn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==", "test.jpg", Date.now()).then(function(o) {
5778
5778
  try {
5779
5779
  return t = o, vn(t).then(function(a) {
5780
5780
  try {
@@ -5782,7 +5782,7 @@ function $t() {
5782
5782
  try {
5783
5783
  return r = c, dt(n), vn(r).then(function(d) {
5784
5784
  try {
5785
- return i = d[0], $t.cachedResult = i.width === 1 && i.height === 2, s($t.cachedResult);
5785
+ return i = d[0], Ht.cachedResult = i.width === 1 && i.height === 2, s(Ht.cachedResult);
5786
5786
  } catch (l) {
5787
5787
  return e(l);
5788
5788
  }
@@ -5887,7 +5887,7 @@ function br(s, e, t = 0) {
5887
5887
  return _.call(this);
5888
5888
  }).then((function(N) {
5889
5889
  try {
5890
- return l = N, g(), $t().then((function(L) {
5890
+ return l = N, g(), Ht().then((function(L) {
5891
5891
  try {
5892
5892
  return u = L ? d : Qr(d, l), g(), h = e.initialQuality || 1, f = e.fileType || s.type, An(u, f, s.name, s.lastModified, h).then((function(v) {
5893
5893
  try {
@@ -6037,7 +6037,7 @@ function Be(s, e) {
6037
6037
  }
6038
6038
  });
6039
6039
  }
6040
- Be.getDataUrlFromFile = Zr, Be.getFilefromDataUrl = Gn, Be.loadImage = Kr, Be.drawImageInCanvas = Xr, Be.drawFileInCanvas = vn, Be.canvasToFile = An, Be.getExifOrientation = Gr, Be.handleMaxWidthOrHeight = Jr, Be.followExifOrientation = Qr, Be.cleanupCanvasMemory = dt, Be.isAutoOrientationInBrowser = $t, Be.approximateBelowMaximumCanvasSizeOfBrowser = zr, Be.copyExifWithoutOrientation = Pr, Be.getBrowserName = Ot, Be.version = "2.0.2";
6040
+ Be.getDataUrlFromFile = Zr, Be.getFilefromDataUrl = Gn, Be.loadImage = Kr, Be.drawImageInCanvas = Xr, Be.drawFileInCanvas = vn, Be.canvasToFile = An, Be.getExifOrientation = Gr, Be.handleMaxWidthOrHeight = Jr, Be.followExifOrientation = Qr, Be.cleanupCanvasMemory = dt, Be.isAutoOrientationInBrowser = Ht, Be.approximateBelowMaximumCanvasSizeOfBrowser = zr, Be.copyExifWithoutOrientation = Pr, Be.getBrowserName = Bt, Be.version = "2.0.2";
6041
6041
  class Ws extends Ie {
6042
6042
  constructor() {
6043
6043
  super("com.hamropatro.grpc.common.ImageUploadRequest", [
@@ -6180,12 +6180,12 @@ const qs = async (s, e, t = !0) => {
6180
6180
  } catch (a) {
6181
6181
  throw a;
6182
6182
  }
6183
- }, Zs = async (s, e, t = !0, n) => {
6184
- var a;
6185
- const r = (a = window.ImageSalonSDK) == null ? void 0 : a.grpcConfig, i = new Yr(r), o = kn.create();
6183
+ }, Zs = async (s, e) => {
6184
+ var o, a;
6185
+ const t = (o = window.ImageSalonSDK) == null ? void 0 : o.grpcConfig, n = (a = window.ImageSalonSDK) == null ? void 0 : a.mode, r = new Yr(t), i = kn.create();
6186
6186
  try {
6187
- return o.mimeType = s, await i.uploadUserImage(
6188
- o,
6187
+ return i.mimeType = s, await r.uploadUserImage(
6188
+ i,
6189
6189
  {
6190
6190
  meta: {
6191
6191
  Authorization: e,
@@ -6217,18 +6217,13 @@ const qs = async (s, e, t = !0) => {
6217
6217
  } catch (r) {
6218
6218
  throw r;
6219
6219
  }
6220
- }, Ks = async (s, e, t, n = !1, r) => {
6221
- var i, o;
6220
+ }, Ks = async (s, e, t) => {
6221
+ var n, r;
6222
6222
  try {
6223
- const a = await Zs(
6224
- e == null ? void 0 : e.type,
6225
- t,
6226
- n,
6227
- r
6228
- ), c = (i = a.response) == null ? void 0 : i.uploadUrl, d = (o = a == null ? void 0 : a.response) == null ? void 0 : o.accessUrl;
6229
- return await ei(s, c, e), d;
6230
- } catch (a) {
6231
- throw a;
6223
+ const i = await Zs(e == null ? void 0 : e.type, t), o = (n = i.response) == null ? void 0 : n.uploadUrl, a = (r = i == null ? void 0 : i.response) == null ? void 0 : r.accessUrl;
6224
+ return await ei(s, o, e), a;
6225
+ } catch (i) {
6226
+ throw i;
6232
6227
  }
6233
6228
  }, zs = (s, e) => {
6234
6229
  const t = e.type.split("/")[0];
@@ -6251,7 +6246,7 @@ async function vr(s) {
6251
6246
  throw t;
6252
6247
  }
6253
6248
  }
6254
- var At, be, Ce, pt, ge, ke, Xe, He, St, kt, st, Ge, Ft, Wt, qn, Nt, It, mt, Rt, ot, at, Tt, Lt, gt, jt, rn, Oe, wt, sn, Fn, on, lt, qt, Ut, xt, Zt, Kt, zt, Xt, an, ln, Gt, ct, Jt;
6249
+ var At, be, Ce, pt, ge, ke, Xe, He, Ot, kt, st, Ge, Ft, Pt, qn, Nt, It, mt, St, ot, at, Tt, Lt, gt, Wt, rn, Oe, wt, sn, Fn, on, lt, jt, Ut, qt, Zt, Kt, zt, Xt, an, ln, Gt, ct, Jt;
6255
6250
  class Gs {
6256
6251
  constructor(e) {
6257
6252
  z(this, At);
@@ -6262,23 +6257,23 @@ class Gs {
6262
6257
  z(this, ke, []);
6263
6258
  z(this, Xe);
6264
6259
  z(this, He);
6265
- z(this, St);
6260
+ z(this, Ot);
6266
6261
  z(this, kt);
6267
6262
  z(this, st, []);
6268
6263
  z(this, Ge);
6269
6264
  z(this, Ft);
6270
- z(this, Wt);
6265
+ z(this, Pt);
6271
6266
  z(this, qn);
6272
6267
  z(this, Nt);
6273
6268
  z(this, It);
6274
6269
  z(this, mt);
6275
- z(this, Rt);
6270
+ z(this, St);
6276
6271
  z(this, ot);
6277
6272
  z(this, at);
6278
6273
  z(this, Tt);
6279
6274
  z(this, Lt);
6280
6275
  z(this, gt);
6281
- z(this, jt);
6276
+ z(this, Wt);
6282
6277
  z(this, rn);
6283
6278
  z(this, Oe);
6284
6279
  z(this, wt);
@@ -6286,9 +6281,9 @@ class Gs {
6286
6281
  z(this, Fn);
6287
6282
  z(this, on);
6288
6283
  z(this, lt);
6289
- z(this, qt);
6284
+ z(this, jt);
6290
6285
  z(this, Ut);
6291
- z(this, xt);
6286
+ z(this, qt);
6292
6287
  z(this, Zt);
6293
6288
  z(this, Kt);
6294
6289
  z(this, zt);
@@ -6298,7 +6293,7 @@ class Gs {
6298
6293
  z(this, Gt);
6299
6294
  z(this, ct);
6300
6295
  z(this, Jt);
6301
- H(this, on, e.isAdmin), H(this, Xe, !1), H(this, xt, e == null ? void 0 : e.mode), e.handleUpload && H(this, Wt, e.handleUpload.bind(this)), e != null && e.accessToken && (H(this, rn, e.accessToken), this._grpcOptionInitializer()), this._init(e).then(() => {
6296
+ H(this, on, e.isAdmin), H(this, Xe, !1), H(this, qt, e == null ? void 0 : e.mode), e.handleUpload && H(this, Pt, e.handleUpload.bind(this)), e != null && e.accessToken && (H(this, rn, e.accessToken), this._grpcOptionInitializer()), this._init(e).then(() => {
6302
6297
  H(this, sn, !0), e != null && e.parentContainerId && this._renderView(e), this.updateWindowObject({ initialized: !0 }), this._initializeGrpcConfig(e.mode, e.endPoint);
6303
6298
  });
6304
6299
  }
@@ -6315,7 +6310,7 @@ class Gs {
6315
6310
  }
6316
6311
  _renderView(e) {
6317
6312
  var t, n, r;
6318
- return this._isAdminOptions(e) ? (H(this, He, !1), H(this, St, !1), H(this, Nt, 0), H(this, at, ""), H(this, gt, !1), H(this, xt, e.mode), H(this, Tt, !1), H(this, Ut, ""), H(this, wt, null), this._removeToastContainer(), this._renderAdminView(e)) : (H(this, qt, ""), H(this, Zt, e == null ? void 0 : e.restrictedFileSize), H(this, Kt, e == null ? void 0 : e.localizedFileRestrictedMessage), H(this, Xt, e == null ? void 0 : e.localizedSuccessMessage), H(this, zt, e == null ? void 0 : e.localizedErrorMessage), H(this, ct, e == null ? void 0 : e.imagePreviewWidth), H(this, Jt, e == null ? void 0 : e.imagePreviewHeight), H(this, an, (t = e == null ? void 0 : e.removeImageConfirm) == null ? void 0 : t.bind(this)), H(this, ln, (n = e == null ? void 0 : e.removeImagePreviewCB) == null ? void 0 : n.bind(this)), H(this, Gt, (r = e == null ? void 0 : e.getUploadingState) == null ? void 0 : r.bind(this)), this._removeUserToast(), this._renderUserView(e));
6313
+ return this._isAdminOptions(e) ? (H(this, He, !1), H(this, Ot, !1), H(this, Nt, 0), H(this, at, ""), H(this, gt, !1), H(this, qt, e.mode), H(this, Tt, !1), H(this, Ut, ""), H(this, wt, null), this._removeToastContainer(), this._renderAdminView(e)) : (H(this, jt, ""), H(this, Zt, e == null ? void 0 : e.restrictedFileSize), H(this, Kt, e == null ? void 0 : e.localizedFileRestrictedMessage), H(this, Xt, e == null ? void 0 : e.localizedSuccessMessage), H(this, zt, e == null ? void 0 : e.localizedErrorMessage), H(this, ct, e == null ? void 0 : e.imagePreviewWidth), H(this, Jt, e == null ? void 0 : e.imagePreviewHeight), H(this, an, (t = e == null ? void 0 : e.removeImageConfirm) == null ? void 0 : t.bind(this)), H(this, ln, (n = e == null ? void 0 : e.removeImagePreviewCB) == null ? void 0 : n.bind(this)), H(this, Gt, (r = e == null ? void 0 : e.getUploadingState) == null ? void 0 : r.bind(this)), this._removeUserToast(), this._renderUserView(e));
6319
6314
  }
6320
6315
  _renderAdminView(e) {
6321
6316
  if (!E(this, sn)) return;
@@ -6337,7 +6332,7 @@ class Gs {
6337
6332
  async _grpcOptionInitializer() {
6338
6333
  H(this, Oe, await _s(
6339
6334
  E(this, rn),
6340
- E(this, xt)
6335
+ E(this, qt)
6341
6336
  ));
6342
6337
  }
6343
6338
  _selectedImageContainer() {
@@ -6364,7 +6359,7 @@ class Gs {
6364
6359
  e.onclick = () => {
6365
6360
  pn.hide(), H(this, ke, []), H(this, ge, []);
6366
6361
  }, E(this, Ft).onclick = () => {
6367
- E(this, Wt).call(this), pn.hide(), H(this, ge, []), H(this, ke, []);
6362
+ E(this, Pt).call(this), pn.hide(), H(this, ge, []), H(this, ke, []);
6368
6363
  }, d.append(e, E(this, Ft));
6369
6364
  const l = K("container-right-main");
6370
6365
  l.append(o, a, c, d), E(this, be).append(E(this, It), l), pn.show({
@@ -6565,7 +6560,7 @@ class Gs {
6565
6560
  Je[Rn((n = t.type) == null ? void 0 : n.split("/")[0])],
6566
6561
  E(this, Oe)
6567
6562
  );
6568
- H(this, qt, r == null ? void 0 : r.response), E(this, Wt).call(this);
6563
+ H(this, jt, r == null ? void 0 : r.response), E(this, Pt).call(this);
6569
6564
  } catch (r) {
6570
6565
  throw Error(r);
6571
6566
  }
@@ -6627,22 +6622,22 @@ class Gs {
6627
6622
  H(this, at, ""), H(this, Tt, !1), H(this, gt, !1), this._fetchFilesFromFolder(E(this, kt));
6628
6623
  return;
6629
6624
  }
6630
- H(this, gt, !0), H(this, jt, o.value), this._search(E(this, jt));
6625
+ H(this, gt, !0), H(this, Wt, o.value), this._search(E(this, Wt));
6631
6626
  }, 750);
6632
6627
  }), E(this, Lt).setAttribute("placeholder", "Search");
6633
6628
  const r = Ns();
6634
6629
  return r.style.position = "absolute", r.style.top = "50%", r.style.left = "5%", r.style.transform = "translate(-5%, -50%)", n.append(r, E(this, Lt)), t.append(n), t;
6635
6630
  }
6636
6631
  _createBrowseMoreContainer() {
6637
- H(this, Rt, K("browse-more-btn-container")), this._createAllAndSelectedTab(E(this, Rt));
6632
+ H(this, St, K("browse-more-btn-container")), this._createAllAndSelectedTab(E(this, St));
6638
6633
  const e = this._renderUploadButton(), t = this._renderCreateFolderBtn(), n = document.createElement("div");
6639
- return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), E(this, Rt).appendChild(n), E(this, Rt);
6634
+ return n.style.display = "flex", n.style.alignItems = "center", n.style.gap = "10px", n.append(e, t), E(this, St).appendChild(n), E(this, St);
6640
6635
  }
6641
6636
  _createBrowseImageMain() {
6642
6637
  const e = K("browse-image-main");
6643
6638
  return H(this, Ce, K("selected-image-container")), E(this, Ce).addEventListener("scroll", () => {
6644
6639
  const t = E(this, Ce).clientHeight, n = E(this, Ce).scrollTop, r = E(this, Ce).scrollHeight;
6645
- t + n >= r - 5 && E(this, Tt) && (E(this, gt) ? this._search(E(this, jt)) : this._fetchFilesFromFolder(E(this, kt)));
6640
+ t + n >= r - 5 && E(this, Tt) && (E(this, gt) ? this._search(E(this, Wt)) : this._fetchFilesFromFolder(E(this, kt)));
6646
6641
  }), e.appendChild(E(this, Ce)), e;
6647
6642
  }
6648
6643
  _renderFetchingSkeletonUI() {
@@ -6745,7 +6740,7 @@ class Gs {
6745
6740
  e.innerHTML = "", E(this, Ce).appendChild(e);
6746
6741
  }
6747
6742
  _fileCardBody(e) {
6748
- var rt, Mt, cn, Vt;
6743
+ var rt, Dt, cn, Mt;
6749
6744
  const t = K("selected-image-content"), n = K("selected-image-top-bar"), r = Ve(
6750
6745
  "",
6751
6746
  "selected-image-btn",
@@ -6806,7 +6801,7 @@ class Gs {
6806
6801
  ue
6807
6802
  );
6808
6803
  const we = ie("Dimension", "preview-title"), ut = ie(
6809
- `${(rt = e == null ? void 0 : e.metadata) == null ? void 0 : rt.width} * ${(Mt = e == null ? void 0 : e.metadata) == null ? void 0 : Mt.height}`,
6804
+ `${(rt = e == null ? void 0 : e.metadata) == null ? void 0 : rt.width} * ${(Dt = e == null ? void 0 : e.metadata) == null ? void 0 : Dt.height}`,
6810
6805
  "preview-option-name"
6811
6806
  );
6812
6807
  V.append(
@@ -6836,7 +6831,7 @@ class Gs {
6836
6831
  w,
6837
6832
  M,
6838
6833
  x,
6839
- ((cn = e == null ? void 0 : e.metadata) == null ? void 0 : cn.width) > 0 && ((Vt = e == null ? void 0 : e.metadata) == null ? void 0 : Vt.height) > 0 ? V : "",
6834
+ ((cn = e == null ? void 0 : e.metadata) == null ? void 0 : cn.width) > 0 && ((Mt = e == null ? void 0 : e.metadata) == null ? void 0 : Mt.height) > 0 ? V : "",
6840
6835
  Z,
6841
6836
  e.nestedFolderName ? P : ""
6842
6837
  ), L.append(
@@ -7093,7 +7088,7 @@ class Gs {
7093
7088
  }
7094
7089
  _updateFolderListContainer() {
7095
7090
  if (E(this, It))
7096
- if (E(this, mt).innerHTML = "", E(this, St)) {
7091
+ if (E(this, mt).innerHTML = "", E(this, Ot)) {
7097
7092
  const e = this._renderFolderListLoadingUI();
7098
7093
  E(this, mt).appendChild(e);
7099
7094
  } else {
@@ -7249,7 +7244,7 @@ class Gs {
7249
7244
  }
7250
7245
  }
7251
7246
  async _upload() {
7252
- return E(this, on) ? E(this, ge) : E(this, qt);
7247
+ return E(this, on) ? E(this, ge) : E(this, jt);
7253
7248
  }
7254
7249
  async _uploadFromSource(e, t) {
7255
7250
  this._removeUserToast();
@@ -7266,14 +7261,11 @@ class Gs {
7266
7261
  const l = await Ks(
7267
7262
  c.result,
7268
7263
  r,
7269
- t,
7270
- !1,
7271
- E(this, xt)
7264
+ t
7272
7265
  ), u = await ss(
7273
7266
  l,
7274
7267
  Je[Rn((d = r.type) == null ? void 0 : d.split("/")[0])],
7275
- t,
7276
- E(this, xt)
7268
+ t
7277
7269
  );
7278
7270
  o(u);
7279
7271
  } catch (l) {
@@ -7313,7 +7305,7 @@ class Gs {
7313
7305
  }
7314
7306
  async _fetchAllFolders() {
7315
7307
  var e, t;
7316
- H(this, He, !0), H(this, St, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
7308
+ H(this, He, !0), H(this, Ot, !0), this._updateSelectedImageListContainerUI(), this._updateFolderListContainer(), this._removeToastContainer();
7317
7309
  try {
7318
7310
  const r = (await ys("", 200, E(this, Oe))).response.folder, i = Us(r);
7319
7311
  H(this, kt, (e = i[0]) == null ? void 0 : e.name), this._fetchFilesFromFolder((t = i[0]) == null ? void 0 : t.name), H(this, Ge, i[0]), H(this, st, i);
@@ -7324,7 +7316,7 @@ class Gs {
7324
7316
  E(this, be)
7325
7317
  );
7326
7318
  } finally {
7327
- H(this, St, !1), this._updateFolderListContainer();
7319
+ H(this, Ot, !1), this._updateFolderListContainer();
7328
7320
  }
7329
7321
  }
7330
7322
  async _search(e) {
@@ -7428,7 +7420,7 @@ class Gs {
7428
7420
  this.updateWindowObject({ grpcConfig: r });
7429
7421
  }
7430
7422
  }
7431
- At = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), pt = new WeakMap(), ge = new WeakMap(), ke = new WeakMap(), Xe = new WeakMap(), He = new WeakMap(), St = new WeakMap(), kt = new WeakMap(), st = new WeakMap(), Ge = new WeakMap(), Ft = new WeakMap(), Wt = new WeakMap(), qn = new WeakMap(), Nt = new WeakMap(), It = new WeakMap(), mt = new WeakMap(), Rt = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), Lt = new WeakMap(), gt = new WeakMap(), jt = new WeakMap(), rn = new WeakMap(), Oe = new WeakMap(), wt = new WeakMap(), sn = new WeakMap(), Fn = new WeakMap(), on = new WeakMap(), lt = new WeakMap(), qt = new WeakMap(), Ut = new WeakMap(), xt = new WeakMap(), Zt = new WeakMap(), Kt = new WeakMap(), zt = new WeakMap(), Xt = new WeakMap(), an = new WeakMap(), ln = new WeakMap(), Gt = new WeakMap(), ct = new WeakMap(), Jt = new WeakMap();
7423
+ At = new WeakMap(), be = new WeakMap(), Ce = new WeakMap(), pt = new WeakMap(), ge = new WeakMap(), ke = new WeakMap(), Xe = new WeakMap(), He = new WeakMap(), Ot = new WeakMap(), kt = new WeakMap(), st = new WeakMap(), Ge = new WeakMap(), Ft = new WeakMap(), Pt = new WeakMap(), qn = new WeakMap(), Nt = new WeakMap(), It = new WeakMap(), mt = new WeakMap(), St = new WeakMap(), ot = new WeakMap(), at = new WeakMap(), Tt = new WeakMap(), Lt = new WeakMap(), gt = new WeakMap(), Wt = new WeakMap(), rn = new WeakMap(), Oe = new WeakMap(), wt = new WeakMap(), sn = new WeakMap(), Fn = new WeakMap(), on = new WeakMap(), lt = new WeakMap(), jt = new WeakMap(), Ut = new WeakMap(), qt = new WeakMap(), Zt = new WeakMap(), Kt = new WeakMap(), zt = new WeakMap(), Xt = new WeakMap(), an = new WeakMap(), ln = new WeakMap(), Gt = new WeakMap(), ct = new WeakMap(), Jt = new WeakMap();
7432
7424
  export {
7433
7425
  Gs as default
7434
7426
  };