@spaceandtimelabs/makeinfinite-ui 0.64.0 → 0.65.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/index.d.ts CHANGED
@@ -167,7 +167,8 @@ declare type APIHandlerType = ReturnType<typeof APIHandler>;
167
167
 
168
168
  export declare const APIProxyHandler: (baseUrl: string, projectHmac?: string) => {
169
169
  getSecrets: () => Promise<Response>;
170
- putSecret: (secretReference: string, secret: Omit<Secret, "creator_user_id" | "secret_reference">) => Promise<Response>;
170
+ putSecret: (secretReference: string, secret: SecretProperties) => Promise<Response>;
171
+ patchSecret: (secretReference: string, secret: SecretProperties) => Promise<Response>;
171
172
  getSecret: (secretReference: string) => Promise<Response>;
172
173
  deleteSecret: (secretReference: string) => Promise<Response>;
173
174
  getAllTierKeyMaps: () => Promise<Response>;
@@ -1229,13 +1230,11 @@ declare const ScrollArea: ForwardRefExoticComponent<Omit<ScrollArea_2.ScrollArea
1229
1230
  declare const ScrollBar: ForwardRefExoticComponent<Omit<ScrollArea_2.ScrollAreaScrollbarProps & RefAttributes<HTMLDivElement>, "ref"> & RefAttributes<HTMLDivElement>>;
1230
1231
 
1231
1232
  /** Represents a secret configuration for API access */
1232
- export declare type Secret = {
1233
- creator_user_id: string;
1234
- api_domain: string;
1235
- api_path_prefix: string;
1236
- auth_header_key: string;
1237
- auth_header_value: string;
1238
- secret_reference: string;
1233
+ export declare type SecretProperties = {
1234
+ api_domain?: string;
1235
+ api_path_prefix?: string;
1236
+ auth_header_key?: string;
1237
+ auth_header_value?: string;
1239
1238
  };
1240
1239
 
1241
1240
  declare const Select: FC<Select_2.SelectProps>;
@@ -89296,15 +89296,15 @@ const cke = (e) => {
89296
89296
  })
89297
89297
  };
