@qratilabs/qrati-connect 2.6.0-beta.5 → 2.6.0-beta.6
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/CHANGELOG.md +13 -0
- package/element/{BSwdc54O.js → BEBoQA60.js} +1 -1
- package/element/{h1CU3XIw.js → BIlPCz_o.js} +1 -1
- package/element/BTd1NOkQ.js +32 -0
- package/element/{DAc8-Vq0.js → Bg_MQgMI.js} +1 -1
- package/element/{B_-odLwh.js → BjTKrK5C.js} +1 -1
- package/element/{DWjAitc4.js → BmadK4Wv.js} +1 -1
- package/element/{BVNtfmU2.js → CCPQ2k_s.js} +1 -1
- package/element/{Khpj7noG.js → Ce3VsZXg.js} +1 -1
- package/element/{Du8-hT2f.js → DevLkupx.js} +1 -1
- package/element/{CCKM4kEF.js → DjZtNg85.js} +1 -1
- package/element/{DqKH1qcp.js → XxtVv0_m.js} +1 -1
- package/element/{Cpc6Qhgr.js → ZkgOLI4e.js} +1 -1
- package/element/web.es.js +39 -30
- package/package.json +1 -1
- package/react/{Dhqp1yUa.js → B4VbYQuK.js} +1 -1
- package/react/{BV4dUjFn.js → B518l82N.js} +1 -1
- package/react/BFad-5c7.js +32 -0
- package/react/{_MLx_tvJ.js → BNgI2fzK.js} +1 -1
- package/react/{D1f3o_1K.js → BVp2XPhY.js} +1 -1
- package/react/{Cobm3-vX.js → BYvNGazA.js} +1 -1
- package/react/{WrXR8YR8.js → BrVwQmEr.js} +1 -1
- package/react/{CeYyoPwz.js → CJSQhi3w.js} +1 -1
- package/react/{CzWQYPHX.js → CQEIwfsl.js} +1 -1
- package/react/CQOo74Vz.js +1 -0
- package/react/{CtqknzON.js → Cj-blcDU.js} +1 -1
- package/react/{DinOaFKZ.js → D5o34T5_.js} +1 -1
- package/react/{DcO7mt_p.js → D8yeXKjO.js} +1 -1
- package/react/{BgevrkB_.js → DDE_F97J.js} +1 -1
- package/react/{C7YJuZC4.js → DEyUQWqd.js} +1 -1
- package/react/{ngxwwooK.js → DXPqp49D.js} +1 -1
- package/react/{BTy_w8kX.js → DZhtj2aW.js} +1 -1
- package/react/{DQ0JX8Dk.js → DeIp8eYZ.js} +1 -1
- package/react/{BMlN6j8n.js → DwVIbjvO.js} +1 -1
- package/react/Dyoz00qA.js +1 -0
- package/react/{D6uUtYXQ.js → KxLT-7LA.js} +1 -1
- package/react/{Bq0ZWbLY.js → NMUY5ELn.js} +1 -1
- package/react/{CTIijg1m.js → _2oT6gLO.js} +1 -1
- package/react/{DKg-Zm_D.js → c6XMzK_1.js} +1 -1
- package/react/index.cjs +1 -1
- package/react/index.mjs +60 -51
- package/umd/web.umd.js +1 -1
- package/element/DrqEbHqs.js +0 -32
- package/react/BamgJ1xL.js +0 -32
- package/react/DN5LeJCD.js +0 -1
- package/react/vKxr3qjL.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# [2.6.0-beta.5](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.6.0-beta.4...v2.6.0-beta.5) (2026-03-25)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* improve error handling in password reset flow and update state management ([e6d0d66](https://github.com/qrati-labs/qrati-connect-ts/commit/e6d0d6680f509ae702927cd95f0a24af21b0a964))
|
|
7
|
+
* update PoweredByQrati component to include link and improve accessibility ([fe929c1](https://github.com/qrati-labs/qrati-connect-ts/commit/fe929c13843b54600e7d90f928a2060ea8f8746f))
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* implement password reset flow with verification code handling ([1f30414](https://github.com/qrati-labs/qrati-connect-ts/commit/1f304142b97df13ef509e5a9a6be1c1ed40528f0))
|
|
13
|
+
|
|
1
14
|
# [2.6.0-beta.4](https://github.com/qrati-labs/qrati-connect-ts/compare/v2.6.0-beta.3...v2.6.0-beta.4) (2026-03-25)
|
|
2
15
|
|
|
3
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t}from"./2R3GoXB1.js";import{Mt as o,N as r,Nt as n,j as e,wt as a}from"./
|
|
1
|
+
import{r as t}from"./2R3GoXB1.js";import{Mt as o,N as r,Nt as n,j as e,wt as a}from"./Bg_MQgMI.js";import{t as i}from"./ZkgOLI4e.js";import{o as s}from"./Ce3VsZXg.js";import{t as c}from"./DjZtNg85.js";var l=new i,p=(t,o)=>{n(/* @__PURE__ */r(e,{client:l,children:/* @__PURE__ */r(s,{children:/* @__PURE__ */r(c,{event:t})})}),o)},m=({events:n})=>{const e=a(null),i=a(null);return o(()=>{if(!e.current||i.current)return;let o;return(async()=>{const r=await import("./ZShDCNL_.js").then(o=>/* @__PURE__ */t(o.default,1));if(await Promise.resolve({ }),!e.current)return;const a=r.map(e.current,{center:[20,0],zoom:2,zoomControl:!0,worldCopyJump:!0});r.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:"© OpenStreetMap contributors",maxZoom:19}).addTo(a),i.current=a;const s=n.filter(t=>"number"==typeof t.location?.x&&"number"==typeof t.location?.y);if(s.length>0){const t=r.latLngBounds([]);for(const o of s){const n=o.location.x,e=o.location.y;t.extend([e,n]);const i=r.divIcon({className:"qrati-leaflet-marker-wrapper",html:'\n <div style="\n width: 28px;\n height: 28px;\n cursor: pointer;\n background: var(--color-primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n "></div>\n ',iconSize:[28,28],iconAnchor:[14,28],popupAnchor:[0,-28]}),s=r.marker([e,n],{icon:i}).addTo(a),c=document.createElement("div");p(o,c),s.bindPopup(c,{closeButton:!0,maxWidth:220})}t.isValid()&&a.fitBounds(t,{padding:[60,60],maxZoom:14})}o=()=>{a.remove(),i.current=null}})(),()=>{o?.()}},[n]),/* @__PURE__ */r("div",{ref:e,class:"size-full"})};export{m as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./2R3GoXB1.js";import{Mt as t,N as r,Nt as n,j as o,wt as i}from"./
|
|
1
|
+
import{r as e}from"./2R3GoXB1.js";import{Mt as t,N as r,Nt as n,j as o,wt as i}from"./Bg_MQgMI.js";import{t as a}from"./ZkgOLI4e.js";import{o as s}from"./Ce3VsZXg.js";import{t as l}from"./DjZtNg85.js";var c=new a,u=(e,t)=>{n(/* @__PURE__ */r(o,{client:c,children:/* @__PURE__ */r(s,{children:/* @__PURE__ */r(l,{event:e})})}),t)},d=({events:n,apiKey:o,is3D:a})=>{const s=i(null),l=i(null),c=i(a);return t(()=>{if(!s.current||l.current)return;let t;return(async()=>{const r=(await import("./DMDEuqn7.js").then(t=>/* @__PURE__ */e(t.default,1))).default;if(await Promise.resolve({ }),!s.current)return;const i=new r.Map({container:s.current,style:`https://api.maptiler.com/maps/streets-v2/style.json?key=${o}`,center:[0,20],zoom:2,pitch:0,bearing:0,projection:c.current?{type:"globe"}:{type:"mercator"},canvasContextAttributes:{antialias:!0}});l.current=i,i.on("load",()=>{const e=i.getStyle()?.layers??[];let t,o;for(const r of e){const e=r;"symbol"===e.type&&e.layout?.["text-field"]&&!t&&(t=r.id),"building"!==e["source-layer"]||o||(o=e.source)}o&&!i.getLayer("3d-buildings")&&i.addLayer({id:"3d-buildings",source:o,"source-layer":"building",filter:["has","render_height"],type:"fill-extrusion",minzoom:14,paint:{"fill-extrusion-color":["interpolate",["linear"],["get","render_height"],0,"lightgray",200,"royalblue",400,"lightblue"],"fill-extrusion-height":["interpolate",["linear"],["zoom"],14,0,15,["get","render_height"]],"fill-extrusion-base":["case",["has","render_min_height"],["get","render_min_height"],0],"fill-extrusion-opacity":.6}},t);const a=n.filter(e=>"number"==typeof e.location?.x&&"number"==typeof e.location?.y);if(0===a.length)return;const s=new r.LngLatBounds;for(const n of a){const e=n.location.x,t=n.location.y;s.extend([e,t]);const o=document.createElement("div");o.className="qrati-map-marker",o.style.cssText="\n width: 32px; height: 32px; cursor: pointer;\n background: var(--color-primary, #6366f1);\n border-radius: 50% 50% 50% 0;\n transform: rotate(-45deg);\n border: 2px solid white;\n box-shadow: 0 2px 8px rgba(0,0,0,0.3);\n ";const a=document.createElement("div");u(n,a);const l=new r.Popup({closeButton:!0,closeOnClick:!1,maxWidth:"none",offset:[0,-34]}).setDOMContent(a);new r.Marker({element:o}).setLngLat([e,t]).setPopup(l).addTo(i)}s.isEmpty()||i.fitBounds(s,{padding:{top:60,bottom:60,left:60,right:60},maxZoom:14,animate:!0,duration:1200})}),t=()=>{i.remove(),l.current=null}})(),()=>{t?.()}},[o]),t(()=>{l.current&&(c.current=a,l.current.setProjection(a?{type:"globe"}:{type:"mercator"}),l.current.easeTo({pitch:0,bearing:0,duration:600}))},[a]),/* @__PURE__ */r("div",{ref:s,class:"size-full"})};export{d as default};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import{$ as e,At as t,B as r,Ct as s,Dt as o,E as n,F as i,Ft as a,M as l,Mt as c,N as h,S as u,St as d,Tt as f,Y as p,_t as m,bt as y,et as g,ft as w,gt as b,ht as R,i as v,jt as S,l as T,lt as x,mt as A,n as E,t as I,tt as C,vt as O,xt as P}from"./Bg_MQgMI.js";var q=class extends s{constructor(e,t){super(),this.options=t,this.#e=e,this.#t=null,this.#r=g(),this.bindMethods(),this.setOptions(t)}#e;#s=void 0;#o=void 0;#n=void 0;#i;#a;#r;#t;#l;#c;#h;#u;#d;#f;#p=/* @__PURE__ */new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#s.addObserver(this),k(this.#s,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return D(this.#s,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return D(this.#s,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=/* @__PURE__ */new Set,this.#g(),this.#w(),this.#s.removeObserver(this)}setOptions(e){const t=this.options,r=this.#s;if(this.options=this.#e.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof R(this.options.enabled,this.#s))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#b(),this.#s.setOptions(this.options),t._defaulted&&!m(this.options,t)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#s,observer:this});const s=this.hasListeners();s&&N(this.#s,r,this.options,t)&&this.#m(),this.updateResult(),!s||this.#s===r&&R(this.options.enabled,this.#s)===R(t.enabled,this.#s)&&b(this.options.staleTime,this.#s)===b(t.staleTime,this.#s)||this.#R();const o=this.#v();!s||this.#s===r&&R(this.options.enabled,this.#s)===R(t.enabled,this.#s)&&o===this.#f||this.#S(o)}getOptimisticResult(e){const t=this.#e.getQueryCache().build(this.#e,e),r=this.createResult(t,e);var s;return s=r,m(this.getCurrentResult(),s)||(this.#n=r,this.#a=this.options,this.#i=this.#s.state),r}getCurrentResult(){return this.#n}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#r.status||this.#r.reject(/* @__PURE__ */new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#s}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#e.defaultQueryOptions(e),r=this.#e.getQueryCache().build(this.#e,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#m(e){this.#b();let t=this.#s.fetch(this.options,e);return e?.throwOnError||(t=t.catch(w)),t}#R(){this.#g();const e=b(this.options.staleTime,this.#s);if(C.isServer()||this.#n.isStale||!x(e))return;const t=y(this.#n.dataUpdatedAt,e)+1;this.#u=P.setTimeout(()=>{this.#n.isStale||this.updateResult()},t)}#v(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#s):this.options.refetchInterval)??!1}#S(e){this.#w(),this.#f=e,!C.isServer()&&!1!==R(this.options.enabled,this.#s)&&x(this.#f)&&0!==this.#f&&(this.#d=P.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#m()},this.#f))}#y(){this.#R(),this.#S(this.#v())}#g(){this.#u&&(P.clearTimeout(this.#u),this.#u=void 0)}#w(){this.#d&&(P.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){const r=this.#s,s=this.options,o=this.#n,n=this.#i,i=this.#a,a=e!==r?e.state:this.#o,{state:l}=e;let c,h={...l},u=!1;if(t._optimisticResults){const o=this.hasListeners(),n=!o&&k(e,t),i=o&&N(e,r,t,s);(n||i)&&(h={...h,...p(l.data,e.options)}),"isRestoring"===t._optimisticResults&&(h.fetchStatus="idle")}let{error:d,errorUpdatedAt:f,status:m}=h;c=h.data;let y=!1;if(void 0!==t.placeholderData&&void 0===c&&"pending"===m){let e;o?.isPlaceholderData&&t.placeholderData===i?.placeholderData?(e=o.data,y=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#h?.state.data,this.#h):t.placeholderData,void 0!==e&&(m="success",c=A(o?.data,e,t),u=!0)}if(t.select&&void 0!==c&&!y)if(o&&c===n?.data&&t.select===this.#l)c=this.#c;else try{this.#l=t.select,c=t.select(c),c=A(o?.data,c,t),this.#c=c,this.#t=null}catch(E){this.#t=E}this.#t&&(d=this.#t,c=this.#c,f=Date.now(),m="error");const w="fetching"===h.fetchStatus,b="pending"===m,v="error"===m,S=b&&w,T=void 0!==c,x={status:m,fetchStatus:h.fetchStatus,isPending:b,isSuccess:"success"===m,isError:v,isInitialLoading:S,isLoading:S,data:c,dataUpdatedAt:h.dataUpdatedAt,error:d,errorUpdatedAt:f,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:h.dataUpdateCount>a.dataUpdateCount||h.errorUpdateCount>a.errorUpdateCount,isFetching:w,isRefetching:w&&!b,isLoadingError:v&&!T,isPaused:"paused"===h.fetchStatus,isPlaceholderData:u,isRefetchError:v&&T,isStale:M(e,t),refetch:this.refetch,promise:this.#r,isEnabled:!1!==R(t.enabled,e)};if(this.options.experimental_prefetchInRender){const t=void 0!==x.data,s="error"===x.status&&!t,o=e=>{s?e.reject(x.error):t&&e.resolve(x.data)},n=()=>{o(this.#r=x.promise=g())},i=this.#r;switch(i.status){case"pending":e.queryHash===r.queryHash&&o(i);break;case"fulfilled":(s||x.data!==i.value)&&n();break;case"rejected":s&&x.error===i.reason||n()}}return x}updateResult(){const e=this.#n,t=this.createResult(this.#s,this.options);this.#i=this.#s.state,this.#a=this.options,void 0!==this.#i.data&&(this.#h=this.#s),m(t,e)||(this.#n=t,this.#T({listeners:(()=>{if(!e)return!0;const{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#p.size)return!0;const s=new Set(r??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#n).some(t=>{const r=t;return this.#n[r]!==e[r]&&s.has(r)})})()}))}#b(){const e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#s)return;const t=this.#s;this.#s=e,this.#o=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#T(t){e.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#n)}),this.#e.getQueryCache().notify({query:this.#s,type:"observerResultsUpdated"})})}};function k(e,t){return function(e,t){return!1!==R(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&D(e,t,t.refetchOnMount)}function D(e,t,r){if(!1!==R(t.enabled,e)&&"static"!==b(t.staleTime,e)){const s="function"==typeof r?r(e):r;return"always"===s||!1!==s&&M(e,t)}return!1}function N(e,t,r,s){return(e!==t||!1===R(s.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&M(e,r)}function M(e,t){return!1!==R(t.enabled,e)&&e.isStaleByTime(b(t.staleTime,e))}var U=a(!1);U.Provider;var L=a(function(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}()),Q=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function _(r,s,n){const a=S(U),h=S(L),u=l(n),d=u.defaultQueryOptions(r);u.getDefaultOptions().queries?._experimental_beforeQuery?.(d);const f=u.getQueryCache().get(d.queryHash);d._optimisticResults=a?"isRestoring":"optimistic",(e=>{if(e.suspense){const t=1e3,r=e=>"static"===e?e:Math.max(e??t,t),s=e.staleTime;e.staleTime="function"==typeof s?(...e)=>r(s(...e)):r(s),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,t))}})(d),((e,t,r)=>{const s=r?.state.error&&"function"==typeof e.throwOnError?O(e.throwOnError,[r.state.error,r]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||s)&&(t.isReset()||(e.retryOnMount=!1))})(d,h,f),(e=>{c(()=>{e.clearReset()},[e])})(h);const p=!u.getQueryCache().get(d.queryHash),[m]=o(()=>new s(u,d)),y=m.getOptimisticResult(d),g=!a&&!1!==r.subscribed;if(i(t(t=>{const r=g?m.subscribe(e.batchCalls(t)):w;return m.updateResult(),r},[m,g]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),c(()=>{m.setOptions(d)},[d,m]),((e,t)=>e?.suspense&&t.isPending)(d,y))throw Q(d,m,h);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:o})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(o&&void 0===e.data||O(r,[e.error,s])))({result:y,errorResetBoundary:h,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw y.error;return u.getDefaultOptions().queries?._experimental_afterQuery?.(d,y),d.experimental_prefetchInRender&&!C.isServer()&&((e,t)=>e.isLoading&&e.isFetching&&!t)(y,a)&&(p?Q(d,m,h):f?.promise)?.catch(w).finally(()=>{m.updateResult()}),d.notifyOnChangeProps?y:m.trackResult(y)}function j(e,t){return _(e,q,t)}var F=class extends Error{response;request;options;constructor(e,t,r){const s=`${e.status||0===e.status?e.status:""} ${e.statusText??""}`.trim();super(`Request failed with ${s?`status code ${s}`:"an unknown error"}: ${t.method} ${t.url}`),this.name="HTTPError",this.response=e,this.request=t,this.options=r}},z=class extends Error{name="NonError";value;constructor(e){let t="Non-error value was thrown";try{"string"==typeof e?t=e:e&&"object"==typeof e&&"message"in e&&"string"==typeof e.message&&(t=e.message)}catch{}super(t),this.value=e}},H=class extends Error{name="ForceRetryError";customDelay;code;customRequest;constructor(e){const t=e?.cause?e.cause instanceof Error?e.cause:new z(e.cause):void 0;super(e?.code?`Forced retry: ${e.code}`:"Forced retry",t?{cause:t}:void 0),this.customDelay=e?.delay,this.code=e?.code,this.customRequest=e?.request}},B=(()=>{let e=!1,t=!1;const r="function"==typeof globalThis.ReadableStream,s="function"==typeof globalThis.Request;if(r&&s)try{t=new globalThis.Request("https://empty.invalid",{body:new globalThis.ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type")}catch(o){if(o instanceof Error&&"unsupported BodyInit type"===o.message)return!1;throw o}return e&&!t})(),W="function"==typeof globalThis.AbortController,V="function"==typeof globalThis.AbortSignal&&"function"==typeof globalThis.AbortSignal.any,Z="function"==typeof globalThis.ReadableStream,$="function"==typeof globalThis.FormData,G=["get","post","put","patch","head","delete"],J={json:"application/json",text:"text/*",formData:"multipart/form-data",arrayBuffer:"*/*",blob:"*/*",bytes:"*/*"},Y=(new TextEncoder).encode("------WebKitFormBoundaryaxpyiPgbbPti10Rw").length,K=Symbol("stop"),X=class{options;constructor(e){this.options=e}},ee=e=>new X(e),te={json:!0,parseJson:!0,stringifyJson:!0,searchParams:!0,prefixUrl:!0,retry:!0,timeout:!0,hooks:!0,throwHttpErrors:!0,onDownloadProgress:!0,onUploadProgress:!0,fetch:!0,context:!0},re={next:!0},se={method:!0,headers:!0,body:!0,mode:!0,credentials:!0,cache:!0,redirect:!0,referrer:!0,referrerPolicy:!0,integrity:!0,keepalive:!0,signal:!0,window:!0,duplex:!0},oe=(e,t,r)=>{let s,o=0;return e.pipeThrough(new TransformStream({transform(e,n){if(n.enqueue(e),s){o+=s.byteLength;let e=0===t?0:o/t;e>=1&&(e=1-Number.EPSILON),r?.({percent:e,totalBytes:Math.max(t,o),transferredBytes:o},s)}s=e},flush(){s&&(o+=s.byteLength,r?.({percent:1,totalBytes:Math.max(t,o),transferredBytes:o},s))}}))},ne=e=>null!==e&&"object"==typeof e,ie=(...e)=>{for(const t of e)if((!ne(t)||Array.isArray(t))&&void 0!==t)throw new TypeError("The `options` argument must be an object");return ue({},...e)},ae=(e={},t={})=>{const r=new globalThis.Headers(e),s=t instanceof globalThis.Headers,o=new globalThis.Headers(t);for(const[n,i]of o.entries())s&&"undefined"===i||void 0===i?r.delete(n):r.set(n,i);return r};function le(e,t,r){return Object.hasOwn(t,r)&&void 0===t[r]?[]:ue(e[r]??[],t[r]??[])}var ce=(e={},t={})=>({beforeRequest:le(e,t,"beforeRequest"),beforeRetry:le(e,t,"beforeRetry"),afterResponse:le(e,t,"afterResponse"),beforeError:le(e,t,"beforeError")}),he=(e,t)=>{const r=new URLSearchParams;for(const s of[e,t])if(void 0!==s)if(s instanceof URLSearchParams)for(const[e,t]of s.entries())r.append(e,t);else if(Array.isArray(s))for(const e of s){if(!Array.isArray(e)||2!==e.length)throw new TypeError("Array search parameters must be provided in [[key, value], ...] format");r.append(String(e[0]),String(e[1]))}else if(ne(s))for(const[e,t]of Object.entries(s))void 0!==t&&r.append(e,String(t));else{const e=new URLSearchParams(s);for(const[t,s]of e.entries())r.append(t,s)}return r},ue=(...e)=>{let t,r={},s={},o={};const n=[];for(const i of e)if(Array.isArray(i))Array.isArray(r)||(r=[]),r=[...r,...i];else if(ne(i)){for(let[e,s]of Object.entries(i))if("signal"===e&&s instanceof globalThis.AbortSignal)n.push(s);else if("context"!==e)"searchParams"!==e?(ne(s)&&e in r&&(s=ue(r[e],s)),r={...r,[e]:s}):t=null==s?void 0:void 0===t?s:he(t,s);else{if(null!=s&&(!ne(s)||Array.isArray(s)))throw new TypeError("The `context` option must be an object");r={...r,context:null==s?{}:{...r.context,...s}}}ne(i.hooks)&&(o=ce(o,i.hooks),r.hooks=o),ne(i.headers)&&(s=ae(s,i.headers),r.headers=s)}return void 0!==t&&(r.searchParams=t),n.length>0&&(1===n.length?r.signal=n[0]:r.signal=V?AbortSignal.any(n):n.at(-1)),r},de=e=>G.includes(e)?e.toUpperCase():e,fe={limit:2,methods:["get","put","head","delete","options","trace"],statusCodes:[408,413,429,500,502,503,504],afterStatusCodes:[413,429,503],maxRetryAfter:Number.POSITIVE_INFINITY,backoffLimit:Number.POSITIVE_INFINITY,delay:e=>.3*2**(e-1)*1e3,jitter:void 0,retryOnTimeout:!1},pe=(e={})=>{if("number"==typeof e)return{...fe,limit:e};if(e.methods&&!Array.isArray(e.methods))throw new Error("retry.methods must be an array");if(e.methods&&=e.methods.map(e=>e.toLowerCase()),e.statusCodes&&!Array.isArray(e.statusCodes))throw new Error("retry.statusCodes must be an array");const t=Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e));return{...fe,...t}},me=class extends Error{request;constructor(e){super(`Request timed out: ${e.method} ${e.url}`),this.name="TimeoutError",this.request=e}},ye=class e{static create(t,r){const s=new e(t,r),o=s.#x(async()=>{if("number"==typeof s.#A.timeout&&s.#A.timeout>2147483647)throw new RangeError("The `timeout` option cannot be greater than 2147483647");await Promise.resolve();let e=await s.#E();for(const r of s.#A.hooks.afterResponse){const o=s.#I(e.clone());let n;try{n=await r(s.request,s.#C(),o,{retryCount:s.#O})}catch(t){throw s.#P(o),s.#P(e),t}if(n instanceof X)throw s.#P(o),s.#P(e),new H(n.options);const i=n instanceof globalThis.Response?n:e;o!==i&&s.#P(o),e!==i&&s.#P(e),e=i}if(s.#I(e),!e.ok&&("function"==typeof s.#A.throwHttpErrors?s.#A.throwHttpErrors(e.status):s.#A.throwHttpErrors)){let t=new F(e,s.request,s.#C());for(const e of s.#A.hooks.beforeError)t=await e(t,{retryCount:s.#O});throw t}if(s.#A.onDownloadProgress){if("function"!=typeof s.#A.onDownloadProgress)throw new TypeError("The `onDownloadProgress` option must be a function");if(!Z)throw new Error("Streams are not supported in your environment. `ReadableStream` is missing.");const t=e.clone();return s.#P(e),((e,t)=>{if(!e.body)return e;if(204===e.status)return new Response(null,{status:e.status,statusText:e.statusText,headers:e.headers});const r=Math.max(0,Number(e.headers.get("content-length"))||0);return new Response(oe(e.body,r,t),{status:e.status,statusText:e.statusText,headers:e.headers})})(t,s.#A.onDownloadProgress)}return e}).finally(()=>{const e=s.#q;s.#k(e?.body??void 0),s.#k(s.request.body??void 0)});for(const[e,n]of Object.entries(J))"bytes"===e&&"function"!=typeof globalThis.Response?.prototype?.bytes||(o[e]=async()=>{s.request.headers.set("accept",s.request.headers.get("accept")||n);const t=await o;if("json"===e){if(204===t.status)return"";const e=await t.text();return""===e?"":r.parseJson?r.parseJson(e):JSON.parse(e)}return t[e]()});return o}static#D(e){return!e||"object"!=typeof e||Array.isArray(e)||e instanceof URLSearchParams?e:Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e))}request;#N;#O=0;#M;#A;#q;#U;#L;constructor(t,r={}){if(this.#M=t,this.#A={...r,headers:ae(this.#M.headers,r.headers),hooks:ce({beforeRequest:[],beforeRetry:[],beforeError:[],afterResponse:[]},r.hooks),method:de(r.method??this.#M.method??"GET"),prefixUrl:String(r.prefixUrl||""),retry:pe(r.retry),throwHttpErrors:r.throwHttpErrors??!0,timeout:r.timeout??1e4,fetch:r.fetch??globalThis.fetch.bind(globalThis),context:r.context??{}},"string"!=typeof this.#M&&!(this.#M instanceof URL||this.#M instanceof globalThis.Request))throw new TypeError("`input` must be a string, URL, or Request");if(this.#A.prefixUrl&&"string"==typeof this.#M){if(this.#M.startsWith("/"))throw new Error("`input` must not begin with a slash when using `prefixUrl`");this.#A.prefixUrl.endsWith("/")||(this.#A.prefixUrl+="/"),this.#M=this.#A.prefixUrl+this.#M}W&&V&&(this.#U=this.#A.signal??this.#M.signal,this.#N=new globalThis.AbortController,this.#A.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal),B&&(this.#A.duplex="half"),void 0!==this.#A.json&&(this.#A.body=this.#A.stringifyJson?.(this.#A.json)??JSON.stringify(this.#A.json),this.#A.headers.set("content-type",this.#A.headers.get("content-type")??"application/json"));const s=r.headers&&new globalThis.Headers(r.headers).has("content-type");if(this.#M instanceof globalThis.Request&&($&&this.#A.body instanceof globalThis.FormData||this.#A.body instanceof URLSearchParams)&&!s&&this.#A.headers.delete("content-type"),this.request=new globalThis.Request(this.#M,this.#A),void 0!==(o=this.#A.searchParams)&&(Array.isArray(o)?o.length>0:o instanceof URLSearchParams?o.size>0:"object"==typeof o?Object.keys(o).length>0:"string"==typeof o?o.trim().length>0:Boolean(o))){const t="?"+("string"==typeof this.#A.searchParams?this.#A.searchParams.replace(/^\?/,""):new URLSearchParams(e.#D(this.#A.searchParams)).toString()),r=this.request.url.replace(/(?:\?.*?)?(?=#|$)/,t);this.request=new globalThis.Request(r,this.#A)}var o;if(this.#A.onUploadProgress){if("function"!=typeof this.#A.onUploadProgress)throw new TypeError("The `onUploadProgress` option must be a function");if(!B)throw new Error("Request streams are not supported in your environment. The `duplex` option for `Request` is not available.");this.request=this.#Q(this.request,this.#A.body??void 0)}}#_(){const e=this.#A.retry.delay(this.#O);let t=e;!0===this.#A.retry.jitter?t=Math.random()*e:"function"==typeof this.#A.retry.jitter&&(t=this.#A.retry.jitter(e),(!Number.isFinite(t)||t<0)&&(t=e));const r=this.#A.retry.backoffLimit??Number.POSITIVE_INFINITY;return Math.min(r,t)}async#j(e){if(this.#O++,this.#O>this.#A.retry.limit)throw e;const t=e instanceof Error?e:new z(e);if(t instanceof H)return t.customDelay??this.#_();if(!this.#A.retry.methods.includes(this.request.method.toLowerCase()))throw e;if(void 0!==this.#A.retry.shouldRetry){const r=await this.#A.retry.shouldRetry({error:t,retryCount:this.#O});if(!1===r)throw e;if(!0===r)return this.#_()}if(function(e){return e instanceof me||e?.name===me.name}(e)&&!this.#A.retry.retryOnTimeout)throw e;if(function(e){return e instanceof F||e?.name===F.name}(e)){if(!this.#A.retry.statusCodes.includes(e.response.status))throw e;const t=e.response.headers.get("Retry-After")??e.response.headers.get("RateLimit-Reset")??e.response.headers.get("X-RateLimit-Retry-After")??e.response.headers.get("X-RateLimit-Reset")??e.response.headers.get("X-Rate-Limit-Reset");if(t&&this.#A.retry.afterStatusCodes.includes(e.response.status)){let e=1e3*Number(t);Number.isNaN(e)?e=Date.parse(t)-Date.now():e>=Date.parse("2024-01-01")&&(e-=Date.now());const r=this.#A.retry.maxRetryAfter??e;return e<r?e:r}if(413===e.response.status)throw e}return this.#_()}#I(e){return this.#A.parseJson&&(e.json=async()=>this.#A.parseJson(await e.text())),e}#k(e){e&&e.cancel().catch(()=>{})}#P(e){this.#k(e.body??void 0)}async#x(e){try{return await e()}catch(t){const r=Math.min(await this.#j(t),2147483647);if(this.#O<1)throw t;if(await async function(e,{signal:t}){return new Promise((r,s)=>{function o(){clearTimeout(n),s(t.reason)}t&&(t.throwIfAborted(),t.addEventListener("abort",o,{once:!0}));const n=setTimeout(()=>{t?.removeEventListener("abort",o),r()},e)})}(r,this.#U?{signal:this.#U}:{}),t instanceof H&&t.customRequest){const e=this.#A.signal?new globalThis.Request(t.customRequest,{signal:this.#A.signal}):new globalThis.Request(t.customRequest);this.#F(e)}for(const e of this.#A.hooks.beforeRetry){const r=await e({request:this.request,options:this.#C(),error:t,retryCount:this.#O});if(r instanceof globalThis.Request){this.#F(r);break}if(r instanceof globalThis.Response)return r;if(r===K)return}return this.#x(e)}}async#E(){this.#N?.signal.aborted&&(this.#N=new globalThis.AbortController,this.#A.signal=this.#U?AbortSignal.any([this.#U,this.#N.signal]):this.#N.signal,this.request=new globalThis.Request(this.request,{signal:this.#A.signal}));for(const t of this.#A.hooks.beforeRequest){const e=await t(this.request,this.#C(),{retryCount:this.#O});if(e instanceof Response)return e;if(e instanceof globalThis.Request){this.#F(e);break}}const e=((e,t)=>{const r={};for(const s in t)Object.hasOwn(t,s)&&(s in se||s in te||s in e&&!(s in re)||(r[s]=t[s]));return r})(this.request,this.#A);return this.#q=this.request,this.request=this.#q.clone(),!1===this.#A.timeout?this.#A.fetch(this.#q,e):async function(e,t,r,s){return new Promise((o,n)=>{const i=setTimeout(()=>{r&&r.abort(),n(new me(e))},s.timeout);s.fetch(e,t).then(o).catch(n).then(()=>{clearTimeout(i)})})}(this.#q,e,this.#N,this.#A)}#C(){if(!this.#L){const{hooks:e,...t}=this.#A;this.#L=Object.freeze(t)}return this.#L}#F(e){this.#L=void 0,this.request=this.#Q(e)}#Q(e,t){return this.#A.onUploadProgress&&e.body?((e,t,r)=>{if(!e.body)return e;const s=(e=>{if(!e)return 0;if(e instanceof FormData){let t=0;for(const[r,s]of e)t+=Y,t+=(new TextEncoder).encode(`Content-Disposition: form-data; name="${r}"`).length,t+="string"==typeof s?(new TextEncoder).encode(s).length:s.size;return t}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength;if("string"==typeof e)return(new TextEncoder).encode(e).length;if(e instanceof URLSearchParams)return(new TextEncoder).encode(e.toString()).length;if("byteLength"in e)return e.byteLength;if("object"==typeof e&&null!==e)try{const t=JSON.stringify(e);return(new TextEncoder).encode(t).length}catch{return 0}return 0})(r??e.body);return new Request(e,{duplex:"half",body:oe(e.body,s,t)})})(e,this.#A.onUploadProgress,t??this.#A.body??void 0):e}},ge=e=>{const t=(t,r)=>ye.create(t,ie(e,r));for(const r of G)t[r]=(t,s)=>ye.create(t,ie(e,s,{method:r}));return t.create=e=>ge(ie(e)),t.extend=t=>("function"==typeof t&&(t=t(e??{})),ge(ie(e,t))),t.stop=K,t.retry=ee,t},we=ge();function be({title:e,children:t}){/* @__PURE__ */
|
|
2
|
+
return h("div",{className:"mx-auto mt-24 w-fit max-w-xl space-y-8",children:[/* @__PURE__ */h("svg",{xmlns:"http://www.w3.org/2000/svg",className:"mx-auto h-64 w-fit",width:"800",height:"469.317",viewBox:"0 0 800 469.317",role:"img","aria-label":"Error illustration",children:/* @__PURE__ */h("g",{transform:"translate(-443.142 -257.876)",children:[
|
|
3
|
+
/* @__PURE__ */h("path",{d:"M898.247,664.1H371.155a30.276,30.276,0,0,1-30.241-30.241V352.525a30.276,30.276,0,0,1,30.241-30.241H898.247a30.276,30.276,0,0,1,30.241,30.241V633.862A30.276,30.276,0,0,1,898.247,664.1Z",transform:"translate(308.867 25.517)",fill:"#fff"}),
|
|
4
|
+
/* @__PURE__ */h("path",{d:"M557.334,341.82H30.241A30.276,30.276,0,0,1,0,311.578V30.241A30.276,30.276,0,0,1,30.241,0H557.334a30.276,30.276,0,0,1,30.241,30.241V311.578A30.276,30.276,0,0,1,557.334,341.82ZM30.241,1.833A28.441,28.441,0,0,0,1.833,30.241V311.578a28.441,28.441,0,0,0,28.409,28.409H557.334a28.441,28.441,0,0,0,28.409-28.409V30.241A28.441,28.441,0,0,0,557.334,1.833Z",transform:"matrix(0.999, -0.035, 0.035, 0.999, 643.995, 358.158)",fill:"#d6d6e3"}),
|
|
5
|
+
/* @__PURE__ */h("path",{d:"M754.171,630.2l-509.5-135.058a30.276,30.276,0,0,1-21.483-36.981L295.28,186.212a30.276,30.276,0,0,1,36.981-21.483l509.5,135.058a30.276,30.276,0,0,1,21.483,36.981L791.152,608.712A30.276,30.276,0,0,1,754.171,630.2Z",transform:"translate(220.958 94.156)",fill:"#f2f2f2"}),
|
|
6
|
+
/* @__PURE__ */h("path",{d:"M775.247,705.1H248.155a30.276,30.276,0,0,1-30.241-30.241V393.525a30.276,30.276,0,0,1,30.241-30.241H775.247a30.276,30.276,0,0,1,30.241,30.242V674.862A30.275,30.275,0,0,1,775.247,705.1Z",transform:"translate(319.149 22.09)",fill:"#fff"}),
|
|
7
|
+
/* @__PURE__ */h("path",{d:"M638.653,701.841H298.272c-.426,0-.852-.009-1.272-.033l160.985-90.663c3.065-1.762,9.943-2.382,15.361-1.385a13.912,13.912,0,0,1,4.26,1.385l108.041,60.842,5.176,2.911Z",transform:"translate(312.538 1.526)",fill:"#e6e6e6"}),
|
|
8
|
+
/* @__PURE__ */h("path",{d:"M760.145,704.279h-294.4l57.049-26.943L526.9,675.4l74.341-35.111c4.874-2.3,16.6-2.445,22.328-.434q.577.206,1.071.434Z",transform:"translate(298.432 -0.912)",fill:"#e6e6e6"}),
|
|
9
|
+
/* @__PURE__ */h("path",{d:"M248.322,365.284a28.441,28.441,0,0,0-28.409,28.409V675.03a28.441,28.441,0,0,0,28.409,28.409H775.415a28.441,28.441,0,0,0,28.409-28.409V393.693a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 21.923)",fill:"#3f3d56"}),
|
|
10
|
+
/* @__PURE__ */h("path",{d:"M777.254,685.116H250.161a8.257,8.257,0,0,1-8.248-8.248V395.532a8.257,8.257,0,0,1,8.248-8.248H777.254a8.257,8.257,0,0,1,8.248,8.248V676.869a8.257,8.257,0,0,1-8.248,8.248Zm-527.092-296a6.422,6.422,0,0,0-6.415,6.415V676.869a6.422,6.422,0,0,0,6.415,6.415H777.254a6.422,6.422,0,0,0,6.415-6.415V395.532a6.422,6.422,0,0,0-6.415-6.415Z",transform:"translate(317.143 20.083)",fill:"#ccc"}),
|
|
11
|
+
/* @__PURE__ */h("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(928.82 428.806)",fill:"#f2f2f2"}),
|
|
12
|
+
/* @__PURE__ */h("path",{d:"M505.77,325.365h.2l3.553,203.7h-7.5Z",transform:"translate(495.097 175.29)",fill:"#ccc"}),
|
|
13
|
+
/* @__PURE__ */h("path",{d:"M736.239,636.154h0a1.776,1.776,0,0,1-.744,2.4l-10.3,5.425-1.655-3.144,10.3-5.425A1.776,1.776,0,0,1,736.239,636.154Z",transform:"translate(276.882 -0.641)",fill:"#ccc"}),
|
|
14
|
+
/* @__PURE__ */h("ellipse",{cx:"71.849",cy:"89.934",rx:"71.849",ry:"89.934",transform:"translate(722.256 428.806)",fill:"#f2f2f2"}),
|
|
15
|
+
/* @__PURE__ */h("path",{d:"M510.532,627.307h0a1.777,1.777,0,0,0-2.4-.744l-7.194,3.788-2.464-141.27h-.2l-3.75,203.7h7.5l-1.02-58.456,8.78-4.622A1.777,1.777,0,0,0,510.532,627.307Z",transform:"translate(296.026 11.574)",fill:"#ccc"}),
|
|
16
|
+
/* @__PURE__ */h("path",{d:"M626.318,603.854a2.25,2.25,0,0,0-3.04-.943l-9.116,4.8-3.122-179h-.25l-4.752,258.115h9.5l-1.292-74.07,11.125-5.857a2.251,2.251,0,0,0,.943-3.04Z",transform:"translate(286.704 16.621)",fill:"#3f3d56"}),
|
|
17
|
+
/* @__PURE__ */h("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1Z",transform:"translate(318.982 22.257)",fill:"#fff"}),
|
|
18
|
+
/* @__PURE__ */h("path",{d:"M671.188,708.113h-370.8c-.464,0-.928-.01-1.386-.036l175.372-98.766c3.339-1.919,10.831-2.595,16.734-1.509a15.16,15.16,0,0,1,4.641,1.509l117.7,66.28,5.639,3.172Z",transform:"translate(288.046 16.168)",fill:"#f2f2f2"}),
|
|
19
|
+
/* @__PURE__ */h("path",{d:"M788.457,708.163H467.743l62.148-29.351,4.472-2.114,80.984-38.25c5.309-2.507,18.082-2.663,24.324-.473q.629.224,1.166.473Z",transform:"translate(287.761 16.118)",fill:"#f2f2f2"}),
|
|
20
|
+
/* @__PURE__ */h("path",{d:"M777.247,703.1H250.155a30.276,30.276,0,0,1-30.241-30.241V391.525a30.276,30.276,0,0,1,30.241-30.241H777.247a30.276,30.276,0,0,1,30.241,30.241V672.862A30.276,30.276,0,0,1,777.247,703.1ZM250.155,363.117a28.441,28.441,0,0,0-28.409,28.409V672.862a28.441,28.441,0,0,0,28.409,28.409H777.247a28.441,28.441,0,0,0,28.409-28.409V391.525a28.441,28.441,0,0,0-28.409-28.409Z",transform:"translate(318.982 22.257)",fill:"#3f3d56"}),
|
|
21
|
+
/* @__PURE__ */h("g",{transform:"translate(696.754 297.373)",children:[
|
|
22
|
+
/* @__PURE__ */h("ellipse",{cx:"61.798",cy:"61.798",rx:"61.798",ry:"61.798",transform:"translate(215.662 36.955)",fill:"#ff6584"}),
|
|
23
|
+
/* @__PURE__ */h("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(225.025 127.808)",fill:"#e6e6e6"}),
|
|
24
|
+
/* @__PURE__ */h("path",{d:"M508.105,323.365h.215l3.87,221.909h-8.171Z",transform:"translate(-204.593 -117.286)",fill:"#ccc"}),
|
|
25
|
+
/* @__PURE__ */h("path",{d:"M739.374,634.239h0a1.935,1.935,0,0,1-.811,2.614l-11.226,5.91-1.8-3.425,11.226-5.91A1.935,1.935,0,0,1,739.374,634.239Z",transform:"translate(-422.513 -281.249)",fill:"#ccc"}),
|
|
26
|
+
/* @__PURE__ */h("ellipse",{cx:"78.271",cy:"97.971",rx:"78.271",ry:"97.971",transform:"translate(0 127.808)",fill:"#e6e6e6"}),
|
|
27
|
+
/* @__PURE__ */h("path",{d:"M513.962,637.661h0a1.936,1.936,0,0,0-2.614-.811l-7.837,4.126-2.684-153.9h-.215l-4.085,221.91H504.7l-1.111-63.68,9.565-5.036A1.936,1.936,0,0,0,513.962,637.661Z",transform:"translate(-422.126 -281.002)",fill:"#ccc"}),
|
|
28
|
+
/* @__PURE__ */h("path",{d:"M612.666,280.653c54.774,0,99.294,103.207,99.294,171.768s-44.4,124.14-99.177,124.14-99.177-55.579-99.177-124.14S557.892,280.653,612.666,280.653Z",transform:"translate(-422.155 -280.653)",fill:"currentColor"}),
|
|
29
|
+
/* @__PURE__ */h("path",{d:"M630.131,617.508a2.452,2.452,0,0,0-3.312-1.027l-9.931,5.228-3.4-195h-.272L608.039,707.89h10.353l-1.408-80.69,12.119-6.38A2.452,2.452,0,0,0,630.131,617.508Z",transform:"translate(-422.315 -280.9)",fill:"#3f3d56"})]})]})}),/* @__PURE__ */h("div",{className:"space-y-4",children:[/* @__PURE__ */h("h4",{className:"text-foreground text-center text-lg font-semibold",children:e}),/* @__PURE__ */h("p",{className:"text-muted-foreground text-center",children:t})]})]})}function Re({organizationId:e,errorType:t}){/* @__PURE__ */
|
|
30
|
+
return h(be,"custom-auth-invalid"===t?{title:"Invalid input",children:"Custom auth mode requires uid, fname, lname. For more details please contact Qrati support."}:{title:"page-not-registered"===t?"Page not registered":"Something went wrong",children:["If you are an admin of this organization, please add the current page URL in Allowed URLs under"," ",
|
|
31
|
+
/* @__PURE__ */h("a",{className:"font-medium text-blue-500",href:u.ORGANIZATION_SETTINGS(e),target:"_blank",rel:"noreferrer",children:"Organization Settings"})," ","⇨"," ",
|
|
32
|
+
/* @__PURE__ */h("a",{className:"font-medium text-blue-500",href:u.ORGANIZATION_SETTINGS_INTEGRATION(e),target:"_blank",rel:"noreferrer",children:"Integration Settings"}),". For more details please contact Qrati support."]})}var ve=e=>({google:"Google",apple:"Apple"}[e]||e.charAt(0).toUpperCase()+e.slice(1)),Se=(e,t=0)=>{let r=t^e.length,s=0;const o=e.length;for(;s+3<o;){let t=255&e.charCodeAt(s)|(255&e.charCodeAt(s+1))<<8|(255&e.charCodeAt(s+2))<<16|(255&e.charCodeAt(s+3))<<24;t=Math.imul(t,3432918353),t=t<<15|t>>>17,t=Math.imul(t,461845907),r^=t,r=r<<13|r>>>19,r=Math.imul(r,5)+3864292196,s+=4}let n=0;switch(o-s){case 3:n^=(255&e.charCodeAt(s+2))<<16;case 2:n^=(255&e.charCodeAt(s+1))<<8;case 1:n^=255&e.charCodeAt(s),n=Math.imul(n,3432918353),n=n<<15|n>>>17,n=Math.imul(n,461845907),r^=n}return r^=r>>>16,r=Math.imul(r,2246822507),r^=r>>>13,r=Math.imul(r,3266489909),r^=r>>>16,r>>>=0,r.toString(16).padStart(8,"0")},Te=async e=>{try{return await e()}catch{return null}},xe=e=>{if(null===e||"object"!=typeof e)return JSON.stringify(e);if(Array.isArray(e))return`[${e.map(xe).join(",")}]`;const t=Object.keys(e).sort(),r=[];for(const s of t){const t=e[s];void 0!==t&&r.push(`${xe(s)}:${xe(t)}`)}return`{${r.join(",")}}`},Ae=async({debug:e=!1}={})=>{const t=await Te(()=>Pe()),r=await Te(()=>new Intl.NumberFormat(window.navigator.languages?.[0]||"en").resolvedOptions().numberingSystem),s=window.navigator.languages?Array.from(window.navigator.languages).join(","):window.navigator.language||null,o=Intl.DateTimeFormat().resolvedOptions().timeZone,n=/* @__PURE__ */(new Date).getTimezoneOffset(),i=window.matchMedia("(prefers-reduced-motion: reduce)").matches?"reduce":"no-preference",a=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",l=window.matchMedia("(forced-colors: active)").matches?"active":null,{pixelDepth:c,colorDepth:h}=window.screen,u="ontouchstart"in window||window.navigator.maxTouchPoints>0,d=await Te(()=>Ee(e)),f=await Te(()=>Ie()),p=await Te(()=>Ce(e)),m=await Te(()=>Oe(e)),y=window.screen.width&&window.screen.height?(window.screen.width/window.screen.height).toFixed(4):null,g={vendor:window.navigator.vendor||null,platform:window.navigator.platform||null,fonts:t,numberingSystem:r,languages:s,timezone:o,timezoneOffset:n,reducedMotion:i,colorScheme:a,hardwareConcurrency:window.navigator.hardwareConcurrency||null,deviceMemory:window.navigator.deviceMemory||null,forcedColors:l,pixelDepth:c,colorDepth:h,touchSupport:u,canvasID:d,webglID:f,webgpuID:p,audioID:m},w={aspectRatio:y,width:window.screen.width,height:window.screen.height,maxTouchPoints:window.navigator.maxTouchPoints};return(!0===navigator.userAgentData?.mobile||/Mobi|Android|iPhone|iPad|iPod|webOS|BlackBerry|Windows Phone/i.test(navigator.userAgent)||navigator.maxTouchPoints>0&&matchMedia("(pointer:coarse)").matches&&innerWidth<=1024)&&Object.assign(g,w),{fingerprint:Se(xe(g)),...g}},Ee=async e=>{const t=document.createElement("canvas");t.width=280,t.height=100;const r=t.getContext("2d"),s=r.createLinearGradient(0,0,280,100);return s.addColorStop(0,"#f60"),s.addColorStop(.4,"#09f"),s.addColorStop(.7,"#f09"),s.addColorStop(1,"#0f9"),r.fillStyle=s,r.fillRect(0,0,280,100),r.font='18px "Arial","Helvetica","DejaVu Sans",sans-serif',r.fillStyle="#000",r.textBaseline="alphabetic",r.fillText("Fingerprint ¼½¾™©®∆π∑€¶§",12,45),r.font='bold 22px "Georgia","Times New Roman",serif',r.fillStyle="#222",r.fillText("🦊🐱🚀 2026",12,78),r.globalAlpha=.7,r.fillStyle="rgba(255, 80, 0, 0.35)",r.fillRect(180,20,80,60),r.beginPath(),r.arc(220,50,32,0,2*Math.PI),r.strokeStyle="#fff",r.lineWidth=4,r.stroke(),r.beginPath(),r.moveTo(30,85),r.quadraticCurveTo(140,20,240,85),r.strokeStyle="#00f",r.lineWidth=3,r.stroke(),e&&(t.style.border="1px solid #444",document.body.appendChild(t)),Se(t.toDataURL("image/png"))},Ie=()=>{const e=document.createElement("canvas"),t=e.getContext("webgl")||e.getContext("experimental-webgl"),r=t.getExtension("WEBGL_debug_renderer_info");return Se(xe({vendor:r?t.getParameter(r.UNMASKED_VENDOR_WEBGL):t.getParameter(t.VENDOR),renderer:r?t.getParameter(r.UNMASKED_RENDERER_WEBGL):t.getParameter(t.RENDERER)}))},Ce=async e=>{const t=await navigator.gpu.requestAdapter({powerPreference:"high-performance"}),r={vendor:t.info?.vendor??"",architecture:t.info?.architecture??"",description:t.info?.description??"",features:Array.from(t.features).sort(),limits:Array.from(t.limits).sort()};if(e){const e=document.createElement("pre");e.style.margin="10px 0",e.style.padding="10px",e.style.border="1px solid #444",e.style.background="#111",e.style.color="#0f8",e.style.fontFamily="monospace",e.textContent=`WebGPU:\n${JSON.stringify(r,null,2)}`,document.body.appendChild(e)}return Se(xe(r))},Oe=async e=>{const t=new(window.OfflineAudioContext||window.webkitOfflineAudioContext)(1,6e3,44100),r=t.createOscillator();r.type="sawtooth",r.frequency.value=8800;const s=t.createDynamicsCompressor();s.threshold.value=-48,s.knee.value=30,s.ratio.value=14,s.attack.value=0,s.release.value=.3;const o=t.createGain();o.gain.value=.4,r.connect(s),s.connect(o),o.connect(t.destination),r.start(0);const n=(await t.startRendering()).getChannelData(0);let i=0,a=0;for(let c=3e3;c<5800;c+=2){const e=n[c];i=31*i+Math.floor(1e5*(e+1))|0,a=Math.imul(a^Math.floor(98765*e),2246822519)}const l=i>>>0^a>>>0;if(e){const e=document.createElement("canvas");e.width=500,e.height=120,e.style.border="1px solid #444",e.style.margin="10px 0",e.title="Audio buffer snippet (4500–5000 samples)";const t=e.getContext("2d");t.fillStyle="#111",t.fillRect(0,0,e.width,e.height),t.font="14px monospace",t.fillStyle="#0f8",t.textAlign="left",t.fillText("AudioID",10,20),t.strokeStyle="#0f8",t.lineWidth=1.5,t.beginPath();const r=Array.from(n.slice(4500,5e3)),s=e.width/r.length;for(let o=0;o<r.length;o++){const n=o*s,i=(r[o]+1)/2*e.height;0===o?t.moveTo(n,i):t.lineTo(n,i)}t.stroke(),document.body.appendChild(e)}return Se(l.toString(16))},Pe=()=>{const e=["monospace","serif","sans-serif"],t=["Arial","Helvetica","Verdana","Trebuchet MS","Comic Sans MS","Georgia","Times New Roman","Courier New","Segoe UI","Roboto","Open Sans","Noto Sans","system-ui","-apple-system","BlinkMacSystemFont"],r=document.createElement("span");r.style.fontSize="72px",r.style.position="absolute",r.style.visibility="hidden",r.style.whiteSpace="nowrap",r.textContent="mmmmmmmmmwwwwwww",document.body.appendChild(r);const s={};for(const n of e)r.style.fontFamily=n,s[n]=r.offsetWidth;const o=[];for(const n of t){let t=!1;for(const i of e)if(r.style.fontFamily=`"${n}", ${i}`,r.offsetWidth!==s[i]){o.push(n),t=!0;break}t||(r.style.fontFamily=`"${n}"`,r.offsetWidth!==s.monospace&&r.offsetWidth!==s.serif&&o.push(n))}return document.body.removeChild(r),o.length?o.sort().join(","):null};"undefined"!=typeof window&&(window.getBrowserFingerprint=Ae);var qe=async(e,t)=>{if(e instanceof F){try{const t=await e.response.json();if(t?.error)return t.error;if(t?.message)return t.message;if("INVALID_EMAIL_OR_PASSWORD"===t?.code)return"Invalid email or password"}catch{return t||e.message}return t||e.message}return e instanceof Error?t||e.message:t||String(e)},ke=a(void 0),De=({props:e={},children:t})=>{const{organizationId:s,uid:i,fname:a,lname:l,theme:u="light"}=e,[d,p]=o(()=>{if("undefined"==typeof window)return null;if(i||a||l)return null;const e=localStorage.getItem("qrati_token");return e?{token:e}:null}),{isLoading:m,data:y,error:g}=j({queryKey:[n.QRATI_CONNECT_SESSION,s,i??null,a??null,l??null],queryFn:async()=>{const e=await(async()=>{const e=await Ae();return"string"==typeof e?e:e?.fingerprint})();return(await we.post(T.INITIALIZE_SESSION,{json:{uid:i,fname:a,lname:l,browserFingerprint:e},headers:{"x-org-id":s,Authorization:i||a||l||!localStorage.getItem("qrati_token")?void 0:`Bearer ${localStorage.getItem("qrati_token")}`}}).json()).data},enabled:!!s});c(()=>{const e=y?.authSession?.session?.token,t=y?.authSession?.user;t&&e?(p({...t,token:e}),y?.organization?.customAuth||localStorage.setItem("qrati_token",e)):y?.organization?.customAuth&&i&&a&&l&&p(e=>e??{uid:i,name:`${a} ${l}`,fname:a,lname:l})},[y]);const w=f(()=>v(y?.organization?.integrationSettings,y?.organization?.customFontUrl),[y?.organization?.integrationSettings,y?.organization?.customFontUrl]),b=async e=>{try{const t=await((e,t,r)=>new Promise((s,o)=>{if(!e)return void o(/* @__PURE__ */new Error("Provider is required"));if(!t)return void o(/* @__PURE__ */new Error("Organization ID is required"));const n=new URL(`${r}/qc-social-auth`);n.searchParams.set("provider",e),n.searchParams.set("organizationId",t),n.searchParams.set("origin",window.location.origin);const i=(window.screen.width-500)/2,a=(window.screen.height-600)/2,l=window.open(n.toString(),"qrati_social_auth",`width=500,height=600,left=${i},top=${a},scrollbars=yes,resizable=yes,status=yes`);if(!l)return void o(/* @__PURE__ */new Error("Failed to open popup window. Please allow popups and try again."));const c=()=>{clearInterval(u),clearTimeout(d),window.removeEventListener("message",h)},h=e=>{try{const t=new URL(r).origin;if(e.origin!==t)return void console.warn("Origin mismatch:",e.origin,"expected:",t)}catch(u){console.warn("Could not parse origin for verification")}const{type:n,data:i,error:a,organizationId:h}=e.data||{};if(h===t)switch(n){case"QRATI_SOCIAL_AUTH_SUCCESS":c(),l.close(),s({user:i.user,session:i.session,token:i.token});break;case"QRATI_SOCIAL_AUTH_ERROR":console.error("Authentication error:",a),c(),l.close(),o(new Error(a||"Social authentication failed"));break;case"QRATI_SOCIAL_AUTH_CANCELLED":c(),l.close(),o(/* @__PURE__ */new Error("Authentication was cancelled"))}else console.warn("Organization ID mismatch:",h,"expected:",t)},u=setInterval(()=>{try{l.closed&&(c(),o(/* @__PURE__ */new Error("Authentication was cancelled")))}catch(e){}},1e3);window.addEventListener("message",h);const d=setTimeout(()=>{c(),l.closed||l.close(),o(/* @__PURE__ */new Error("Authentication timeout. Please try again."))},3e5)}))(e,s??"","https://beta.qratilabs.com");return t?.user&&t?.token&&(p({...t.user,token:t.token}),localStorage.setItem("qrati_token",t.token)),t}catch(g){throw console.error("Social login error:",g),g}};return g?/* @__PURE__ */h(r,{fallback:null,children:/* @__PURE__ */h(Re,{organizationId:s??"",errorType:401===g?.response?.status?"page-not-registered":"generic-error"})}):!y?.organization?.customAuth||i&&a&&l?/* @__PURE__ */h(ke.Provider,{value:{props:e,initializing:m,sessionId:y?.sessionId,organization:y?.organization,folders:y?.folders,loadingUser:m,user:d,updateUser:async e=>{p(t=>{const r={...t,...e};return r?.token&&localStorage.setItem("qrati_token",r.token),r})},registerUsingEmail:async(e,t,r,o)=>{try{const n=await we.post(T.REGISTER,{json:{email:e,password:t,fname:r,lname:o},headers:{"x-org-id":s}}).json();return n.error?{error:n.error}:(p({...n.user,token:n.token}),localStorage.setItem("qrati_token",n.token),n)}catch(g){return{error:await qe(g,"Registration failed")}}},loginWithGoogle:async()=>{try{return await b("google")}catch(g){throw console.error("Google login error:",g),g}},loginWithApple:async()=>{try{return await b("apple")}catch(g){throw console.error("Apple login error:",g),g}},loginUsingEmail:async(e,t)=>{try{const r=await we.post(T.LOGIN,{json:{email:e,password:t},headers:{"x-org-id":s}}).json();return r.error?{error:r.error}:(p({...r.user,token:r.token}),localStorage.setItem("qrati_token",r.token),r)}catch(g){return{error:await qe(g,"Invalid email or password")}}},sendPasswordResetCode:async e=>{try{const t=await we.post(T.SEND_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase()},headers:{"x-org-id":s}}).json();return t.error?{error:t.error}:t}catch(g){return{error:await qe(g,"Failed to send password reset code")}}},verifyPasswordResetCode:async(e,t)=>{try{const r=await we.post(T.VERIFY_PASSWORD_RESET_CODE,{json:{email:e.toLowerCase(),code:t},headers:{"x-org-id":s}}).json();return r.error?{error:r.error}:r}catch(g){return{error:await qe(g,"Invalid code, please check your email")}}},resetPassword:async(e,t)=>{try{const r=await we.post(T.RESET_PASSWORD,{json:{passwordResetCodeId:e,newPassword:t},headers:{"x-org-id":s}}).json();return r.error?{error:r.error}:r}catch(g){return{error:g?.message}}},signout:async()=>{try{const e=await we.post(T.LOGOUT,{headers:{"x-org-id":s,Authorization:`Bearer ${d?.token}`}}).json();return e.error?{error:e.error}:(localStorage.removeItem("qrati_token"),p(null),e)}catch(g){return console.error(g),{error:g?.message}}},error:g},children:/* @__PURE__ */h("div",{id:"qrati-connect-container",style:{...E(y?.organization,u),fontFamily:"var(--font-family)"},className:I("bg-background text-foreground relative min-h-[80vh]"),children:[w?/* @__PURE__ */h("style",{children:w}):null,t]})}):/* @__PURE__ */h(r,{fallback:null,children:/* @__PURE__ */h(Re,{organizationId:s??"",errorType:"custom-auth-invalid"})})},Ne=()=>{const e=S(ke);if(void 0===e)throw new Error("useSession must be used within SessionProvider");return e};export{we as a,q as c,ve as i,Ne as n,j as o,Ae as r,_ as s,De as t};
|