gemi 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gemi.js +1456 -5
- package/dist/bin/gemi.js.map +9 -5
- package/dist/broadcasting/index.js +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/{chunk-msz8rngs.js → chunk-004bcmsa.js} +2 -2
- package/dist/chunk-004bcmsa.js.map +10 -0
- package/dist/chunk-07t0dmdg.js +4 -0
- package/dist/{chunk-faa987e4.js.map → chunk-07t0dmdg.js.map} +2 -2
- package/dist/{chunk-4t6a82fh.js → chunk-0weeq0ke.js} +2 -2
- package/dist/{chunk-4t6a82fh.js.map → chunk-0weeq0ke.js.map} +1 -1
- package/dist/chunk-113khwbw.js +5 -0
- package/dist/{chunk-2qn472j4.js.map → chunk-113khwbw.js.map} +1 -1
- package/dist/{chunk-tmk4zfz9.js → chunk-1sh6kqjn.js} +3 -3
- package/dist/{chunk-tmk4zfz9.js.map → chunk-1sh6kqjn.js.map} +1 -1
- package/dist/{chunk-2gw6cyyj.js → chunk-1snh7yc4.js} +2 -2
- package/dist/{chunk-2gw6cyyj.js.map → chunk-1snh7yc4.js.map} +1 -1
- package/dist/chunk-26r8dcxd.js +6 -0
- package/dist/{chunk-hbycemy5.js.map → chunk-26r8dcxd.js.map} +2 -2
- package/dist/{chunk-ebcgdv00.js → chunk-2pt6kyn9.js} +3 -3
- package/dist/{chunk-ebcgdv00.js.map → chunk-2pt6kyn9.js.map} +1 -1
- package/dist/{chunk-jdfe4dmh.js → chunk-2zmz3pjk.js} +3 -3
- package/dist/{chunk-jdfe4dmh.js.map → chunk-2zmz3pjk.js.map} +1 -1
- package/dist/{chunk-zhsaz9cr.js → chunk-3bw1jk21.js} +1 -1
- package/dist/chunk-4qkzdyj7.js +4 -0
- package/dist/{chunk-4e61qbp4.js.map → chunk-4qkzdyj7.js.map} +1 -1
- package/dist/{chunk-d1ahbza9.js → chunk-50vm7x98.js} +3 -3
- package/dist/{chunk-d1ahbza9.js.map → chunk-50vm7x98.js.map} +1 -1
- package/dist/{chunk-qyaqg07q.js → chunk-6j1z2cqt.js} +2 -2
- package/dist/{chunk-qyaqg07q.js.map → chunk-6j1z2cqt.js.map} +1 -1
- package/dist/chunk-6rhebm18.js +5 -0
- package/dist/chunk-6rhebm18.js.map +10 -0
- package/dist/{chunk-rq770c71.js → chunk-71m47kad.js} +2 -2
- package/dist/{chunk-rq770c71.js.map → chunk-71m47kad.js.map} +1 -1
- package/dist/{chunk-0h3jr9d9.js → chunk-7f5ad759.js} +2 -2
- package/dist/{chunk-8p6rqegw.js.map → chunk-7f5ad759.js.map} +1 -1
- package/dist/{chunk-qj4mmner.js → chunk-85av4ncy.js} +2 -2
- package/dist/{chunk-qj4mmner.js.map → chunk-85av4ncy.js.map} +1 -1
- package/dist/{chunk-23g7qdpg.js → chunk-9taz1h3t.js} +3 -3
- package/dist/{chunk-23g7qdpg.js.map → chunk-9taz1h3t.js.map} +1 -1
- package/dist/{chunk-ppt296ye.js → chunk-agabw2w1.js} +2 -2
- package/dist/{chunk-ppt296ye.js.map → chunk-agabw2w1.js.map} +1 -1
- package/dist/{chunk-092pj2j2.js → chunk-bb3zvxsf.js} +3 -3
- package/dist/{chunk-092pj2j2.js.map → chunk-bb3zvxsf.js.map} +1 -1
- package/dist/{chunk-h7jv3ame.js → chunk-br8ten26.js} +2 -2
- package/dist/{chunk-h7jv3ame.js.map → chunk-br8ten26.js.map} +1 -1
- package/dist/{chunk-4e61qbp4.js → chunk-bzhtymvv.js} +2 -2
- package/dist/{chunk-0h3jr9d9.js.map → chunk-bzhtymvv.js.map} +1 -1
- package/dist/{chunk-68w225rv.js → chunk-c0wcsmpj.js} +2 -2
- package/dist/{chunk-68w225rv.js.map → chunk-c0wcsmpj.js.map} +1 -1
- package/dist/{chunk-xsmt86n3.js → chunk-c22vcxty.js} +2 -2
- package/dist/{chunk-xsmt86n3.js.map → chunk-c22vcxty.js.map} +1 -1
- package/dist/{chunk-a0sy9f9x.js → chunk-c2pv3ah8.js} +2 -2
- package/dist/{chunk-a0sy9f9x.js.map → chunk-c2pv3ah8.js.map} +2 -2
- package/dist/{chunk-q09mmr05.js → chunk-cz3szqhq.js} +2 -2
- package/dist/{chunk-q09mmr05.js.map → chunk-cz3szqhq.js.map} +1 -1
- package/dist/{chunk-69w4egkg.js → chunk-dwx2y7br.js} +4 -4
- package/dist/{chunk-69w4egkg.js.map → chunk-dwx2y7br.js.map} +1 -1
- package/dist/{chunk-2sfz64xh.js → chunk-dxw8k6f1.js} +2 -2
- package/dist/{chunk-2sfz64xh.js.map → chunk-dxw8k6f1.js.map} +1 -1
- package/dist/chunk-e3mggavt.js +5 -0
- package/dist/chunk-e3mggavt.js.map +11 -0
- package/dist/{chunk-j1knf8gv.js → chunk-efsk1wy0.js} +3 -3
- package/dist/{chunk-j1knf8gv.js.map → chunk-efsk1wy0.js.map} +1 -1
- package/dist/{chunk-t4n25km9.js → chunk-f13f68c0.js} +2 -2
- package/dist/{chunk-t4n25km9.js.map → chunk-f13f68c0.js.map} +1 -1
- package/dist/{chunk-vv72kw74.js → chunk-f418jh9k.js} +2 -2
- package/dist/{chunk-vv72kw74.js.map → chunk-f418jh9k.js.map} +1 -1
- package/dist/chunk-f4e7fh95.js +17 -0
- package/dist/chunk-f4e7fh95.js.map +14 -0
- package/dist/{chunk-ewgv1j8q.js → chunk-fcqc3e3r.js} +2 -2
- package/dist/{chunk-ewgv1j8q.js.map → chunk-fcqc3e3r.js.map} +1 -1
- package/dist/{chunk-3y9nf09k.js → chunk-g5tj10p8.js} +2 -2
- package/dist/{chunk-3y9nf09k.js.map → chunk-g5tj10p8.js.map} +1 -1
- package/dist/chunk-gn9zjgep.js +5 -0
- package/dist/chunk-gn9zjgep.js.map +10 -0
- package/dist/{chunk-5s45prj5.js → chunk-h7mcwfg5.js} +4 -4
- package/dist/{chunk-5s45prj5.js.map → chunk-h7mcwfg5.js.map} +1 -1
- package/dist/chunk-hk067634.js +4 -0
- package/dist/{chunk-vnjvd82s.js.map → chunk-hk067634.js.map} +2 -2
- package/dist/{chunk-qx6sahe0.js → chunk-hrrmxreg.js} +2 -2
- package/dist/{chunk-qx6sahe0.js.map → chunk-hrrmxreg.js.map} +1 -1
- package/dist/{chunk-p22rkf1g.js → chunk-jb022m7n.js} +2 -2
- package/dist/{chunk-p22rkf1g.js.map → chunk-jb022m7n.js.map} +1 -1
- package/dist/chunk-jb2nst6v.js +4 -0
- package/dist/{chunk-6scjrbw7.js.map → chunk-jb2nst6v.js.map} +2 -2
- package/dist/{chunk-kxzwem3g.js → chunk-jdgvdddd.js} +2 -2
- package/dist/{chunk-kxzwem3g.js.map → chunk-jdgvdddd.js.map} +1 -1
- package/dist/{chunk-2yth3kk2.js → chunk-jp4pf3yt.js} +4 -4
- package/dist/{chunk-2yth3kk2.js.map → chunk-jp4pf3yt.js.map} +1 -1
- package/dist/{chunk-0tbwn6er.js → chunk-k14dmqwh.js} +3 -3
- package/dist/{chunk-0tbwn6er.js.map → chunk-k14dmqwh.js.map} +1 -1
- package/dist/{chunk-1ce7veh9.js → chunk-k8endm5j.js} +3 -3
- package/dist/{chunk-1ce7veh9.js.map → chunk-k8endm5j.js.map} +1 -1
- package/dist/chunk-kkkqyvwv.js +81 -0
- package/dist/{chunk-km6x37ws.js.map → chunk-kkkqyvwv.js.map} +5 -5
- package/dist/{chunk-cmq5t8p9.js → chunk-kv2ep453.js} +3 -3
- package/dist/{chunk-cmq5t8p9.js.map → chunk-kv2ep453.js.map} +1 -1
- package/dist/{chunk-z4q1ty6w.js → chunk-kz39hphm.js} +3 -3
- package/dist/{chunk-z4q1ty6w.js.map → chunk-kz39hphm.js.map} +1 -1
- package/dist/{chunk-kaxvw75w.js → chunk-ms8qd7da.js} +3 -3
- package/dist/{chunk-kaxvw75w.js.map → chunk-ms8qd7da.js.map} +1 -1
- package/dist/{chunk-ttzkn1qd.js → chunk-n1tkn8gv.js} +2 -2
- package/dist/{chunk-ttzkn1qd.js.map → chunk-n1tkn8gv.js.map} +1 -1
- package/dist/chunk-nncwsdzz.js +5 -0
- package/dist/chunk-nncwsdzz.js.map +10 -0
- package/dist/{chunk-et0j6jx8.js → chunk-pgjk5ft3.js} +3 -3
- package/dist/{chunk-et0j6jx8.js.map → chunk-pgjk5ft3.js.map} +1 -1
- package/dist/{chunk-tztqkat2.js → chunk-r06rxn19.js} +2 -2
- package/dist/{chunk-tztqkat2.js.map → chunk-r06rxn19.js.map} +1 -1
- package/dist/chunk-r9z5rrk0.js +4 -0
- package/dist/{chunk-1ab1ptq5.js.map → chunk-r9z5rrk0.js.map} +2 -2
- package/dist/{chunk-h5g05qwb.js → chunk-s6e7cvek.js} +2 -2
- package/dist/{chunk-h5g05qwb.js.map → chunk-s6e7cvek.js.map} +1 -1
- package/dist/{chunk-53e48ce8.js → chunk-sqp7kn7h.js} +3 -3
- package/dist/{chunk-53e48ce8.js.map → chunk-sqp7kn7h.js.map} +1 -1
- package/dist/{chunk-mt2755rs.js → chunk-w6gb9gc5.js} +3 -3
- package/dist/{chunk-mt2755rs.js.map → chunk-w6gb9gc5.js.map} +1 -1
- package/dist/{chunk-ha7n1c94.js → chunk-xxw0gz4q.js} +2 -2
- package/dist/{chunk-ha7n1c94.js.map → chunk-xxw0gz4q.js.map} +1 -1
- package/dist/chunk-ywr2vd5r.js +5 -0
- package/dist/{chunk-f29vd5mc.js.map → chunk-ywr2vd5r.js.map} +2 -2
- package/dist/{chunk-38ma6gg3.js → chunk-zckj6bs6.js} +3 -3
- package/dist/{chunk-38ma6gg3.js.map → chunk-zckj6bs6.js.map} +1 -1
- package/dist/chunks/ThemeProvider-Bk1eZymb.js +2901 -0
- package/dist/chunks/ThemeProvider-Bk1eZymb.js.map +1 -0
- package/dist/client/ComponentContext.d.ts.map +1 -1
- package/dist/client/DictionarySinkContext.d.ts +10 -0
- package/dist/client/DictionarySinkContext.d.ts.map +1 -0
- package/dist/client/Mutation.d.ts +1 -1
- package/dist/client/Mutation.d.ts.map +1 -1
- package/dist/client/ThemeProvider.d.ts +7 -0
- package/dist/client/ThemeProvider.d.ts.map +1 -1
- package/dist/client/createRoot.d.ts.map +1 -1
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +242 -2629
- package/dist/client/index.js.map +1 -1
- package/dist/client/useDictionary.d.ts +34 -0
- package/dist/client/useDictionary.d.ts.map +1 -0
- package/dist/client/useDictionary.test-d.d.ts +2 -0
- package/dist/client/useDictionary.test-d.d.ts.map +1 -0
- package/dist/client/useIsNavigationPending.d.ts.map +1 -1
- package/dist/client/useMutate.d.ts.map +1 -1
- package/dist/client/useTranslator.d.ts +8 -0
- package/dist/client/useTranslator.d.ts.map +1 -1
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/Lang.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/Dictionary.d.ts +7 -0
- package/dist/i18n/Dictionary.d.ts.map +1 -1
- package/dist/i18n/Translator.d.ts +12 -0
- package/dist/i18n/Translator.d.ts.map +1 -1
- package/dist/i18n/config.d.ts +6 -0
- package/dist/i18n/config.d.ts.map +1 -1
- package/dist/i18n/defineDictionary.d.ts +65 -0
- package/dist/i18n/defineDictionary.d.ts.map +1 -0
- package/dist/i18n/dictionaryRegistry.d.ts +85 -0
- package/dist/i18n/dictionaryRegistry.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.d.ts +16 -0
- package/dist/i18n/dictionaryRuntime.d.ts.map +1 -0
- package/dist/i18n/dictionaryRuntime.js +4 -0
- package/dist/i18n/dictionaryRuntime.js.map +9 -0
- package/dist/i18n/dictionaryShape.d.ts +66 -0
- package/dist/i18n/dictionaryShape.d.ts.map +1 -0
- package/dist/i18n/dictionarySink.d.ts +31 -0
- package/dist/i18n/dictionarySink.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.d.ts.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +5 -4
- package/dist/i18n/translate.d.ts +21 -0
- package/dist/i18n/translate.d.ts.map +1 -0
- package/dist/internal/gemiExternals.d.ts +1 -1
- package/dist/internal/gemiExternals.d.ts.map +1 -1
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/index.js +2 -2
- package/dist/orm/index.js.map +2 -2
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +4 -4
- package/dist/services/index.js.map +2 -2
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/services/router/streamQueryInjection.d.ts +9 -1
- package/dist/services/router/streamQueryInjection.d.ts.map +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/Page.d.ts +166 -0
- package/dist/testing/Page.d.ts.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +352 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/utils/Subject.d.ts.map +1 -1
- package/dist/utils/variantKey.d.ts +19 -0
- package/dist/utils/variantKey.d.ts.map +1 -0
- package/dist/vite/__vite-browser-external-S5EYS4bz.mjs +7 -0
- package/dist/vite/api_vite-DSBC5Nzy.mjs +5 -0
- package/dist/vite/browser-DFEUWTkA.mjs +6086 -0
- package/dist/vite/build-C0lmnz6d.mjs +5326 -0
- package/dist/vite/index.mjs +1349 -1
- package/dist/vite/lib-TT6NqN6b.mjs +363 -0
- package/dist/vite/lib-U4DF62jt.mjs +48846 -0
- package/dist/vite/main-Drp2rSLR.mjs +2123 -0
- package/dist/vite/node-BgyIm-M7.mjs +17799 -0
- package/dist/vite/node-yGkKTK1d.mjs +789 -0
- package/dist/vite/postcss-hCXrlC4m.mjs +3515 -0
- package/dist/vite/postcss-import-rYEe0OKc.mjs +448 -0
- package/dist/vite/prompt--dNycKSZ-BmZ8jzP_.mjs +889 -0
- package/dist/vite/rolldown-runtime-B4lejLz5.mjs +37 -0
- package/package.json +4 -1
- package/dist/chunk-1ab1ptq5.js +0 -4
- package/dist/chunk-2qn472j4.js +0 -5
- package/dist/chunk-6scjrbw7.js +0 -4
- package/dist/chunk-88pq4gmf.js +0 -5
- package/dist/chunk-88pq4gmf.js.map +0 -10
- package/dist/chunk-8p6rqegw.js +0 -4
- package/dist/chunk-f29vd5mc.js +0 -5
- package/dist/chunk-faa987e4.js +0 -4
- package/dist/chunk-hbycemy5.js +0 -6
- package/dist/chunk-km6x37ws.js +0 -81
- package/dist/chunk-msz8rngs.js.map +0 -10
- package/dist/chunk-vnjvd82s.js +0 -4
- package/dist/chunk-xw44bwnh.js +0 -5
- package/dist/chunk-xw44bwnh.js.map +0 -11
- /package/dist/{chunk-zhsaz9cr.js.map → chunk-3bw1jk21.js.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{
|
|
2
|
+
import{Ia as C}from"./chunk-f13f68c0.js";import"./chunk-r06rxn19.js";import{Ka as ne}from"./chunk-50vm7x98.js";import{La as _}from"./chunk-ms8qd7da.js";import{df as c,hf as F}from"./chunk-7f5ad759.js";var x=c(_(),1),T=c(C(),1);var q=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var D=c(ne(),1);var u=c(_(),1),m=c(C(),1);var W=300000,h="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var j=async(e,o={},r)=>{let{SSOOIDCClient:t}=await import("./chunk-r9z5rrk0.js").then((m)=>c(m.default,1)),n=(f)=>o.clientConfig?.[f]??o.parentClientConfig?.[f]??r?.[f];return new t(Object.assign({},o.clientConfig??{},{region:e??o.clientConfig?.region,logger:n("logger"),userAgentAppId:n("userAgentAppId")}))};var X=async(e,o,r={},t)=>{let{CreateTokenCommand:n}=await import("./chunk-r9z5rrk0.js").then((m)=>c(m.default,1));return(await j(o,r,t)).send(new n({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var z=c(_(),1);var P=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new z.TokenProviderError(`Token is expired. ${h}`,!1)};var J=c(_(),1);var g=(e,o,r=!1)=>{if(typeof o>"u")throw new J.TokenProviderError(`Value not present for '${e}' in SSO Token${r?". Cannot refresh":""}. ${h}`,!1)};var V=c(C(),1);import{promises as re}from"fs";var{writeFile:te}=re,Y=(e,o)=>{let r=V.getSSOTokenFilepath(e),t=JSON.stringify(o,null,2);return te(r,t)};var B=new Date(0),Q=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");let r=await m.parseKnownFiles(e),t=m.getProfileName({profile:e.profile??o?.profile}),n=r[t];if(!n)throw new u.TokenProviderError(`Profile '${t}' could not be found in shared credentials file.`,!1);else if(!n.sso_session)throw new u.TokenProviderError(`Profile '${t}' is missing required property 'sso_session'.`);let a=n.sso_session,p=(await m.loadSsoSessionData(e))[a];if(!p)throw new u.TokenProviderError(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let i of["sso_start_url","sso_region"])if(!p[i])throw new u.TokenProviderError(`Sso session '${a}' is missing required property '${i}'.`,!1);let{sso_start_url:S,sso_region:I}=p,s;try{s=await m.getSSOTokenFromFile(a)}catch(i){throw new u.TokenProviderError(`The SSO session token associated with profile=${t} was not found or is invalid. ${h}`,!1)}g("accessToken",s.accessToken),g("expiresAt",s.expiresAt);let{accessToken:y,expiresAt:E}=s,l={token:y,expiration:new Date(E)};if(l.expiration.getTime()-Date.now()>W)return l;if(Date.now()-B.getTime()<30000)return P(l),l;g("clientId",s.clientId,!0),g("clientSecret",s.clientSecret,!0),g("refreshToken",s.refreshToken,!0);try{B.setTime(Date.now());let i=await X(s,I,e,o);g("accessToken",i.accessToken),g("expiresIn",i.expiresIn);let O=new Date(Date.now()+i.expiresIn*1000);try{await Y(a,{...s,accessToken:i.accessToken,expiresAt:O.toISOString(),refreshToken:i.refreshToken})}catch(R){}return{token:i.accessToken,expiration:O}}catch(i){return P(l),l}};var k=c(_(),1),Z=c(C(),1),A=!1,$=async({ssoStartUrl:e,ssoSession:o,ssoAccountId:r,ssoRegion:t,ssoRoleName:n,ssoClient:a,clientConfig:f,parentClientConfig:p,callerClientConfig:S,profile:I,filepath:s,configFilepath:y,ignoreCache:E,logger:l})=>{let i,O="To refresh this SSO session run aws sso login with the corresponding profile.";if(o)try{let w=await Q({profile:I,filepath:s,configFilepath:y,ignoreCache:E})();i={accessToken:w.token,expiresAt:new Date(w.expiration).toISOString()}}catch(w){throw new k.CredentialsProviderError(w.message,{tryNextLink:A,logger:l})}else try{i=await Z.getSSOTokenFromFile(e)}catch(w){throw new k.CredentialsProviderError("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l})}if(new Date(i.expiresAt).getTime()-Date.now()<=0)throw new k.CredentialsProviderError("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:A,logger:l});let{accessToken:R}=i,{SSOClient:d,GetRoleCredentialsCommand:N}=await import("./chunk-jb2nst6v.js"),se=a||new d(Object.assign({},f??{},{logger:f?.logger??S?.logger??p?.logger,region:f?.region??t,userAgentAppId:f?.userAgentAppId??S?.userAgentAppId??p?.userAgentAppId})),L;try{L=await se.send(new N({accountId:r,roleName:n,accessToken:R}))}catch(w){throw new k.CredentialsProviderError(w,{tryNextLink:A,logger:l})}let{roleCredentials:{accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:b,credentialScope:H,accountId:U}={}}=L;if(!M||!G||!K||!b)throw new k.CredentialsProviderError("SSO returns an invalid temporary credential.",{tryNextLink:A,logger:l});let v={accessKeyId:M,secretAccessKey:G,sessionToken:K,expiration:new Date(b),...H&&{credentialScope:H},...U&&{accountId:U}};if(o)D.setCredentialFeature(v,"CREDENTIALS_SSO","s");else D.setCredentialFeature(v,"CREDENTIALS_SSO_LEGACY","u");return v};var ee=c(_(),1),oe=(e,o)=>{let{sso_start_url:r,sso_account_id:t,sso_region:n,sso_role_name:a}=e;if(!r||!t||!n||!a)throw new ee.CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", "sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}
|
|
3
3
|
Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:o});return e};var Ce=(e={})=>async({callerClientConfig:o}={})=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");let{ssoStartUrl:r,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoSession:f}=e,{ssoClient:p}=e,S=T.getProfileName({profile:e.profile??o?.profile});if(!r&&!t&&!n&&!a&&!f){let s=(await T.parseKnownFiles(e))[S];if(!s)throw new x.CredentialsProviderError(`Profile ${S} was not found.`,{logger:e.logger});if(!q(s))throw new x.CredentialsProviderError(`Profile ${S} is not configured with SSO credentials.`,{logger:e.logger});if(s?.sso_session){let d=(await T.loadSsoSessionData(e))[s.sso_session],N=` configurations in profile ${S} and sso-session ${s.sso_session}`;if(n&&n!==d.sso_region)throw new x.CredentialsProviderError("Conflicting SSO region"+N,{tryNextLink:!1,logger:e.logger});if(r&&r!==d.sso_start_url)throw new x.CredentialsProviderError("Conflicting SSO start_url"+N,{tryNextLink:!1,logger:e.logger});s.sso_region=d.sso_region,s.sso_start_url=d.sso_start_url}let{sso_start_url:y,sso_account_id:E,sso_region:l,sso_role_name:i,sso_session:O}=oe(s,e.logger);return $({ssoStartUrl:y,ssoSession:O,ssoAccountId:E,ssoRegion:l,ssoRoleName:i,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})}else if(!r||!t||!n||!a)throw new x.CredentialsProviderError('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return $({ssoStartUrl:r,ssoSession:f,ssoAccountId:t,ssoRegion:n,ssoRoleName:a,ssoClient:p,clientConfig:e.clientConfig,parentClientConfig:e.parentClientConfig,callerClientConfig:e.callerClientConfig,profile:S,filepath:e.filepath,configFilepath:e.configFilepath,ignoreCache:e.ignoreCache,logger:e.logger})};export{oe as validateSsoProfile,q as isSsoProfile,Ce as fromSSO};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=426952EF023789E364756E2164756E21
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
"import { CredentialsProviderError } from \"@smithy/property-provider\";\nexport const validateSsoProfile = (profile, logger) => {\n const { sso_start_url, sso_account_id, sso_region, sso_role_name } = profile;\n if (!sso_start_url || !sso_account_id || !sso_region || !sso_role_name) {\n throw new CredentialsProviderError(`Profile is configured with invalid SSO credentials. Required parameters \"sso_account_id\", ` +\n `\"sso_region\", \"sso_role_name\", \"sso_start_url\". Got ${Object.keys(profile).join(\", \")}\\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`, { tryNextLink: false, logger });\n }\n return profile;\n};\n"
|
|
16
16
|
],
|
|
17
17
|
"mappings": ";iOAAA,SACA,KCDO,FAAM,JAA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,MAAO,CAAC,EAG5G,YAAO,EAAsB,CACzB,cACA,aACA,eACA,YACA,cACA,YACA,aAAc,EAAK,aACnB,mBAAoB,EAAK,mBACzB,mBAAoB,EAAK,mBACzB,QAAS,EACT,SAAU,EAAK,SACf,eAAgB,EAAK,eACrB,YAAa,EAAK,YAClB,OAAQ,EAAK,MACjB,CAAC",
|
|
18
|
-
"debugId": "
|
|
18
|
+
"debugId": "426952EF023789E364756E2164756E21",
|
|
19
19
|
"names": []
|
|
20
20
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var $=globalThis.__GEMI_DICTIONARY_REGISTRY__??={registry:new Map,resolved:new Map,inFlight:new Map,degraded:new Map,order:[],warmed:new Map,activeLocale:null},{registry:V,resolved:X,inFlight:Q,degraded:E,order:j,warmed:W}=$;function G(q,x){return`${q}\x00${x}`}function U(q){if(V.has(q.id))return;V.set(q.id,q),j.push(q.id)}function Y(){return j.length}function I(q,x){return X.get(q)?.get(x)}function Z(q,x,A){let z=X.get(q);if(!z)z=new Map,X.set(q,z);z.set(x,A)}function M(q,x){let A=I(q,x);if(A)return A;let z=G(q,x),C=Q.get(z);if(C)return C;let B=V.get(q);if(!B)throw Error(`Unknown dictionary "${q}". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`);let H=B.load(x);if(!(H instanceof Promise))return Z(q,x,H),H;let J=H.then((O)=>{return Z(q,x,O),Q.delete(z),O},(O)=>{throw Q.delete(z),O});return Q.set(z,J),J}function _(q,x){let A=I(q,x);if(A)return A;let z=G(q,x),C=E.get(z);if(C)return C;let B=M(q,x);if(!(B instanceof Promise))return B;let H=B.then((J)=>J,(J)=>{return console.error(`Failed to load dictionary ${q} for locale ${x}; rendering keys instead.`,J),N});return E.set(z,H),H}var N={};async function D(q,x){let A=x??W.get(q)??0,z=j.slice(A);if(z.length===0)return;let C=await Promise.all(z.map(async(B)=>{try{return await M(B,P(B,q)),!0}catch{return!1}}));if(x===void 0){let B=C.indexOf(!1),H=B===-1?z.length:B;W.set(q,Math.max(W.get(q)??0,A+H))}}function P(q,x){if(x)return x;return V.get(q)?.locales[0]??x}function K(q,x){if(!q)return;for(let[A,z]of Object.entries(q))Z(A,x,z)}function S(q){if(q)$.activeLocale=q}function T(){return $.activeLocale}if(typeof window<"u"){let q=window,x=([z,C,B])=>{Z(z,C,B)},A=Array.isArray(q.__GEMI_DICT__)?q.__GEMI_DICT__:[];q.__GEMI_DICT__={push:x};for(let z of A)x(z)}function L(){V.clear(),X.clear(),Q.clear(),E.clear(),W.clear(),j.length=0,$.activeLocale=null}function w(){let q=new Set,x=[],A=[];return{use(z,C,B){let H=`${z} ${C}`;if(q.has(H))return;q.add(H);let J={id:z,locale:C,strings:B};if(x.length===0){A.push(J);return}for(let O of x)O(J)},onUse(z){x.push(z);while(A.length>0)z(A.shift())}}}
|
|
3
|
+
export{U as qd,Y as rd,M as sd,_ as td,D as ud,K as vd,S as wd,T as xd,L as yd,w as zd};
|
|
4
|
+
|
|
5
|
+
//# debugId=6D31999AA021699864756E2164756E21
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../i18n/dictionaryRegistry.ts", "../i18n/dictionarySink.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"/**\n * The process-wide store behind `defineDictionary`.\n *\n * Every handle registers itself here when its module is *evaluated*, not when\n * it is first rendered. That ordering is the whole point: the view router\n * already awaits a view's module import before rendering it, so by the time it\n * calls `preloadDictionaries()` every dictionary reachable from that view has\n * announced itself and can be warmed in one pass. `useDictionary` then reads\n * resolved strings synchronously and the render never suspends — on the server\n * that keeps the SSR stream from fragmenting into a reveal chunk per\n * dictionary, and on the client it keeps navigations flash-free.\n *\n * `use()` in the hook is the correctness net for what a preload pass cannot\n * see: a dictionary inside a `lazy()` subtree, or a locale switch.\n */\n\nimport type { LocaleStrings } from \"./dictionaryShape\";\n\nexport type { LocaleStrings };\n\nexport interface RegisteredDictionary {\n id: string;\n /** Locales this dictionary declares. Empty when it is not known up front. */\n locales: string[];\n load: (locale: string) => Promise<LocaleStrings> | LocaleStrings;\n}\n\ninterface RegistryState {\n /** Every handle that has been constructed, by id. */\n registry: Map<string, RegisteredDictionary>;\n /** Resolved strings: id -> locale -> strings. */\n resolved: Map<string, Map<string, LocaleStrings>>;\n /** In-flight loads, so N components sharing a dictionary share one request. */\n inFlight: Map<string, Promise<LocaleStrings>>;\n /**\n * Never-rejecting promises for the render path; see\n * `loadDictionaryForRender`. `use()` needs a stable reference, so these\n * cannot be built per render.\n */\n degraded: Map<string, Promise<LocaleStrings>>;\n /**\n * Registration order, so `preloadDictionaries` can warm only what a freshly\n * imported module added instead of re-walking every dictionary in the app on\n * every navigation.\n */\n order: string[];\n /**\n * Per locale, how far into `order` an unmarked `preloadDictionaries` has\n * already warmed. Lets the server's per-request call cost O(newly imported)\n * rather than O(every dictionary in the app).\n */\n warmed: Map<string, number>;\n /**\n * The locale currently being rendered, recorded by `useDictionary`. The\n * initial payload is in `__GEMI_DATA__`, but that snapshot is frozen at the\n * first load — after a locale switch it is stale, and the view loader needs\n * to know which locale's chunks to warm.\n */\n activeLocale: string | null;\n}\n\n/**\n * Parked on `globalThis` rather than in module scope, because this module gets\n * bundled more than once and the copies have to agree.\n *\n * gemi ships `gemi/client` from one Vite lib build and `gemi/dictionary` from a\n * separate Bun build, an SSR view graph externalizes some gemi subpaths and\n * bundles others, and a dictionary imported by both a view and a controller is\n * evaluated on both sides. Every one of those splits would otherwise produce a\n * second registry: views would register into one Map while the view router\n * preloaded and snapshotted from another, and the hydration payload would come\n * out empty. Module identity is not something this can depend on; a global key\n * is.\n */\nconst GLOBAL_KEY = \"__GEMI_DICTIONARY_REGISTRY__\";\n\nconst state: RegistryState = ((globalThis as any)[GLOBAL_KEY] ??= {\n registry: new Map(),\n resolved: new Map(),\n inFlight: new Map(),\n degraded: new Map(),\n order: [],\n warmed: new Map(),\n activeLocale: null,\n});\n\nconst { registry, resolved, inFlight, degraded, order, warmed } = state;\n\nfunction cacheKey(id: string, locale: string) {\n return `${id}\\0${locale}`;\n}\n\nexport function registerDictionary(entry: RegisteredDictionary) {\n // A dictionary module can be evaluated twice with the same id — e.g. the\n // Vite-processed copy pulled in by a view and the plain copy a controller\n // imports outside the bundler. Same id means same source literal, so the\n // first registration wins and the duplicate is a no-op rather than a reset\n // that would drop already-resolved strings.\n if (registry.has(entry.id)) {\n return;\n }\n registry.set(entry.id, entry);\n order.push(entry.id);\n}\n\n/** A marker for \"everything registered so far\", for `preloadDictionaries`. */\nexport function dictionaryRegistrationMark(): number {\n return order.length;\n}\n\nexport function getResolved(\n id: string,\n locale: string,\n): LocaleStrings | undefined {\n return resolved.get(id)?.get(locale);\n}\n\nfunction putResolved(id: string, locale: string, strings: LocaleStrings) {\n let byLocale = resolved.get(id);\n if (!byLocale) {\n byLocale = new Map();\n resolved.set(id, byLocale);\n }\n byLocale.set(locale, strings);\n}\n\n/**\n * Load one dictionary's locale, de-duplicating concurrent callers. Returns the\n * strings directly (not a promise) when they are already resolved, so the hook\n * can take a synchronous path without a microtask hop.\n */\nexport function loadDictionary(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const pending = inFlight.get(key);\n if (pending) {\n return pending;\n }\n\n const entry = registry.get(id);\n if (!entry) {\n throw new Error(\n `Unknown dictionary \"${id}\". A dictionary must be created with defineDictionary() and its module must have been evaluated before it is read.`,\n );\n }\n\n const result = entry.load(locale);\n\n // The untransformed path holds every locale in memory and answers\n // synchronously — no reason to make callers await a resolved promise.\n if (!(result instanceof Promise)) {\n putResolved(id, locale, result);\n return result;\n }\n\n const promise = result.then(\n (strings) => {\n putResolved(id, locale, strings);\n inFlight.delete(key);\n return strings;\n },\n (err) => {\n inFlight.delete(key);\n throw err;\n },\n );\n inFlight.set(key, promise);\n return promise;\n}\n\n/**\n * The same load, but as something safe to hand React's `use()`.\n *\n * A rejecting promise passed to `use()` rethrows during render, which unmounts\n * the whole route into its error boundary — or, before the shell is ready,\n * fails the server render outright. A missing locale chunk is a routine event\n * (a browser holding stale HTML after a rolling deploy requests a hashed\n * filename that no longer exists), and the deprecated `useTranslator` degraded\n * every i18n failure to rendering the raw key. This keeps that behaviour: the\n * returned promise resolves to no strings, and the per-key lookup in\n * `useDictionary` then logs and falls back to the key.\n *\n * The degraded promise is cached because `use()` requires a stable reference —\n * a fresh `.then()` per render would suspend forever. It is only consulted\n * after `getResolved` misses, so a later successful load supersedes it without\n * needing to be evicted.\n */\nexport function loadDictionaryForRender(\n id: string,\n locale: string,\n): LocaleStrings | Promise<LocaleStrings> {\n const already = getResolved(id, locale);\n if (already) {\n return already;\n }\n\n const key = cacheKey(id, locale);\n const cached = degraded.get(key);\n if (cached) {\n return cached;\n }\n\n const result = loadDictionary(id, locale);\n if (!(result instanceof Promise)) {\n return result;\n }\n\n const safe = result.then(\n (strings) => strings,\n (err) => {\n console.error(\n `Failed to load dictionary ${id} for locale ${locale}; rendering keys instead.`,\n err,\n );\n return EMPTY_STRINGS;\n },\n );\n degraded.set(key, safe);\n return safe;\n}\n\nconst EMPTY_STRINGS: LocaleStrings = {};\n\n/**\n * Warm dictionaries for `locale`, so a subsequent render reads them\n * synchronously instead of suspending.\n *\n * With a `mark` — the value taken *before* importing a view module — only that\n * view's newly announced dictionaries are loaded. That is the client's use: it\n * knows exactly which chunk just arrived.\n *\n * Without one, it resumes from where this locale last got to. The server calls\n * it per request and has no mark to give (view modules were imported long\n * before the request arrived), so a plain scan from zero would walk every\n * dictionary in the app on every request — re-deriving the per-request cost this\n * whole change exists to remove, just with a smaller constant.\n *\n * An empty `locale` means the app configured none, and each dictionary is warmed\n * under its own source language — the same key `useDictionary` will ask for, so\n * the warmed entry is the one the render actually reads.\n *\n * Failures are swallowed: a dictionary that cannot load should surface at the\n * component that actually reads it, where the error names the key, rather than\n * take down an unrelated navigation.\n */\nexport async function preloadDictionaries(locale: string, mark?: number) {\n const from = mark ?? warmed.get(locale) ?? 0;\n const ids = order.slice(from);\n if (ids.length === 0) {\n return;\n }\n\n const settled = await Promise.all(\n ids.map(async (id) => {\n try {\n await loadDictionary(id, localeFor(id, locale));\n return true;\n } catch {\n // Deliberately ignored — see above.\n return false;\n }\n }),\n );\n\n if (mark === undefined) {\n // Advanced *after* the loads settle, and only across the leading run that\n // resolved. Moving it up front — as this first did — is a correctness bug\n // twice over: a second request arriving mid-flight reads the raised mark,\n // finds an empty slice, returns immediately and then suspends on the\n // in-flight promises anyway, which is the stream fragmentation the preload\n // exists to prevent; and a swallowed failure would be marked warm and never\n // retried. Stopping at the first failure keeps \"below the watermark\" and\n // \"resolved\" the same statement.\n const firstFailure = settled.indexOf(false);\n const reached = firstFailure === -1 ? ids.length : firstFailure;\n warmed.set(locale, Math.max(warmed.get(locale) ?? 0, from + reached));\n }\n}\n\n/**\n * Which locale a given dictionary should be warmed under.\n *\n * `useDictionary` falls back to the dictionary's own source language when the\n * app has no locale configured, so the preload has to make the same choice or\n * it caches under a key no render ever reads — warming `\"\"`, then suspending on\n * `\"en-US\"` a moment later.\n */\nfunction localeFor(id: string, locale: string): string {\n if (locale) {\n return locale;\n }\n return registry.get(id)?.locales[0] ?? locale;\n}\n\n/**\n * Seed already-known strings, skipping the loader entirely. The client calls\n * this with the SSR payload before hydration so the first render matches the\n * server without a single dictionary request.\n */\nexport function seedDictionaries(\n dictionaries: Record<string, LocaleStrings> | undefined,\n locale: string,\n) {\n if (!dictionaries) {\n return;\n }\n for (const [id, strings] of Object.entries(dictionaries)) {\n putResolved(id, locale, strings);\n }\n}\n\nexport function setActiveLocale(locale: string | undefined | null) {\n if (locale) {\n state.activeLocale = locale;\n }\n}\n\nexport function getActiveLocale(): string | null {\n return state.activeLocale;\n}\n\n/**\n * Adopt strings the server streamed into the document.\n *\n * Mirrors `__GEMI_STREAM__` in `QueryManagerContext`: scripts that already ran\n * sit buffered in a plain array, and from here on `push` seeds directly. Both\n * halves are needed because dictionary scripts interleave with React's chunks —\n * a segment that reveals late carries its dictionary late too.\n *\n * Installed at module scope rather than during a render: seeding is idempotent\n * and touches no React state, and doing it here means it is already in place\n * before hydration reads anything.\n */\ntype StreamedDictionary = [id: string, locale: string, strings: LocaleStrings];\n\nif (typeof window !== \"undefined\") {\n const w = window as unknown as {\n __GEMI_DICT__?: StreamedDictionary[] | { push: (p: StreamedDictionary) => void };\n };\n const adopt = ([id, locale, strings]: StreamedDictionary) => {\n putResolved(id, locale, strings);\n };\n const buffered = Array.isArray(w.__GEMI_DICT__) ? w.__GEMI_DICT__ : [];\n w.__GEMI_DICT__ = { push: adopt };\n for (const entry of buffered) {\n adopt(entry);\n }\n}\n\n/** Test-only: drop all state so cases do not leak into one another. */\nexport function __resetDictionaryRegistry() {\n registry.clear();\n resolved.clear();\n inFlight.clear();\n degraded.clear();\n warmed.clear();\n order.length = 0;\n state.activeLocale = null;\n}\n",
|
|
6
|
+
"import type { LocaleStrings } from \"./dictionaryShape\";\n\n/**\n * Collects the dictionaries one SSR render actually read.\n *\n * Scoped per request by living in React context rather than in module state: a\n * streaming server has several renders in flight at once, so a module-level\n * collector would mix one page's dictionaries into another's payload. Context\n * is per render tree, which is exactly the boundary wanted, and it needs no\n * async-local storage to survive React's internal scheduling.\n *\n * Why stream these rather than put them in `__GEMI_DATA__`: that snapshot is\n * serialized before `renderToReadableStream` is even called, and which\n * dictionaries a page reads is only known once it has rendered. A suspended\n * segment reveals later still, long after the shell has flushed.\n *\n * The sink deliberately emits data, not markup — `streamQueryInjection` owns\n * script formatting and the `</script>`-safe encoding that goes with it.\n */\nexport interface DictionaryUse {\n id: string;\n locale: string;\n strings: LocaleStrings;\n}\n\nexport interface DictionarySink {\n /** Called during render, the first time a dictionary is read. */\n use(id: string, locale: string, strings: LocaleStrings): void;\n /** The response injector subscribes to receive uses as they happen. */\n onUse(cb: (use: DictionaryUse) => void): void;\n}\n\nexport function createDictionarySink(): DictionarySink {\n const seen = new Set<string>();\n const listeners: Array<(use: DictionaryUse) => void> = [];\n // Uses recorded before the injector subscribed — the render begins before the\n // response stream is wrapped.\n const pending: DictionaryUse[] = [];\n\n return {\n use(id, locale, strings) {\n const key = `${id} ${locale}`;\n if (seen.has(key)) return;\n seen.add(key);\n const entry: DictionaryUse = { id, locale, strings };\n if (listeners.length === 0) {\n pending.push(entry);\n return;\n }\n for (const listener of listeners) listener(entry);\n },\n onUse(cb) {\n listeners.push(cb);\n while (pending.length > 0) {\n cb(pending.shift()!);\n }\n },\n };\n}\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";AA4EA,IAAM,EAAyB,WAFZ,+BAE+C,CAChE,SAAU,IAAI,IACd,SAAU,IAAI,IACd,SAAU,IAAI,IACd,SAAU,IAAI,IACd,MAAO,CAAC,EACR,OAAQ,IAAI,IACZ,aAAc,IAChB,GAEQ,WAAU,WAAU,WAAU,WAAU,QAAO,UAAW,EAElE,SAAS,CAAQ,CAAC,EAAY,EAAgB,CAC5C,MAAO,GAAG,QAAO,IAGZ,SAAS,CAAkB,CAAC,EAA6B,CAM9D,GAAI,EAAS,IAAI,EAAM,EAAE,EACvB,OAEF,EAAS,IAAI,EAAM,GAAI,CAAK,EAC5B,EAAM,KAAK,EAAM,EAAE,EAId,SAAS,CAA0B,EAAW,CACnD,OAAO,EAAM,OAGR,SAAS,CAAW,CACzB,EACA,EAC2B,CAC3B,OAAO,EAAS,IAAI,CAAE,GAAG,IAAI,CAAM,EAGrC,SAAS,CAAW,CAAC,EAAY,EAAgB,EAAwB,CACvE,IAAI,EAAW,EAAS,IAAI,CAAE,EAC9B,GAAI,CAAC,EACH,EAAW,IAAI,IACf,EAAS,IAAI,EAAI,CAAQ,EAE3B,EAAS,IAAI,EAAQ,CAAO,EAQvB,SAAS,CAAc,CAC5B,EACA,EACwC,CACxC,IAAM,EAAU,EAAY,EAAI,CAAM,EACtC,GAAI,EACF,OAAO,EAGT,IAAM,EAAM,EAAS,EAAI,CAAM,E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,EAAG,CAC1B,EAAQ,KAAK,CAAK,EAClB,OAEF,QAAW,KAAY,EAAW,EAAS,CAAK,GAElD,KAAK,CAAC,EAAI,CACR,EAAU,KAAK,CAAE,EACjB,MAAO,EAAQ,OAAS,EACtB,EAAG,EAAQ,MAAM,CAAE,EAGzB",
|
|
9
|
+
"debugId": "6D31999AA021699864756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{Ja as J}from"./chunk-
|
|
3
|
-
export{Z as
|
|
2
|
+
import{Ja as J}from"./chunk-r06rxn19.js";import{ef as I}from"./chunk-7f5ad759.js";var Z=I((Q)=>{var K=J(),L=(b)=>{return{setHttpHandler(j){b.httpHandler=j},httpHandler(){return b.httpHandler},updateHttpClientConfig(j,w){b.httpHandler?.updateHttpClientConfig(j,w)},httpHandlerConfigs(){return b.httpHandler.httpHandlerConfigs()}}},M=(b)=>{return{httpHandler:b.httpHandler()}};class B{name;kind;values;constructor({name:b,kind:j=K.FieldPosition.HEADER,values:w=[]}){this.name=b,this.kind=j,this.values=w}add(b){this.values.push(b)}set(b){this.values=b}remove(b){this.values=this.values.filter((j)=>j!==b)}toString(){return this.values.map((b)=>b.includes(",")||b.includes(" ")?`"${b}"`:b).join(", ")}get(){return this.values}}class D{entries={};encoding;constructor({fields:b=[],encoding:j="utf-8"}){b.forEach(this.setField.bind(this)),this.encoding=j}setField(b){this.entries[b.name.toLowerCase()]=b}getField(b){return this.entries[b.toLowerCase()]}removeField(b){delete this.entries[b.toLowerCase()]}getByType(b){return Object.values(this.entries).filter((j)=>j.kind===b)}}class z{method;protocol;hostname;port;path;query;headers;username;password;fragment;body;constructor(b){this.method=b.method||"GET",this.hostname=b.hostname||"localhost",this.port=b.port,this.query=b.query||{},this.headers=b.headers||{},this.body=b.body,this.protocol=b.protocol?b.protocol.slice(-1)!==":"?`${b.protocol}:`:b.protocol:"https:",this.path=b.path?b.path.charAt(0)!=="/"?`/${b.path}`:b.path:"/",this.username=b.username,this.password=b.password,this.fragment=b.fragment}static clone(b){let j=new z({...b,headers:{...b.headers}});if(j.query)j.query=O(j.query);return j}static isInstance(b){if(!b)return!1;let j=b;return"method"in j&&"protocol"in j&&"hostname"in j&&"path"in j&&typeof j.query==="object"&&typeof j.headers==="object"}clone(){return z.clone(this)}}function O(b){return Object.keys(b).reduce((j,w)=>{let A=b[w];return{...j,[w]:Array.isArray(A)?[...A]:A}},{})}class G{statusCode;reason;headers;body;constructor(b){this.statusCode=b.statusCode,this.reason=b.reason,this.headers=b.headers||{},this.body=b.body}static isInstance(b){if(!b)return!1;let j=b;return typeof j.statusCode==="number"&&typeof j.headers==="object"}}function P(b){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(b)}Q.Field=B;Q.Fields=D;Q.HttpRequest=z;Q.HttpResponse=G;Q.getHttpHandlerExtensionConfiguration=L;Q.isValidHostname=P;Q.resolveHttpHandlerRuntimeConfig=M});
|
|
3
|
+
export{Z as Ga};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=9B5257AD6BB5E2AC64756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"'use strict';\n\nvar types = require('@smithy/types');\n\nconst getHttpHandlerExtensionConfiguration = (runtimeConfig) => {\n return {\n setHttpHandler(handler) {\n runtimeConfig.httpHandler = handler;\n },\n httpHandler() {\n return runtimeConfig.httpHandler;\n },\n updateHttpClientConfig(key, value) {\n runtimeConfig.httpHandler?.updateHttpClientConfig(key, value);\n },\n httpHandlerConfigs() {\n return runtimeConfig.httpHandler.httpHandlerConfigs();\n },\n };\n};\nconst resolveHttpHandlerRuntimeConfig = (httpHandlerExtensionConfiguration) => {\n return {\n httpHandler: httpHandlerExtensionConfiguration.httpHandler(),\n };\n};\n\nclass Field {\n name;\n kind;\n values;\n constructor({ name, kind = types.FieldPosition.HEADER, values = [] }) {\n this.name = name;\n this.kind = kind;\n this.values = values;\n }\n add(value) {\n this.values.push(value);\n }\n set(values) {\n this.values = values;\n }\n remove(value) {\n this.values = this.values.filter((v) => v !== value);\n }\n toString() {\n return this.values.map((v) => (v.includes(\",\") || v.includes(\" \") ? `\"${v}\"` : v)).join(\", \");\n }\n get() {\n return this.values;\n }\n}\n\nclass Fields {\n entries = {};\n encoding;\n constructor({ fields = [], encoding = \"utf-8\" }) {\n fields.forEach(this.setField.bind(this));\n this.encoding = encoding;\n }\n setField(field) {\n this.entries[field.name.toLowerCase()] = field;\n }\n getField(name) {\n return this.entries[name.toLowerCase()];\n }\n removeField(name) {\n delete this.entries[name.toLowerCase()];\n }\n getByType(kind) {\n return Object.values(this.entries).filter((field) => field.kind === kind);\n }\n}\n\nclass HttpRequest {\n method;\n protocol;\n hostname;\n port;\n path;\n query;\n headers;\n username;\n password;\n fragment;\n body;\n constructor(options) {\n this.method = options.method || \"GET\";\n this.hostname = options.hostname || \"localhost\";\n this.port = options.port;\n this.query = options.query || {};\n this.headers = options.headers || {};\n this.body = options.body;\n this.protocol = options.protocol\n ? options.protocol.slice(-1) !== \":\"\n ? `${options.protocol}:`\n : options.protocol\n : \"https:\";\n this.path = options.path ? (options.path.charAt(0) !== \"/\" ? `/${options.path}` : options.path) : \"/\";\n this.username = options.username;\n this.password = options.password;\n this.fragment = options.fragment;\n }\n static clone(request) {\n const cloned = new HttpRequest({\n ...request,\n headers: { ...request.headers },\n });\n if (cloned.query) {\n cloned.query = cloneQuery(cloned.query);\n }\n return cloned;\n }\n static isInstance(request) {\n if (!request) {\n return false;\n }\n const req = request;\n return (\"method\" in req &&\n \"protocol\" in req &&\n \"hostname\" in req &&\n \"path\" in req &&\n typeof req[\"query\"] === \"object\" &&\n typeof req[\"headers\"] === \"object\");\n }\n clone() {\n return HttpRequest.clone(this);\n }\n}\nfunction cloneQuery(query) {\n return Object.keys(query).reduce((carry, paramName) => {\n const param = query[paramName];\n return {\n ...carry,\n [paramName]: Array.isArray(param) ? [...param] : param,\n };\n }, {});\n}\n\nclass HttpResponse {\n statusCode;\n reason;\n headers;\n body;\n constructor(options) {\n this.statusCode = options.statusCode;\n this.reason = options.reason;\n this.headers = options.headers || {};\n this.body = options.body;\n }\n static isInstance(response) {\n if (!response)\n return false;\n const resp = response;\n return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n }\n}\n\nfunction isValidHostname(hostname) {\n const hostPattern = /^[a-z0-9][a-z0-9\\.\\-]*[a-z0-9]$/;\n return hostPattern.test(hostname);\n}\n\nexports.Field = Field;\nexports.Fields = Fields;\nexports.HttpRequest = HttpRequest;\nexports.HttpResponse = HttpResponse;\nexports.getHttpHandlerExtensionConfiguration = getHttpHandlerExtensionConfiguration;\nexports.isValidHostname = isValidHostname;\nexports.resolveHttpHandlerRuntimeConfig = resolveHttpHandlerRuntimeConfig;\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";sGAEA,FAAI,MAEE,EAAuC,CAAC,IAAkB,CAC5D,MAAO,CACH,cAAc,CAAC,EAAS,CACpB,EAAc,YAAc,GAEhC,WAAW,EAAG,CACV,OAAO,EAAc,aAEzB,sBAAsB,CAAC,EAAK,EAAO,CAC/B,EAAc,aAAa,uBAAuB,EAAK,CAAK,GAEhE,kBAAkB,EAAG,CACjB,OAAO,EAAc,YAAY,mBAAmB,EAE5D,GAEE,EAAkC,CAAC,IAAsC,CAC3E,MAAO,CACH,YAAa,EAAkC,YAAY,CAC/D,GAGJ,MAAM,CAAM,CACR,KACA,KACA,OACA,WAAW,EAAG,OAAM,OAAO,EAAM,cAAc,OAAQ,SAAS,CAAC,GAAK,CAClE,KAAK,KAAO,EACZ,KAAK,KAAO,EACZ,KAAK,OAAS,EAElB,GAAG,CAAC,EAAO,CACP,KAAK,OAAO,KAAK,CAAK,EAE1B,GAAG,CAAC,EAAQ,CACR,KAAK,OAAS,EAElB,MAAM,CAAC,EAAO,CACV,KAAK,OAAS,KAAK,OAAO,OAAO,CAAC,IAAM,IAAM,CAAK,EAEvD,QAAQ,E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"./chunk-r06rxn19.js";import{ef as _,hf as a}from"./chunk-7f5ad759.js";var I=_((b)=>{Object.defineProperty(b,"__esModule",{value:!0});b.getHomeDir=void 0;var W=a("os"),V=a("path"),x={},G=()=>{if(process&&process.geteuid)return`${process.geteuid()}`;return"DEFAULT"},U=()=>{let{HOME:e,USERPROFILE:t,HOMEPATH:r,HOMEDRIVE:o=`C:${V.sep}`}=process.env;if(e)return e;if(t)return t;if(r)return`${o}${r}`;let i=G();if(!x[i])x[i]=(0,W.homedir)();return x[i]};b.getHomeDir=U});var P=_((j)=>{Object.defineProperty(j,"__esModule",{value:!0});j.getSSOTokenFilepath=void 0;var X=a("crypto"),B=a("path"),J=I(),z=(e)=>{let r=(0,X.createHash)("sha1").update(e).digest("hex");return(0,B.join)((0,J.getHomeDir)(),".aws","sso","cache",`${r}.json`)};j.getSSOTokenFilepath=z});var R=_((C)=>{Object.defineProperty(C,"__esModule",{value:!0});C.getSSOTokenFromFile=C.tokenIntercept=void 0;var Q=a("fs/promises"),Y=P();C.tokenIntercept={};var Z=async(e)=>{if(C.tokenIntercept[e])return C.tokenIntercept[e];let t=(0,Y.getSSOTokenFilepath)(e),r=await(0,Q.readFile)(t,"utf8");return JSON.parse(r)};C.getSSOTokenFromFile=Z});var k=_((L)=>{Object.defineProperty(L,"__esModule",{value:!0});L.readFile=L.fileIntercept=L.filePromises=void 0;var ee=a("fs/promises");L.filePromises={};L.fileIntercept={};var te=(e,t)=>{if(L.fileIntercept[e]!==void 0)return L.fileIntercept[e];if(!L.filePromises[e]||t?.ignoreCache)L.filePromises[e]=(0,ee.readFile)(e,"utf8");return L.filePromises[e]};L.readFile=te});var ye=_((c)=>{var l=I(),O=P(),y=R(),g=a("path"),S=re(),f=k(),q="AWS_PROFILE",$="default",oe=(e)=>e.profile||process.env[q]||$,p=".",ie=(e)=>Object.entries(e).filter(([t])=>{let r=t.indexOf(p);if(r===-1)return!1;return Object.values(S.IniSectionType).includes(t.substring(0,r))}).reduce((t,[r,o])=>{let i=r.indexOf(p),n=r.substring(0,i)===S.IniSectionType.PROFILE?r.substring(i+1):r;return t[n]=o,t},{...e.default&&{default:e.default}}),ne="AWS_CONFIG_FILE",M=()=>process.env[ne]||g.join(l.getHomeDir(),".aws","config"),se="AWS_SHARED_CREDENTIALS_FILE",ce=()=>process.env[se]||g.join(l.getHomeDir(),".aws","credentials"),ae=/^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/,le=["__proto__","profile __proto__"],T=(e)=>{let t={},r,o;for(let i of e.split(/\r?\n/)){let n=i.split(/(^|\s)[;#]/)[0].trim();if(n[0]==="["&&n[n.length-1]==="]"){r=void 0,o=void 0;let s=n.substring(1,n.length-1),u=ae.exec(s);if(u){let[,d,,m]=u;if(Object.values(S.IniSectionType).includes(d))r=[d,m].join(p)}else r=s;if(le.includes(s))throw Error(`Found invalid profile name "${s}"`)}else if(r){let s=n.indexOf("=");if(![0,-1].includes(s)){let[u,d]=[n.substring(0,s).trim(),n.substring(s+1).trim()];if(d==="")o=u;else{if(o&&i.trimStart()===i)o=void 0;t[r]=t[r]||{};let m=o?[o,u].join(p):u;t[r][m]=d}}}}return t},A=()=>({}),K=async(e={})=>{let{filepath:t=ce(),configFilepath:r=M()}=e,o=l.getHomeDir(),i="~/",n=t;if(t.startsWith("~/"))n=g.join(o,t.slice(2));let h=r;if(r.startsWith("~/"))h=g.join(o,r.slice(2));let s=await Promise.all([f.readFile(h,{ignoreCache:e.ignoreCache}).then(T).then(ie).catch(A),f.readFile(n,{ignoreCache:e.ignoreCache}).then(T).catch(A)]);return{configFile:s[0],credentialsFile:s[1]}},pe=(e)=>Object.entries(e).filter(([t])=>t.startsWith(S.IniSectionType.SSO_SESSION+p)).reduce((t,[r,o])=>({...t,[r.substring(r.indexOf(p)+1)]:o}),{}),ue=()=>({}),fe=async(e={})=>f.readFile(e.configFilepath??M()).then(T).then(pe).catch(ue),de=(...e)=>{let t={};for(let r of e)for(let[o,i]of Object.entries(r))if(t[o]!==void 0)Object.assign(t[o],i);else t[o]=i;return t},_e=async(e)=>{let t=await K(e);return de(t.configFile,t.credentialsFile)},Fe={getFileRecord(){return f.fileIntercept},interceptFile(e,t){f.fileIntercept[e]=Promise.resolve(t)},getTokenRecord(){return y.tokenIntercept},interceptToken(e,t){y.tokenIntercept[e]=t}};c.getSSOTokenFromFile=y.getSSOTokenFromFile;c.readFile=f.readFile;c.CONFIG_PREFIX_SEPARATOR=p;c.DEFAULT_PROFILE=$;c.ENV_PROFILE=q;c.externalDataInterceptor=Fe;c.getProfileName=oe;c.loadSharedConfigFiles=K;c.loadSsoSessionData=fe;c.parseKnownFiles=_e;Object.prototype.hasOwnProperty.call(l,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:l.__proto__});Object.keys(l).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=l[e]});Object.prototype.hasOwnProperty.call(O,"__proto__")&&!Object.prototype.hasOwnProperty.call(c,"__proto__")&&Object.defineProperty(c,"__proto__",{enumerable:!0,value:O.__proto__});Object.keys(O).forEach(function(e){if(e!=="default"&&!Object.prototype.hasOwnProperty.call(c,e))c[e]=O[e]})});
|
|
3
3
|
export{ye as Ia};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=62417EB2B30DC69B64756E2164756E21
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
"'use strict';\n\nvar getHomeDir = require('./getHomeDir');\nvar getSSOTokenFilepath = require('./getSSOTokenFilepath');\nvar getSSOTokenFromFile = require('./getSSOTokenFromFile');\nvar path = require('path');\nvar types = require('@smithy/types');\nvar readFile = require('./readFile');\n\nconst ENV_PROFILE = \"AWS_PROFILE\";\nconst DEFAULT_PROFILE = \"default\";\nconst getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;\n\nconst CONFIG_PREFIX_SEPARATOR = \".\";\n\nconst getConfigData = (data) => Object.entries(data)\n .filter(([key]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n if (indexOfSeparator === -1) {\n return false;\n }\n return Object.values(types.IniSectionType).includes(key.substring(0, indexOfSeparator));\n})\n .reduce((acc, [key, value]) => {\n const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);\n const updatedKey = key.substring(0, indexOfSeparator) === types.IniSectionType.PROFILE ? key.substring(indexOfSeparator + 1) : key;\n acc[updatedKey] = value;\n return acc;\n}, {\n ...(data.default && { default: data.default }),\n});\n\nconst ENV_CONFIG_PATH = \"AWS_CONFIG_FILE\";\nconst getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"config\");\n\nconst ENV_CREDENTIALS_PATH = \"AWS_SHARED_CREDENTIALS_FILE\";\nconst getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || path.join(getHomeDir.getHomeDir(), \".aws\", \"credentials\");\n\nconst prefixKeyRegex = /^([\\w-]+)\\s([\"'])?([\\w-@\\+\\.%:/]+)\\2$/;\nconst profileNameBlockList = [\"__proto__\", \"profile __proto__\"];\nconst parseIni = (iniData) => {\n const map = {};\n let currentSection;\n let currentSubSection;\n for (const iniLine of iniData.split(/\\r?\\n/)) {\n const trimmedLine = iniLine.split(/(^|\\s)[;#]/)[0].trim();\n const isSection = trimmedLine[0] === \"[\" && trimmedLine[trimmedLine.length - 1] === \"]\";\n if (isSection) {\n currentSection = undefined;\n currentSubSection = undefined;\n const sectionName = trimmedLine.substring(1, trimmedLine.length - 1);\n const matches = prefixKeyRegex.exec(sectionName);\n if (matches) {\n const [, prefix, , name] = matches;\n if (Object.values(types.IniSectionType).includes(prefix)) {\n currentSection = [prefix, name].join(CONFIG_PREFIX_SEPARATOR);\n }\n }\n else {\n currentSection = sectionName;\n }\n if (profileNameBlockList.includes(sectionName)) {\n throw new Error(`Found invalid profile name \"${sectionName}\"`);\n }\n }\n else if (currentSection) {\n const indexOfEqualsSign = trimmedLine.indexOf(\"=\");\n if (![0, -1].includes(indexOfEqualsSign)) {\n const [name, value] = [\n trimmedLine.substring(0, indexOfEqualsSign).trim(),\n trimmedLine.substring(indexOfEqualsSign + 1).trim(),\n ];\n if (value === \"\") {\n currentSubSection = name;\n }\n else {\n if (currentSubSection && iniLine.trimStart() === iniLine) {\n currentSubSection = undefined;\n }\n map[currentSection] = map[currentSection] || {};\n const key = currentSubSection ? [currentSubSection, name].join(CONFIG_PREFIX_SEPARATOR) : name;\n map[currentSection][key] = value;\n }\n }\n }\n }\n return map;\n};\n\nconst swallowError$1 = () => ({});\nconst loadSharedConfigFiles = async (init = {}) => {\n const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;\n const homeDir = getHomeDir.getHomeDir();\n const relativeHomeDirPrefix = \"~/\";\n let resolvedFilepath = filepath;\n if (filepath.startsWith(relativeHomeDirPrefix)) {\n resolvedFilepath = path.join(homeDir, filepath.slice(2));\n }\n let resolvedConfigFilepath = configFilepath;\n if (configFilepath.startsWith(relativeHomeDirPrefix)) {\n resolvedConfigFilepath = path.join(homeDir, configFilepath.slice(2));\n }\n const parsedFiles = await Promise.all([\n readFile.readFile(resolvedConfigFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .then(getConfigData)\n .catch(swallowError$1),\n readFile.readFile(resolvedFilepath, {\n ignoreCache: init.ignoreCache,\n })\n .then(parseIni)\n .catch(swallowError$1),\n ]);\n return {\n configFile: parsedFiles[0],\n credentialsFile: parsedFiles[1],\n };\n};\n\nconst getSsoSessionData = (data) => Object.entries(data)\n .filter(([key]) => key.startsWith(types.IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR))\n .reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});\n\nconst swallowError = () => ({});\nconst loadSsoSessionData = async (init = {}) => readFile.readFile(init.configFilepath ?? getConfigFilepath())\n .then(parseIni)\n .then(getSsoSessionData)\n .catch(swallowError);\n\nconst mergeConfigFiles = (...files) => {\n const merged = {};\n for (const file of files) {\n for (const [key, values] of Object.entries(file)) {\n if (merged[key] !== undefined) {\n Object.assign(merged[key], values);\n }\n else {\n merged[key] = values;\n }\n }\n }\n return merged;\n};\n\nconst parseKnownFiles = async (init) => {\n const parsedFiles = await loadSharedConfigFiles(init);\n return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);\n};\n\nconst externalDataInterceptor = {\n getFileRecord() {\n return readFile.fileIntercept;\n },\n interceptFile(path, contents) {\n readFile.fileIntercept[path] = Promise.resolve(contents);\n },\n getTokenRecord() {\n return getSSOTokenFromFile.tokenIntercept;\n },\n interceptToken(id, contents) {\n getSSOTokenFromFile.tokenIntercept[id] = contents;\n },\n};\n\nexports.getSSOTokenFromFile = getSSOTokenFromFile.getSSOTokenFromFile;\nexports.readFile = readFile.readFile;\nexports.CONFIG_PREFIX_SEPARATOR = CONFIG_PREFIX_SEPARATOR;\nexports.DEFAULT_PROFILE = DEFAULT_PROFILE;\nexports.ENV_PROFILE = ENV_PROFILE;\nexports.externalDataInterceptor = externalDataInterceptor;\nexports.getProfileName = getProfileName;\nexports.loadSharedConfigFiles = loadSharedConfigFiles;\nexports.loadSsoSessionData = loadSsoSessionData;\nexports.parseKnownFiles = parseKnownFiles;\nObject.prototype.hasOwnProperty.call(getHomeDir, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getHomeDir['__proto__']\n });\n\nObject.keys(getHomeDir).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getHomeDir[k];\n});\nObject.prototype.hasOwnProperty.call(getSSOTokenFilepath, '__proto__') &&\n !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&\n Object.defineProperty(exports, '__proto__', {\n enumerable: true,\n value: getSSOTokenFilepath['__proto__']\n });\n\nObject.keys(getSSOTokenFilepath).forEach(function (k) {\n if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = getSSOTokenFilepath[k];\n});\n"
|
|
10
10
|
],
|
|
11
11
|
"mappings": ";+GACA,CAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,aAAkB,OAC1B,IAAM,UACA,YACA,EAAe,CAAC,EAChB,EAAqB,IAAM,CAC7B,GAAI,SAAW,QAAQ,QACnB,MAAO,GAAG,QAAQ,QAAQ,IAE9B,MAAO,WAEL,EAAa,IAAM,CACrB,IAAQ,OAAM,cAAa,WAAU,YAAY,KAAK,EAAO,OAAU,QAAQ,IAC/E,GAAI,EACA,OAAO,EACX,GAAI,EACA,OAAO,EACX,GAAI,EACA,MAAO,GAAG,IAAY,IAC1B,IAAM,EAAkB,EAAmB,EAC3C,GAAI,CAAC,EAAa,GACd,EAAa,IAAoB,EAAG,EAAK,SAAS,EACtD,OAAO,EAAa,IAEhB,aAAa,kBCxBrB,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,sBAA2B,OACnC,IAAM,cACA,YACA,MACA,EAAsB,CAAC,IAAO,CAEhC,IAAM,GADU,EAAG,EAAS,YAAY,MAAM,EACrB,OAAO,CAAE,EAAE,OAAO,KAAK,EAChD,OAAQ,EAAG,EAAO,OAAO,EAAG,EAAa,YAAY,EAAG,OAAQ,MAAO,QAAS,GAAG,QAAgB,GAE/F,sBAAsB,kBCV9B,OAAO,eAAe,EAAS,aAAc,CAAE,MAAO,EAAK,CAAC,EACpD,sBAA8B,iBAAsB,OAC5D,IAAM,mBACA,MACE,iBAAiB,CAAC,EAC1B,IAAM,EAAsB,MAAO,IAAO,CACtC,GAAY,iBAAe,GACvB,OAAe,iBAAe,GAElC,IAAM,GAAoB,EAAG,EAAsB,qBAAqB,CAAE,EACpE,EAAe,MAAO,EAAG,EAAW,UAAU,EAAkB,MAAM,EAC5E,OAAO,KAAK,MAAM,CAAY,GA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EAAU,CAC1B,EAAS,cAAc,GAAQ,QAAQ,QAAQ,CAAQ,GAE3D,cAAc,EAAG,CACb,OAAO,EAAoB,gBAE/B,cAAc,CAAC,EAAI,EAAU,CACzB,EAAoB,eAAe,GAAM,EAEjD,EAEQ,sBAAsB,EAAoB,oBAC1C,WAAW,EAAS,SACpB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,0BAA0B,GAC1B,iBAAiB,GACjB,wBAAwB,EACxB,qBAAqB,GACrB,kBAAkB,GAC1B,OAAO,UAAU,eAAe,KAAK,EAAY,WAAW,GACxD,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAW,SACtB,CAAC,EAEL,OAAO,KAAK,CAAU,EAAE,QAAQ,QAAS,CAAC,EAAG,CACzC,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAW,GACrG,EACD,OAAO,UAAU,eAAe,KAAK,EAAqB,WAAW,GACjE,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,WAAW,GAC1D,OAAO,eAAe,EAAS,YAAa,CACxC,WAAY,GACZ,MAAO,EAAoB,SAC/B,CAAC,EAEL,OAAO,KAAK,CAAmB,EAAE,QAAQ,QAAS,CAAC,EAAG,CAClD,GAAI,IAAM,WAAa,CAAC,OAAO,UAAU,eAAe,KAAK,EAAS,CAAC,EAAG,EAAQ,GAAK,EAAoB,GAC9G",
|
|
12
|
-
"debugId": "
|
|
12
|
+
"debugId": "62417EB2B30DC69B64756E2164756E21",
|
|
13
13
|
"names": []
|
|
14
14
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import{existsSync as v}from"fs";import{join as z}from"path";var A=["gemi.config.ts","gemi.config.js","gemi.config.mjs"];async function J(q=process.cwd()){for(let u of A){let b=z(q,u);if(v(b)){let k=await import(b);return k.default??k}}return{}}
|
|
3
|
-
export{J as
|
|
3
|
+
export{J as r};
|
|
4
4
|
|
|
5
|
-
//# debugId=
|
|
5
|
+
//# debugId=DE4FAB0C28987AB264756E2164756E21
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
"import { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { GemiConfig } from \"./index\";\n\nconst CONFIG_FILES = [\"gemi.config.ts\", \"gemi.config.js\", \"gemi.config.mjs\"];\n\n// Load the app's `gemi.config.*` from `rootDir`. Runs under Bun in every\n// context that needs it — the CLI, the `--preload` runtime, and the gemi Vite\n// plugin (the build runs Vite via `bun --bun`, dev via `bun --hot`) — so a\n// TypeScript config imports directly with no extra transpilation step. Returns\n// an empty config when no file is present, so config is entirely optional.\nexport async function loadGemiConfig(\n rootDir: string = process.cwd(),\n): Promise<GemiConfig> {\n for (const name of CONFIG_FILES) {\n const path = join(rootDir, name);\n if (existsSync(path)) {\n const mod = await import(path);\n return (mod.default ?? mod) as GemiConfig;\n }\n }\n return {};\n}\n"
|
|
6
6
|
],
|
|
7
7
|
"mappings": ";AAAA,qBAAS,WACT,eAAS,aAGT,IAAM,EAAe,CAAC,iBAAkB,iBAAkB,iBAAiB,EAO3E,eAAsB,CAAc,CAClC,EAAkB,QAAQ,IAAI,EACT,CACrB,QAAW,KAAQ,EAAc,CAC/B,IAAM,EAAO,EAAK,EAAS,CAAI,EAC/B,GAAI,EAAW,CAAI,EAAG,CACpB,IAAM,EAAM,MAAa,UACzB,OAAQ,EAAI,SAAW,GAG3B,MAAO,CAAC",
|
|
8
|
-
"debugId": "
|
|
8
|
+
"debugId": "DE4FAB0C28987AB264756E2164756E21",
|
|
9
9
|
"names": []
|
|
10
10
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{n as I,o as x,p as k,q as m}from"./chunk-gn9zjgep.js";import{r as p}from"./chunk-f418jh9k.js";var Hz=["gemi","gemi/client","gemi/http","gemi/app","gemi/facades","gemi/email","gemi/kernel","gemi/services","gemi/broadcasting","gemi/i18n","gemi/dictionary"];function V(z){return z==="gemi"||z.startsWith("gemi/")}var l=44,u=59,T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",y=new Uint8Array(64),d=new Uint8Array(128);for(let z=0;z<T.length;z++){let Q=T.charCodeAt(z);y[z]=Q,d[Q]=z}function U(z,Q,Z){let $=Q-Z;$=$<0?-$<<1|1:$<<1;do{let J=$&31;if($>>>=5,$>0)J|=32;z.write(y[J])}while($>0);return Q}var R=16384,b=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(z){return Buffer.from(z.buffer,z.byteOffset,z.byteLength).toString()}}:{decode(z){let Q="";for(let Z=0;Z<z.length;Z++)Q+=String.fromCharCode(z[Z]);return Q}},a=class{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(R)}write(z){let{buffer:Q}=this;if(Q[this.pos++]=z,this.pos===R)this.out+=b.decode(Q),this.pos=0}flush(){let{buffer:z,out:Q,pos:Z}=this;return Z>0?Q+b.decode(z.subarray(0,Z)):Q}};function v(z){let Q=new a,Z=0,$=0,J=0,W=0;for(let H=0;H<z.length;H++){let Y=z[H];if(H>0)Q.write(u);if(Y.length===0)continue;let F=0;for(let X=0;X<Y.length;X++){let D=Y[X];if(X>0)Q.write(l);if(F=U(Q,D[0],F),D.length===1)continue;if(Z=U(Q,D[1],Z),$=U(Q,D[2],$),J=U(Q,D[3],J),D.length===4)continue;W=U(Q,D[4],W)}}return Q.flush()}class j{constructor(z){this.bits=z instanceof j?z.bits.slice():[]}add(z){this.bits[z>>5]|=1<<(z&31)}has(z){return!!(this.bits[z>>5]&1<<(z&31))}}class K{constructor(z,Q,Z){this.start=z,this.end=Q,this.original=Z,this.intro="",this.outro="",this.content=Z,this.storeName=!1,this.edited=!1,this.previous=null,this.next=null}appendLeft(z){this.outro+=z}appendRight(z){this.intro=this.intro+z}clone(){let z=new K(this.start,this.end,this.original);return z.intro=this.intro,z.outro=this.outro,z.content=this.content,z.storeName=this.storeName,z.edited=this.edited,z}contains(z){return this.start<z&&z<this.end}eachNext(z){let Q=this;while(Q)z(Q),Q=Q.next}eachPrevious(z){let Q=this;while(Q)z(Q),Q=Q.previous}edit(z,Q,Z){if(this.content=z,!Z)this.intro="",this.outro="";return this.storeName=Q,this.edited=!0,this}prependLeft(z){this.outro=z+this.outro}prependRight(z){this.intro=z+this.intro}reset(){if(this.intro="",this.outro="",this.edited)this.content=this.original,this.storeName=!1,this.edited=!1}split(z){let Q=z-this.start,Z=this.original.slice(0,Q),$=this.original.slice(Q);this.original=Z;let J=new K(z,this.end,$);if(J.outro=this.outro,this.outro="",this.end=z,this.edited)J.edit("",!1),this.content="";else this.content=Z;if(J.next=this.next,J.next)J.next.previous=J;return J.previous=this,this.next=J,J}toString(){return this.intro+this.content+this.outro}trimEnd(z){if(this.outro=this.outro.replace(z,""),this.outro.length)return!0;let Q=this.content.replace(z,"");if(Q.length){if(Q!==this.content){if(this.split(this.start+Q.length).edit("",void 0,!0),this.edited)this.edit(Q,this.storeName,!0)}return!0}else if(this.edit("",void 0,!0),this.intro=this.intro.replace(z,""),this.intro.length)return!0}trimStart(z){if(this.intro=this.intro.replace(z,""),this.intro.length)return!0;let Q=this.content.replace(z,"");if(Q.length){if(Q!==this.content){let Z=this.split(this.end-Q.length);if(this.edited)Z.edit(Q,this.storeName,!0);this.edit("",void 0,!0)}return!0}else if(this.edit("",void 0,!0),this.outro=this.outro.replace(z,""),this.outro.length)return!0}}function s(){if(typeof globalThis<"u"&&typeof globalThis.btoa==="function")return(z)=>globalThis.btoa(unescape(encodeURIComponent(z)));else if(typeof Buffer==="function")return(z)=>Buffer.from(z,"utf-8").toString("base64");else return()=>{throw Error("Unsupported environment: `window.btoa` or `Buffer` should be supported.")}}var c=s();class f{constructor(z){if(this.version=3,this.file=z.file,this.sources=z.sources,this.sourcesContent=z.sourcesContent,this.names=z.names,this.mappings=v(z.mappings),typeof z.x_google_ignoreList<"u")this.x_google_ignoreList=z.x_google_ignoreList;if(typeof z.debugId<"u")this.debugId=z.debugId}toString(){return JSON.stringify(this)}toUrl(){return"data:application/json;charset=utf-8;base64,"+c(this.toString())}}function o(z){let Q=z.split(`
|
|
3
|
+
`),Z=Q.filter((W)=>/^\t+/.test(W)),$=Q.filter((W)=>/^ {2,}/.test(W));if(Z.length===0&&$.length===0)return null;if(Z.length>=$.length)return"\t";let J=$.reduce((W,H)=>{let Y=/^ +/.exec(H)[0].length;return Math.min(Y,W)},1/0);return Array(J+1).join(" ")}function i(z,Q){let Z=z.split(/[/\\]/),$=Q.split(/[/\\]/);Z.pop();while(Z[0]===$[0])Z.shift(),$.shift();if(Z.length){let J=Z.length;while(J--)Z[J]=".."}return Z.concat($).join("/")}var r=Object.prototype.toString;function t(z){return r.call(z)==="[object Object]"}function L(z){let Q=z.split(`
|
|
4
|
+
`),Z=[];for(let $=0,J=0;$<Q.length;$++)Z.push(J),J+=Q[$].length+1;return function(J){let W=0,H=Z.length;while(W<H){let X=W+H>>1;if(J<Z[X])H=X;else W=X+1}let Y=W-1,F=J-Z[Y];return{line:Y,column:F}}}var n=/\w/;class w{constructor(z){this.hires=z,this.generatedCodeLine=0,this.generatedCodeColumn=0,this.raw=[],this.rawSegments=this.raw[this.generatedCodeLine]=[],this.pending=null}addEdit(z,Q,Z,$){if(Q.length){let J=Q.length-1,W=Q.indexOf(`
|
|
5
|
+
`,0),H=-1;while(W>=0&&J>W){let F=[this.generatedCodeColumn,z,Z.line,Z.column];if($>=0)F.push($);this.rawSegments.push(F),this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,H=W,W=Q.indexOf(`
|
|
6
|
+
`,W+1)}let Y=[this.generatedCodeColumn,z,Z.line,Z.column];if($>=0)Y.push($);this.rawSegments.push(Y),this.advance(Q.slice(H+1))}else if(this.pending)this.rawSegments.push(this.pending),this.advance(Q);this.pending=null}addUneditedChunk(z,Q,Z,$,J){let W=Q.start,H=!0,Y=!1;while(W<Q.end){if(Z[W]===`
|
|
7
|
+
`)$.line+=1,$.column=0,this.generatedCodeLine+=1,this.raw[this.generatedCodeLine]=this.rawSegments=[],this.generatedCodeColumn=0,H=!0,Y=!1;else{if(this.hires||H||J.has(W)){let F=[this.generatedCodeColumn,z,$.line,$.column];if(this.hires==="boundary")if(n.test(Z[W])){if(!Y)this.rawSegments.push(F),Y=!0}else this.rawSegments.push(F),Y=!1;else this.rawSegments.push(F)}$.column+=1,this.generatedCodeColumn+=1,H=!1}W+=1}this.pending=null}advance(z){if(!z)return;let Q=z.split(`
|
|
8
|
+
`);if(Q.length>1){for(let Z=0;Z<Q.length-1;Z++)this.generatedCodeLine++,this.raw[this.generatedCodeLine]=this.rawSegments=[];this.generatedCodeColumn=0}this.generatedCodeColumn+=Q[Q.length-1].length}}var q=`
|
|
9
|
+
`,A={insertLeft:!1,insertRight:!1,storeName:!1};class B{constructor(z,Q={}){let Z=new K(0,z.length,z);Object.defineProperties(this,{original:{writable:!0,value:z},outro:{writable:!0,value:""},intro:{writable:!0,value:""},firstChunk:{writable:!0,value:Z},lastChunk:{writable:!0,value:Z},lastSearchedChunk:{writable:!0,value:Z},byStart:{writable:!0,value:{}},byEnd:{writable:!0,value:{}},filename:{writable:!0,value:Q.filename},indentExclusionRanges:{writable:!0,value:Q.indentExclusionRanges},sourcemapLocations:{writable:!0,value:new j},storedNames:{writable:!0,value:{}},indentStr:{writable:!0,value:void 0},ignoreList:{writable:!0,value:Q.ignoreList},offset:{writable:!0,value:Q.offset||0}}),this.byStart[0]=Z,this.byEnd[z.length]=Z}addSourcemapLocation(z){this.sourcemapLocations.add(z)}append(z){if(typeof z!=="string")throw TypeError("outro content must be a string");return this.outro+=z,this}appendLeft(z,Q){if(z=z+this.offset,typeof Q!=="string")throw TypeError("inserted content must be a string");this._split(z);let Z=this.byEnd[z];if(Z)Z.appendLeft(Q);else this.intro+=Q;return this}appendRight(z,Q){if(z=z+this.offset,typeof Q!=="string")throw TypeError("inserted content must be a string");this._split(z);let Z=this.byStart[z];if(Z)Z.appendRight(Q);else this.outro+=Q;return this}clone(){let z=new B(this.original,{filename:this.filename,offset:this.offset}),Q=this.firstChunk,Z=z.firstChunk=z.lastSearchedChunk=Q.clone();while(Q){z.byStart[Z.start]=Z,z.byEnd[Z.end]=Z;let $=Q.next,J=$&&$.clone();if(J)Z.next=J,J.previous=Z,Z=J;Q=$}if(z.lastChunk=Z,this.indentExclusionRanges)z.indentExclusionRanges=this.indentExclusionRanges.slice();return z.sourcemapLocations=new j(this.sourcemapLocations),z.intro=this.intro,z.outro=this.outro,z}generateDecodedMap(z){z=z||{};let Q=0,Z=Object.keys(this.storedNames),$=new w(z.hires),J=L(this.original);if(this.intro)$.advance(this.intro);if(this.firstChunk.eachNext((W)=>{let H=J(W.start);if(W.intro.length)$.advance(W.intro);if(W.edited)$.addEdit(Q,W.content,H,W.storeName?Z.indexOf(W.original):-1);else $.addUneditedChunk(Q,W,this.original,H,this.sourcemapLocations);if(W.outro.length)$.advance(W.outro)}),this.outro)$.advance(this.outro);return{file:z.file?z.file.split(/[/\\]/).pop():void 0,sources:[z.source?i(z.file||"",z.source):z.file||""],sourcesContent:z.includeContent?[this.original]:void 0,names:Z,mappings:$.raw,x_google_ignoreList:this.ignoreList?[Q]:void 0}}generateMap(z){return new f(this.generateDecodedMap(z))}_ensureindentStr(){if(this.indentStr===void 0)this.indentStr=o(this.original)}_getRawIndentString(){return this._ensureindentStr(),this.indentStr}getIndentString(){return this._ensureindentStr(),this.indentStr===null?"\t":this.indentStr}indent(z,Q){let Z=/^[^\r\n]/gm;if(t(z))Q=z,z=void 0;if(z===void 0)this._ensureindentStr(),z=this.indentStr||"\t";if(z==="")return this;Q=Q||{};let $={};if(Q.exclude)(typeof Q.exclude[0]==="number"?[Q.exclude]:Q.exclude).forEach((X)=>{for(let D=X[0];D<X[1];D+=1)$[D]=!0});let J=Q.indentStart!==!1,W=(F)=>{if(J)return`${z}${F}`;return J=!0,F};this.intro=this.intro.replace(Z,W);let H=0,Y=this.firstChunk;while(Y){let F=Y.end;if(Y.edited){if(!$[H]){if(Y.content=Y.content.replace(Z,W),Y.content.length)J=Y.content[Y.content.length-1]===`
|
|
10
|
+
`}}else{H=Y.start;while(H<F){if(!$[H]){let X=this.original[H];if(X===`
|
|
11
|
+
`)J=!0;else if(X!=="\r"&&J)if(J=!1,H===Y.start)Y.prependRight(z);else this._splitChunk(Y,H),Y=Y.next,Y.prependRight(z)}H+=1}}H=Y.end,Y=Y.next}return this.outro=this.outro.replace(Z,W),this}insert(){throw Error("magicString.insert(...) is deprecated. Use prependRight(...) or appendLeft(...)")}insertLeft(z,Q){if(!A.insertLeft)console.warn("magicString.insertLeft(...) is deprecated. Use magicString.appendLeft(...) instead"),A.insertLeft=!0;return this.appendLeft(z,Q)}insertRight(z,Q){if(!A.insertRight)console.warn("magicString.insertRight(...) is deprecated. Use magicString.prependRight(...) instead"),A.insertRight=!0;return this.prependRight(z,Q)}move(z,Q,Z){if(z=z+this.offset,Q=Q+this.offset,Z=Z+this.offset,Z>=z&&Z<=Q)throw Error("Cannot move a selection inside itself");this._split(z),this._split(Q),this._split(Z);let $=this.byStart[z],J=this.byEnd[Q],W=$.previous,H=J.next,Y=this.byStart[Z];if(!Y&&J===this.lastChunk)return this;let F=Y?Y.previous:this.lastChunk;if(W)W.next=H;if(H)H.previous=W;if(F)F.next=$;if(Y)Y.previous=J;if(!$.previous)this.firstChunk=J.next;if(!J.next)this.lastChunk=$.previous,this.lastChunk.next=null;if($.previous=F,J.next=Y||null,!F)this.firstChunk=$;if(!Y)this.lastChunk=J;return this}overwrite(z,Q,Z,$){return $=$||{},this.update(z,Q,Z,{...$,overwrite:!$.contentOnly})}update(z,Q,Z,$){if(z=z+this.offset,Q=Q+this.offset,typeof Z!=="string")throw TypeError("replacement content must be a string");if(this.original.length!==0){while(z<0)z+=this.original.length;while(Q<0)Q+=this.original.length}if(Q>this.original.length)throw Error("end is out of bounds");if(z===Q)throw Error("Cannot overwrite a zero-length range \u2013 use appendLeft or prependRight instead");if(this._split(z),this._split(Q),$===!0){if(!A.storeName)console.warn("The final argument to magicString.overwrite(...) should be an options object. See https://github.com/rich-harris/magic-string"),A.storeName=!0;$={storeName:!0}}let J=$!==void 0?$.storeName:!1,W=$!==void 0?$.overwrite:!1;if(J){let F=this.original.slice(z,Q);Object.defineProperty(this.storedNames,F,{writable:!0,value:!0,enumerable:!0})}let H=this.byStart[z],Y=this.byEnd[Q];if(H){let F=H;while(F!==Y){if(F.next!==this.byStart[F.end])throw Error("Cannot overwrite across a split point");F=F.next,F.edit("",!1)}H.edit(Z,J,!W)}else{let F=new K(z,Q,"").edit(Z,J);Y.next=F,F.previous=Y}return this}prepend(z){if(typeof z!=="string")throw TypeError("outro content must be a string");return this.intro=z+this.intro,this}prependLeft(z,Q){if(z=z+this.offset,typeof Q!=="string")throw TypeError("inserted content must be a string");this._split(z);let Z=this.byEnd[z];if(Z)Z.prependLeft(Q);else this.intro=Q+this.intro;return this}prependRight(z,Q){if(z=z+this.offset,typeof Q!=="string")throw TypeError("inserted content must be a string");this._split(z);let Z=this.byStart[z];if(Z)Z.prependRight(Q);else this.outro=Q+this.outro;return this}remove(z,Q){if(z=z+this.offset,Q=Q+this.offset,this.original.length!==0){while(z<0)z+=this.original.length;while(Q<0)Q+=this.original.length}if(z===Q)return this;if(z<0||Q>this.original.length)throw Error("Character is out of bounds");if(z>Q)throw Error("end must be greater than start");this._split(z),this._split(Q);let Z=this.byStart[z];while(Z)Z.intro="",Z.outro="",Z.edit(""),Z=Q>Z.end?this.byStart[Z.end]:null;return this}reset(z,Q){if(z=z+this.offset,Q=Q+this.offset,this.original.length!==0){while(z<0)z+=this.original.length;while(Q<0)Q+=this.original.length}if(z===Q)return this;if(z<0||Q>this.original.length)throw Error("Character is out of bounds");if(z>Q)throw Error("end must be greater than start");this._split(z),this._split(Q);let Z=this.byStart[z];while(Z)Z.reset(),Z=Q>Z.end?this.byStart[Z.end]:null;return this}lastChar(){if(this.outro.length)return this.outro[this.outro.length-1];let z=this.lastChunk;do{if(z.outro.length)return z.outro[z.outro.length-1];if(z.content.length)return z.content[z.content.length-1];if(z.intro.length)return z.intro[z.intro.length-1]}while(z=z.previous);if(this.intro.length)return this.intro[this.intro.length-1];return""}lastLine(){let z=this.outro.lastIndexOf(q);if(z!==-1)return this.outro.substr(z+1);let Q=this.outro,Z=this.lastChunk;do{if(Z.outro.length>0){if(z=Z.outro.lastIndexOf(q),z!==-1)return Z.outro.substr(z+1)+Q;Q=Z.outro+Q}if(Z.content.length>0){if(z=Z.content.lastIndexOf(q),z!==-1)return Z.content.substr(z+1)+Q;Q=Z.content+Q}if(Z.intro.length>0){if(z=Z.intro.lastIndexOf(q),z!==-1)return Z.intro.substr(z+1)+Q;Q=Z.intro+Q}}while(Z=Z.previous);if(z=this.intro.lastIndexOf(q),z!==-1)return this.intro.substr(z+1)+Q;return this.intro+Q}slice(z=0,Q=this.original.length-this.offset){if(z=z+this.offset,Q=Q+this.offset,this.original.length!==0){while(z<0)z+=this.original.length;while(Q<0)Q+=this.original.length}let Z="",$=this.firstChunk;while($&&($.start>z||$.end<=z)){if($.start<Q&&$.end>=Q)return Z;$=$.next}if($&&$.edited&&$.start!==z)throw Error(`Cannot use replaced character ${z} as slice start anchor.`);let J=$;while($){if($.intro&&(J!==$||$.start===z))Z+=$.intro;let W=$.start<Q&&$.end>=Q;if(W&&$.edited&&$.end!==Q)throw Error(`Cannot use replaced character ${Q} as slice end anchor.`);let H=J===$?z-$.start:0,Y=W?$.content.length+Q-$.end:$.content.length;if(Z+=$.content.slice(H,Y),$.outro&&(!W||$.end===Q))Z+=$.outro;if(W)break;$=$.next}return Z}snip(z,Q){let Z=this.clone();return Z.remove(0,z),Z.remove(Q,Z.original.length),Z}_split(z){if(this.byStart[z]||this.byEnd[z])return;let Q=this.lastSearchedChunk,Z=Q,$=z>Q.end;while(Q){if(Q.contains(z))return this._splitChunk(Q,z);if(Q=$?this.byStart[Q.end]:this.byEnd[Q.start],Q===Z)return;Z=Q}}_splitChunk(z,Q){if(z.edited&&z.content.length){let $=L(this.original)(Q);throw Error(`Cannot split a chunk that has already been edited (${$.line}:${$.column} \u2013 "${z.original}")`)}let Z=z.split(Q);if(this.byEnd[Q]=z,this.byStart[Q]=Z,this.byEnd[Z.end]=Z,z===this.lastChunk)this.lastChunk=Z;return this.lastSearchedChunk=z,!0}toString(){let z=this.intro,Q=this.firstChunk;while(Q)z+=Q.toString(),Q=Q.next;return z+this.outro}isEmpty(){let z=this.firstChunk;do if(z.intro.length&&z.intro.trim()||z.content.length&&z.content.trim()||z.outro.length&&z.outro.trim())return!1;while(z=z.next);return!0}length(){let z=this.firstChunk,Q=0;do Q+=z.intro.length+z.content.length+z.outro.length;while(z=z.next);return Q}trimLines(){return this.trim("[\\r\\n]")}trim(z){return this.trimStart(z).trimEnd(z)}trimEndAborted(z){let Q=new RegExp((z||"\\s")+"+$");if(this.outro=this.outro.replace(Q,""),this.outro.length)return!0;let Z=this.lastChunk;do{let $=Z.end,J=Z.trimEnd(Q);if(Z.end!==$){if(this.lastChunk===Z)this.lastChunk=Z.next;this.byEnd[Z.end]=Z,this.byStart[Z.next.start]=Z.next,this.byEnd[Z.next.end]=Z.next}if(J)return!0;Z=Z.previous}while(Z);return!1}trimEnd(z){return this.trimEndAborted(z),this}trimStartAborted(z){let Q=new RegExp("^"+(z||"\\s")+"+");if(this.intro=this.intro.replace(Q,""),this.intro.length)return!0;let Z=this.firstChunk;do{let $=Z.end,J=Z.trimStart(Q);if(Z.end!==$){if(Z===this.lastChunk)this.lastChunk=Z.next;this.byEnd[Z.end]=Z,this.byStart[Z.next.start]=Z.next,this.byEnd[Z.next.end]=Z.next}if(J)return!0;Z=Z.next}while(Z);return!1}trimStart(z){return this.trimStartAborted(z),this}hasChanged(){return this.original!==this.toString()}_replaceRegexp(z,Q){function Z(J,W){if(typeof Q==="string")return Q.replace(/\$(\$|&|\d+)/g,(H,Y)=>{if(Y==="$")return"$";if(Y==="&")return J[0];if(+Y<J.length)return J[+Y];return`$${Y}`});else return Q(...J,J.index,W,J.groups)}function $(J,W){let H,Y=[];while(H=J.exec(W))Y.push(H);return Y}if(z.global)$(z,this.original).forEach((W)=>{if(W.index!=null){let H=Z(W,this.original);if(H!==W[0])this.overwrite(W.index,W.index+W[0].length,H)}});else{let J=this.original.match(z);if(J&&J.index!=null){let W=Z(J,this.original);if(W!==J[0])this.overwrite(J.index,J.index+J[0].length,W)}}return this}_replaceString(z,Q){let{original:Z}=this,$=Z.indexOf(z);if($!==-1){if(typeof Q==="function")Q=Q(z,$,Z);if(z!==Q)this.overwrite($,$+z.length,Q)}return this}replace(z,Q){if(typeof z==="string")return this._replaceString(z,Q);return this._replaceRegexp(z,Q)}_replaceAllString(z,Q){let{original:Z}=this,$=z.length;for(let J=Z.indexOf(z);J!==-1;J=Z.indexOf(z,J+$)){let W=Z.slice(J,J+$),H=Q;if(typeof Q==="function")H=Q(W,J,Z);if(W!==H)this.overwrite(J,J+$,H)}return this}replaceAll(z,Q){if(typeof z==="string")return this._replaceAllString(z,Q);if(!z.global)throw TypeError("MagicString.prototype.replaceAll called with a non-global RegExp argument");return this._replaceRegexp(z,Q)}}import{parseAstAsync as e}from"vite";var C="virtual:gemi-dict/",S="\x00virtual:gemi-dict/",zz=new Set(["gemi/dictionary","gemi/client","gemi/i18n"]),Qz="gemi/dictionary";function g(){let z=new Map;return{name:"gemi-plugin-dictionary",enforce:"post",resolveId(Q){if(Q.startsWith(C))return`\x00${Q}`;return null},async load(Q){if(!Q.startsWith(S))return null;let Z=Q.slice(S.length),$=Z.lastIndexOf("/"),J=Z.slice(0,$),W=Z.slice($+1),H=z.get(J);if(!H){let F=Zz(J);if(F){try{await this.load({id:F})}catch{}H=z.get(J)}}if(!H)return this.error(`No dictionary registered for "${J}". If this persists, restart the dev server.`),null;let Y=x(H.translations,W,H.locales);return`export default ${JSON.stringify(Y)};
|
|
12
|
+
`},async transform(Q,Z){if(!Q.includes("defineDictionary"))return null;if(Z.startsWith("\x00")||Z.includes("/node_modules/"))return null;let $=await e(Q),J=new Set;for(let X of $.body){if(X.type!=="ImportDeclaration")continue;if(!zz.has(X.source?.value))continue;for(let D of X.specifiers??[])if(D.type==="ImportSpecifier"&&D.imported?.name==="defineDictionary")J.add(D.local.name)}let W=[],H=0;if(N($,(X)=>{if(X.type!=="CallExpression")return;let D=X.callee;if(D?.type==="Identifier"&&J.has(D.name)){W.push(X);return}if((D?.type==="Identifier"?D.name:D?.type==="MemberExpression"&&!D.computed?D.property?.name:void 0)==="defineDictionary")H++}),H>0&&Wz($,"defineDictionary"))H=0;if(H>0)this.warn(`${Z}: ${H} defineDictionary() call(s) could not be traced to an import of "gemi/dictionary", "gemi/client" or "gemi/i18n", so their locales were left inline and will all ship to the browser. Import defineDictionary directly by name rather than through a namespace import or a local re-export.`);if(W.length===0)return null;let Y=new B(Q),F=!1;for(let X of W){if(X.arguments?.length<1||X.arguments?.length>2)this.error({message:"defineDictionary() takes an object literal and an optional options object.",pos:X.start});let D=$z(X.arguments[0],(G)=>this.error({message:G,pos:X.arguments[0]?.start??X.start})),_=Jz(X.arguments[1],(G)=>this.error({message:G,pos:X.arguments[1]?.start??X.start})),O=m(D),M=`${Buffer.from(Z).toString("base64url")}/${O}`,P=I(D,_);if(P.length===0)this.error({message:'defineDictionary() declares no locales \u2014 every key needs at least one "<locale>": "<string>" entry.',pos:X.start});if(!_){let G=k(D);if(G)this.error({message:`defineDictionary() cannot infer a source language. Key "${G.againstKey}" lists "${G.againstFirst}" first but "${G.key}" lists "${G.first}" first, so the locale every key falls back to depends on the order `+"they are written in \u2014 moving one key would change what language a reader sees. "+'Pass { sourceLocale: "<locale>" } as the second argument to pin it.',pos:X.start})}z.set(M,{id:O,locales:P,translations:D});let h=P.map((G)=>`${JSON.stringify(G)}:()=>import(${JSON.stringify(`${C}${M}/${G}`)})`).join(",");Y.overwrite(X.start,X.end,`__gemi_dict__(${JSON.stringify(O)},{${h}})`),F=!0}if(!F)return null;return Y.append(`
|
|
13
|
+
import { __gemi_dict__ } from ${JSON.stringify(Qz)};
|
|
14
|
+
`),{code:Y.toString(),map:Y.generateMap({hires:!0})}}}}function Zz(z){let Q=z.indexOf("/");if(Q===-1)return null;try{return Buffer.from(z.slice(0,Q),"base64url").toString("utf8")}catch{return null}}function $z(z,Q){if(z?.type!=="ObjectExpression")Q("defineDictionary() needs an inline object literal \u2014 it is read at build time, so a variable or spread cannot be resolved.");let Z={};for(let $ of z.properties){let J=E($);if(J===null)Q("defineDictionary() keys must be plain string keys \u2014 computed keys and spreads cannot be read at build time.");if($.value?.type!=="ObjectExpression")Q(`defineDictionary() entry "${J}" must be an object of "<locale>": "<string>" pairs.`);let W={};for(let H of $.value.properties){let Y=E(H);if(Y===null)Q(`defineDictionary() entry "${J}" has a locale key that cannot be read at build time.`);let F=H.value;if(F?.type!=="Literal"||typeof F.value!=="string")Q(`defineDictionary() entry "${J}" locale "${Y}" must be a string literal. Use {{param}} interpolation instead of a template literal or a function.`);W[Y]=F.value}Z[J]=W}return Z}function Jz(z,Q){if(z===void 0)return;if(z.type!=="ObjectExpression")Q("defineDictionary() options must be an inline object literal \u2014 it is read at build time.");for(let Z of z.properties){if(E(Z)!=="sourceLocale")continue;let $=Z.value;if($?.type!=="Literal"||typeof $.value!=="string")Q("defineDictionary() sourceLocale must be a string literal.");return $.value}return}function Wz(z,Q){let Z=!1;return N(z,($)=>{if(Z)return;if($.type==="FunctionDeclaration"&&$.id?.name===Q)Z=!0;if($.type==="VariableDeclarator"&&$.id?.name===Q)Z=!0}),Z}function E(z){if(z?.type!=="Property"||z.computed)return null;if(z.key?.type==="Identifier")return z.key.name;if(z.key?.type==="Literal"&&typeof z.key.value==="string")return z.key.value;return null}function N(z,Q){if(z===null||typeof z!=="object")return;if(Array.isArray(z)){for(let Z of z)N(Z,Q);return}if(typeof z.type==="string")Q(z);for(let Z of Object.keys(z)){if(Z==="parent")continue;let $=z[Z];if($&&typeof $==="object")N($,Q)}}var Yz=async()=>{let z=await p(process.cwd()),{plugins:Q=[],...Z}=z.vite??{};return[{name:"gemi-plugin-config",enforce:"pre",config:async($,J)=>{let W=`${process.cwd()}/app`;return{assetsInclude:["/public"],build:{manifest:!0,ssrEmitAssets:!0,sourcemap:!0,rollupOptions:{input:Array.from(JSON.parse(process.env.GEMI_INPUT??"[]")),preserveEntrySignatures:"strict",...J.isSsrBuild?{external:V}:{}}},resolve:{alias:{"@/app":W}}}}},{name:"gemi-plugin-user-config",config:()=>Z},{name:"gemi-plugin-hot-reload",handleHotUpdate({server:$,modules:J}){if(J?.[0]?.id?.includes("/app/http/"))return[]}},...Q,g()]},Pz=Yz;
|
|
15
|
+
export{Hz as l,Pz as m};
|
|
16
|
+
|
|
17
|
+
//# debugId=33BA1C41A141A92F64756E2164756E21
|