89298
89298
  }, _fe = (e, t) => {
89299
- const n = e, r = (S = !1, C) => {
89300
- const I = {
89299
+ const n = e, r = (C = !1, I) => {
89300
+ const A = {
89301
89301
  "Content-Type": "application/json"
89302
89302
  };
89303
- if (S) {
89304
- const A = C || t;
89305
- A && (I["x-sxt-project-hmac"] = A);
89303
+ if (C) {
89304
+ const T = I || t;
89305
+ T && (A["x-sxt-project-hmac"] = T);
89306
89306
  }
89307
- return I;
89307
+ return A;
89308
89308
  };
89309
89309
  return {
89310
89310
  // Secrets
@@ -89312,16 +89312,21 @@ const cke = (e) => {
89312
89312
  method: "GET",
89313
89313
  headers: r(!1)
89314
89314
  }),
89315
- putSecret: async (S, C) => await fetch(`${n}/config/secrets/${S}`, {
89315
+ putSecret: async (C, I) => await fetch(`${n}/config/secrets/${C}`, {
89316
89316
  method: "PUT",
89317
89317
  headers: r(!1),
89318
- body: JSON.stringify(C)
89318
+ body: JSON.stringify(I)
89319
89319
  }),
89320
- getSecret: async (S) => await fetch(`${n}/config/secrets/${S}`, {
89320
+ patchSecret: async (C, I) => await fetch(`${n}/config/secrets/${C}`, {
89321
+ method: "PATCH",
89322
+ headers: r(!1),
89323
+ body: JSON.stringify(I)
89324
+ }),
89325
+ getSecret: async (C) => await fetch(`${n}/config/secrets/${C}`, {
89321
89326
  method: "GET",
89322
89327
  headers: r(!1)
89323
89328
  }),
89324
- deleteSecret: async (S) => await fetch(`${n}/config/secrets/${S}`, {
89329
+ deleteSecret: async (C) => await fetch(`${n}/config/secrets/${C}`, {
89325
89330
  method: "DELETE",
89326
89331
  headers: r(!1)
89327
89332
  }),
@@ -89334,121 +89339,121 @@ const cke = (e) => {
89334
89339
  // No HMAC needed for wildcard
89335
89340
  }
89336
89341
  ),
89337
- getTierKeyMap: async (S, C) => await fetch(
89338
- `${n}/config/miniapps/${S}/tier-key-map`,
89342
+ getTierKeyMap: async (C, I) => await fetch(
89343
+ `${n}/config/miniapps/${C}/tier-key-map`,
89339
89344
  {
89340
89345
  method: "GET",
89341
- headers: r(!0, C)
89346
+ headers: r(!0, I)
89342
89347
  }
89343
89348
  ),
89344
- putTierKeyMap: async (S, C, I, A) => await fetch(
89345
- `${n}/config/miniapps/${S}/tier-key-map/${C}`,
89349
+ putTierKeyMap: async (C, I, A, T) => await fetch(
89350
+ `${n}/config/miniapps/${C}/tier-key-map/${I}`,
89346
89351
  {
89347
89352
  method: "PUT",
89348
- headers: r(!0, A),
89349
- body: JSON.stringify({ secret_reference: I })
89353
+ headers: r(!0, T),
89354
+ body: JSON.stringify({ secret_reference: A })
89350
89355
  }
89351
89356
  ),
89352
- getTierKeyMapForTier: async (S, C, I) => await fetch(
89353
- `${n}/config/miniapps/${S}/tier-key-map/${C}`,
89357
+ getTierKeyMapForTier: async (C, I, A) => await fetch(
89358
+ `${n}/config/miniapps/${C}/tier-key-map/${I}`,
89354
89359
  {
89355
89360
  method: "GET",
89356
- headers: r(!0, I)
89361
+ headers: r(!0, A)
89357
89362
  }
89358
89363
  ),
89359
- deleteTierKeyMap: async (S, C, I, A) => await fetch(
89360
- `${n}/config/miniapps/${S}/tier-key-map/${C}/${I}`,
89364
+ deleteTierKeyMap: async (C, I, A, T) => await fetch(
89365
+ `${n}/config/miniapps/${C}/tier-key-map/${I}/${A}`,
89361
89366
  {
89362
89367
  method: "DELETE",
89363
- headers: r(!0, A)
89368
+ headers: r(!0, T)
89364
89369
  }
89365
89370
  ),
89366
89371
  // Tier Assignments
89367
- getTierAssignments: async (S, C) => await fetch(
89368
- `${n}/config/miniapps/${S}/assignments`,
89372
+ getTierAssignments: async (C, I) => await fetch(
89373
+ `${n}/config/miniapps/${C}/assignments`,
89369
89374
  {
89370
89375
  method: "GET",
89371
- headers: r(!0, C)
89376
+ headers: r(!0, I)
89372
89377
  }
89373
89378
  ),
89374
- putTierAssignment: async (S, C, I, A) => await fetch(
89375
- `${n}/config/miniapps/${S}/assignments/${C}`,
89379
+ putTierAssignment: async (C, I, A, T) => await fetch(
89380
+ `${n}/config/miniapps/${C}/assignments/${I}`,
89376
89381
  {
89377
89382
  method: "PUT",
89378
- headers: r(!0, A),
89379
- body: JSON.stringify({ tier: I })
89383
+ headers: r(!0, T),
89384
+ body: JSON.stringify({ tier: A })
89380
89385
  }
89381
89386
  ),
89382
- getTierAssignment: async (S, C, I) => await fetch(
89383
- `${n}/config/miniapps/${S}/assignments/${C}`,
89387
+ getTierAssignment: async (C, I, A) => await fetch(
89388
+ `${n}/config/miniapps/${C}/assignments/${I}`,
89384
89389
  {
89385
89390
  method: "GET",
89386
- headers: r(!0, I)
89391
+ headers: r(!0, A)
89387
89392
  }
89388
89393
  ),
89389
- deleteTierAssignment: async (S, C, I) => await fetch(
89390
- `${n}/config/miniapps/${S}/assignments/${C}`,
89394
+ deleteTierAssignment: async (C, I, A) => await fetch(
89395
+ `${n}/config/miniapps/${C}/assignments/${I}`,
89391
89396
  {
89392
89397
  method: "DELETE",
89393
- headers: r(!0, I)
89398
+ headers: r(!0, A)
89394
89399
  }
89395
89400
  ),
89396
89401
  // Rate Limits
89397
- getRateLimits: async (S, C) => await fetch(
89398
- `${n}/config/miniapps/${S}/rate-limits`,
89402
+ getRateLimits: async (C, I) => await fetch(
89403
+ `${n}/config/miniapps/${C}/rate-limits`,
89399
89404
  {
89400
89405
  method: "GET",
89401
- headers: r(!0, C)
89406
+ headers: r(!0, I)
89402
89407
  }
89403
89408
  ),
89404
- putRateLimit: async (S, C, I, A, T) => await fetch(
89405
- `${n}/config/miniapps/${S}/rate-limits/${C}/${I}`,
89409
+ putRateLimit: async (C, I, A, T, N) => await fetch(
89410
+ `${n}/config/miniapps/${C}/rate-limits/${I}/${A}`,
89406
89411
  {
89407
89412
  method: "PUT",
89408
- headers: r(!0, T),
89409
- body: JSON.stringify(A)
89413
+ headers: r(!0, N),
89414
+ body: JSON.stringify(T)
89410
89415
  }
89411
89416
  ),
89412
- getRateLimit: async (S, C, I, A) => await fetch(
89413
- `${n}/config/miniapps/${S}/rate-limits/${C}/${I}`,
89417
+ getRateLimit: async (C, I, A, T) => await fetch(
89418
+ `${n}/config/miniapps/${C}/rate-limits/${I}/${A}`,
89414
89419
  {
89415
89420
  method: "GET",
89416
- headers: r(!0, A)
89421
+ headers: r(!0, T)
89417
89422
  }
89418
89423
  ),
89419
- deleteRateLimit: async (S, C, I, A) => await fetch(
89420
- `${n}/config/miniapps/${S}/rate-limits/${C}/${I}`,
89424
+ deleteRateLimit: async (C, I, A, T) => await fetch(
89425
+ `${n}/config/miniapps/${C}/rate-limits/${I}/${A}`,
89421
89426
  {
89422
89427
  method: "DELETE",
89423
- headers: r(!0, A)
89428
+ headers: r(!0, T)
89424
89429
  }
89425
89430
  ),
89426
89431
  // Proxy
89427
- createProxyFetch: (S) => async (C, I) => {
89428
- const A = C instanceof URL ? C : new URL(C.toString());
89432
+ createProxyFetch: (C) => async (I, A) => {
89433
+ const T = I instanceof URL ? I : new URL(I.toString());
89429
89434
  return await fetch(
89430
- `${n}/proxy/${S.miniappName}/${A.host}${A.pathname}${A.search}${A.hash}`,
89431
- I
89435
+ `${n}/proxy/${C.miniappName}/${T.host}${T.pathname}${T.search}${T.hash}`,
89436
+ A
89432
89437
  );
89433
89438
  },
89434
- createProxyGetView: (S) => {
89435
- const C = new URL(S.gwProxyUrl).hostname;
89436
- return async (I, A, T = {}) => {
89437
- let N = `SELECT * FROM ${I}.${A}`;
89438
- T && Object.keys(T).length > 0 && (N += `(${Object.entries(T).map(([O, F]) => `'${O}=${F}'`).join(",")})`);
89439
- const E = await fetch(
89440
- `${n}/proxy/${S.miniappName}/${C}/v1/sql/no-injected-authz`,
89439
+ createProxyGetView: (C) => {
89440
+ const I = new URL(C.gwProxyUrl).hostname;
89441
+ return async (A, T, N = {}) => {
89442
+ let E = `SELECT * FROM ${A}.${T}`;
89443
+ N && Object.keys(N).length > 0 && (E += `(${Object.entries(N).map(([F, B]) => `'${F}=${B}'`).join(",")})`);
89444
+ const R = await fetch(
89445
+ `${n}/proxy/${C.miniappName}/${I}/v1/sql/no-injected-authz`,
89441
89446
  {
89442
89447
  method: "POST",
89443
89448
  headers: r(!1),
89444
89449
  body: JSON.stringify({
89445
- sqlText: N
89450
+ sqlText: E
89446
89451
  })
89447
89452
  }
89448
89453
  );
89449
- if (!E.ok)
89450
- throw new Error(`Failed to fetch view: ${E.statusText}`);
89451
- return await E.json();
89454
+ if (!R.ok)
89455
+ throw new Error(`Failed to fetch view: ${R.statusText}`);
89456
+ return await R.json();
89452
89457
  };
89453
89458
  }
89454
89459
  };
@@ -8072,7 +8072,7 @@ object-assign
8072
8072
  */var Mr=typeof Symbol=="function"&&Symbol.for,_Q=Mr?Symbol.for("react.element"):60103,wQ=Mr?Symbol.for("react.portal"):60106,mj=Mr?Symbol.for("react.fragment"):60107,_j=Mr?Symbol.for("react.strict_mode"):60108,wj=Mr?Symbol.for("react.profiler"):60114,bj=Mr?Symbol.for("react.provider"):60109,kj=Mr?Symbol.for("react.context"):60110,bQ=Mr?Symbol.for("react.async_mode"):60111,xj=Mr?Symbol.for("react.concurrent_mode"):60111,Sj=Mr?Symbol.for("react.forward_ref"):60112,Mj=Mr?Symbol.for("react.suspense"):60113,Git=Mr?Symbol.for("react.suspense_list"):60120,Cj=Mr?Symbol.for("react.memo"):60115,Nj=Mr?Symbol.for("react.lazy"):60116,Wit=Mr?Symbol.for("react.block"):60121,Uit=Mr?Symbol.for("react.fundamental"):60117,Yit=Mr?Symbol.for("react.responder"):60118,Xit=Mr?Symbol.for("react.scope"):60119;function Ja(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case _Q:switch(e=e.type,e){case bQ:case xj:case mj:case wj:case _j:case Mj:return e;default:switch(e=e&&e.$$typeof,e){case kj:case Sj:case Nj:case Cj:case bj:return e;default:return t}}case wQ:return t}}}function R_e(e){return Ja(e)===xj}pn.AsyncMode=bQ,pn.ConcurrentMode=xj,pn.ContextConsumer=kj,pn.ContextProvider=bj,pn.Element=_Q,pn.ForwardRef=Sj,pn.Fragment=mj,pn.Lazy=Nj,pn.Memo=Cj,pn.Portal=wQ,pn.Profiler=wj,pn.StrictMode=_j,pn.Suspense=Mj,pn.isAsyncMode=function(e){return R_e(e)||Ja(e)===bQ},pn.isConcurrentMode=R_e,pn.isContextConsumer=function(e){return Ja(e)===kj},pn.isContextProvider=function(e){return Ja(e)===bj},pn.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===_Q},pn.isForwardRef=function(e){return Ja(e)===Sj},pn.isFragment=function(e){return Ja(e)===mj},pn.isLazy=function(e){return Ja(e)===Nj},pn.isMemo=function(e){return Ja(e)===Cj},pn.isPortal=function(e){return Ja(e)===wQ},pn.isProfiler=function(e){return Ja(e)===wj},pn.isStrictMode=function(e){return Ja(e)===_j},pn.isSuspense=function(e){return Ja(e)===Mj},pn.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===mj||e===xj||e===wj||e===_j||e===Mj||e===Git||typeof e=="object"&&e!==null&&(e.$$typeof===Nj||e.$$typeof===Cj||e.$$typeof===bj||e.$$typeof===kj||e.$$typeof===Sj||e.$$typeof===Uit||e.$$typeof===Yit||e.$$typeof===Xit||e.$$typeof===Wit)},pn.typeOf=Ja,P_e.exports=pn;var kQ=P_e.exports;function Zit(e){function t(Q,G,te,ce,ee){for(var he=0,Z=0,se=0,fe=0,oe,ae,X=0,U=0,le,me=le=oe=0,_e=0,Y=0,ie=0,de=0,Ie=te.length,ye=Ie-1,xe,Le="",Fe="",Tt="",q="",E;_e<Ie;){if(ae=te.charCodeAt(_e),_e===ye&&Z+fe+se+he!==0&&(Z!==0&&(ae=Z===47?10:47),fe=se=he=0,Ie++,ye++),Z+fe+se+he===0){if(_e===ye&&(0<Y&&(Le=Le.replace(h,"")),0<Le.trim().length)){switch(ae){case 32:case 9:case 59:case 13:case 10:break;default:Le+=te.charAt(_e)}ae=59}switch(ae){case 123:for(Le=Le.trim(),oe=Le.charCodeAt(0),le=1,de=++_e;_e<Ie;){switch(ae=te.charCodeAt(_e)){case 123:le++;break;case 125:le--;break;case 47:switch(ae=te.charCodeAt(_e+1)){case 42:case 47:e:{for(me=_e+1;me<ye;++me)switch(te.charCodeAt(me)){case 47:if(ae===42&&te.charCodeAt(me-1)===42&&_e+2!==me){_e=me+1;break e}break;case 10:if(ae===47){_e=me+1;break e}}_e=me}}break;case 91:ae++;case 40:ae++;case 34:case 39:for(;_e++<ye&&te.charCodeAt(_e)!==ae;);}if(le===0)break;_e++}switch(le=te.substring(de,_e),oe===0&&(oe=(Le=Le.replace(d,"").trim()).charCodeAt(0)),oe){case 64:switch(0<Y&&(Le=Le.replace(h,"")),ae=Le.charCodeAt(1),ae){case 100:case 109:case 115:case 45:Y=G;break;default:Y=B}if(le=t(G,Y,le,ae,ee+1),de=le.length,0<z&&(Y=n(B,Le,ie),E=s(3,le,Y,G,T,P,de,ae,ee,ce),Le=Y.join(""),E!==void 0&&(de=(le=E.trim()).length)===0&&(ae=0,le="")),0<de)switch(ae){case 115:Le=Le.replace(x,o);case 100:case 109:case 45:le=Le+"{"+le+"}";break;case 107:Le=Le.replace(m,"$1 $2"),le=Le+"{"+le+"}",le=O===1||O===2&&i("@"+le,3)?"@-webkit-"+le+"@"+le:"@"+le;break;default:le=Le+le,ce===112&&(le=(Fe+=le,""))}else le="";break;default:le=t(G,n(G,Le,ie),le,ce,ee+1)}Tt+=le,le=ie=Y=me=oe=0,Le="",ae=te.charCodeAt(++_e);break;case 125:case 59:if(Le=(0<Y?Le.replace(h,""):Le).trim(),1<(de=Le.length))switch(me===0&&(oe=Le.charCodeAt(0),oe===45||96<oe&&123>oe)&&(de=(Le=Le.replace(" ",":")).length),0<z&&(E=s(1,Le,G,Q,T,P,Fe.length,ce,ee,ce))!==void 0&&(de=(Le=E.trim()).length)===0&&(Le="\0\0"),oe=Le.charCodeAt(0),ae=Le.charCodeAt(1),oe){case 0:break;case 64:if(ae===105||ae===99){q+=Le+te.charAt(_e);break}default:Le.charCodeAt(de-1)!==58&&(Fe+=a(Le,oe,ae,Le.charCodeAt(2)))}ie=Y=me=oe=0,Le="",ae=te.charCodeAt(++_e)}}switch(ae){case 13:case 10:Z===47?Z=0:1+oe===0&&ce!==107&&0<Le.length&&(Y=1,Le+="\0"),0<z*H&&s(0,Le,G,Q,T,P,Fe.length,ce,ee,ce),P=1,T++;break;case 59:case 125:if(Z+fe+se+he===0){P++;break}default:switch(P++,xe=te.charAt(_e),ae){case 9:case 32:if(fe+he+Z===0)switch(X){case 44:case 58:case 9:case 32:xe="";break;default:ae!==32&&(xe=" ")}break;case 0:xe="\\0";break;case 12:xe="\\f";break;case 11:xe="\\v";break;case 38:fe+Z+he===0&&(Y=ie=1,xe="\f"+xe);break;case 108:if(fe+Z+he+$===0&&0<me)switch(_e-me){case 2:X===112&&te.charCodeAt(_e-3)===58&&($=X);case 8:U===111&&($=U)}break;case 58:fe+Z+he===0&&(me=_e);break;case 44:Z+se+fe+he===0&&(Y=1,xe+="\r");break;case 34:case 39:Z===0&&(fe=fe===ae?0:fe===0?ae:fe);break;case 91:fe+Z+se===0&&he++;break;case 93:fe+Z+se===0&&he--;break;case 41:fe+Z+he===0&&se--;break;case 40:if(fe+Z+he===0){if(oe===0)switch(2*X+3*U){case 533:break;default:oe=1}se++}break;case 64:Z+se+fe+he+me+le===0&&(le=1);break;case 42:case 47:if(!(0<fe+he+se))switch(Z){case 0:switch(2*ae+3*te.charCodeAt(_e+1)){case 235:Z=47;break;case 220:de=_e,Z=42}break;case 42:ae===47&&X===42&&de+2!==_e&&(te.charCodeAt(de+2)===33&&(Fe+=te.substring(de,_e+1)),xe="",Z=0)}}Z===0&&(Le+=xe)}U=X,X=ae,_e++}if(de=Fe.length,0<de){if(Y=G,0<z&&(E=s(2,Fe,Y,Q,T,P,de,ce,ee,ce),E!==void 0&&(Fe=E).length===0))return q+Fe+Tt;if(Fe=Y.join(",")+"{"+Fe+"}",O*$!==0){switch(O!==2||i(Fe,2)||($=0),$){case 111:Fe=Fe.replace(b,":-moz-$1")+Fe;break;case 112:Fe=Fe.replace(_,"::-webkit-input-$1")+Fe.replace(_,"::-moz-$1")+Fe.replace(_,":-ms-input-$1")+Fe}$=0}}return q+Fe+Tt}function n(Q,G,te){var ce=G.trim().split(y);G=ce;var ee=ce.length,he=Q.length;switch(he){case 0:case 1:var Z=0;for(Q=he===0?"":Q[0]+" ";Z<ee;++Z)G[Z]=r(Q,G[Z],te).trim();break;default:var se=Z=0;for(G=[];Z<ee;++Z)for(var fe=0;fe<he;++fe)G[se++]=r(Q[fe]+" ",ce[Z],te).trim()}return G}function r(Q,G,te){var ce=G.charCodeAt(0);switch(33>ce&&(ce=(G=G.trim()).charCodeAt(0)),ce){case 38:return G.replace(g,"$1"+Q.trim());case 58:return Q.trim()+G.replace(g,"$1"+Q.trim());default:if(0<1*te&&0<G.indexOf("\f"))return G.replace(g,(Q.charCodeAt(0)===58?"":"$1")+Q.trim())}return Q+G}function a(Q,G,te,ce){var ee=Q+";",he=2*G+3*te+4*ce;if(he===944){Q=ee.indexOf(":",9)+1;var Z=ee.substring(Q,ee.length-1).trim();return Z=ee.substring(0,Q).trim()+Z+";",O===1||O===2&&i(Z,1)?"-webkit-"+Z+Z:Z}if(O===0||O===2&&!i(ee,1))return ee;switch(he){case 1015:return ee.charCodeAt(10)===97?"-webkit-"+ee+ee:ee;case 951:return ee.charCodeAt(3)===116?"-webkit-"+ee+ee:ee;case 963:return ee.charCodeAt(5)===110?"-webkit-"+ee+ee:ee;case 1009:if(ee.charCodeAt(4)!==100)break;case 969:case 942:return"-webkit-"+ee+ee;case 978:return"-webkit-"+ee+"-moz-"+ee+ee;case 1019:case 983:return"-webkit-"+ee+"-moz-"+ee+"-ms-"+ee+ee;case 883:if(ee.charCodeAt(8)===45)return"-webkit-"+ee+ee;if(0<ee.indexOf("image-set(",11))return ee.replace(A,"$1-webkit-$2")+ee;break;case 932:if(ee.charCodeAt(4)===45)switch(ee.charCodeAt(5)){case 103:return"-webkit-box-"+ee.replace("-grow","")+"-webkit-"+ee+"-ms-"+ee.replace("grow","positive")+ee;case 115:return"-webkit-"+ee+"-ms-"+ee.replace("shrink","negative")+ee;case 98:return"-webkit-"+ee+"-ms-"+ee.replace("basis","preferred-size")+ee}return"-webkit-"+ee+"-ms-"+ee+ee;case 964:return"-webkit-"+ee+"-ms-flex-"+ee+ee;case 1023:if(ee.charCodeAt(8)!==99)break;return Z=ee.substring(ee.indexOf(":",15)).replace("flex-","").replace("space-between","justify"),"-webkit-box-pack"+Z+"-webkit-"+ee+"-ms-flex-pack"+Z+ee;case 1005:return p.test(ee)?ee.replace(f,":-webkit-")+ee.replace(f,":-moz-")+ee:ee;case 1e3:switch(Z=ee.substring(13).trim(),G=Z.indexOf("-")+1,Z.charCodeAt(0)+Z.charCodeAt(G)){case 226:Z=ee.replace(k,"tb");break;case 232:Z=ee.replace(k,"tb-rl");break;case 220:Z=ee.replace(k,"lr");break;default:return ee}return"-webkit-"+ee+"-ms-"+Z+ee;case 1017:if(ee.indexOf("sticky",9)===-1)break;case 975:switch(G=(ee=Q).length-10,Z=(ee.charCodeAt(G)===33?ee.substring(0,G):ee).substring(Q.indexOf(":",7)+1).trim(),he=Z.charCodeAt(0)+(Z.charCodeAt(7)|0)){case 203:if(111>Z.charCodeAt(8))break;case 115:ee=ee.replace(Z,"-webkit-"+Z)+";"+ee;break;case 207:case 102:ee=ee.replace(Z,"-webkit-"+(102<he?"inline-":"")+"box")+";"+ee.replace(Z,"-webkit-"+Z)+";"+ee.replace(Z,"-ms-"+Z+"box")+";"+ee}return ee+";";case 938:if(ee.charCodeAt(5)===45)switch(ee.charCodeAt(6)){case 105:return Z=ee.replace("-items",""),"-webkit-"+ee+"-webkit-box-"+Z+"-ms-flex-"+Z+ee;case 115:return"-webkit-"+ee+"-ms-flex-item-"+ee.replace(C,"")+ee;default:return"-webkit-"+ee+"-ms-flex-line-pack"+ee.replace("align-content","").replace(C,"")+ee}break;case 973:case 989:if(ee.charCodeAt(3)!==45||ee.charCodeAt(4)===122)break;case 931:case 953:if(L.test(Q)===!0)return(Z=Q.substring(Q.indexOf(":")+1)).charCodeAt(0)===115?a(Q.replace("stretch","fill-available"),G,te,ce).replace(":fill-available",":stretch"):ee.replace(Z,"-webkit-"+Z)+ee.replace(Z,"-moz-"+Z.replace("fill-",""))+ee;break;case 962:if(ee="-webkit-"+ee+(ee.charCodeAt(5)===102?"-ms-"+ee:"")+ee,te+ce===211&&ee.charCodeAt(13)===105&&0<ee.indexOf("transform",10))return ee.substring(0,ee.indexOf(";",27)+1).replace(v,"$1-webkit-$2")+ee}return ee}function i(Q,G){var te=Q.indexOf(G===1?":":"{"),ce=Q.substring(0,G!==3?te:10);return te=Q.substring(te+1,Q.length-1),j(G!==2?ce:ce.replace(N,"$1"),te,G)}function o(Q,G){var te=a(G,G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2));return te!==G+";"?te.replace(S," or ($1)").substring(4):"("+G+")"}function s(Q,G,te,ce,ee,he,Z,se,fe,oe){for(var ae=0,X=G,U;ae<z;++ae)switch(U=V[ae].call(u,Q,X,te,ce,ee,he,Z,se,fe,oe)){case void 0:case!1:case!0:case null:break;default:X=U}if(X!==G)return X}function c(Q){switch(Q){case void 0:case null:z=V.length=0;break;default:if(typeof Q=="function")V[z++]=Q;else if(typeof Q=="object")for(var G=0,te=Q.length;G<te;++G)c(Q[G]);else H=!!Q|0}return c}function l(Q){return Q=Q.prefix,Q!==void 0&&(j=null,Q?typeof Q!="function"?O=1:(O=2,j=Q):O=0),l}function u(Q,G){var te=Q;if(33>te.charCodeAt(0)&&(te=te.trim()),W=te,te=[W],0<z){var ce=s(-1,G,te,te,T,P,0,0,0,0);ce!==void 0&&typeof ce=="string"&&(G=ce)}var ee=t(B,te,G,0,0);return 0<z&&(ce=s(-2,ee,te,te,T,P,ee.length,0,0,0),ce!==void 0&&(ee=ce)),W="",$=0,P=T=1,ee}var d=/^\0+/g,h=/[\0\r\f]/g,f=/: */g,p=/zoo|gra/,v=/([,: ])(transform)/g,y=/,\r+?/g,g=/([\t\r\n ])*\f?&/g,m=/@(k\w+)\s*(\S*)\s*/,_=/::(place)/g,b=/:(read-only)/g,k=/[svh]\w+-[tblr]{2}/,x=/\(\s*(.*)\s*\)/g,S=/([\s\S]*?);/g,C=/-self|flex-/g,N=/[^]*?(:[rp][el]a[\w-]+)[^]*/,L=/stretch|:\s*\w+\-(?:conte|avail)/,A=/([^-])(image-set\()/,P=1,T=1,$=0,O=1,B=[],V=[],z=0,j=null,H=0,W="";return u.use=c,u.set=l,e!==void 0&&l(e),u}var Kit={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};function Jit(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}var Qit=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,$_e=Jit(function(e){return Qit.test(e)||e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)<91}),xQ=kQ,eot={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},tot={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},not={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},O_e={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},SQ={};SQ[xQ.ForwardRef]=not,SQ[xQ.Memo]=O_e;function z_e(e){return xQ.isMemo(e)?O_e:SQ[e.$$typeof]||eot}var rot=Object.defineProperty,aot=Object.getOwnPropertyNames,F_e=Object.getOwnPropertySymbols,iot=Object.getOwnPropertyDescriptor,oot=Object.getPrototypeOf,B_e=Object.prototype;function V_e(e,t,n){if(typeof t!="string"){if(B_e){var r=oot(t);r&&r!==B_e&&V_e(e,r,n)}var a=aot(t);F_e&&(a=a.concat(F_e(t)));for(var i=z_e(e),o=z_e(t),s=0;s<a.length;++s){var c=a[s];if(!tot[c]&&!(n&&n[c])&&!(o&&o[c])&&!(i&&i[c])){var l=iot(t,c);try{rot(e,c,l)}catch{}}}}return e}var sot=V_e;const cot=Py(sot);function gc(){return(gc=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var j_e=function(e,t){for(var n=[e[0]],r=0,a=t.length;r<a;r+=1)n.push(t[r],e[r+1]);return n},MQ=function(e){return e!==null&&typeof e=="object"&&(e.toString?e.toString():Object.prototype.toString.call(e))==="[object Object]"&&!kQ.typeOf(e)},Ij=Object.freeze([]),Al=Object.freeze({});function pm(e){return typeof e=="function"}function H_e(e){return e.displayName||e.name||"Component"}function CQ(e){return e&&typeof e.styledComponentId=="string"}var E0=typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_ATTR||process.env.SC_ATTR)||"data-styled",NQ=typeof window<"u"&&"HTMLElement"in window,lot=!!(typeof SC_DISABLE_SPEEDY=="boolean"?SC_DISABLE_SPEEDY:typeof process<"u"&&process.env!==void 0&&(process.env.REACT_APP_SC_DISABLE_SPEEDY!==void 0&&process.env.REACT_APP_SC_DISABLE_SPEEDY!==""?process.env.REACT_APP_SC_DISABLE_SPEEDY!=="false"&&process.env.REACT_APP_SC_DISABLE_SPEEDY:process.env.SC_DISABLE_SPEEDY!==void 0&&process.env.SC_DISABLE_SPEEDY!==""&&process.env.SC_DISABLE_SPEEDY!=="false"&&process.env.SC_DISABLE_SPEEDY));function vm(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw new Error("An error occurred. See https://git.io/JUIaE#"+e+" for more information."+(n.length>0?" Args: "+n.join(", "):""))}var uot=function(){function e(n){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=n}var t=e.prototype;return t.indexOfGroup=function(n){for(var r=0,a=0;a<n;a++)r+=this.groupSizes[a];return r},t.insertRules=function(n,r){if(n>=this.groupSizes.length){for(var a=this.groupSizes,i=a.length,o=i;n>=o;)(o<<=1)<0&&vm(16,""+n);this.groupSizes=new Uint32Array(o),this.groupSizes.set(a),this.length=o;for(var s=i;s<o;s++)this.groupSizes[s]=0}for(var c=this.indexOfGroup(n+1),l=0,u=r.length;l<u;l++)this.tag.insertRule(c,r[l])&&(this.groupSizes[n]++,c++)},t.clearGroup=function(n){if(n<this.length){var r=this.groupSizes[n],a=this.indexOfGroup(n),i=a+r;this.groupSizes[n]=0;for(var o=a;o<i;o++)this.tag.deleteRule(a)}},t.getGroup=function(n){var r="";if(n>=this.length||this.groupSizes[n]===0)return r;for(var a=this.groupSizes[n],i=this.indexOfGroup(n),o=i+a,s=i;s<o;s++)r+=this.tag.getRule(s)+`/*!sc*/
8073
8073
  `;return r},e}(),Lj=new Map,Aj=new Map,ym=1,Tj=function(e){if(Lj.has(e))return Lj.get(e);for(;Aj.has(ym);)ym++;var t=ym++;return Lj.set(e,t),Aj.set(t,e),t},dot=function(e){return Aj.get(e)},hot=function(e,t){t>=ym&&(ym=t+1),Lj.set(e,t),Aj.set(t,e)},fot="style["+E0+'][data-styled-version="5.3.11"]',pot=new RegExp("^"+E0+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),vot=function(e,t,n){for(var r,a=n.split(","),i=0,o=a.length;i<o;i++)(r=a[i])&&e.registerName(t,r)},yot=function(e,t){for(var n=(t.textContent||"").split(`/*!sc*/
8074
8074
  `),r=[],a=0,i=n.length;a<i;a++){var o=n[a].trim();if(o){var s=o.match(pot);if(s){var c=0|parseInt(s[1],10),l=s[2];c!==0&&(hot(l,c),vot(e,l,s[3]),e.getTag().insertRules(c,r)),r.length=0}else r.push(o)}}},got=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:null},q_e=function(e){var t=document.head,n=e||t,r=document.createElement("style"),a=function(s){for(var c=s.childNodes,l=c.length;l>=0;l--){var u=c[l];if(u&&u.nodeType===1&&u.hasAttribute(E0))return u}}(n),i=a!==void 0?a.nextSibling:null;r.setAttribute(E0,"active"),r.setAttribute("data-styled-version","5.3.11");var o=got();return o&&r.setAttribute("nonce",o),n.insertBefore(r,i),r},mot=function(){function e(n){var r=this.element=q_e(n);r.appendChild(document.createTextNode("")),this.sheet=function(a){if(a.sheet)return a.sheet;for(var i=document.styleSheets,o=0,s=i.length;o<s;o++){var c=i[o];if(c.ownerNode===a)return c}vm(17)}(r),this.length=0}var t=e.prototype;return t.insertRule=function(n,r){try{return this.sheet.insertRule(r,n),this.length++,!0}catch{return!1}},t.deleteRule=function(n){this.sheet.deleteRule(n),this.length--},t.getRule=function(n){var r=this.sheet.cssRules[n];return r!==void 0&&typeof r.cssText=="string"?r.cssText:""},e}(),_ot=function(){function e(n){var r=this.element=q_e(n);this.nodes=r.childNodes,this.length=0}var t=e.prototype;return t.insertRule=function(n,r){if(n<=this.length&&n>=0){var a=document.createTextNode(r),i=this.nodes[n];return this.element.insertBefore(a,i||null),this.length++,!0}return!1},t.deleteRule=function(n){this.element.removeChild(this.nodes[n]),this.length--},t.getRule=function(n){return n<this.length?this.nodes[n].textContent:""},e}(),wot=function(){function e(n){this.rules=[],this.length=0}var t=e.prototype;return t.insertRule=function(n,r){return n<=this.length&&(this.rules.splice(n,0,r),this.length++,!0)},t.deleteRule=function(n){this.rules.splice(n,1),this.length--},t.getRule=function(n){return n<this.length?this.rules[n]:""},e}(),G_e=NQ,bot={isServer:!NQ,useCSSOMInjection:!lot},W_e=function(){function e(n,r,a){n===void 0&&(n=Al),r===void 0&&(r={}),this.options=gc({},bot,{},n),this.gs=r,this.names=new Map(a),this.server=!!n.isServer,!this.server&&NQ&&G_e&&(G_e=!1,function(i){for(var o=document.querySelectorAll(fot),s=0,c=o.length;s<c;s++){var l=o[s];l&&l.getAttribute(E0)!=="active"&&(yot(i,l),l.parentNode&&l.parentNode.removeChild(l))}}(this))}e.registerId=function(n){return Tj(n)};var t=e.prototype;return t.reconstructWithOptions=function(n,r){return r===void 0&&(r=!0),new e(gc({},this.options,{},n),this.gs,r&&this.names||void 0)},t.allocateGSInstance=function(n){return this.gs[n]=(this.gs[n]||0)+1},t.getTag=function(){return this.tag||(this.tag=(a=(r=this.options).isServer,i=r.useCSSOMInjection,o=r.target,n=a?new wot(o):i?new mot(o):new _ot(o),new uot(n)));var n,r,a,i,o},t.hasNameForId=function(n,r){return this.names.has(n)&&this.names.get(n).has(r)},t.registerName=function(n,r){if(Tj(n),this.names.has(n))this.names.get(n).add(r);else{var a=new Set;a.add(r),this.names.set(n,a)}},t.insertRules=function(n,r,a){this.registerName(n,r),this.getTag().insertRules(Tj(n),a)},t.clearNames=function(n){this.names.has(n)&&this.names.get(n).clear()},t.clearRules=function(n){this.getTag().clearGroup(Tj(n)),this.clearNames(n)},t.clearTag=function(){this.tag=void 0},t.toString=function(){return function(n){for(var r=n.getTag(),a=r.length,i="",o=0;o<a;o++){var s=dot(o);if(s!==void 0){var c=n.names.get(s),l=r.getGroup(o);if(c&&l&&c.size){var u=E0+".g"+o+'[id="'+s+'"]',d="";c!==void 0&&c.forEach(function(h){h.length>0&&(d+=h+",")}),i+=""+l+u+'{content:"'+d+`"}/*!sc*/
8075
- `}}}return i}(this)},e}(),kot=/(a)(d)/gi,U_e=function(e){return String.fromCharCode(e+(e>25?39:97))};function IQ(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=U_e(t%52)+n;return(U_e(t%52)+n).replace(kot,"$1-$2")}var D0=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Y_e=function(e){return D0(5381,e)};function xot(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(pm(n)&&!CQ(n))return!1}return!0}var Sot=Y_e("5.3.11"),Mot=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&xot(t),this.componentId=n,this.baseHash=D0(Sot,n),this.baseStyle=r,W_e.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var a=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(a,this.staticRulesId))i.push(this.staticRulesId);else{var o=P0(this.rules,t,n,r).join(""),s=IQ(D0(this.baseHash,o)>>>0);if(!n.hasNameForId(a,s)){var c=r(o,"."+s,void 0,a);n.insertRules(a,s,c)}i.push(s),this.staticRulesId=s}else{for(var l=this.rules.length,u=D0(this.baseHash,r.hash),d="",h=0;h<l;h++){var f=this.rules[h];if(typeof f=="string")d+=f;else if(f){var p=P0(f,t,n,r),v=Array.isArray(p)?p.join(""):p;u=D0(u,v+h),d+=v}}if(d){var y=IQ(u>>>0);if(!n.hasNameForId(a,y)){var g=r(d,"."+y,void 0,a);n.insertRules(a,y,g)}i.push(y)}}return i.join(" ")},e}(),Cot=/^\s*\/\/.*$/gm,Not=[":","[",".","#"];function Iot(e){var t,n,r,a,i=Al,o=i.options,s=o===void 0?Al:o,c=i.plugins,l=c===void 0?Ij:c,u=new Zit(s),d=[],h=function(v){function y(g){if(g)try{v(g+"}")}catch{}}return function(g,m,_,b,k,x,S,C,N,L){switch(g){case 1:if(N===0&&m.charCodeAt(0)===64)return v(m+";"),"";break;case 2:if(C===0)return m+"/*|*/";break;case 3:switch(C){case 102:case 112:return v(_[0]+m),"";default:return m+(L===0?"/*|*/":"")}case-2:m.split("/*|*/}").forEach(y)}}}(function(v){d.push(v)}),f=function(v,y,g){return y===0&&Not.indexOf(g[n.length])!==-1||g.match(a)?v:"."+t};function p(v,y,g,m){m===void 0&&(m="&");var _=v.replace(Cot,""),b=y&&g?g+" "+y+" { "+_+" }":_;return t=m,n=y,r=new RegExp("\\"+n+"\\b","g"),a=new RegExp("(\\"+n+"\\b){2,}"),u(g||!y?"":y,b)}return u.use([].concat(l,[function(v,y,g){v===2&&g.length&&g[0].lastIndexOf(n)>0&&(g[0]=g[0].replace(r,f))},h,function(v){if(v===-2){var y=d;return d=[],y}}])),p.hash=l.length?l.reduce(function(v,y){return y.name||vm(15),D0(v,y.name)},5381).toString():"",p}var X_e=D.createContext();X_e.Consumer;var Z_e=D.createContext(),Lot=(Z_e.Consumer,new W_e),LQ=Iot();function Aot(){return D.useContext(X_e)||Lot}function Tot(){return D.useContext(Z_e)||LQ}var Eot=function(){function e(t,n){var r=this;this.inject=function(a,i){i===void 0&&(i=LQ);var o=r.name+i.hash;a.hasNameForId(r.id,o)||a.insertRules(r.id,o,i(r.rules,o,"@keyframes"))},this.toString=function(){return vm(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=LQ),this.name+t.hash},e}(),Dot=/([A-Z])/,Pot=/([A-Z])/g,Rot=/^ms-/,$ot=function(e){return"-"+e.toLowerCase()};function K_e(e){return Dot.test(e)?e.replace(Pot,$ot).replace(Rot,"-ms-"):e}var J_e=function(e){return e==null||e===!1||e===""};function P0(e,t,n,r){if(Array.isArray(e)){for(var a,i=[],o=0,s=e.length;o<s;o+=1)(a=P0(e[o],t,n,r))!==""&&(Array.isArray(a)?i.push.apply(i,a):i.push(a));return i}if(J_e(e))return"";if(CQ(e))return"."+e.styledComponentId;if(pm(e)){if(typeof(l=e)!="function"||l.prototype&&l.prototype.isReactComponent||!t)return e;var c=e(t);return P0(c,t,n,r)}var l;return e instanceof Eot?n?(e.inject(n,r),e.getName(r)):e:MQ(e)?function u(d,h){var f,p,v=[];for(var y in d)d.hasOwnProperty(y)&&!J_e(d[y])&&(Array.isArray(d[y])&&d[y].isCss||pm(d[y])?v.push(K_e(y)+":",d[y],";"):MQ(d[y])?v.push.apply(v,u(d[y],y)):v.push(K_e(y)+": "+(f=y,(p=d[y])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||f in Kit||f.startsWith("--")?String(p).trim():p+"px")+";"));return h?[h+" {"].concat(v,["}"]):v}(e):e.toString()}var Q_e=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Oot(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return pm(e)||MQ(e)?Q_e(P0(j_e(Ij,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:Q_e(P0(j_e(e,n)))}var zot=function(e,t,n){return n===void 0&&(n=Al),e.theme!==n.theme&&e.theme||t||n.theme},Fot=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Bot=/(^-|-$)/g;function AQ(e){return e.replace(Fot,"-").replace(Bot,"")}var Vot=function(e){return IQ(Y_e(e)>>>0)};function Ej(e){return typeof e=="string"&&!0}var TQ=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},jot=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function Hot(e,t,n){var r=e[n];TQ(t)&&TQ(r)?ewe(r,t):e[n]=t}function ewe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,i=n;a<i.length;a++){var o=i[a];if(TQ(o))for(var s in o)jot(s)&&Hot(e,o[s],s)}return e}var twe=D.createContext();twe.Consumer;var EQ={};function nwe(e,t,n){var r=CQ(e),a=!Ej(e),i=t.attrs,o=i===void 0?Ij:i,s=t.componentId,c=s===void 0?function(m,_){var b=typeof m!="string"?"sc":AQ(m);EQ[b]=(EQ[b]||0)+1;var k=b+"-"+Vot("5.3.11"+b+EQ[b]);return _?_+"-"+k:k}(t.displayName,t.parentComponentId):s,l=t.displayName,u=l===void 0?function(m){return Ej(m)?"styled."+m:"Styled("+H_e(m)+")"}(e):l,d=t.displayName&&t.componentId?AQ(t.displayName)+"-"+t.componentId:t.componentId||c,h=r&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,f=t.shouldForwardProp;r&&e.shouldForwardProp&&(f=t.shouldForwardProp?function(m,_,b){return e.shouldForwardProp(m,_,b)&&t.shouldForwardProp(m,_,b)}:e.shouldForwardProp);var p,v=new Mot(n,d,r?e.componentStyle:void 0),y=v.isStatic&&o.length===0,g=function(m,_){return function(b,k,x,S){var C=b.attrs,N=b.componentStyle,L=b.defaultProps,A=b.foldedComponentIds,P=b.shouldForwardProp,T=b.styledComponentId,$=b.target,O=function(ce,ee,he){ce===void 0&&(ce=Al);var Z=gc({},ee,{theme:ce}),se={};return he.forEach(function(fe){var oe,ae,X,U=fe;for(oe in pm(U)&&(U=U(Z)),U)Z[oe]=se[oe]=oe==="className"?(ae=se[oe],X=U[oe],ae&&X?ae+" "+X:ae||X):U[oe]}),[Z,se]}(zot(k,D.useContext(twe),L)||Al,k,C),B=O[0],V=O[1],z=function(ce,ee,he,Z){var se=Aot(),fe=Tot(),oe=ee?ce.generateAndInjectStyles(Al,se,fe):ce.generateAndInjectStyles(he,se,fe);return oe}(N,S,B),j=x,H=V.$as||k.$as||V.as||k.as||$,W=Ej(H),Q=V!==k?gc({},k,{},V):k,G={};for(var te in Q)te[0]!=="$"&&te!=="as"&&(te==="forwardedAs"?G.as=Q[te]:(P?P(te,$_e,H):!W||$_e(te))&&(G[te]=Q[te]));return k.style&&V.style!==k.style&&(G.style=gc({},k.style,{},V.style)),G.className=Array.prototype.concat(A,T,z!==T?z:null,k.className,V.className).filter(Boolean).join(" "),G.ref=j,D.createElement(H,G)}(p,m,_,y)};return g.displayName=u,(p=D.forwardRef(g)).attrs=h,p.componentStyle=v,p.displayName=u,p.shouldForwardProp=f,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Ij,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(m){var _=t.componentId,b=function(x,S){if(x==null)return{};var C,N,L={},A=Object.keys(x);for(N=0;N<A.length;N++)C=A[N],S.indexOf(C)>=0||(L[C]=x[C]);return L}(t,["componentId"]),k=_&&_+"-"+(Ej(m)?m:AQ(H_e(m)));return nwe(m,gc({},b,{attrs:h,componentId:k}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(m){this._foldedDefaultProps=r?ewe({},e.defaultProps,m):m}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),a&&cot(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var Tl=function(e){return function t(n,r,a){if(a===void 0&&(a=Al),!kQ.isValidElementType(r))return vm(1,String(r));var i=function(){return n(r,a,Oot.apply(void 0,arguments))};return i.withConfig=function(o){return t(n,r,gc({},a,{},o))},i.attrs=function(o){return t(n,r,gc({},a,{attrs:Array.prototype.concat(a.attrs,o).filter(Boolean)}))},i}(nwe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Tl[e]=Tl(e)});const rwe=D.createContext(null),awe=()=>{const e=D.useContext(rwe);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},qot=({children:e})=>{const[t,n]=D.useState(0),r=D.useCallback(async i=>{n(o=>o+1);try{return await i}finally{n(o=>Math.max(0,o-1))}},[]),a=D.useCallback(async(i,o)=>(n(s=>s+1),new Promise((s,c)=>{const l=i(),u=()=>{n(d=>Math.max(0,d-1))};l.addEventListener("load",()=>{if(u(),l.status>=200&&l.status<300)try{const d=o(l);s(d)}catch(d){c(d)}else c(new Error(`Request failed with status ${l.status}`))}),l.addEventListener("error",()=>{u(),c(new Error("Network error occurred"))}),l.addEventListener("abort",()=>{u(),c(new Error("Request cancelled"))})})),[]);return M.jsx(rwe.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:a},children:e})},iwe=D.createContext(null),DQ=()=>{const e=D.useContext(iwe);if(!e)throw new Error("useRGContext must be used within a RGProvider");return e},owe=e=>{const{children:t}=e,[n,r]=D.useState({w:1,h:1}),a=o=>{r(o)},i=()=>{r({w:1,h:1})};return M.jsx(iwe.Provider,{value:{activeCompDimension:n,onDragStart:a,onDragStop:i},children:t})};for(var zr=[],PQ=0;PQ<256;++PQ)zr.push((PQ+256).toString(16).slice(1));function Got(e,t=0){return(zr[e[t+0]]+zr[e[t+1]]+zr[e[t+2]]+zr[e[t+3]]+"-"+zr[e[t+4]]+zr[e[t+5]]+"-"+zr[e[t+6]]+zr[e[t+7]]+"-"+zr[e[t+8]]+zr[e[t+9]]+"-"+zr[e[t+10]]+zr[e[t+11]]+zr[e[t+12]]+zr[e[t+13]]+zr[e[t+14]]+zr[e[t+15]]).toLowerCase()}var Dj,Wot=new Uint8Array(16);function Uot(){if(!Dj&&(Dj=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dj))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dj(Wot)}var Yot=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const swe={randomUUID:Yot};function cwe(e,t,n){if(swe.randomUUID&&!e)return swe.randomUUID();e=e||{};var r=e.random||(e.rng||Uot)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Got(r)}const RQ=e=>{const t=e;return{createProject:async(V,z,j,H=[])=>{const W=new FormData;W.append("description",V),W.append("theme",z),j&&W.append("background_image",j);const Q=Array.isArray(H)?H:[H];for(const G of Q)W.append("secret_references",G);return await fetch(`${t}/create_project`,{method:"POST",body:W})},createBlankProject:async(V,z,j,H=[])=>{const W=new FormData;W.append("description",V),W.append("theme",z),j&&W.append("background_image",j);const Q=Array.isArray(H)?H:[H];for(const G of Q)W.append("secret_references",G);return await fetch(`${t}/create_blank_project`,{method:"POST",body:W})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getProjectMetadata:async V=>await fetch(`${t}/project/${V}`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async V=>await fetch(`${t}/subdomains?project_name=${V}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},releaseSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},publishProject:async(V,z)=>{const j={project_name:V,git_ref:z};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},unpublishProject:async V=>{const z={project_name:V};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},tagCommit:async(V,z,j)=>{const H={project_name:V,commit_hash:z,tag_name:j};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(V,z,j,H)=>{const W={project_name:V,component_namespace:z,component_name:j,layout_metadata:H};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},addProjectChart:async(V,z,j)=>{const H={project_name:V,visual_id:z,layout_metadata:j};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectComponentLayoutMetadata:async(V,z,j)=>{const H={project_name:V,component_id:z,layout_metadata:j};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectComponentSourceCode:async(V,z,j)=>{const H={project_name:V,component_id:z,source_code:j};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateApplicationMetadata:async(V,z,j,H)=>{const W={project_name:V,application_name:z,application_description:j,application_category:H};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},updateApplicationSettings:async(V,z=null,j=null)=>{const H={project_name:V,application_login_enabled:z,default_deployment_chain_reference:j};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectFile:async(V,z,j,H)=>{const W={file_path:V,project_name:z,source_code:j};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W),signal:H})},updateProjectFiles:async(V,z)=>{const j=V.map(H=>({project_name:H.projectName,file_path:H.filePath,source_code:H.fileContent}));return await fetch(`${t}/update_project_files`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j),signal:z})},deleteProjectComponent:async(V,z)=>{const j={project_name:V,file_path:z};return await fetch(`${t}/delete_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},deleteProjectFile:async(V,z)=>{const j={project_name:V,file_path:z};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},resetProjectFile:async(V,z,j,H,W)=>{let Q={project_name:V,file_path:z,git_ref:j};return H&&(Q.prune=H),W&&(Q.extra_metadata=W),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})},deleteProject:async V=>{const z={projects:[V]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},requestErrorCorrection:async(V,z,j)=>{const H={project_name:V,component_id:z,error_message:j};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},addImage:async V=>await fetch(`${t}/add_image`,{method:"POST",body:V}),editElement:async V=>{const z={project_name:V.projectName,component_id:V.componentId,element_xpath:V.elementXPath,style_request:V.styleRequest||null,text_request:V.textRequest||null,background_image_request:V.backgroundImageRequest||null,dom_tree_repr:V.domTreeRepr};return await fetch(`${t}/edit_element`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},initializeProject:async V=>await fetch(`${t}/initialize_project/${V}`,{method:"POST",headers:{"Content-Type":"application/json"}}),getUserSpendAnalytics:async()=>await fetch(`${t}/analytics/user_spend`,{method:"GET",headers:{"Content-Type":"application/json"}}),getCreatorPointsSum:async V=>{let z=`${t}/analytics/creator_points/sum`;return V&&(z+=`?project_name=${encodeURIComponent(V)}`),await fetch(z,{method:"GET",headers:{"Content-Type":"application/json"}})},getCreatorPointsTop:async(V=20)=>await fetch(`${t}/analytics/creator_points/top?n=${V}`,{method:"GET",headers:{"Content-Type":"application/json"}})}},lwe=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,o,s,c,l,u,d,h)=>{const f=new URLSearchParams({pageNo:i.toString(),pageSize:o.toString(),scope:s,searchPattern:c,sortBy:l,sortOrder:u,visibility:d,visualType:h}).toString();return await fetch(`${t}/v2/content/visuals?${f}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},$Q=(e,t)=>{const n=e,r=(S=!1,C)=>{const N={"Content-Type":"application/json"};if(S){const L=C||t;L&&(N["x-sxt-project-hmac"]=L)}return N};return{getSecrets:async()=>await fetch(`${n}/config/secrets`,{method:"GET",headers:r(!1)}),putSecret:async(S,C)=>await fetch(`${n}/config/secrets/${S}`,{method:"PUT",headers:r(!1),body:JSON.stringify(C)}),getSecret:async S=>await fetch(`${n}/config/secrets/${S}`,{method:"GET",headers:r(!1)}),deleteSecret:async S=>await fetch(`${n}/config/secrets/${S}`,{method:"DELETE",headers:r(!1)}),getAllTierKeyMaps:async()=>await fetch(`${n}/config/miniapps/*/tier-key-map`,{method:"GET",headers:r(!1)}),getTierKeyMap:async(S,C)=>await fetch(`${n}/config/miniapps/${S}/tier-key-map`,{method:"GET",headers:r(!0,C)}),putTierKeyMap:async(S,C,N,L)=>await fetch(`${n}/config/miniapps/${S}/tier-key-map/${C}`,{method:"PUT",headers:r(!0,L),body:JSON.stringify({secret_reference:N})}),getTierKeyMapForTier:async(S,C,N)=>await fetch(`${n}/config/miniapps/${S}/tier-key-map/${C}`,{method:"GET",headers:r(!0,N)}),deleteTierKeyMap:async(S,C,N,L)=>await fetch(`${n}/config/miniapps/${S}/tier-key-map/${C}/${N}`,{method:"DELETE",headers:r(!0,L)}),getTierAssignments:async(S,C)=>await fetch(`${n}/config/miniapps/${S}/assignments`,{method:"GET",headers:r(!0,C)}),putTierAssignment:async(S,C,N,L)=>await fetch(`${n}/config/miniapps/${S}/assignments/${C}`,{method:"PUT",headers:r(!0,L),body:JSON.stringify({tier:N})}),getTierAssignment:async(S,C,N)=>await fetch(`${n}/config/miniapps/${S}/assignments/${C}`,{method:"GET",headers:r(!0,N)}),deleteTierAssignment:async(S,C,N)=>await fetch(`${n}/config/miniapps/${S}/assignments/${C}`,{method:"DELETE",headers:r(!0,N)}),getRateLimits:async(S,C)=>await fetch(`${n}/config/miniapps/${S}/rate-limits`,{method:"GET",headers:r(!0,C)}),putRateLimit:async(S,C,N,L,A)=>await fetch(`${n}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"PUT",headers:r(!0,A),body:JSON.stringify(L)}),getRateLimit:async(S,C,N,L)=>await fetch(`${n}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"GET",headers:r(!0,L)}),deleteRateLimit:async(S,C,N,L)=>await fetch(`${n}/config/miniapps/${S}/rate-limits/${C}/${N}`,{method:"DELETE",headers:r(!0,L)}),createProxyFetch:S=>async(C,N)=>{const L=C instanceof URL?C:new URL(C.toString());return await fetch(`${n}/proxy/${S.miniappName}/${L.host}${L.pathname}${L.search}${L.hash}`,N)},createProxyGetView:S=>{const C=new URL(S.gwProxyUrl).hostname;return async(N,L,A={})=>{let P=`SELECT * FROM ${N}.${L}`;A&&Object.keys(A).length>0&&(P+=`(${Object.entries(A).map(([O,B])=>`'${O}=${B}'`).join(",")})`);const T=await fetch(`${n}/proxy/${S.miniappName}/${C}/v1/sql/no-injected-authz`,{method:"POST",headers:r(!1),body:JSON.stringify({sqlText:P})});if(!T.ok)throw new Error(`Failed to fetch view: ${T.statusText}`);return await T.json()}}}};function Xot(e){return typeof e=="function"}const Zot=e=>{const{wrapAPICall:t}=awe(),n=RQ(e);return new Proxy(n,{get:(a,i)=>{const o=a[i];return Xot(o)?(...s)=>t(o.apply(a,s)):o}})},OQ=D.createContext(null);OQ.Consumer;const Kot=e=>{const[t,n]=D.useState({projectName:null,projectURL:null,extraMeta:{}}),[r,a]=D.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,o]=D.useState(()=>lwe(e.config.GW_BASE_URL||"")),[s,c]=D.useState(!1),[l,u]=D.useState(""),[d,h]=D.useState(""),[f,p]=D.useState(""),[v,y]=D.useState(cwe()),g=Zot(e.config.API_BASE_URL||""),m=RQ(e.config.API_BASE_URL||""),_=g||m,[b,k]=D.useState(()=>$Q(e.config.PROXY_API_BASE_URL||"",t==null?void 0:t.projectHmac)),[x,S]=D.useState(null),[C,N]=D.useState(null),L=()=>{y(cwe())};return D.useEffect(()=>{a(e==null?void 0:e.config)},[e.config]),D.useEffect(()=>{e!=null&&e.metadata&&n(e.metadata)},[e.metadata]),D.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}o(lwe(r.GW_BASE_URL||"")),k(A=>{const P=$Q(r.PROXY_API_BASE_URL||"",t==null?void 0:t.projectHmac),T=P.createProxyFetch({miniappName:t.projectName||""}),$=async(V,z)=>T(V,z);S(()=>$);const O=P.createProxyGetView({miniappName:t.projectName||"",gwProxyUrl:r.GW_PROXY_URL||""}),B=async(V,z,j={})=>{if(typeof V!="string"||typeof z!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof V}, viewName: ${typeof z}`);return O(V,z,j)};return N(()=>B),P})},[r,t]),M.jsx(OQ.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,syncToken:v,setSyncToken:L,selectedComponentId:l,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:h,selectedComponentHTML:f,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:c,APIHandler:_,gwAPIHandler:i,proxyHandler:b,proxyFetch:x,proxyGetView:C},children:e.children})},Jot=e=>M.jsx(qot,{children:M.jsx(owe,{children:M.jsx(Kot,{...e})})}),zQ=()=>{const e=D.useContext(OQ);if(e===null)throw new Error("Invalid project context.");return e},Qot=Tl.div`
8075
+ `}}}return i}(this)},e}(),kot=/(a)(d)/gi,U_e=function(e){return String.fromCharCode(e+(e>25?39:97))};function IQ(e){var t,n="";for(t=Math.abs(e);t>52;t=t/52|0)n=U_e(t%52)+n;return(U_e(t%52)+n).replace(kot,"$1-$2")}var D0=function(e,t){for(var n=t.length;n;)e=33*e^t.charCodeAt(--n);return e},Y_e=function(e){return D0(5381,e)};function xot(e){for(var t=0;t<e.length;t+=1){var n=e[t];if(pm(n)&&!CQ(n))return!1}return!0}var Sot=Y_e("5.3.11"),Mot=function(){function e(t,n,r){this.rules=t,this.staticRulesId="",this.isStatic=(r===void 0||r.isStatic)&&xot(t),this.componentId=n,this.baseHash=D0(Sot,n),this.baseStyle=r,W_e.registerId(n)}return e.prototype.generateAndInjectStyles=function(t,n,r){var a=this.componentId,i=[];if(this.baseStyle&&i.push(this.baseStyle.generateAndInjectStyles(t,n,r)),this.isStatic&&!r.hash)if(this.staticRulesId&&n.hasNameForId(a,this.staticRulesId))i.push(this.staticRulesId);else{var o=P0(this.rules,t,n,r).join(""),s=IQ(D0(this.baseHash,o)>>>0);if(!n.hasNameForId(a,s)){var c=r(o,"."+s,void 0,a);n.insertRules(a,s,c)}i.push(s),this.staticRulesId=s}else{for(var l=this.rules.length,u=D0(this.baseHash,r.hash),d="",h=0;h<l;h++){var f=this.rules[h];if(typeof f=="string")d+=f;else if(f){var p=P0(f,t,n,r),v=Array.isArray(p)?p.join(""):p;u=D0(u,v+h),d+=v}}if(d){var y=IQ(u>>>0);if(!n.hasNameForId(a,y)){var g=r(d,"."+y,void 0,a);n.insertRules(a,y,g)}i.push(y)}}return i.join(" ")},e}(),Cot=/^\s*\/\/.*$/gm,Not=[":","[",".","#"];function Iot(e){var t,n,r,a,i=Al,o=i.options,s=o===void 0?Al:o,c=i.plugins,l=c===void 0?Ij:c,u=new Zit(s),d=[],h=function(v){function y(g){if(g)try{v(g+"}")}catch{}}return function(g,m,_,b,k,x,S,C,N,L){switch(g){case 1:if(N===0&&m.charCodeAt(0)===64)return v(m+";"),"";break;case 2:if(C===0)return m+"/*|*/";break;case 3:switch(C){case 102:case 112:return v(_[0]+m),"";default:return m+(L===0?"/*|*/":"")}case-2:m.split("/*|*/}").forEach(y)}}}(function(v){d.push(v)}),f=function(v,y,g){return y===0&&Not.indexOf(g[n.length])!==-1||g.match(a)?v:"."+t};function p(v,y,g,m){m===void 0&&(m="&");var _=v.replace(Cot,""),b=y&&g?g+" "+y+" { "+_+" }":_;return t=m,n=y,r=new RegExp("\\"+n+"\\b","g"),a=new RegExp("(\\"+n+"\\b){2,}"),u(g||!y?"":y,b)}return u.use([].concat(l,[function(v,y,g){v===2&&g.length&&g[0].lastIndexOf(n)>0&&(g[0]=g[0].replace(r,f))},h,function(v){if(v===-2){var y=d;return d=[],y}}])),p.hash=l.length?l.reduce(function(v,y){return y.name||vm(15),D0(v,y.name)},5381).toString():"",p}var X_e=D.createContext();X_e.Consumer;var Z_e=D.createContext(),Lot=(Z_e.Consumer,new W_e),LQ=Iot();function Aot(){return D.useContext(X_e)||Lot}function Tot(){return D.useContext(Z_e)||LQ}var Eot=function(){function e(t,n){var r=this;this.inject=function(a,i){i===void 0&&(i=LQ);var o=r.name+i.hash;a.hasNameForId(r.id,o)||a.insertRules(r.id,o,i(r.rules,o,"@keyframes"))},this.toString=function(){return vm(12,String(r.name))},this.name=t,this.id="sc-keyframes-"+t,this.rules=n}return e.prototype.getName=function(t){return t===void 0&&(t=LQ),this.name+t.hash},e}(),Dot=/([A-Z])/,Pot=/([A-Z])/g,Rot=/^ms-/,$ot=function(e){return"-"+e.toLowerCase()};function K_e(e){return Dot.test(e)?e.replace(Pot,$ot).replace(Rot,"-ms-"):e}var J_e=function(e){return e==null||e===!1||e===""};function P0(e,t,n,r){if(Array.isArray(e)){for(var a,i=[],o=0,s=e.length;o<s;o+=1)(a=P0(e[o],t,n,r))!==""&&(Array.isArray(a)?i.push.apply(i,a):i.push(a));return i}if(J_e(e))return"";if(CQ(e))return"."+e.styledComponentId;if(pm(e)){if(typeof(l=e)!="function"||l.prototype&&l.prototype.isReactComponent||!t)return e;var c=e(t);return P0(c,t,n,r)}var l;return e instanceof Eot?n?(e.inject(n,r),e.getName(r)):e:MQ(e)?function u(d,h){var f,p,v=[];for(var y in d)d.hasOwnProperty(y)&&!J_e(d[y])&&(Array.isArray(d[y])&&d[y].isCss||pm(d[y])?v.push(K_e(y)+":",d[y],";"):MQ(d[y])?v.push.apply(v,u(d[y],y)):v.push(K_e(y)+": "+(f=y,(p=d[y])==null||typeof p=="boolean"||p===""?"":typeof p!="number"||p===0||f in Kit||f.startsWith("--")?String(p).trim():p+"px")+";"));return h?[h+" {"].concat(v,["}"]):v}(e):e.toString()}var Q_e=function(e){return Array.isArray(e)&&(e.isCss=!0),e};function Oot(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return pm(e)||MQ(e)?Q_e(P0(j_e(Ij,[e].concat(n)))):n.length===0&&e.length===1&&typeof e[0]=="string"?e:Q_e(P0(j_e(e,n)))}var zot=function(e,t,n){return n===void 0&&(n=Al),e.theme!==n.theme&&e.theme||t||n.theme},Fot=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,Bot=/(^-|-$)/g;function AQ(e){return e.replace(Fot,"-").replace(Bot,"")}var Vot=function(e){return IQ(Y_e(e)>>>0)};function Ej(e){return typeof e=="string"&&!0}var TQ=function(e){return typeof e=="function"||typeof e=="object"&&e!==null&&!Array.isArray(e)},jot=function(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"};function Hot(e,t,n){var r=e[n];TQ(t)&&TQ(r)?ewe(r,t):e[n]=t}function ewe(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];for(var a=0,i=n;a<i.length;a++){var o=i[a];if(TQ(o))for(var s in o)jot(s)&&Hot(e,o[s],s)}return e}var twe=D.createContext();twe.Consumer;var EQ={};function nwe(e,t,n){var r=CQ(e),a=!Ej(e),i=t.attrs,o=i===void 0?Ij:i,s=t.componentId,c=s===void 0?function(m,_){var b=typeof m!="string"?"sc":AQ(m);EQ[b]=(EQ[b]||0)+1;var k=b+"-"+Vot("5.3.11"+b+EQ[b]);return _?_+"-"+k:k}(t.displayName,t.parentComponentId):s,l=t.displayName,u=l===void 0?function(m){return Ej(m)?"styled."+m:"Styled("+H_e(m)+")"}(e):l,d=t.displayName&&t.componentId?AQ(t.displayName)+"-"+t.componentId:t.componentId||c,h=r&&e.attrs?Array.prototype.concat(e.attrs,o).filter(Boolean):o,f=t.shouldForwardProp;r&&e.shouldForwardProp&&(f=t.shouldForwardProp?function(m,_,b){return e.shouldForwardProp(m,_,b)&&t.shouldForwardProp(m,_,b)}:e.shouldForwardProp);var p,v=new Mot(n,d,r?e.componentStyle:void 0),y=v.isStatic&&o.length===0,g=function(m,_){return function(b,k,x,S){var C=b.attrs,N=b.componentStyle,L=b.defaultProps,A=b.foldedComponentIds,P=b.shouldForwardProp,T=b.styledComponentId,$=b.target,O=function(ce,ee,he){ce===void 0&&(ce=Al);var Z=gc({},ee,{theme:ce}),se={};return he.forEach(function(fe){var oe,ae,X,U=fe;for(oe in pm(U)&&(U=U(Z)),U)Z[oe]=se[oe]=oe==="className"?(ae=se[oe],X=U[oe],ae&&X?ae+" "+X:ae||X):U[oe]}),[Z,se]}(zot(k,D.useContext(twe),L)||Al,k,C),B=O[0],V=O[1],z=function(ce,ee,he,Z){var se=Aot(),fe=Tot(),oe=ee?ce.generateAndInjectStyles(Al,se,fe):ce.generateAndInjectStyles(he,se,fe);return oe}(N,S,B),j=x,H=V.$as||k.$as||V.as||k.as||$,W=Ej(H),Q=V!==k?gc({},k,{},V):k,G={};for(var te in Q)te[0]!=="$"&&te!=="as"&&(te==="forwardedAs"?G.as=Q[te]:(P?P(te,$_e,H):!W||$_e(te))&&(G[te]=Q[te]));return k.style&&V.style!==k.style&&(G.style=gc({},k.style,{},V.style)),G.className=Array.prototype.concat(A,T,z!==T?z:null,k.className,V.className).filter(Boolean).join(" "),G.ref=j,D.createElement(H,G)}(p,m,_,y)};return g.displayName=u,(p=D.forwardRef(g)).attrs=h,p.componentStyle=v,p.displayName=u,p.shouldForwardProp=f,p.foldedComponentIds=r?Array.prototype.concat(e.foldedComponentIds,e.styledComponentId):Ij,p.styledComponentId=d,p.target=r?e.target:e,p.withComponent=function(m){var _=t.componentId,b=function(x,S){if(x==null)return{};var C,N,L={},A=Object.keys(x);for(N=0;N<A.length;N++)C=A[N],S.indexOf(C)>=0||(L[C]=x[C]);return L}(t,["componentId"]),k=_&&_+"-"+(Ej(m)?m:AQ(H_e(m)));return nwe(m,gc({},b,{attrs:h,componentId:k}),n)},Object.defineProperty(p,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(m){this._foldedDefaultProps=r?ewe({},e.defaultProps,m):m}}),Object.defineProperty(p,"toString",{value:function(){return"."+p.styledComponentId}}),a&&cot(p,e,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0,withComponent:!0}),p}var Tl=function(e){return function t(n,r,a){if(a===void 0&&(a=Al),!kQ.isValidElementType(r))return vm(1,String(r));var i=function(){return n(r,a,Oot.apply(void 0,arguments))};return i.withConfig=function(o){return t(n,r,gc({},a,{},o))},i.attrs=function(o){return t(n,r,gc({},a,{attrs:Array.prototype.concat(a.attrs,o).filter(Boolean)}))},i}(nwe,e)};["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","textPath","tspan"].forEach(function(e){Tl[e]=Tl(e)});const rwe=D.createContext(null),awe=()=>{const e=D.useContext(rwe);if(!e)throw new Error("useAPI must be used within an APIProvider");return e},qot=({children:e})=>{const[t,n]=D.useState(0),r=D.useCallback(async i=>{n(o=>o+1);try{return await i}finally{n(o=>Math.max(0,o-1))}},[]),a=D.useCallback(async(i,o)=>(n(s=>s+1),new Promise((s,c)=>{const l=i(),u=()=>{n(d=>Math.max(0,d-1))};l.addEventListener("load",()=>{if(u(),l.status>=200&&l.status<300)try{const d=o(l);s(d)}catch(d){c(d)}else c(new Error(`Request failed with status ${l.status}`))}),l.addEventListener("error",()=>{u(),c(new Error("Network error occurred"))}),l.addEventListener("abort",()=>{u(),c(new Error("Request cancelled"))})})),[]);return M.jsx(rwe.Provider,{value:{isLoading:t>0,wrapAPICall:r,wrapXHRCall:a},children:e})},iwe=D.createContext(null),DQ=()=>{const e=D.useContext(iwe);if(!e)throw new Error("useRGContext must be used within a RGProvider");return e},owe=e=>{const{children:t}=e,[n,r]=D.useState({w:1,h:1}),a=o=>{r(o)},i=()=>{r({w:1,h:1})};return M.jsx(iwe.Provider,{value:{activeCompDimension:n,onDragStart:a,onDragStop:i},children:t})};for(var zr=[],PQ=0;PQ<256;++PQ)zr.push((PQ+256).toString(16).slice(1));function Got(e,t=0){return(zr[e[t+0]]+zr[e[t+1]]+zr[e[t+2]]+zr[e[t+3]]+"-"+zr[e[t+4]]+zr[e[t+5]]+"-"+zr[e[t+6]]+zr[e[t+7]]+"-"+zr[e[t+8]]+zr[e[t+9]]+"-"+zr[e[t+10]]+zr[e[t+11]]+zr[e[t+12]]+zr[e[t+13]]+zr[e[t+14]]+zr[e[t+15]]).toLowerCase()}var Dj,Wot=new Uint8Array(16);function Uot(){if(!Dj&&(Dj=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Dj))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dj(Wot)}var Yot=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const swe={randomUUID:Yot};function cwe(e,t,n){if(swe.randomUUID&&!e)return swe.randomUUID();e=e||{};var r=e.random||(e.rng||Uot)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Got(r)}const RQ=e=>{const t=e;return{createProject:async(V,z,j,H=[])=>{const W=new FormData;W.append("description",V),W.append("theme",z),j&&W.append("background_image",j);const Q=Array.isArray(H)?H:[H];for(const G of Q)W.append("secret_references",G);return await fetch(`${t}/create_project`,{method:"POST",body:W})},createBlankProject:async(V,z,j,H=[])=>{const W=new FormData;W.append("description",V),W.append("theme",z),j&&W.append("background_image",j);const Q=Array.isArray(H)?H:[H];for(const G of Q)W.append("secret_references",G);return await fetch(`${t}/create_blank_project`,{method:"POST",body:W})},getProjects:async()=>await fetch(`${t}/fetch_projects`,{method:"GET",headers:{"Content-Type":"application/json"}}),getProjectMetadata:async V=>await fetch(`${t}/project/${V}`,{method:"GET",headers:{"Content-Type":"application/json"}}),getSubdomains:async V=>await fetch(`${t}/subdomains?project_name=${V}`,{method:"GET",headers:{"Content-Type":"application/json"}}),allocateSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/allocate_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},updateSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/update_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},releaseSubdomain:async(V,z)=>{const j={project_name:V,subdomain:z};return await fetch(`${t}/release_subdomain`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},publishProject:async(V,z)=>{const j={project_name:V,git_ref:z};return await fetch(`${t}/publish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},unpublishProject:async V=>{const z={project_name:V};return await fetch(`${t}/unpublish_project`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},tagCommit:async(V,z,j)=>{const H={project_name:V,commit_hash:z,tag_name:j};return await fetch(`${t}/tag_project_commit`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},getComponentLibrary:async()=>await fetch(`${t}/library_components?namespaces=example`,{method:"GET",headers:{"Content-Type":"application/json"}}),addProjectComponent:async(V,z,j,H)=>{const W={project_name:V,component_namespace:z,component_name:j,layout_metadata:H};return await fetch(`${t}/add_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},addProjectChart:async(V,z,j)=>{const H={project_name:V,visual_id:z,layout_metadata:j};return await fetch(`${t}/add_project_chart`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectComponentLayoutMetadata:async(V,z,j)=>{const H={project_name:V,component_id:z,layout_metadata:j};return await fetch(`${t}/update_project_component_layout_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectComponentSourceCode:async(V,z,j)=>{const H={project_name:V,component_id:z,source_code:j};return await fetch(`${t}/update_project_component_source_code`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateApplicationMetadata:async(V,z,j,H)=>{const W={project_name:V,application_name:z,application_description:j,application_category:H};return await fetch(`${t}/update_application_metadata`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W)})},updateApplicationSettings:async(V,z=null,j=null)=>{const H={project_name:V,application_login_enabled:z,default_deployment_chain_reference:j};return await fetch(`${t}/update_application_settings`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},updateProjectFile:async(V,z,j,H)=>{const W={file_path:V,project_name:z,source_code:j};return await fetch(`${t}/update_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(W),signal:H})},updateProjectFiles:async(V,z)=>{const j=V.map(H=>({project_name:H.projectName,file_path:H.filePath,source_code:H.fileContent}));return await fetch(`${t}/update_project_files`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j),signal:z})},deleteProjectComponent:async(V,z)=>{const j={project_name:V,file_path:z};return await fetch(`${t}/delete_project_component`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},deleteProjectFile:async(V,z)=>{const j={project_name:V,file_path:z};return await fetch(`${t}/delete_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(j)})},resetProjectFile:async(V,z,j,H,W)=>{let Q={project_name:V,file_path:z,git_ref:j};return H&&(Q.prune=H),W&&(Q.extra_metadata=W),await fetch(`${t}/reset_project_file`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)})},deleteProject:async V=>{const z={projects:[V]};return await fetch(`${t}/delete_projects`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},requestErrorCorrection:async(V,z,j)=>{const H={project_name:V,component_id:z,error_message:j};return await fetch(`${t}/error_correction`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(H)})},addImage:async V=>await fetch(`${t}/add_image`,{method:"POST",body:V}),editElement:async V=>{const z={project_name:V.projectName,component_id:V.componentId,element_xpath:V.elementXPath,style_request:V.styleRequest||null,text_request:V.textRequest||null,background_image_request:V.backgroundImageRequest||null,dom_tree_repr:V.domTreeRepr};return await fetch(`${t}/edit_element`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(z)})},initializeProject:async V=>await fetch(`${t}/initialize_project/${V}`,{method:"POST",headers:{"Content-Type":"application/json"}}),getUserSpendAnalytics:async()=>await fetch(`${t}/analytics/user_spend`,{method:"GET",headers:{"Content-Type":"application/json"}}),getCreatorPointsSum:async V=>{let z=`${t}/analytics/creator_points/sum`;return V&&(z+=`?project_name=${encodeURIComponent(V)}`),await fetch(z,{method:"GET",headers:{"Content-Type":"application/json"}})},getCreatorPointsTop:async(V=20)=>await fetch(`${t}/analytics/creator_points/top?n=${V}`,{method:"GET",headers:{"Content-Type":"application/json"}})}},lwe=e=>{const t=e;return{getQueryContent:async i=>await fetch(`${t}/v1/public/sql/content-queries`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({queryId:i,biscuits:[]})}),getVisuals:async(i,o,s,c,l,u,d,h)=>{const f=new URLSearchParams({pageNo:i.toString(),pageSize:o.toString(),scope:s,searchPattern:c,sortBy:l,sortOrder:u,visibility:d,visualType:h}).toString();return await fetch(`${t}/v2/content/visuals?${f}`,{method:"GET",headers:{"Content-Type":"application/json"}})},getSubscription:async()=>await fetch(`${t}/v1/subscription`,{method:"GET",headers:{"Content-Type":"application/json"}})}},$Q=(e,t)=>{const n=e,r=(C=!1,N)=>{const L={"Content-Type":"application/json"};if(C){const A=N||t;A&&(L["x-sxt-project-hmac"]=A)}return L};return{getSecrets:async()=>await fetch(`${n}/config/secrets`,{method:"GET",headers:r(!1)}),putSecret:async(C,N)=>await fetch(`${n}/config/secrets/${C}`,{method:"PUT",headers:r(!1),body:JSON.stringify(N)}),patchSecret:async(C,N)=>await fetch(`${n}/config/secrets/${C}`,{method:"PATCH",headers:r(!1),body:JSON.stringify(N)}),getSecret:async C=>await fetch(`${n}/config/secrets/${C}`,{method:"GET",headers:r(!1)}),deleteSecret:async C=>await fetch(`${n}/config/secrets/${C}`,{method:"DELETE",headers:r(!1)}),getAllTierKeyMaps:async()=>await fetch(`${n}/config/miniapps/*/tier-key-map`,{method:"GET",headers:r(!1)}),getTierKeyMap:async(C,N)=>await fetch(`${n}/config/miniapps/${C}/tier-key-map`,{method:"GET",headers:r(!0,N)}),putTierKeyMap:async(C,N,L,A)=>await fetch(`${n}/config/miniapps/${C}/tier-key-map/${N}`,{method:"PUT",headers:r(!0,A),body:JSON.stringify({secret_reference:L})}),getTierKeyMapForTier:async(C,N,L)=>await fetch(`${n}/config/miniapps/${C}/tier-key-map/${N}`,{method:"GET",headers:r(!0,L)}),deleteTierKeyMap:async(C,N,L,A)=>await fetch(`${n}/config/miniapps/${C}/tier-key-map/${N}/${L}`,{method:"DELETE",headers:r(!0,A)}),getTierAssignments:async(C,N)=>await fetch(`${n}/config/miniapps/${C}/assignments`,{method:"GET",headers:r(!0,N)}),putTierAssignment:async(C,N,L,A)=>await fetch(`${n}/config/miniapps/${C}/assignments/${N}`,{method:"PUT",headers:r(!0,A),body:JSON.stringify({tier:L})}),getTierAssignment:async(C,N,L)=>await fetch(`${n}/config/miniapps/${C}/assignments/${N}`,{method:"GET",headers:r(!0,L)}),deleteTierAssignment:async(C,N,L)=>await fetch(`${n}/config/miniapps/${C}/assignments/${N}`,{method:"DELETE",headers:r(!0,L)}),getRateLimits:async(C,N)=>await fetch(`${n}/config/miniapps/${C}/rate-limits`,{method:"GET",headers:r(!0,N)}),putRateLimit:async(C,N,L,A,P)=>await fetch(`${n}/config/miniapps/${C}/rate-limits/${N}/${L}`,{method:"PUT",headers:r(!0,P),body:JSON.stringify(A)}),getRateLimit:async(C,N,L,A)=>await fetch(`${n}/config/miniapps/${C}/rate-limits/${N}/${L}`,{method:"GET",headers:r(!0,A)}),deleteRateLimit:async(C,N,L,A)=>await fetch(`${n}/config/miniapps/${C}/rate-limits/${N}/${L}`,{method:"DELETE",headers:r(!0,A)}),createProxyFetch:C=>async(N,L)=>{const A=N instanceof URL?N:new URL(N.toString());return await fetch(`${n}/proxy/${C.miniappName}/${A.host}${A.pathname}${A.search}${A.hash}`,L)},createProxyGetView:C=>{const N=new URL(C.gwProxyUrl).hostname;return async(L,A,P={})=>{let T=`SELECT * FROM ${L}.${A}`;P&&Object.keys(P).length>0&&(T+=`(${Object.entries(P).map(([B,V])=>`'${B}=${V}'`).join(",")})`);const $=await fetch(`${n}/proxy/${C.miniappName}/${N}/v1/sql/no-injected-authz`,{method:"POST",headers:r(!1),body:JSON.stringify({sqlText:T})});if(!$.ok)throw new Error(`Failed to fetch view: ${$.statusText}`);return await $.json()}}}};function Xot(e){return typeof e=="function"}const Zot=e=>{const{wrapAPICall:t}=awe(),n=RQ(e);return new Proxy(n,{get:(a,i)=>{const o=a[i];return Xot(o)?(...s)=>t(o.apply(a,s)):o}})},OQ=D.createContext(null);OQ.Consumer;const Kot=e=>{const[t,n]=D.useState({projectName:null,projectURL:null,extraMeta:{}}),[r,a]=D.useState({API_BASE_URL:null,WS_BASE_URL:null,GW_BASE_URL:null,GW_PROXY_URL:null,PROXY_API_BASE_URL:null}),[i,o]=D.useState(()=>lwe(e.config.GW_BASE_URL||"")),[s,c]=D.useState(!1),[l,u]=D.useState(""),[d,h]=D.useState(""),[f,p]=D.useState(""),[v,y]=D.useState(cwe()),g=Zot(e.config.API_BASE_URL||""),m=RQ(e.config.API_BASE_URL||""),_=g||m,[b,k]=D.useState(()=>$Q(e.config.PROXY_API_BASE_URL||"",t==null?void 0:t.projectHmac)),[x,S]=D.useState(null),[C,N]=D.useState(null),L=()=>{y(cwe())};return D.useEffect(()=>{a(e==null?void 0:e.config)},[e.config]),D.useEffect(()=>{e!=null&&e.metadata&&n(e.metadata)},[e.metadata]),D.useEffect(()=>{if(!(r!=null&&r.PROXY_API_BASE_URL)||!(r!=null&&r.GW_PROXY_URL)||!(t!=null&&t.projectName)){console.log("Missing required config for proxy setup");return}o(lwe(r.GW_BASE_URL||"")),k(A=>{const P=$Q(r.PROXY_API_BASE_URL||"",t==null?void 0:t.projectHmac),T=P.createProxyFetch({miniappName:t.projectName||""}),$=async(V,z)=>T(V,z);S(()=>$);const O=P.createProxyGetView({miniappName:t.projectName||"",gwProxyUrl:r.GW_PROXY_URL||""}),B=async(V,z,j={})=>{if(typeof V!="string"||typeof z!="string")throw new Error(`Invalid parameters: schema and viewName must be strings. Got schema: ${typeof V}, viewName: ${typeof z}`);return O(V,z,j)};return N(()=>B),P})},[r,t]),M.jsx(OQ.Provider,{value:{config:r,projectMetadata:t,setProjectMetadata:n,syncToken:v,setSyncToken:L,selectedComponentId:l,setSelectedComponentId:u,selectedComponentXPath:d,setSelectedComponentXPath:h,selectedComponentHTML:f,setSelectedComponentHTML:p,isComponentSubselected:s,setIsComponentSubselected:c,APIHandler:_,gwAPIHandler:i,proxyHandler:b,proxyFetch:x,proxyGetView:C},children:e.children})},Jot=e=>M.jsx(qot,{children:M.jsx(owe,{children:M.jsx(Kot,{...e})})}),zQ=()=>{const e=D.useContext(OQ);if(e===null)throw new Error("Invalid project context.");return e},Qot=Tl.div`
8076
8076
  position: fixed;
8077
8077
  top: 0;
8078
8078
  left: 0;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@spaceandtimelabs/makeinfinite-ui",
3
3
  "author": "aw-sxt",
4
4
  "private": false,
5
- "version": "0.64.0",
5
+ "version": "0.65.0",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {