entity-client 1.0.9 → 1.0.10

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.
Files changed (35) hide show
  1. package/dist/EntityAppServerApi.d.ts +16 -0
  2. package/dist/EntityServerApi.d.ts +8 -0
  3. package/dist/client/base.d.ts +1 -0
  4. package/dist/client/base.js +1 -1
  5. package/dist/client/base.js.map +2 -2
  6. package/dist/index.js +1 -1
  7. package/dist/index.js.map +2 -2
  8. package/dist/mixins/app/plugins/alimtalk.d.ts +1 -0
  9. package/dist/mixins/app/plugins/friendtalk.d.ts +1 -0
  10. package/dist/mixins/app/plugins/holidays.d.ts +1 -0
  11. package/dist/mixins/app/plugins/identity.d.ts +1 -0
  12. package/dist/mixins/app/plugins/llm.d.ts +1 -0
  13. package/dist/mixins/app/plugins/ocr.d.ts +1 -0
  14. package/dist/mixins/app/plugins/pg.d.ts +1 -0
  15. package/dist/mixins/app/plugins/push.d.ts +1 -0
  16. package/dist/mixins/app/plugins/sms.d.ts +1 -0
  17. package/dist/mixins/app/plugins/taxinvoice.d.ts +1 -0
  18. package/dist/mixins/app/routes/account.d.ts +1 -0
  19. package/dist/mixins/app/routes/board.d.ts +1 -0
  20. package/dist/mixins/app/routes/email-verify.d.ts +1 -0
  21. package/dist/mixins/app/routes/oauth.d.ts +1 -0
  22. package/dist/mixins/app/routes/password-reset.d.ts +1 -0
  23. package/dist/mixins/app/routes/two-factor.d.ts +1 -0
  24. package/dist/mixins/server/admin.d.ts +1 -0
  25. package/dist/mixins/server/auth.d.ts +1 -0
  26. package/dist/mixins/server/entity.d.ts +1 -0
  27. package/dist/mixins/server/file.d.ts +1 -0
  28. package/dist/mixins/server/push.d.ts +1 -0
  29. package/dist/mixins/server/smtp.d.ts +1 -0
  30. package/dist/mixins/server/transaction.d.ts +1 -0
  31. package/dist/mixins/server/utils.d.ts +1 -0
  32. package/dist/react.js +1 -1
  33. package/dist/react.js.map +2 -2
  34. package/dist/types.d.ts +7 -0
  35. package/package.json +1 -1
@@ -24,6 +24,7 @@ export declare function AlimtalkMixin<TBase extends GConstructor<EntityServerCli
24
24
  refreshBuffer: number;
25
25
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
26
26
  onSessionExpired?: (error: Error) => void;
27
+ onHealthChange?: (online: boolean) => void;
27
28
  _sessionRefreshToken: string | null;
28
29
  _refreshTimer: ReturnType<typeof setTimeout> | null;
29
30
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -18,6 +18,7 @@ export declare function FriendtalkMixin<TBase extends GConstructor<EntityServerC
18
18
  refreshBuffer: number;
19
19
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
20
20
  onSessionExpired?: (error: Error) => void;
21
+ onHealthChange?: (online: boolean) => void;
21
22
  _sessionRefreshToken: string | null;
22
23
  _refreshTimer: ReturnType<typeof setTimeout> | null;
23
24
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -26,6 +26,7 @@ export declare function HolidaysMixin<TBase extends GConstructor<EntityServerCli
26
26
  refreshBuffer: number;
27
27
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
28
28
  onSessionExpired?: (error: Error) => void;
29
+ onHealthChange?: (online: boolean) => void;
29
30
  _sessionRefreshToken: string | null;
30
31
  _refreshTimer: ReturnType<typeof setTimeout> | null;
31
32
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -24,6 +24,7 @@ export declare function IdentityMixin<TBase extends GConstructor<EntityServerCli
24
24
  refreshBuffer: number;
25
25
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
26
26
  onSessionExpired?: (error: Error) => void;
27
+ onHealthChange?: (online: boolean) => void;
27
28
  _sessionRefreshToken: string | null;
28
29
  _refreshTimer: ReturnType<typeof setTimeout> | null;
29
30
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -86,6 +86,7 @@ export declare function LlmMixin<TBase extends GConstructor<EntityServerClientBa
86
86
  refreshBuffer: number;
87
87
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
88
88
  onSessionExpired?: (error: Error) => void;
89
+ onHealthChange?: (online: boolean) => void;
89
90
  _sessionRefreshToken: string | null;
90
91
  _refreshTimer: ReturnType<typeof setTimeout> | null;
91
92
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -32,6 +32,7 @@ export declare function OcrMixin<TBase extends GConstructor<EntityServerClientBa
32
32
  refreshBuffer: number;
33
33
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
34
34
  onSessionExpired?: (error: Error) => void;
35
+ onHealthChange?: (online: boolean) => void;
35
36
  _sessionRefreshToken: string | null;
36
37
  _refreshTimer: ReturnType<typeof setTimeout> | null;
37
38
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -30,6 +30,7 @@ export declare function PgMixin<TBase extends GConstructor<EntityServerClientBas
30
30
  refreshBuffer: number;
31
31
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
32
32
  onSessionExpired?: (error: Error) => void;
33
+ onHealthChange?: (online: boolean) => void;
33
34
  _sessionRefreshToken: string | null;
34
35
  _refreshTimer: ReturnType<typeof setTimeout> | null;
35
36
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -26,6 +26,7 @@ export declare function AppPushMixin<TBase extends GConstructor<EntityServerClie
26
26
  refreshBuffer: number;
27
27
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
28
28
  onSessionExpired?: (error: Error) => void;
29
+ onHealthChange?: (online: boolean) => void;
29
30
  _sessionRefreshToken: string | null;
30
31
  _refreshTimer: ReturnType<typeof setTimeout> | null;
31
32
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -24,6 +24,7 @@ export declare function SmsMixin<TBase extends GConstructor<EntityServerClientBa
24
24
  refreshBuffer: number;
25
25
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
26
26
  onSessionExpired?: (error: Error) => void;
27
+ onHealthChange?: (online: boolean) => void;
27
28
  _sessionRefreshToken: string | null;
28
29
  _refreshTimer: ReturnType<typeof setTimeout> | null;
29
30
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -28,6 +28,7 @@ export declare function TaxinvoiceMixin<TBase extends GConstructor<EntityServerC
28
28
  refreshBuffer: number;
29
29
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
30
30
  onSessionExpired?: (error: Error) => void;
31
+ onHealthChange?: (online: boolean) => void;
31
32
  _sessionRefreshToken: string | null;
32
33
  _refreshTimer: ReturnType<typeof setTimeout> | null;
33
34
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -26,6 +26,7 @@ export declare function AccountAppMixin<TBase extends GConstructor<EntityServerC
26
26
  refreshBuffer: number;
27
27
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
28
28
  onSessionExpired?: (error: Error) => void;
29
+ onHealthChange?: (online: boolean) => void;
29
30
  _sessionRefreshToken: string | null;
30
31
  _refreshTimer: ReturnType<typeof setTimeout> | null;
31
32
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -49,6 +49,7 @@ export declare function BoardMixin<TBase extends GConstructor<EntityServerClient
49
49
  refreshBuffer: number;
50
50
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
51
51
  onSessionExpired?: (error: Error) => void;
52
+ onHealthChange?: (online: boolean) => void;
52
53
  _sessionRefreshToken: string | null;
53
54
  _refreshTimer: ReturnType<typeof setTimeout> | null;
54
55
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -21,6 +21,7 @@ export declare function EmailVerifyMixin<TBase extends GConstructor<EntityServer
21
21
  refreshBuffer: number;
22
22
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
23
23
  onSessionExpired?: (error: Error) => void;
24
+ onHealthChange?: (online: boolean) => void;
24
25
  _sessionRefreshToken: string | null;
25
26
  _refreshTimer: ReturnType<typeof setTimeout> | null;
26
27
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -22,6 +22,7 @@ export declare function OAuthMixin<TBase extends GConstructor<EntityServerClient
22
22
  refreshBuffer: number;
23
23
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
24
24
  onSessionExpired?: (error: Error) => void;
25
+ onHealthChange?: (online: boolean) => void;
25
26
  _sessionRefreshToken: string | null;
26
27
  _refreshTimer: ReturnType<typeof setTimeout> | null;
27
28
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -21,6 +21,7 @@ export declare function PasswordResetMixin<TBase extends GConstructor<EntityServ
21
21
  refreshBuffer: number;
22
22
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
23
23
  onSessionExpired?: (error: Error) => void;
24
+ onHealthChange?: (online: boolean) => void;
24
25
  _sessionRefreshToken: string | null;
25
26
  _refreshTimer: ReturnType<typeof setTimeout> | null;
26
27
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -23,6 +23,7 @@ export declare function TwoFactorMixin<TBase extends GConstructor<EntityServerCl
23
23
  refreshBuffer: number;
24
24
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
25
25
  onSessionExpired?: (error: Error) => void;
26
+ onHealthChange?: (online: boolean) => void;
26
27
  _sessionRefreshToken: string | null;
27
28
  _refreshTimer: ReturnType<typeof setTimeout> | null;
28
29
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -67,6 +67,7 @@ export declare function AdminMixin<TBase extends GConstructor<EntityServerClient
67
67
  refreshBuffer: number;
68
68
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
69
69
  onSessionExpired?: (error: Error) => void;
70
+ onHealthChange?: (online: boolean) => void;
70
71
  _sessionRefreshToken: string | null;
71
72
  _refreshTimer: ReturnType<typeof setTimeout> | null;
72
73
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -60,6 +60,7 @@ export declare function AuthMixin<TBase extends GConstructor<EntityServerClientB
60
60
  refreshBuffer: number;
61
61
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
62
62
  onSessionExpired?: (error: Error) => void;
63
+ onHealthChange?: (online: boolean) => void;
63
64
  _sessionRefreshToken: string | null;
64
65
  _refreshTimer: ReturnType<typeof setTimeout> | null;
65
66
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -109,6 +109,7 @@ export declare function EntityMixin<TBase extends GConstructor<EntityServerClien
109
109
  refreshBuffer: number;
110
110
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
111
111
  onSessionExpired?: (error: Error) => void;
112
+ onHealthChange?: (online: boolean) => void;
112
113
  _sessionRefreshToken: string | null;
113
114
  _refreshTimer: ReturnType<typeof setTimeout> | null;
114
115
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -65,6 +65,7 @@ export declare function FileMixin<TBase extends GConstructor<EntityServerClientB
65
65
  refreshBuffer: number;
66
66
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
67
67
  onSessionExpired?: (error: Error) => void;
68
+ onHealthChange?: (online: boolean) => void;
68
69
  _sessionRefreshToken: string | null;
69
70
  _refreshTimer: ReturnType<typeof setTimeout> | null;
70
71
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -65,6 +65,7 @@ export declare function PushMixin<TBase extends GConstructor<WithSubmit>>(Base:
65
65
  refreshBuffer: number;
66
66
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
67
67
  onSessionExpired?: (error: Error) => void;
68
+ onHealthChange?: (online: boolean) => void;
68
69
  _sessionRefreshToken: string | null;
69
70
  _refreshTimer: ReturnType<typeof setTimeout> | null;
70
71
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -29,6 +29,7 @@ export declare function SmtpMixin<TBase extends GConstructor<EntityServerClientB
29
29
  refreshBuffer: number;
30
30
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
31
31
  onSessionExpired?: (error: Error) => void;
32
+ onHealthChange?: (online: boolean) => void;
32
33
  _sessionRefreshToken: string | null;
33
34
  _refreshTimer: ReturnType<typeof setTimeout> | null;
34
35
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -22,6 +22,7 @@ export declare function TransactionMixin<TBase extends GConstructor<EntityServer
22
22
  refreshBuffer: number;
23
23
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
24
24
  onSessionExpired?: (error: Error) => void;
25
+ onHealthChange?: (online: boolean) => void;
25
26
  _sessionRefreshToken: string | null;
26
27
  _refreshTimer: ReturnType<typeof setTimeout> | null;
27
28
  _healthTickTimer: ReturnType<typeof setInterval> | null;
@@ -78,6 +78,7 @@ export declare function UtilsMixin<TBase extends GConstructor<EntityServerClient
78
78
  refreshBuffer: number;
79
79
  onTokenRefreshed?: (accessToken: string, expiresIn: number) => void;
80
80
  onSessionExpired?: (error: Error) => void;
81
+ onHealthChange?: (online: boolean) => void;
81
82
  _sessionRefreshToken: string | null;
82
83
  _refreshTimer: ReturnType<typeof setTimeout> | null;
83
84
  _healthTickTimer: ReturnType<typeof setInterval> | null;
package/dist/react.js CHANGED
@@ -1,2 +1,2 @@
1
- import{useCallback as _,useEffect as he,useMemo as Ae,useRef as Te,useState as fe}from"react";function A(r,n){let{singleton:e=!0,tokenResolver:t,baseUrl:s,token:i,resumeSession:o}=r,[a,u]=fe(!1),[T,h]=fe(null),d=Te(!0);he(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=Ae(()=>{let l=e?n.singletonInstance:new n.ClientClass({baseUrl:s,token:i});e&&l.configure({baseUrl:s,token:i});let m=t?.();return typeof m=="string"&&l.setToken(m),l},[e,t,s,i,n.ClientClass,n.singletonInstance]),O=Te(o);he(()=>{let l=O.current;l&&f.refreshToken(l).catch(()=>{})},[f]);let P=_(async l=>{d.current&&(u(!0),h(null));try{return await l()}catch(m){let y=m instanceof Error?m:new Error(String(m));throw d.current&&h(y),y}finally{d.current&&u(!1)}},[]),E=_((l,m,y)=>P(()=>f.submit(l,m,y)),[f,P]),x=_((l,m,y)=>P(()=>f.delete(l,m,y)),[f,P]),C=_((l,m)=>P(()=>f.query(l,m)),[f,P]),M=_(()=>{u(!1),h(null)},[]);return{client:f,isPending:a,error:T,reset:M,submit:E,del:x,query:C}}function ke(r){let n=import.meta;if(n?.env?.[r]!=null)return n.env[r];let e=globalThis.process;if(e?.env?.[r]!=null)return e.env[r]}function c(r){return Object.entries(r).filter(([,n])=>n!=null).map(([n,e])=>`${encodeURIComponent(n==="orderBy"?"order_by":n)}=${encodeURIComponent(String(e))}`).join("&")}import{xchacha20poly1305 as ge}from"@noble/ciphers/chacha";import{sha256 as qe}from"@noble/hashes/sha2";import{hkdf as Ue}from"@noble/hashes/hkdf";var G=32,F=2,H=14,R=24,Oe=16,Me="entity-server:hkdf:v1",Ie="entity-server:packet-encryption";function B(r){return r instanceof Uint8Array?r:new Uint8Array(r)}function ye(r,n=Ie){return Ue(qe,new TextEncoder().encode(r),new TextEncoder().encode(Me),new TextEncoder().encode(n),G)}function Pe(r,n=F,e=H){let t=B(r);return t.length<G?n:n+t[G-1]%e}function we(r,n,e=F,t=H){let s=B(r),i=B(n),o=Pe(i,e,t),a=crypto.getRandomValues(new Uint8Array(o)),u=crypto.getRandomValues(new Uint8Array(R)),h=ge(i,u).encrypt(s),d=new Uint8Array(o+R+h.length);return d.set(a,0),d.set(u,o),d.set(h,o+R),d}function ve(r,n,e=F,t=H){let s=B(r),i=B(n),o=Pe(i,e,t);if(s.length<o+R+Oe)throw new Error("Encrypted packet too short");let a=s.slice(o,o+R),u=s.slice(o+R);return ge(i,a).decrypt(u)}function $(r,n){return ye(r||n)}function be(r,n){return we(r,n)}function q(r,n){let e=ve(r,n);return JSON.parse(new TextDecoder().decode(e))}function xe(r,n,e,t){let s=n.toLowerCase().includes("application/octet-stream");if(e&&!s)throw new Error("Encrypted request required: Content-Type must be application/octet-stream");if(s){if(r==null)throw new Error("Encrypted request body is empty");if(r instanceof ArrayBuffer)return q(r,t);if(r instanceof Uint8Array){let i=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);return q(i,t)}throw new Error("Encrypted request body must be ArrayBuffer or Uint8Array")}return r==null||r===""?{}:typeof r=="string"?JSON.parse(r):r}import{sha256 as Ge}from"@noble/hashes/sha2";import{hmac as Fe}from"@noble/hashes/hmac";function Ce(r,n,e,t,s){let i=String(Math.floor(Date.now()/1e3)),o=crypto.randomUUID(),a=new TextEncoder().encode(`${r}|${n}|${i}|${o}|`),u=new Uint8Array(a.length+e.length);u.set(a,0),u.set(e,a.length);let h=[...Fe(Ge,new TextEncoder().encode(s),u)].map(d=>d.toString(16).padStart(2,"0")).join("");return{"X-API-Key":t,"X-Timestamp":i,"X-Nonce":o,"X-Signature":h}}function He(r){return r.hmacSecret||r.token||r.anonymousPacketToken}function Le(r){return r!=="GET"&&r!=="HEAD"&&r!=="OPTIONS"}function L(r){if(typeof document>"u")return"";for(let n of document.cookie.split(";")){let e=n.indexOf("=");if(!(e<0)&&n.substring(0,e).trim()===r)return decodeURIComponent(n.substring(e+1).trim())}return""}function je(r,n){return r===403&&/csrf/i.test(n)?!0:/csrf/i.test(n)&&/expired|token validation failed/i.test(n)}async function Re(r){if((r.headers.get("Content-Type")??"").includes("application/json")){let t=await r.json().catch(()=>null);if(t?.error)return t.error;if(t?.message)return t.message}return await r.text().catch(()=>"")||`HTTP ${r.status}`}async function b(r,n,e,t,s=!0,i={},o=!0){let{baseUrl:a,token:u,apiKey:T,hmacSecret:h,encryptRequests:d,anonymousPacketToken:f,csrfEnabled:O,csrfHeaderName:P,csrfCookieName:E,refreshCsrfCookie:x}=r,C=s&&!!(T&&h),M=He(r),l=O&&Le(n)&&!C,m=l?L(E):"",y="application/json",_e=!u&&!C&&!!f,w=null;if(t!=null)if(d&&!!M&&n!=="GET"&&n!=="HEAD"){let g=$(h,u||f);w=be(new TextEncoder().encode(JSON.stringify(t)),g),y="application/octet-stream"}else w=JSON.stringify(t);let Be=p=>{let g={"Content-Type":y,...i};if(!C&&s&&u&&(g.Authorization=`Bearer ${u}`),_e&&(g["X-Packet-Token"]=f),l&&p&&(g[P]=p),C){let $e=w instanceof Uint8Array?w:typeof w=="string"?new TextEncoder().encode(w):new Uint8Array(0);Object.assign(g,Ce(n,e,$e,T,h))}return g};l&&!m&&x&&(await x(),m=L(E));let de=p=>fetch(a+e,{method:n,headers:Be(p),...w!=null?{body:w}:{},credentials:"include"}),k=await de(m);if(!k.ok){let p=await Re(k.clone());if(l&&x&&je(k.status,p))await x(),m=L(E),k=await de(m);else{let g=new Error(p);throw g.status=k.status,g}}if(!k.ok){let p=new Error(await Re(k));throw p.status=k.status,p}let pe=k.headers.get("Content-Type")??"";if(pe.includes("application/octet-stream")){let p=$(h,u||f);return q(await k.arrayBuffer(),p)}if(!pe.includes("application/json"))return await k.text();let I=await k.json();if(o&&!I.ok){let p=new Error(I.message??`EntityServer error (HTTP ${k.status})`);throw p.status=k.status,p}return I}var U=class{baseUrl;token;anonymousPacketToken;apiKey;hmacSecret;encryptRequests;csrfEnabled;csrfHeaderName;csrfCookieName;_csrfRefresher=null;activeTxId=null;keepSession;refreshBuffer;onTokenRefreshed;onSessionExpired;_sessionRefreshToken=null;_refreshTimer=null;_healthTickTimer=null;_healthTickPromise=null;constructor(n={}){let e=ke("VITE_ENTITY_SERVER_URL");this.baseUrl=(n.baseUrl??e??"").replace(/\/$/,""),this.token=n.token??"",this.anonymousPacketToken=n.anonymousPacketToken??"",this.apiKey=n.apiKey??"",this.hmacSecret=n.hmacSecret??"",this.encryptRequests=n.encryptRequests??!1,this.csrfEnabled=n.csrfEnabled??!1,this.csrfHeaderName=n.csrfHeaderName??"x-csrf-token",this.csrfCookieName=n.csrfCookieName??"_csrf",this.keepSession=n.keepSession??!1,this.refreshBuffer=n.refreshBuffer??60,this.onTokenRefreshed=n.onTokenRefreshed,this.onSessionExpired=n.onSessionExpired,typeof n.healthTickInterval=="number"&&n.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(n.healthTickInterval))}configure(n){typeof n.baseUrl=="string"&&(this.baseUrl=n.baseUrl.replace(/\/$/,"")),typeof n.token=="string"&&(this.token=n.token),typeof n.anonymousPacketToken=="string"&&(this.anonymousPacketToken=n.anonymousPacketToken),typeof n.encryptRequests=="boolean"&&(this.encryptRequests=n.encryptRequests),typeof n.csrfEnabled=="boolean"&&(this.csrfEnabled=n.csrfEnabled),typeof n.csrfHeaderName=="string"&&(this.csrfHeaderName=n.csrfHeaderName),typeof n.csrfCookieName=="string"&&(this.csrfCookieName=n.csrfCookieName),typeof n.apiKey=="string"&&(this.apiKey=n.apiKey),typeof n.hmacSecret=="string"&&(this.hmacSecret=n.hmacSecret),typeof n.keepSession=="boolean"&&(this.keepSession=n.keepSession),typeof n.refreshBuffer=="number"&&(this.refreshBuffer=n.refreshBuffer),n.onTokenRefreshed&&(this.onTokenRefreshed=n.onTokenRefreshed),n.onSessionExpired&&(this.onSessionExpired=n.onSessionExpired),typeof n.healthTickInterval=="number"&&n.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(n.healthTickInterval))}setToken(n){this.token=n}setAnonymousPacketToken(n){this.anonymousPacketToken=n}setApiKey(n){this.apiKey=n}setHmacSecret(n){this.hmacSecret=n}setEncryptRequests(n){this.encryptRequests=n}setCsrfEnabled(n){this.csrfEnabled=n}startHealthTick(n=300*1e3){this.stopHealthTick();let e=()=>{this._healthTickPromise||(this._healthTickPromise=(this._csrfRefresher?this._csrfRefresher():Promise.resolve()).catch(()=>{}).finally(()=>{this._healthTickPromise=null}))};e(),this._healthTickTimer=setInterval(e,n)}stopHealthTick(){this._healthTickTimer!==null&&(clearInterval(this._healthTickTimer),this._healthTickTimer=null),this._healthTickPromise=null}_scheduleKeepSession(n,e,t){this._clearRefreshTimer(),this._sessionRefreshToken=n;let s=Math.max((e-this.refreshBuffer)*1e3,0);this._refreshTimer=setTimeout(async()=>{if(this._sessionRefreshToken)try{let i=await t(this._sessionRefreshToken);this.onTokenRefreshed?.(i.access_token,i.expires_in),this._scheduleKeepSession(this._sessionRefreshToken,i.expires_in,t)}catch(i){this._clearRefreshTimer(),this.onSessionExpired?.(i instanceof Error?i:new Error(String(i)))}},s)}_clearRefreshTimer(){this._refreshTimer!==null&&(clearTimeout(this._refreshTimer),this._refreshTimer=null)}stopKeepSession(){this._clearRefreshTimer(),this._sessionRefreshToken=null}_applyCsrfHealth(){if(!(typeof document>"u")){for(let n of document.cookie.split(";")){let e=n.indexOf("=");if(!(e<0)&&n.substring(0,e).trim()===this.csrfCookieName){this.csrfEnabled=!!n.substring(e+1).trim();return}}this.csrfEnabled=!1}}readRequestBody(n,e="application/json",t=!1){let s=$(this.hmacSecret,this.token||this.anonymousPacketToken);return xe(n,e,t,s)}get _reqOpts(){return{baseUrl:this.baseUrl,token:this.token,anonymousPacketToken:this.anonymousPacketToken,apiKey:this.apiKey,hmacSecret:this.hmacSecret,encryptRequests:this.encryptRequests,csrfEnabled:this.csrfEnabled,csrfHeaderName:this.csrfHeaderName,csrfCookieName:this.csrfCookieName,refreshCsrfCookie:this.csrfEnabled?this._csrfRefresher:null}}get http(){let n=this;return{get(e,t=!0,s){return b(n._reqOpts,"GET",e,void 0,t,s,!1)},post(e,t,s=!0,i){return b(n._reqOpts,"POST",e,t,s,i,!1)},put(e,t,s=!0,i){return b(n._reqOpts,"PUT",e,t,s,i,!1)},patch(e,t,s=!0,i){return b(n._reqOpts,"PATCH",e,t,s,i,!1)},delete(e,t,s=!0,i){return b(n._reqOpts,"DELETE",e,t,s,i,!1)}}}requestBinary(n,e,t,s=!0){return this._requestBinary(n,e,t,s)}requestForm(n,e,t,s=!0){return this._requestForm(n,e,t,s)}requestFormBinary(n,e,t,s=!0){return this._requestFormBinary(n,e,t,s)}_request(n,e,t,s=!0,i){return b(this._reqOpts,n,e,t,s,i,!0)}async _requestBinary(n,e,t,s=!0){let i={"Content-Type":"application/json"};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,...t!=null?{body:JSON.stringify(t)}:{},credentials:"include"});if(!o.ok){let a=await o.text(),u=new Error(`HTTP ${o.status}: ${a}`);throw u.status=o.status,u}return o.arrayBuffer()}async _requestForm(n,e,t,s=!0){let i={};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,body:t,credentials:"include"}),a=await o.json();if(!a.ok){let u=new Error(a.message??`EntityServer error (HTTP ${o.status})`);throw u.status=o.status,u}return a}async _requestFormBinary(n,e,t,s=!0){let i={};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,body:t,credentials:"include"});if(!o.ok){let a=await o.text(),u=new Error(`HTTP ${o.status}: ${a}`);throw u.status=o.status,u}return o.arrayBuffer()}};function j(r){return class extends r{_csrfRefresher=()=>this.checkHealth().then(()=>{});async checkHealth(){let t=await(await fetch(`${this.baseUrl}/v1/health`,{signal:AbortSignal.timeout(3e3),credentials:"include"})).json();return typeof t.packet_token=="string"&&(this.anonymousPacketToken=t.packet_token),this._applyCsrfHealth(),t}async login(e,t){let s=await this._request("POST","/v1/auth/login",{email:e,passwd:t},!1);return this.token=s.data.access_token,this.keepSession&&this._scheduleKeepSession(s.data.refresh_token,s.data.expires_in,i=>this.refreshToken(i)),s.data}async refreshToken(e){let t=await this._request("POST","/v1/auth/refresh",{refresh_token:e},!1);return this.token=t.data.access_token,this.keepSession&&this._scheduleKeepSession(e,t.data.expires_in,s=>this.refreshToken(s)),t.data}async logout(e){this.stopKeepSession();let t=await this._request("POST","/v1/auth/logout",{refresh_token:e},!1);return this.token="",t}me(){return this._request("GET","/v1/auth/me")}withdraw(e){return this._request("POST","/v1/auth/withdraw",e?{passwd:e}:{})}}}function K(r){return class extends r{async transStart(){let e=await this._request("POST","/v1/transaction/start",void 0,!1);return this.activeTxId=e.transaction_id,this.activeTxId}transRollback(e){let t=e??this.activeTxId;return t?(this.activeTxId=null,this._request("POST",`/v1/transaction/rollback/${t}`)):Promise.reject(new Error("No active transaction. Call transStart() first."))}transCommit(e){let t=e??this.activeTxId;return t?(this.activeTxId=null,this._request("POST",`/v1/transaction/commit/${t}`)):Promise.reject(new Error("No active transaction. Call transStart() first."))}meta(e){return this._request("POST",`/v1/entity/${e}/meta`,{})}validate(e,t){return this.http.post(`/v1/entity/${e}/validate`,t)}get(e,t,s={}){let i=s.skipHooks?"?skipHooks=true":"";return this._request("GET",`/v1/entity/${e}/${t}${i}`)}find(e,t,s={}){let i=s.skipHooks?"?skipHooks=true":"";return this._request("POST",`/v1/entity/${e}/find${i}`,t??{})}list(e,t={}){let{conditions:s,fields:i,orderDir:o,orderBy:a,...u}=t,T={page:1,limit:20,...u};return a&&(T.orderBy=o==="DESC"?`-${a}`:a),i?.length&&(T.fields=i.join(",")),this._request("POST",`/v1/entity/${e}/list?${c(T)}`,s??{})}count(e,t){return this._request("POST",`/v1/entity/${e}/count`,t??{})}query(e,t){return this._request("POST",`/v1/entity/${e}/query`,t)}submit(e,t,s={}){let i=s.transactionId??this.activeTxId,o=i?{"X-Transaction-ID":i}:void 0,a=s.skipHooks?"?skipHooks=true":"";return this._request("POST",`/v1/entity/${e}/submit${a}`,t,!0,o)}delete(e,t,s={}){let i=new URLSearchParams;s.hard&&i.set("hard","true"),s.skipHooks&&i.set("skipHooks","true");let o=i.size?`?${i}`:"",a=s.transactionId??this.activeTxId,u=a?{"X-Transaction-ID":a}:void 0;return this._request("POST",`/v1/entity/${e}/delete/${t}${o}`,void 0,!0,u)}history(e,t,s={}){return this._request("GET",`/v1/entity/${e}/history/${t}?${c({page:1,limit:50,...s})}`)}rollback(e,t){return this._request("POST",`/v1/entity/${e}/rollback/${t}`)}}}function D(r){return class extends r{async fileUpload(e,t,s={}){let i=new FormData;return i.append("file",t,t instanceof File?t.name:"upload"),s.refSeq!=null&&i.append("ref_seq",String(s.refSeq)),s.isPublic!=null&&i.append("is_public",s.isPublic?"true":"false"),this._requestForm("POST",`/v1/files/${e}/upload`,i)}fileDownload(e,t){return this._requestBinary("POST",`/v1/files/${e}/download/${t}`,{})}fileDelete(e,t){return this._request("POST",`/v1/files/${e}/delete/${t}`,{})}fileList(e,t={}){return this._request("POST",`/v1/files/${e}/list`,t.refSeq?{ref_seq:t.refSeq}:{})}fileMeta(e,t){return this._request("POST",`/v1/files/${e}/meta/${t}`,{})}fileToken(e){return this._request("POST",`/v1/files/token/${e}`,{})}fileViewUrl(e,t={}){let s=t.download?"?download=true":"";return`${this.baseUrl}/v1/files/${e}${s}`}fileUrl(e){return`${this.baseUrl}/v1/files/${e}`}}}function N(r){return class extends r{push(e,t,s={}){return this.submit(e,t,s)}pushLogList(e={}){return this.list("push_log",e)}registerPushDevice(e,t,s,i={}){let{platform:o,deviceType:a,browser:u,browserVersion:T,pushEnabled:h=!0,transactionId:d}=i;return this.submit("account_device",{id:t,account_seq:e,push_token:s,push_enabled:h,...o?{platform:o}:{},...a?{device_type:a}:{},...u?{browser:u}:{},...T?{browser_version:T}:{}},{transactionId:d})}updatePushDeviceToken(e,t,s={}){let{pushEnabled:i=!0,transactionId:o}=s;return this.submit("account_device",{seq:e,push_token:t,push_enabled:i},{transactionId:o})}disablePushDevice(e,t={}){return this.submit("account_device",{seq:e,push_enabled:!1},{transactionId:t.transactionId})}}}function V(r){return class extends r{smtpSend(e){return this._request("POST","/v1/smtp/send",e)}smtpStatus(e){return this._request("POST",`/v1/smtp/status/${e}`,{})}smtpTemplatePreview(e){let t=e.split("/").map(encodeURIComponent).join("/");return fetch(`${this.baseUrl}/v1/smtp/template/${t}`,{credentials:"include"}).then(s=>s.text())}}}function Q(r){return class extends r{transactionStart(e){return this._request("POST","/v1/transaction/start",e??{})}transactionCommit(e){return this._request("POST",`/v1/transaction/commit/${encodeURIComponent(e)}`,{})}transactionRollback(e){return this._request("POST",`/v1/transaction/rollback/${encodeURIComponent(e)}`,{})}}}function z(r){return class extends r{addressSido(){return this.http.get("/v1/utils/address/sido",!1)}addressSigungu(e){let t=new URLSearchParams({sido:e.sido}).toString();return this.http.get(`/v1/utils/address/sigungu?${t}`,!1)}addressDong(e){let t=new URLSearchParams({sido:e.sido,sigungu:e.sigungu}).toString();return this.http.get(`/v1/utils/address/dong?${t}`,!1)}addressClean(e){let t=new URLSearchParams({q:e.q}).toString();return this.http.get(`/v1/utils/address/clean?${t}`,!1)}qrcode(e,t={}){return this._requestBinary("POST","/v1/utils/qrcode",{content:e,...t})}qrcodeBase64(e,t={}){return this._request("POST","/v1/utils/qrcode/base64",{content:e,...t})}qrcodeText(e,t={}){return this._request("POST","/v1/utils/qrcode/text",{content:e,...t})}barcode(e,t={}){return this._requestBinary("POST","/v1/utils/barcode",{content:e,...t})}pdf2png(e,t={}){let s=new FormData;s.append("file",new Blob([e],{type:"application/pdf"}),"document.pdf");let i=new URLSearchParams;t.dpi!=null&&i.set("dpi",String(t.dpi)),t.firstPage!=null&&i.set("first_page",String(t.firstPage)),t.lastPage!=null&&i.set("last_page",String(t.lastPage));let o=i.toString(),a="/v1/utils/pdf2png"+(o?`?${o}`:"");return this._requestFormBinary("POST",a,s)}pdf2pngByFileSeq(e,t={}){return this.requestBinary("POST",`/v1/utils/pdf2png/${e}`,t)}pdf2jpg(e,t={}){let s=new FormData;s.append("file",new Blob([e],{type:"application/pdf"}),"document.pdf");let i=new URLSearchParams;t.dpi!=null&&i.set("dpi",String(t.dpi)),t.firstPage!=null&&i.set("first_page",String(t.firstPage)),t.lastPage!=null&&i.set("last_page",String(t.lastPage));let o=i.toString(),a="/v1/utils/pdf2jpg"+(o?`?${o}`:"");return this._requestFormBinary("POST",a,s)}pdf2jpgByFileSeq(e,t={}){return this.requestBinary("POST",`/v1/utils/pdf2jpg/${e}`,t)}}}function X(r){return class extends r{_adminPath(e){return`/v1/admin${e}`}_adminGet(e){return this.http.get(this._adminPath(e))}_adminPost(e,t){return this.http.post(this._adminPath(e),t)}_adminPut(e,t){return this.http.put(this._adminPath(e),t)}_adminPatch(e,t){return this.http.patch(this._adminPath(e),t)}_adminDelete(e,t){return this.http.delete(this._adminPath(e),t)}listAdminEntities(){return this._adminGet("/entities")}getAdminErdSchema(){return this._adminGet("/erd/schema")}batchEnsureAdminEntities(e){return this._adminPost("/entities/batch-ensure",e)}createAdminEntityConfig(e,t){return this._adminPost(`/${e}/create`,t)}getAdminEntityConfig(e){return this._adminGet(`/${e}/config`)}updateAdminEntityConfig(e,t){return this._adminPut(`/${e}/config`,t)}validateAdminEntityConfig(e,t){return this._adminPost(t?`/${t}/validate`:"/entity/validate",e)}normalizeAdminEntityConfig(e,t){return this._adminPost(t?`/${t}/normalize`:"/entity/normalize",e)}getAdminEntityStats(e,t){return this._adminPost(`/${e}/stats`,t)}reindexAdminEntity(e){return this._adminPost(`/${e}/reindex`)}syncAdminEntitySchema(e){return this._adminPost(`/${e}/sync-schema`)}resetAdminEntity(e){return this._adminPost(`/${e}/reset`)}truncateAdminEntity(e){return this._adminPost(`/${e}/truncate`)}dropAdminEntity(e){return this._adminPost(`/${e}/drop`)}resetAllAdmin(e){return this._adminPost("/reset-all",e)}listAdminConfigs(){return this._adminGet("/configs")}getAdminConfig(e){return this._adminGet(`/configs/${e}`)}updateAdminConfig(e,t){return this._adminPatch(`/configs/${e}`,t)}listAdminRoles(){return this._adminGet("/roles")}createAdminRole(e){return this._adminPost("/roles",e)}getAdminRole(e){return this._adminGet(`/roles/${e}`)}updateAdminRole(e,t){return this._adminPatch(`/roles/${e}`,t)}deleteAdminRole(e){return this._adminDelete(`/roles/${e}`)}listAdminApiKeys(){return this._adminGet("/api-keys")}createAdminApiKey(e){return this._adminPost("/api-keys",e)}getAdminApiKey(e){return this._adminGet(`/api-keys/${e}`)}updateAdminApiKey(e,t){return this._adminPatch(`/api-keys/${e}`,t)}deleteAdminApiKey(e){return this._adminDelete(`/api-keys/${e}`)}regenerateAdminApiKeySecret(e){return this._adminPost(`/api-keys/${e}/regenerate-secret`)}listAdminAccounts(){return this._adminGet("/accounts")}createAdminAccount(e){return this._adminPost("/accounts",e)}getAdminAccount(e){return this._adminGet(`/accounts/${e}`)}updateAdminAccount(e,t){return this._adminPatch(`/accounts/${e}`,t)}deleteAdminAccount(e){return this._adminDelete(`/accounts/${e}`)}listAdminLicenses(){return this._adminGet("/licenses")}createAdminLicense(e){return this._adminPost("/licenses",e)}getAdminLicense(e){return this._adminGet(`/licenses/${e}`)}updateAdminLicense(e,t){return this._adminPatch(`/licenses/${e}`,t)}deleteAdminLicense(e){return this._adminDelete(`/licenses/${e}`)}runAdminBackup(e){return this._adminPost("/backup/run",e)}getAdminBackupStatus(e){return this._adminPost("/backup/status",e)}listAdminBackups(e){return this._adminPost("/backup/list",e)}restoreAdminBackup(e){return this._adminPost("/backup/restore",e)}deleteAdminBackup(e){return this._adminPost("/backup/delete",e)}disableAdminAccountTwoFactor(e){return this._adminDelete(`/accounts/${e}/2fa`)}}}var v=class extends z(Q(D(V(N(X(K(j(U)))))))){};function J(r){return class extends r{accountRegister(e){return this.http.post("/v1/account/register",e,!1)}accountWithdraw(e){return this.http.post("/v1/account/withdraw",e)}accountChangePassword(e){return this.http.post("/v1/account/change-password",e)}accountReactivate(e){return this.http.post("/v1/account/reactivate",e,!1)}listAccountBiometrics(){return this.http.get("/v1/account/biometric")}registerAccountBiometric(e){return this.http.post("/v1/account/biometric",e)}deleteAccountBiometric(e){return this.http.delete(`/v1/account/biometric/${e}`)}}}function W(r){return class extends r{listBoardCategories(e={}){let t=c(e);return this.http.get(`/v1/board/categories${t?`?${t}`:""}`,!1)}getBoardCategory(e){return this.http.get(`/v1/board/categories/${e}`,!1)}createBoardCategory(e){return this.http.post("/v1/board/categories",e)}updateBoardCategory(e,t){return this.http.put(`/v1/board/categories/${e}`,t)}deleteBoardCategory(e){return this.http.delete(`/v1/board/categories/${e}`)}listBoardPosts(e,t={}){let s=c(t);return this.http.get(`/v1/board/${e}/list${s?`?${s}`:""}`,!1)}getBoardPost(e){return this.http.get(`/v1/board/posts/${e}`,!1)}createBoardPost(e,t){return this.http.post(`/v1/board/${e}/submit`,t)}updateBoardPost(e,t){return this.http.put(`/v1/board/posts/${e}`,t)}deleteBoardPost(e){return this.http.delete(`/v1/board/posts/${e}`)}listBoardComments(e,t={}){let s=c(t);return this.http.get(`/v1/board/posts/${e}/comments${s?`?${s}`:""}`,!1)}createBoardComment(e,t){return this.http.post(`/v1/board/posts/${e}/comments/submit`,t)}updateBoardComment(e,t){return this.http.put(`/v1/board/comments/${e}`,t)}deleteBoardComment(e){return this.http.delete(`/v1/board/comments/${e}`)}listBoardFiles(e){return this.http.get(`/v1/board/posts/${e}/files`,!1)}async uploadBoardFile(e,t){let s=new FormData;return s.append("file",t,t instanceof File?t.name:"upload"),this.requestForm("POST",`/v1/board/posts/${e}/files`,s)}boardFileUrl(e){return`${this.baseUrl}/v1/board/files/${e}`}deleteBoardFile(e){return this.http.delete(`/v1/board/files/${e}`)}createBoardGuestPost(e,t){return this.http.post(`/v1/board/${e}/guest-submit`,t,!1)}authenticateBoardGuestPost(e,t){return this.http.post(`/v1/board/posts/${e}/guest-auth`,t,!1)}toggleBoardPostLike(e){return this.http.post(`/v1/board/posts/${e}/like`,{})}acceptBoardPost(e){return this.http.post(`/v1/board/posts/${e}/accept`,{})}rateBoardPost(e,t){return this.http.post(`/v1/board/posts/${e}/rating`,t)}rateBoardComment(e,t){return this.http.post(`/v1/board/comments/${e}/rating`,t)}listBoardTags(e={}){let t=c(e);return this.http.get(`/v1/board/tags${t?`?${t}`:""}`,!1)}setBoardPostTags(e,t){return this.http.put(`/v1/board/posts/${e}/tags`,t)}reportBoardPost(e,t){return this.http.post(`/v1/board/posts/${e}/report`,t)}reportBoardComment(e,t){return this.http.post(`/v1/board/comments/${e}/report`,t)}listBoardReports(e={}){let t=c(e);return this.http.get(`/v1/board/admin/reports${t?`?${t}`:""}`)}updateBoardReport(e,t){return this.http.patch(`/v1/board/admin/reports/${e}`,t)}markBoardPostRead(e){return this.http.post(`/v1/board/posts/${e}/read`,{})}listBoardMentions(e={}){let t=c(e);return this.http.get(`/v1/board/mentions${t?`?${t}`:""}`)}markBoardMentionRead(e){return this.http.patch(`/v1/board/mentions/${e}/read`,{})}}}function Y(r){return class extends r{sendEmailVerification(e){return this.http.post("/v1/email-verify/send",e,!1)}confirmEmailVerification(e){return this.http.post("/v1/email-verify/confirm",e,!1)}activateEmailVerification(e){let t=c(e);return this.http.get(`/v1/email-verify/activate${t?`?${t}`:""}`,!1)}getEmailVerificationStatus(){return this.http.get("/v1/email-verify/status")}changeVerifiedEmail(e){return this.http.post("/v1/email-verify/change",e)}}}function Z(r){return class extends r{oauthAuthorizeUrl(e,t={}){let s=c(t);return`${this.baseUrl}/v1/oauth/${e}${s?`?${s}`:""}`}oauthCallback(e,t,s="POST"){if(s==="GET"){let i=c(t??{});return this.http.get(`/v1/oauth/${e}/callback${i?`?${i}`:""}`,!1)}return this.http.post(`/v1/oauth/${e}/callback`,t,!1)}linkOAuthAccount(e){return this.http.post("/v1/account/oauth/link",e)}unlinkOAuthAccount(e){return this.http.delete(`/v1/account/oauth/link/${e}`)}listOAuthProviders(){return this.http.get("/v1/account/oauth/providers")}refreshOAuthProviderToken(e,t){return this.http.post(`/v1/account/oauth/refresh/${e}`,t)}}}function ee(r){return class extends r{requestPasswordReset(e){return this.http.post("/v1/password-reset/request",e,!1)}validatePasswordResetToken(e){return this.http.get(`/v1/password-reset/validate/${encodeURIComponent(e)}`,!1)}verifyPasswordReset(e){return this.http.post("/v1/password-reset/verify",e,!1)}}}function te(r){return class extends r{setupTwoFactor(e){return this.http.post("/v1/account/2fa/setup",e)}verifyTwoFactorSetup(e){return this.http.post("/v1/account/2fa/setup/verify",e,!1)}disableTwoFactor(){return this.http.delete("/v1/account/2fa")}getTwoFactorStatus(){return this.http.get("/v1/account/2fa/status")}regenerateTwoFactorRecoveryCodes(){return this.http.post("/v1/account/2fa/recovery/regenerate")}verifyTwoFactor(e){return this.http.post("/v1/account/2fa/verify",e,!1)}recoverTwoFactorAccess(e){return this.http.post("/v1/account/2fa/recovery",e,!1)}}}function ne(r){return class extends r{alimtalkSend(e){return this.http.post("/v1/alimtalk/send",e)}alimtalkStatus(e){return this.http.get(`/v1/alimtalk/status/${e}`,!1)}listAlimtalkTemplates(){return this.http.get("/v1/alimtalk/templates",!1)}alimtalkWebhook(e,t){return this.http.post(`/v1/alimtalk/webhook/${encodeURIComponent(e)}`,t,!1)}}}function re(r){return class extends r{friendtalkSend(e){return this.http.post("/v1/friendtalk/send",e)}}}function se(r){return class extends r{listHolidays(e={}){let t=c(e);return this.http.get(`/v1/holidays${t?`?${t}`:""}`,!1)}getHolidayByDate(e){return this.http.get(`/v1/holidays/${encodeURIComponent(e)}`,!1)}syncHolidays(e){return this.http.post("/v1/holidays/sync",e)}}}function ie(r){return class extends r{identityRequest(e){return this.http.post("/v1/identity/request",e,!1)}identityCallback(e){return this.http.post("/v1/identity/callback",e,!1)}identityResult(e){return this.http.get(`/v1/identity/result/${encodeURIComponent(e)}`,!1)}identityVerifyCI(e){return this.http.post("/v1/identity/verify-ci",e)}}}function oe(r){return class extends r{llmChat(e){return this.http.post("/v1/llm/chat",e)}llmChatStream(e){return this.http.post("/v1/llm/chat/stream",e)}createLlmConversation(e){return this.http.post("/v1/llm/conversations",e)}sendLlmMessage(e,t){return this.http.post(`/v1/llm/conversations/${e}/messages`,t)}listLlmConversations(e={}){let t=c(e);return this.http.get(`/v1/llm/conversations${t?`?${t}`:""}`)}getLlmConversation(e){return this.http.get(`/v1/llm/conversations/${e}`)}updateLlmConversation(e,t){return this.http.patch(`/v1/llm/conversations/${e}`,t)}deleteLlmConversation(e){return this.http.delete(`/v1/llm/conversations/${e}`)}ragUploadDocument(e){return this.requestForm("POST","/v1/llm/rag/documents",e)}ragListDocuments(e={}){let t=c(e);return this.http.get(`/v1/llm/rag/documents${t?`?${t}`:""}`)}ragDeleteDocument(e){return this.http.delete(`/v1/llm/rag/documents/${encodeURIComponent(e)}`)}ragSearch(e){return this.http.post("/v1/llm/rag/search",e)}ragChat(e){return this.http.post("/v1/llm/rag/chat",e)}ragChatStream(e){return this.http.post("/v1/llm/rag/chat/stream",e)}ragRebuildIndex(e){return this.http.post("/v1/llm/rag/rebuild-index",e)}listLlmProviders(){return this.http.get("/v1/llm/providers")}getLlmUsage(e={}){let t=c(e);return this.http.get(`/v1/llm/usage${t?`?${t}`:""}`)}getLlmUsageSummary(e={}){let t=c(e);return this.http.get(`/v1/llm/usage/summary${t?`?${t}`:""}`)}getLlmCacheStats(){return this.http.get("/v1/llm/cache/stats")}clearLlmCache(){return this.http.delete("/v1/llm/cache")}listLlmTemplates(){return this.http.get("/v1/llm/templates")}llmTemplateChat(e,t){return this.http.post(`/v1/llm/${encodeURIComponent(e)}/chat`,t)}llmTemplateChatStream(e,t){return this.http.post(`/v1/llm/${encodeURIComponent(e)}/chat/stream`,t)}listLlmChatbots(e={}){let t=c(e);return this.http.get(`/v1/llm/chatbots${t?`?${t}`:""}`)}createLlmChatbot(e){return this.http.post("/v1/llm/chatbots",e)}getLlmChatbot(e){return this.http.get(`/v1/llm/chatbots/${e}`)}updateLlmChatbot(e,t){return this.http.patch(`/v1/llm/chatbots/${e}`,t)}deleteLlmChatbot(e){return this.http.delete(`/v1/llm/chatbots/${e}`)}llmChatbotChat(e,t){return this.http.post(`/v1/llm/chatbots/${e}/chat`,t)}llmChatbotChatStream(e,t){return this.http.post(`/v1/llm/chatbots/${e}/chat/stream`,t)}listLlmChatbotSessions(e,t={}){let s=c(t);return this.http.get(`/v1/llm/chatbots/${e}/sessions${s?`?${s}`:""}`)}deleteLlmChatbotSession(e,t){return this.http.delete(`/v1/llm/chatbots/${e}/sessions/${t}`)}listLlmProfiles(e={}){let t=c(e);return this.http.get(`/v1/llm/profiles${t?`?${t}`:""}`)}upsertLlmProfile(e){return this.http.post("/v1/llm/profiles",e)}deleteLlmProfile(e){return this.http.delete(`/v1/llm/profiles/${e}`)}}}function ae(r){return class extends r{ocrRecognize(e){return this.requestForm("POST","/v1/ocr/recognize",e)}ocrRecognizeAsync(e){return this.requestForm("POST","/v1/ocr/recognize/async",e)}ocrRecognizeByDocType(e,t){return this.requestForm("POST",`/v1/ocr/${encodeURIComponent(e)}`,t)}listOcrResults(e={}){let t=c(e);return this.http.get(`/v1/ocr/results${t?`?${t}`:""}`)}getOcrResult(e){return this.http.get(`/v1/ocr/results/${encodeURIComponent(e)}`)}getOcrResultText(e){return this.http.get(`/v1/ocr/results/${encodeURIComponent(e)}/text`)}deleteOcrResult(e){return this.http.delete(`/v1/ocr/results/${encodeURIComponent(e)}`)}getOcrQuota(){return this.http.get("/v1/ocr/quota")}}}function ue(r){return class extends r{pgCreateOrder(e){return this.http.post("/v1/pg/orders",e)}pgGetOrder(e){return this.http.get(`/v1/pg/orders/${encodeURIComponent(e)}`)}pgConfirmPayment(e){return this.http.post("/v1/pg/confirm",e)}pgCancelPayment(e,t){return this.http.post(`/v1/pg/orders/${encodeURIComponent(e)}/cancel`,t)}pgSyncPaymentStatus(e,t){return this.http.post(`/v1/pg/orders/${encodeURIComponent(e)}/sync`,t)}pgWebhook(e){return this.http.post("/v1/pg/webhook",e,!1)}pgGetClientConfig(){return this.http.get("/v1/pg/config",!1)}}}function ce(r){return class extends r{appPushSend(e){return this.http.post("/v1/push/send",e)}appPushBroadcast(e){return this.http.post("/v1/push/broadcast",e)}appPushStatus(e){return this.http.get(`/v1/push/status/${e}`)}appPushRegisterDevice(e){return this.http.post("/v1/push/device",e)}appPushUnregisterDevice(e){return this.http.delete(`/v1/push/device/${e}`)}}}function le(r){return class extends r{smsSend(e){return this.http.post("/v1/sms/send",e)}smsStatus(e){return this.http.get(`/v1/sms/status/${e}`,!1)}smsVerificationSend(e){return this.http.post("/v1/sms/verification/send",e,!1)}smsVerificationVerify(e){return this.http.post("/v1/sms/verification/verify",e,!1)}}}function me(r){return class extends r{taxinvoiceRegistIssue(e){return this.http.post("/v1/taxinvoice",e)}taxinvoiceRegister(e){return this.http.post("/v1/taxinvoice/register",e)}taxinvoiceIssue(e){return this.http.post(`/v1/taxinvoice/${e}/issue`,{})}taxinvoiceCancelIssue(e,t){return this.http.post(`/v1/taxinvoice/${e}/cancel`,t)}taxinvoiceGetState(e){return this.http.get(`/v1/taxinvoice/${e}/state`)}taxinvoiceGetDetail(e){return this.http.get(`/v1/taxinvoice/${e}`)}}}var S=class extends ne(re(le(ce(ue(me(ae(oe(ie(se(Z(te(ee(Y(W(J(v)))))))))))))))){};var Se=new v,Ee=new S;function tr(r={}){return A(r,{singletonInstance:Se,ClientClass:v})}function ir(r={}){return A(r,{singletonInstance:Ee,ClientClass:S})}export{ir as useEntityAppServer,A as useEntityClient,tr as useEntityServer};
1
+ import{useCallback as _,useEffect as he,useMemo as Ae,useRef as Te,useState as fe}from"react";function A(r,n){let{singleton:e=!0,tokenResolver:t,baseUrl:s,token:i,resumeSession:o}=r,[a,u]=fe(!1),[T,h]=fe(null),d=Te(!0);he(()=>(d.current=!0,()=>{d.current=!1}),[]);let f=Ae(()=>{let l=e?n.singletonInstance:new n.ClientClass({baseUrl:s,token:i});e&&l.configure({baseUrl:s,token:i});let m=t?.();return typeof m=="string"&&l.setToken(m),l},[e,t,s,i,n.ClientClass,n.singletonInstance]),O=Te(o);he(()=>{let l=O.current;l&&f.refreshToken(l).catch(()=>{})},[f]);let P=_(async l=>{d.current&&(u(!0),h(null));try{return await l()}catch(m){let y=m instanceof Error?m:new Error(String(m));throw d.current&&h(y),y}finally{d.current&&u(!1)}},[]),E=_((l,m,y)=>P(()=>f.submit(l,m,y)),[f,P]),x=_((l,m,y)=>P(()=>f.delete(l,m,y)),[f,P]),C=_((l,m)=>P(()=>f.query(l,m)),[f,P]),M=_(()=>{u(!1),h(null)},[]);return{client:f,isPending:a,error:T,reset:M,submit:E,del:x,query:C}}function ke(r){let n=import.meta;if(n?.env?.[r]!=null)return n.env[r];let e=globalThis.process;if(e?.env?.[r]!=null)return e.env[r]}function c(r){return Object.entries(r).filter(([,n])=>n!=null).map(([n,e])=>`${encodeURIComponent(n==="orderBy"?"order_by":n)}=${encodeURIComponent(String(e))}`).join("&")}import{xchacha20poly1305 as ge}from"@noble/ciphers/chacha";import{sha256 as qe}from"@noble/hashes/sha2";import{hkdf as Ue}from"@noble/hashes/hkdf";var G=32,H=2,F=14,R=24,Oe=16,Me="entity-server:hkdf:v1",Ie="entity-server:packet-encryption";function B(r){return r instanceof Uint8Array?r:new Uint8Array(r)}function ye(r,n=Ie){return Ue(qe,new TextEncoder().encode(r),new TextEncoder().encode(Me),new TextEncoder().encode(n),G)}function Pe(r,n=H,e=F){let t=B(r);return t.length<G?n:n+t[G-1]%e}function we(r,n,e=H,t=F){let s=B(r),i=B(n),o=Pe(i,e,t),a=crypto.getRandomValues(new Uint8Array(o)),u=crypto.getRandomValues(new Uint8Array(R)),h=ge(i,u).encrypt(s),d=new Uint8Array(o+R+h.length);return d.set(a,0),d.set(u,o),d.set(h,o+R),d}function ve(r,n,e=H,t=F){let s=B(r),i=B(n),o=Pe(i,e,t);if(s.length<o+R+Oe)throw new Error("Encrypted packet too short");let a=s.slice(o,o+R),u=s.slice(o+R);return ge(i,a).decrypt(u)}function $(r,n){return ye(r||n)}function be(r,n){return we(r,n)}function q(r,n){let e=ve(r,n);return JSON.parse(new TextDecoder().decode(e))}function xe(r,n,e,t){let s=n.toLowerCase().includes("application/octet-stream");if(e&&!s)throw new Error("Encrypted request required: Content-Type must be application/octet-stream");if(s){if(r==null)throw new Error("Encrypted request body is empty");if(r instanceof ArrayBuffer)return q(r,t);if(r instanceof Uint8Array){let i=r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength);return q(i,t)}throw new Error("Encrypted request body must be ArrayBuffer or Uint8Array")}return r==null||r===""?{}:typeof r=="string"?JSON.parse(r):r}import{sha256 as Ge}from"@noble/hashes/sha2";import{hmac as He}from"@noble/hashes/hmac";function Ce(r,n,e,t,s){let i=String(Math.floor(Date.now()/1e3)),o=crypto.randomUUID(),a=new TextEncoder().encode(`${r}|${n}|${i}|${o}|`),u=new Uint8Array(a.length+e.length);u.set(a,0),u.set(e,a.length);let h=[...He(Ge,new TextEncoder().encode(s),u)].map(d=>d.toString(16).padStart(2,"0")).join("");return{"X-API-Key":t,"X-Timestamp":i,"X-Nonce":o,"X-Signature":h}}function Fe(r){return r.hmacSecret||r.token||r.anonymousPacketToken}function Le(r){return r!=="GET"&&r!=="HEAD"&&r!=="OPTIONS"}function L(r){if(typeof document>"u")return"";for(let n of document.cookie.split(";")){let e=n.indexOf("=");if(!(e<0)&&n.substring(0,e).trim()===r)return decodeURIComponent(n.substring(e+1).trim())}return""}function je(r,n){return r===403&&/csrf/i.test(n)?!0:/csrf/i.test(n)&&/expired|token validation failed/i.test(n)}async function Re(r){if((r.headers.get("Content-Type")??"").includes("application/json")){let t=await r.json().catch(()=>null);if(t?.error)return t.error;if(t?.message)return t.message}return await r.text().catch(()=>"")||`HTTP ${r.status}`}async function b(r,n,e,t,s=!0,i={},o=!0){let{baseUrl:a,token:u,apiKey:T,hmacSecret:h,encryptRequests:d,anonymousPacketToken:f,csrfEnabled:O,csrfHeaderName:P,csrfCookieName:E,refreshCsrfCookie:x}=r,C=s&&!!(T&&h),M=Fe(r),l=O&&Le(n)&&!C,m=l?L(E):"",y="application/json",_e=!u&&!C&&!!f,w=null;if(t!=null)if(d&&!!M&&n!=="GET"&&n!=="HEAD"){let g=$(h,u||f);w=be(new TextEncoder().encode(JSON.stringify(t)),g),y="application/octet-stream"}else w=JSON.stringify(t);let Be=p=>{let g={"Content-Type":y,...i};if(!C&&s&&u&&(g.Authorization=`Bearer ${u}`),_e&&(g["X-Packet-Token"]=f),l&&p&&(g[P]=p),C){let $e=w instanceof Uint8Array?w:typeof w=="string"?new TextEncoder().encode(w):new Uint8Array(0);Object.assign(g,Ce(n,e,$e,T,h))}return g};l&&!m&&x&&(await x(),m=L(E));let de=p=>fetch(a+e,{method:n,headers:Be(p),...w!=null?{body:w}:{},credentials:"include"}),k=await de(m);if(!k.ok){let p=await Re(k.clone());if(l&&x&&je(k.status,p))await x(),m=L(E),k=await de(m);else{let g=new Error(p);throw g.status=k.status,g}}if(!k.ok){let p=new Error(await Re(k));throw p.status=k.status,p}let pe=k.headers.get("Content-Type")??"";if(pe.includes("application/octet-stream")){let p=$(h,u||f);return q(await k.arrayBuffer(),p)}if(!pe.includes("application/json"))return await k.text();let I=await k.json();if(o&&!I.ok){let p=new Error(I.message??`EntityServer error (HTTP ${k.status})`);throw p.status=k.status,p}return I}var U=class{baseUrl;token;anonymousPacketToken;apiKey;hmacSecret;encryptRequests;csrfEnabled;csrfHeaderName;csrfCookieName;_csrfRefresher=null;activeTxId=null;keepSession;refreshBuffer;onTokenRefreshed;onSessionExpired;onHealthChange;_sessionRefreshToken=null;_refreshTimer=null;_healthTickTimer=null;_healthTickPromise=null;constructor(n={}){let e=ke("VITE_ENTITY_SERVER_URL");this.baseUrl=(n.baseUrl??e??"").replace(/\/$/,""),this.token=n.token??"",this.anonymousPacketToken=n.anonymousPacketToken??"",this.apiKey=n.apiKey??"",this.hmacSecret=n.hmacSecret??"",this.encryptRequests=n.encryptRequests??!1,this.csrfEnabled=n.csrfEnabled??!1,this.csrfHeaderName=n.csrfHeaderName??"x-csrf-token",this.csrfCookieName=n.csrfCookieName??"_csrf",this.keepSession=n.keepSession??!1,this.refreshBuffer=n.refreshBuffer??60,this.onTokenRefreshed=n.onTokenRefreshed,this.onSessionExpired=n.onSessionExpired,this.onHealthChange=n.onHealthChange,typeof n.healthTickInterval=="number"&&n.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(n.healthTickInterval))}configure(n){typeof n.baseUrl=="string"&&(this.baseUrl=n.baseUrl.replace(/\/$/,"")),typeof n.token=="string"&&(this.token=n.token),typeof n.anonymousPacketToken=="string"&&(this.anonymousPacketToken=n.anonymousPacketToken),typeof n.encryptRequests=="boolean"&&(this.encryptRequests=n.encryptRequests),typeof n.csrfEnabled=="boolean"&&(this.csrfEnabled=n.csrfEnabled),typeof n.csrfHeaderName=="string"&&(this.csrfHeaderName=n.csrfHeaderName),typeof n.csrfCookieName=="string"&&(this.csrfCookieName=n.csrfCookieName),typeof n.apiKey=="string"&&(this.apiKey=n.apiKey),typeof n.hmacSecret=="string"&&(this.hmacSecret=n.hmacSecret),typeof n.keepSession=="boolean"&&(this.keepSession=n.keepSession),typeof n.refreshBuffer=="number"&&(this.refreshBuffer=n.refreshBuffer),n.onTokenRefreshed&&(this.onTokenRefreshed=n.onTokenRefreshed),n.onSessionExpired&&(this.onSessionExpired=n.onSessionExpired),n.onHealthChange&&(this.onHealthChange=n.onHealthChange),typeof n.healthTickInterval=="number"&&n.healthTickInterval>0&&Promise.resolve().then(()=>this.startHealthTick(n.healthTickInterval))}setToken(n){this.token=n}setAnonymousPacketToken(n){this.anonymousPacketToken=n}setApiKey(n){this.apiKey=n}setHmacSecret(n){this.hmacSecret=n}setEncryptRequests(n){this.encryptRequests=n}setCsrfEnabled(n){this.csrfEnabled=n}startHealthTick(n=300*1e3){this.stopHealthTick();let e=()=>{this._healthTickPromise||(this._healthTickPromise=(this._csrfRefresher?this._csrfRefresher():Promise.resolve()).then(()=>{this.onHealthChange?.(!0)}).catch(()=>{this.onHealthChange?.(!1)}).finally(()=>{this._healthTickPromise=null}))};e(),this._healthTickTimer=setInterval(e,n)}stopHealthTick(){this._healthTickTimer!==null&&(clearInterval(this._healthTickTimer),this._healthTickTimer=null),this._healthTickPromise=null}_scheduleKeepSession(n,e,t){this._clearRefreshTimer(),this._sessionRefreshToken=n;let s=Math.max((e-this.refreshBuffer)*1e3,0);this._refreshTimer=setTimeout(async()=>{if(this._sessionRefreshToken)try{let i=await t(this._sessionRefreshToken);this.onTokenRefreshed?.(i.access_token,i.expires_in),this._scheduleKeepSession(this._sessionRefreshToken,i.expires_in,t)}catch(i){this._clearRefreshTimer(),this.onSessionExpired?.(i instanceof Error?i:new Error(String(i)))}},s)}_clearRefreshTimer(){this._refreshTimer!==null&&(clearTimeout(this._refreshTimer),this._refreshTimer=null)}stopKeepSession(){this._clearRefreshTimer(),this._sessionRefreshToken=null}_applyCsrfHealth(){if(!(typeof document>"u")){for(let n of document.cookie.split(";")){let e=n.indexOf("=");if(!(e<0)&&n.substring(0,e).trim()===this.csrfCookieName){this.csrfEnabled=!!n.substring(e+1).trim();return}}this.csrfEnabled=!1}}readRequestBody(n,e="application/json",t=!1){let s=$(this.hmacSecret,this.token||this.anonymousPacketToken);return xe(n,e,t,s)}get _reqOpts(){return{baseUrl:this.baseUrl,token:this.token,anonymousPacketToken:this.anonymousPacketToken,apiKey:this.apiKey,hmacSecret:this.hmacSecret,encryptRequests:this.encryptRequests,csrfEnabled:this.csrfEnabled,csrfHeaderName:this.csrfHeaderName,csrfCookieName:this.csrfCookieName,refreshCsrfCookie:this.csrfEnabled?this._csrfRefresher:null}}get http(){let n=this;return{get(e,t=!0,s){return b(n._reqOpts,"GET",e,void 0,t,s,!1)},post(e,t,s=!0,i){return b(n._reqOpts,"POST",e,t,s,i,!1)},put(e,t,s=!0,i){return b(n._reqOpts,"PUT",e,t,s,i,!1)},patch(e,t,s=!0,i){return b(n._reqOpts,"PATCH",e,t,s,i,!1)},delete(e,t,s=!0,i){return b(n._reqOpts,"DELETE",e,t,s,i,!1)}}}requestBinary(n,e,t,s=!0){return this._requestBinary(n,e,t,s)}requestForm(n,e,t,s=!0){return this._requestForm(n,e,t,s)}requestFormBinary(n,e,t,s=!0){return this._requestFormBinary(n,e,t,s)}_request(n,e,t,s=!0,i){return b(this._reqOpts,n,e,t,s,i,!0)}async _requestBinary(n,e,t,s=!0){let i={"Content-Type":"application/json"};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,...t!=null?{body:JSON.stringify(t)}:{},credentials:"include"});if(!o.ok){let a=await o.text(),u=new Error(`HTTP ${o.status}: ${a}`);throw u.status=o.status,u}return o.arrayBuffer()}async _requestForm(n,e,t,s=!0){let i={};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,body:t,credentials:"include"}),a=await o.json();if(!a.ok){let u=new Error(a.message??`EntityServer error (HTTP ${o.status})`);throw u.status=o.status,u}return a}async _requestFormBinary(n,e,t,s=!0){let i={};s&&this.token&&(i.Authorization=`Bearer ${this.token}`),this.apiKey&&(i["X-API-Key"]=this.apiKey);let o=await fetch(this.baseUrl+e,{method:n,headers:i,body:t,credentials:"include"});if(!o.ok){let a=await o.text(),u=new Error(`HTTP ${o.status}: ${a}`);throw u.status=o.status,u}return o.arrayBuffer()}};function j(r){return class extends r{_csrfRefresher=()=>this.checkHealth().then(()=>{});async checkHealth(){let t=await(await fetch(`${this.baseUrl}/v1/health`,{signal:AbortSignal.timeout(3e3),credentials:"include"})).json();return typeof t.packet_token=="string"&&(this.anonymousPacketToken=t.packet_token),this._applyCsrfHealth(),t}async login(e,t){let s=await this._request("POST","/v1/auth/login",{email:e,passwd:t},!1);return this.token=s.data.access_token,this.keepSession&&this._scheduleKeepSession(s.data.refresh_token,s.data.expires_in,i=>this.refreshToken(i)),s.data}async refreshToken(e){let t=await this._request("POST","/v1/auth/refresh",{refresh_token:e},!1);return this.token=t.data.access_token,this.keepSession&&this._scheduleKeepSession(e,t.data.expires_in,s=>this.refreshToken(s)),t.data}async logout(e){this.stopKeepSession();let t=await this._request("POST","/v1/auth/logout",{refresh_token:e},!1);return this.token="",t}me(){return this._request("GET","/v1/auth/me")}withdraw(e){return this._request("POST","/v1/auth/withdraw",e?{passwd:e}:{})}}}function K(r){return class extends r{async transStart(){let e=await this._request("POST","/v1/transaction/start",void 0,!1);return this.activeTxId=e.transaction_id,this.activeTxId}transRollback(e){let t=e??this.activeTxId;return t?(this.activeTxId=null,this._request("POST",`/v1/transaction/rollback/${t}`)):Promise.reject(new Error("No active transaction. Call transStart() first."))}transCommit(e){let t=e??this.activeTxId;return t?(this.activeTxId=null,this._request("POST",`/v1/transaction/commit/${t}`)):Promise.reject(new Error("No active transaction. Call transStart() first."))}meta(e){return this._request("POST",`/v1/entity/${e}/meta`,{})}validate(e,t){return this.http.post(`/v1/entity/${e}/validate`,t)}get(e,t,s={}){let i=s.skipHooks?"?skipHooks=true":"";return this._request("GET",`/v1/entity/${e}/${t}${i}`)}find(e,t,s={}){let i=s.skipHooks?"?skipHooks=true":"";return this._request("POST",`/v1/entity/${e}/find${i}`,t??{})}list(e,t={}){let{conditions:s,fields:i,orderDir:o,orderBy:a,...u}=t,T={page:1,limit:20,...u};return a&&(T.orderBy=o==="DESC"?`-${a}`:a),i?.length&&(T.fields=i.join(",")),this._request("POST",`/v1/entity/${e}/list?${c(T)}`,s??{})}count(e,t){return this._request("POST",`/v1/entity/${e}/count`,t??{})}query(e,t){return this._request("POST",`/v1/entity/${e}/query`,t)}submit(e,t,s={}){let i=s.transactionId??this.activeTxId,o=i?{"X-Transaction-ID":i}:void 0,a=s.skipHooks?"?skipHooks=true":"";return this._request("POST",`/v1/entity/${e}/submit${a}`,t,!0,o)}delete(e,t,s={}){let i=new URLSearchParams;s.hard&&i.set("hard","true"),s.skipHooks&&i.set("skipHooks","true");let o=i.size?`?${i}`:"",a=s.transactionId??this.activeTxId,u=a?{"X-Transaction-ID":a}:void 0;return this._request("POST",`/v1/entity/${e}/delete/${t}${o}`,void 0,!0,u)}history(e,t,s={}){return this._request("GET",`/v1/entity/${e}/history/${t}?${c({page:1,limit:50,...s})}`)}rollback(e,t){return this._request("POST",`/v1/entity/${e}/rollback/${t}`)}}}function D(r){return class extends r{async fileUpload(e,t,s={}){let i=new FormData;return i.append("file",t,t instanceof File?t.name:"upload"),s.refSeq!=null&&i.append("ref_seq",String(s.refSeq)),s.isPublic!=null&&i.append("is_public",s.isPublic?"true":"false"),this._requestForm("POST",`/v1/files/${e}/upload`,i)}fileDownload(e,t){return this._requestBinary("POST",`/v1/files/${e}/download/${t}`,{})}fileDelete(e,t){return this._request("POST",`/v1/files/${e}/delete/${t}`,{})}fileList(e,t={}){return this._request("POST",`/v1/files/${e}/list`,t.refSeq?{ref_seq:t.refSeq}:{})}fileMeta(e,t){return this._request("POST",`/v1/files/${e}/meta/${t}`,{})}fileToken(e){return this._request("POST",`/v1/files/token/${e}`,{})}fileViewUrl(e,t={}){let s=t.download?"?download=true":"";return`${this.baseUrl}/v1/files/${e}${s}`}fileUrl(e){return`${this.baseUrl}/v1/files/${e}`}}}function N(r){return class extends r{push(e,t,s={}){return this.submit(e,t,s)}pushLogList(e={}){return this.list("push_log",e)}registerPushDevice(e,t,s,i={}){let{platform:o,deviceType:a,browser:u,browserVersion:T,pushEnabled:h=!0,transactionId:d}=i;return this.submit("account_device",{id:t,account_seq:e,push_token:s,push_enabled:h,...o?{platform:o}:{},...a?{device_type:a}:{},...u?{browser:u}:{},...T?{browser_version:T}:{}},{transactionId:d})}updatePushDeviceToken(e,t,s={}){let{pushEnabled:i=!0,transactionId:o}=s;return this.submit("account_device",{seq:e,push_token:t,push_enabled:i},{transactionId:o})}disablePushDevice(e,t={}){return this.submit("account_device",{seq:e,push_enabled:!1},{transactionId:t.transactionId})}}}function V(r){return class extends r{smtpSend(e){return this._request("POST","/v1/smtp/send",e)}smtpStatus(e){return this._request("POST",`/v1/smtp/status/${e}`,{})}smtpTemplatePreview(e){let t=e.split("/").map(encodeURIComponent).join("/");return fetch(`${this.baseUrl}/v1/smtp/template/${t}`,{credentials:"include"}).then(s=>s.text())}}}function Q(r){return class extends r{transactionStart(e){return this._request("POST","/v1/transaction/start",e??{})}transactionCommit(e){return this._request("POST",`/v1/transaction/commit/${encodeURIComponent(e)}`,{})}transactionRollback(e){return this._request("POST",`/v1/transaction/rollback/${encodeURIComponent(e)}`,{})}}}function z(r){return class extends r{addressSido(){return this.http.get("/v1/utils/address/sido",!1)}addressSigungu(e){let t=new URLSearchParams({sido:e.sido}).toString();return this.http.get(`/v1/utils/address/sigungu?${t}`,!1)}addressDong(e){let t=new URLSearchParams({sido:e.sido,sigungu:e.sigungu}).toString();return this.http.get(`/v1/utils/address/dong?${t}`,!1)}addressClean(e){let t=new URLSearchParams({q:e.q}).toString();return this.http.get(`/v1/utils/address/clean?${t}`,!1)}qrcode(e,t={}){return this._requestBinary("POST","/v1/utils/qrcode",{content:e,...t})}qrcodeBase64(e,t={}){return this._request("POST","/v1/utils/qrcode/base64",{content:e,...t})}qrcodeText(e,t={}){return this._request("POST","/v1/utils/qrcode/text",{content:e,...t})}barcode(e,t={}){return this._requestBinary("POST","/v1/utils/barcode",{content:e,...t})}pdf2png(e,t={}){let s=new FormData;s.append("file",new Blob([e],{type:"application/pdf"}),"document.pdf");let i=new URLSearchParams;t.dpi!=null&&i.set("dpi",String(t.dpi)),t.firstPage!=null&&i.set("first_page",String(t.firstPage)),t.lastPage!=null&&i.set("last_page",String(t.lastPage));let o=i.toString(),a="/v1/utils/pdf2png"+(o?`?${o}`:"");return this._requestFormBinary("POST",a,s)}pdf2pngByFileSeq(e,t={}){return this.requestBinary("POST",`/v1/utils/pdf2png/${e}`,t)}pdf2jpg(e,t={}){let s=new FormData;s.append("file",new Blob([e],{type:"application/pdf"}),"document.pdf");let i=new URLSearchParams;t.dpi!=null&&i.set("dpi",String(t.dpi)),t.firstPage!=null&&i.set("first_page",String(t.firstPage)),t.lastPage!=null&&i.set("last_page",String(t.lastPage));let o=i.toString(),a="/v1/utils/pdf2jpg"+(o?`?${o}`:"");return this._requestFormBinary("POST",a,s)}pdf2jpgByFileSeq(e,t={}){return this.requestBinary("POST",`/v1/utils/pdf2jpg/${e}`,t)}}}function X(r){return class extends r{_adminPath(e){return`/v1/admin${e}`}_adminGet(e){return this.http.get(this._adminPath(e))}_adminPost(e,t){return this.http.post(this._adminPath(e),t)}_adminPut(e,t){return this.http.put(this._adminPath(e),t)}_adminPatch(e,t){return this.http.patch(this._adminPath(e),t)}_adminDelete(e,t){return this.http.delete(this._adminPath(e),t)}listAdminEntities(){return this._adminGet("/entities")}getAdminErdSchema(){return this._adminGet("/erd/schema")}batchEnsureAdminEntities(e){return this._adminPost("/entities/batch-ensure",e)}createAdminEntityConfig(e,t){return this._adminPost(`/${e}/create`,t)}getAdminEntityConfig(e){return this._adminGet(`/${e}/config`)}updateAdminEntityConfig(e,t){return this._adminPut(`/${e}/config`,t)}validateAdminEntityConfig(e,t){return this._adminPost(t?`/${t}/validate`:"/entity/validate",e)}normalizeAdminEntityConfig(e,t){return this._adminPost(t?`/${t}/normalize`:"/entity/normalize",e)}getAdminEntityStats(e,t){return this._adminPost(`/${e}/stats`,t)}reindexAdminEntity(e){return this._adminPost(`/${e}/reindex`)}syncAdminEntitySchema(e){return this._adminPost(`/${e}/sync-schema`)}resetAdminEntity(e){return this._adminPost(`/${e}/reset`)}truncateAdminEntity(e){return this._adminPost(`/${e}/truncate`)}dropAdminEntity(e){return this._adminPost(`/${e}/drop`)}resetAllAdmin(e){return this._adminPost("/reset-all",e)}listAdminConfigs(){return this._adminGet("/configs")}getAdminConfig(e){return this._adminGet(`/configs/${e}`)}updateAdminConfig(e,t){return this._adminPatch(`/configs/${e}`,t)}listAdminRoles(){return this._adminGet("/roles")}createAdminRole(e){return this._adminPost("/roles",e)}getAdminRole(e){return this._adminGet(`/roles/${e}`)}updateAdminRole(e,t){return this._adminPatch(`/roles/${e}`,t)}deleteAdminRole(e){return this._adminDelete(`/roles/${e}`)}listAdminApiKeys(){return this._adminGet("/api-keys")}createAdminApiKey(e){return this._adminPost("/api-keys",e)}getAdminApiKey(e){return this._adminGet(`/api-keys/${e}`)}updateAdminApiKey(e,t){return this._adminPatch(`/api-keys/${e}`,t)}deleteAdminApiKey(e){return this._adminDelete(`/api-keys/${e}`)}regenerateAdminApiKeySecret(e){return this._adminPost(`/api-keys/${e}/regenerate-secret`)}listAdminAccounts(){return this._adminGet("/accounts")}createAdminAccount(e){return this._adminPost("/accounts",e)}getAdminAccount(e){return this._adminGet(`/accounts/${e}`)}updateAdminAccount(e,t){return this._adminPatch(`/accounts/${e}`,t)}deleteAdminAccount(e){return this._adminDelete(`/accounts/${e}`)}listAdminLicenses(){return this._adminGet("/licenses")}createAdminLicense(e){return this._adminPost("/licenses",e)}getAdminLicense(e){return this._adminGet(`/licenses/${e}`)}updateAdminLicense(e,t){return this._adminPatch(`/licenses/${e}`,t)}deleteAdminLicense(e){return this._adminDelete(`/licenses/${e}`)}runAdminBackup(e){return this._adminPost("/backup/run",e)}getAdminBackupStatus(e){return this._adminPost("/backup/status",e)}listAdminBackups(e){return this._adminPost("/backup/list",e)}restoreAdminBackup(e){return this._adminPost("/backup/restore",e)}deleteAdminBackup(e){return this._adminPost("/backup/delete",e)}disableAdminAccountTwoFactor(e){return this._adminDelete(`/accounts/${e}/2fa`)}}}var v=class extends z(Q(D(V(N(X(K(j(U)))))))){};function J(r){return class extends r{accountRegister(e){return this.http.post("/v1/account/register",e,!1)}accountWithdraw(e){return this.http.post("/v1/account/withdraw",e)}accountChangePassword(e){return this.http.post("/v1/account/change-password",e)}accountReactivate(e){return this.http.post("/v1/account/reactivate",e,!1)}listAccountBiometrics(){return this.http.get("/v1/account/biometric")}registerAccountBiometric(e){return this.http.post("/v1/account/biometric",e)}deleteAccountBiometric(e){return this.http.delete(`/v1/account/biometric/${e}`)}}}function W(r){return class extends r{listBoardCategories(e={}){let t=c(e);return this.http.get(`/v1/board/categories${t?`?${t}`:""}`,!1)}getBoardCategory(e){return this.http.get(`/v1/board/categories/${e}`,!1)}createBoardCategory(e){return this.http.post("/v1/board/categories",e)}updateBoardCategory(e,t){return this.http.put(`/v1/board/categories/${e}`,t)}deleteBoardCategory(e){return this.http.delete(`/v1/board/categories/${e}`)}listBoardPosts(e,t={}){let s=c(t);return this.http.get(`/v1/board/${e}/list${s?`?${s}`:""}`,!1)}getBoardPost(e){return this.http.get(`/v1/board/posts/${e}`,!1)}createBoardPost(e,t){return this.http.post(`/v1/board/${e}/submit`,t)}updateBoardPost(e,t){return this.http.put(`/v1/board/posts/${e}`,t)}deleteBoardPost(e){return this.http.delete(`/v1/board/posts/${e}`)}listBoardComments(e,t={}){let s=c(t);return this.http.get(`/v1/board/posts/${e}/comments${s?`?${s}`:""}`,!1)}createBoardComment(e,t){return this.http.post(`/v1/board/posts/${e}/comments/submit`,t)}updateBoardComment(e,t){return this.http.put(`/v1/board/comments/${e}`,t)}deleteBoardComment(e){return this.http.delete(`/v1/board/comments/${e}`)}listBoardFiles(e){return this.http.get(`/v1/board/posts/${e}/files`,!1)}async uploadBoardFile(e,t){let s=new FormData;return s.append("file",t,t instanceof File?t.name:"upload"),this.requestForm("POST",`/v1/board/posts/${e}/files`,s)}boardFileUrl(e){return`${this.baseUrl}/v1/board/files/${e}`}deleteBoardFile(e){return this.http.delete(`/v1/board/files/${e}`)}createBoardGuestPost(e,t){return this.http.post(`/v1/board/${e}/guest-submit`,t,!1)}authenticateBoardGuestPost(e,t){return this.http.post(`/v1/board/posts/${e}/guest-auth`,t,!1)}toggleBoardPostLike(e){return this.http.post(`/v1/board/posts/${e}/like`,{})}acceptBoardPost(e){return this.http.post(`/v1/board/posts/${e}/accept`,{})}rateBoardPost(e,t){return this.http.post(`/v1/board/posts/${e}/rating`,t)}rateBoardComment(e,t){return this.http.post(`/v1/board/comments/${e}/rating`,t)}listBoardTags(e={}){let t=c(e);return this.http.get(`/v1/board/tags${t?`?${t}`:""}`,!1)}setBoardPostTags(e,t){return this.http.put(`/v1/board/posts/${e}/tags`,t)}reportBoardPost(e,t){return this.http.post(`/v1/board/posts/${e}/report`,t)}reportBoardComment(e,t){return this.http.post(`/v1/board/comments/${e}/report`,t)}listBoardReports(e={}){let t=c(e);return this.http.get(`/v1/board/admin/reports${t?`?${t}`:""}`)}updateBoardReport(e,t){return this.http.patch(`/v1/board/admin/reports/${e}`,t)}markBoardPostRead(e){return this.http.post(`/v1/board/posts/${e}/read`,{})}listBoardMentions(e={}){let t=c(e);return this.http.get(`/v1/board/mentions${t?`?${t}`:""}`)}markBoardMentionRead(e){return this.http.patch(`/v1/board/mentions/${e}/read`,{})}}}function Y(r){return class extends r{sendEmailVerification(e){return this.http.post("/v1/email-verify/send",e,!1)}confirmEmailVerification(e){return this.http.post("/v1/email-verify/confirm",e,!1)}activateEmailVerification(e){let t=c(e);return this.http.get(`/v1/email-verify/activate${t?`?${t}`:""}`,!1)}getEmailVerificationStatus(){return this.http.get("/v1/email-verify/status")}changeVerifiedEmail(e){return this.http.post("/v1/email-verify/change",e)}}}function Z(r){return class extends r{oauthAuthorizeUrl(e,t={}){let s=c(t);return`${this.baseUrl}/v1/oauth/${e}${s?`?${s}`:""}`}oauthCallback(e,t,s="POST"){if(s==="GET"){let i=c(t??{});return this.http.get(`/v1/oauth/${e}/callback${i?`?${i}`:""}`,!1)}return this.http.post(`/v1/oauth/${e}/callback`,t,!1)}linkOAuthAccount(e){return this.http.post("/v1/account/oauth/link",e)}unlinkOAuthAccount(e){return this.http.delete(`/v1/account/oauth/link/${e}`)}listOAuthProviders(){return this.http.get("/v1/account/oauth/providers")}refreshOAuthProviderToken(e,t){return this.http.post(`/v1/account/oauth/refresh/${e}`,t)}}}function ee(r){return class extends r{requestPasswordReset(e){return this.http.post("/v1/password-reset/request",e,!1)}validatePasswordResetToken(e){return this.http.get(`/v1/password-reset/validate/${encodeURIComponent(e)}`,!1)}verifyPasswordReset(e){return this.http.post("/v1/password-reset/verify",e,!1)}}}function te(r){return class extends r{setupTwoFactor(e){return this.http.post("/v1/account/2fa/setup",e)}verifyTwoFactorSetup(e){return this.http.post("/v1/account/2fa/setup/verify",e,!1)}disableTwoFactor(){return this.http.delete("/v1/account/2fa")}getTwoFactorStatus(){return this.http.get("/v1/account/2fa/status")}regenerateTwoFactorRecoveryCodes(){return this.http.post("/v1/account/2fa/recovery/regenerate")}verifyTwoFactor(e){return this.http.post("/v1/account/2fa/verify",e,!1)}recoverTwoFactorAccess(e){return this.http.post("/v1/account/2fa/recovery",e,!1)}}}function ne(r){return class extends r{alimtalkSend(e){return this.http.post("/v1/alimtalk/send",e)}alimtalkStatus(e){return this.http.get(`/v1/alimtalk/status/${e}`,!1)}listAlimtalkTemplates(){return this.http.get("/v1/alimtalk/templates",!1)}alimtalkWebhook(e,t){return this.http.post(`/v1/alimtalk/webhook/${encodeURIComponent(e)}`,t,!1)}}}function re(r){return class extends r{friendtalkSend(e){return this.http.post("/v1/friendtalk/send",e)}}}function se(r){return class extends r{listHolidays(e={}){let t=c(e);return this.http.get(`/v1/holidays${t?`?${t}`:""}`,!1)}getHolidayByDate(e){return this.http.get(`/v1/holidays/${encodeURIComponent(e)}`,!1)}syncHolidays(e){return this.http.post("/v1/holidays/sync",e)}}}function ie(r){return class extends r{identityRequest(e){return this.http.post("/v1/identity/request",e,!1)}identityCallback(e){return this.http.post("/v1/identity/callback",e,!1)}identityResult(e){return this.http.get(`/v1/identity/result/${encodeURIComponent(e)}`,!1)}identityVerifyCI(e){return this.http.post("/v1/identity/verify-ci",e)}}}function oe(r){return class extends r{llmChat(e){return this.http.post("/v1/llm/chat",e)}llmChatStream(e){return this.http.post("/v1/llm/chat/stream",e)}createLlmConversation(e){return this.http.post("/v1/llm/conversations",e)}sendLlmMessage(e,t){return this.http.post(`/v1/llm/conversations/${e}/messages`,t)}listLlmConversations(e={}){let t=c(e);return this.http.get(`/v1/llm/conversations${t?`?${t}`:""}`)}getLlmConversation(e){return this.http.get(`/v1/llm/conversations/${e}`)}updateLlmConversation(e,t){return this.http.patch(`/v1/llm/conversations/${e}`,t)}deleteLlmConversation(e){return this.http.delete(`/v1/llm/conversations/${e}`)}ragUploadDocument(e){return this.requestForm("POST","/v1/llm/rag/documents",e)}ragListDocuments(e={}){let t=c(e);return this.http.get(`/v1/llm/rag/documents${t?`?${t}`:""}`)}ragDeleteDocument(e){return this.http.delete(`/v1/llm/rag/documents/${encodeURIComponent(e)}`)}ragSearch(e){return this.http.post("/v1/llm/rag/search",e)}ragChat(e){return this.http.post("/v1/llm/rag/chat",e)}ragChatStream(e){return this.http.post("/v1/llm/rag/chat/stream",e)}ragRebuildIndex(e){return this.http.post("/v1/llm/rag/rebuild-index",e)}listLlmProviders(){return this.http.get("/v1/llm/providers")}getLlmUsage(e={}){let t=c(e);return this.http.get(`/v1/llm/usage${t?`?${t}`:""}`)}getLlmUsageSummary(e={}){let t=c(e);return this.http.get(`/v1/llm/usage/summary${t?`?${t}`:""}`)}getLlmCacheStats(){return this.http.get("/v1/llm/cache/stats")}clearLlmCache(){return this.http.delete("/v1/llm/cache")}listLlmTemplates(){return this.http.get("/v1/llm/templates")}llmTemplateChat(e,t){return this.http.post(`/v1/llm/${encodeURIComponent(e)}/chat`,t)}llmTemplateChatStream(e,t){return this.http.post(`/v1/llm/${encodeURIComponent(e)}/chat/stream`,t)}listLlmChatbots(e={}){let t=c(e);return this.http.get(`/v1/llm/chatbots${t?`?${t}`:""}`)}createLlmChatbot(e){return this.http.post("/v1/llm/chatbots",e)}getLlmChatbot(e){return this.http.get(`/v1/llm/chatbots/${e}`)}updateLlmChatbot(e,t){return this.http.patch(`/v1/llm/chatbots/${e}`,t)}deleteLlmChatbot(e){return this.http.delete(`/v1/llm/chatbots/${e}`)}llmChatbotChat(e,t){return this.http.post(`/v1/llm/chatbots/${e}/chat`,t)}llmChatbotChatStream(e,t){return this.http.post(`/v1/llm/chatbots/${e}/chat/stream`,t)}listLlmChatbotSessions(e,t={}){let s=c(t);return this.http.get(`/v1/llm/chatbots/${e}/sessions${s?`?${s}`:""}`)}deleteLlmChatbotSession(e,t){return this.http.delete(`/v1/llm/chatbots/${e}/sessions/${t}`)}listLlmProfiles(e={}){let t=c(e);return this.http.get(`/v1/llm/profiles${t?`?${t}`:""}`)}upsertLlmProfile(e){return this.http.post("/v1/llm/profiles",e)}deleteLlmProfile(e){return this.http.delete(`/v1/llm/profiles/${e}`)}}}function ae(r){return class extends r{ocrRecognize(e){return this.requestForm("POST","/v1/ocr/recognize",e)}ocrRecognizeAsync(e){return this.requestForm("POST","/v1/ocr/recognize/async",e)}ocrRecognizeByDocType(e,t){return this.requestForm("POST",`/v1/ocr/${encodeURIComponent(e)}`,t)}listOcrResults(e={}){let t=c(e);return this.http.get(`/v1/ocr/results${t?`?${t}`:""}`)}getOcrResult(e){return this.http.get(`/v1/ocr/results/${encodeURIComponent(e)}`)}getOcrResultText(e){return this.http.get(`/v1/ocr/results/${encodeURIComponent(e)}/text`)}deleteOcrResult(e){return this.http.delete(`/v1/ocr/results/${encodeURIComponent(e)}`)}getOcrQuota(){return this.http.get("/v1/ocr/quota")}}}function ue(r){return class extends r{pgCreateOrder(e){return this.http.post("/v1/pg/orders",e)}pgGetOrder(e){return this.http.get(`/v1/pg/orders/${encodeURIComponent(e)}`)}pgConfirmPayment(e){return this.http.post("/v1/pg/confirm",e)}pgCancelPayment(e,t){return this.http.post(`/v1/pg/orders/${encodeURIComponent(e)}/cancel`,t)}pgSyncPaymentStatus(e,t){return this.http.post(`/v1/pg/orders/${encodeURIComponent(e)}/sync`,t)}pgWebhook(e){return this.http.post("/v1/pg/webhook",e,!1)}pgGetClientConfig(){return this.http.get("/v1/pg/config",!1)}}}function ce(r){return class extends r{appPushSend(e){return this.http.post("/v1/push/send",e)}appPushBroadcast(e){return this.http.post("/v1/push/broadcast",e)}appPushStatus(e){return this.http.get(`/v1/push/status/${e}`)}appPushRegisterDevice(e){return this.http.post("/v1/push/device",e)}appPushUnregisterDevice(e){return this.http.delete(`/v1/push/device/${e}`)}}}function le(r){return class extends r{smsSend(e){return this.http.post("/v1/sms/send",e)}smsStatus(e){return this.http.get(`/v1/sms/status/${e}`,!1)}smsVerificationSend(e){return this.http.post("/v1/sms/verification/send",e,!1)}smsVerificationVerify(e){return this.http.post("/v1/sms/verification/verify",e,!1)}}}function me(r){return class extends r{taxinvoiceRegistIssue(e){return this.http.post("/v1/taxinvoice",e)}taxinvoiceRegister(e){return this.http.post("/v1/taxinvoice/register",e)}taxinvoiceIssue(e){return this.http.post(`/v1/taxinvoice/${e}/issue`,{})}taxinvoiceCancelIssue(e,t){return this.http.post(`/v1/taxinvoice/${e}/cancel`,t)}taxinvoiceGetState(e){return this.http.get(`/v1/taxinvoice/${e}/state`)}taxinvoiceGetDetail(e){return this.http.get(`/v1/taxinvoice/${e}`)}}}var S=class extends ne(re(le(ce(ue(me(ae(oe(ie(se(Z(te(ee(Y(W(J(v)))))))))))))))){};var Se=new v,Ee=new S;function tr(r={}){return A(r,{singletonInstance:Se,ClientClass:v})}function ir(r={}){return A(r,{singletonInstance:Ee,ClientClass:S})}export{ir as useEntityAppServer,A as useEntityClient,tr as useEntityServer};
2
2
  //# sourceMappingURL=react.js.map