@dcl/blog-site 0.3.0 → 0.3.1-24103023146.commit-2dbaf97
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/assets/{QueryClientProvider-DVt1z-lo.js → QueryClientProvider-CaylTeJU.js} +1 -1
- package/assets/{SignInRedirect-DQ2EXIlf.js → SignInRedirect-Cq5V2cbN.js} +5 -5
- package/assets/{X-_bf2yze4.js → X-Duht4Iz6.js} +1 -1
- package/assets/{__federation_expose_App-DpSY-Y9d.js → __federation_expose_App-MABV9ejQ.js} +1 -1
- package/assets/{__federation_fn_import-D82-s3kA.js → __federation_fn_import-BOkD8n2P.js} +1 -1
- package/assets/__federation_shared_@dcl/{hooks-35itWugh.js → hooks-BWESDPD3.js} +3 -3
- package/assets/__federation_shared_@emotion/react-BQUlnVL8.js +1 -0
- package/assets/__federation_shared_@emotion/{styled-CER0OT-8.js → styled-CDI3vXYZ.js} +1 -1
- package/assets/{__federation_shared_decentraland-ui2-qV0BHWTj.js → __federation_shared_decentraland-ui2-Dkip0j-u.js} +4 -4
- package/assets/{__federation_shared_react-redux-7pAtHZvO.js → __federation_shared_react-redux-Cz6uJTZg.js} +1 -1
- package/assets/{__federation_shared_react-router-dom-DM3U0-DJ.js → __federation_shared_react-router-dom-CC-GCyPC.js} +1 -1
- package/assets/{__federation_shared_viem-B7de3aIh.js → __federation_shared_viem-N4jx8tpP.js} +1 -1
- package/assets/{__federation_shared_wagmi-B-FL62eC.js → __federation_shared_wagmi-T79wv6wS.js} +1 -1
- package/assets/{add-D95ShjVd.js → add-2qvA7EiO.js} +1 -1
- package/assets/{all-wallets-BY6r5fcR.js → all-wallets-lXjoBtOu.js} +1 -1
- package/assets/{app-store-SmbPBgEb.js → app-store-DYHc9uss.js} +1 -1
- package/assets/{apple-D8pqe3de.js → apple-trBstREI.js} +1 -1
- package/assets/{arrow-bottom-DQy0lFo0.js → arrow-bottom-BWqJWXR-.js} +1 -1
- package/assets/{arrow-bottom-circle-OyHlN-U-.js → arrow-bottom-circle-YjuLILdA.js} +1 -1
- package/assets/{arrow-left-CXPqeZRE.js → arrow-left-DhtuQend.js} +1 -1
- package/assets/{arrow-right-BI45gebZ.js → arrow-right-BvYZ2BiR.js} +1 -1
- package/assets/{arrow-top-BxYGxPQg.js → arrow-top-D28-F_Hg.js} +1 -1
- package/assets/{auto-track-IXpT7xap.js → auto-track-D9PR_g0H.js} +1 -1
- package/assets/{bank-DvWpLZQG.js → bank-DdnPzesM.js} +1 -1
- package/assets/{basic-DENnvNSD.js → basic-DmnKpYra.js} +1 -1
- package/assets/{biconomy-GzbQEJRq.js → biconomy-BuodyWlH.js} +1 -1
- package/assets/{browser-COUlM8GK.js → browser-WTqp-RH-.js} +1 -1
- package/assets/{card-DCZ4hxW7.js → card-CUcjOncu.js} +1 -1
- package/assets/{ccip-DGW5U0-8.js → ccip-BBJ3I8Xu.js} +1 -1
- package/assets/{checkmark-C3MmlUGU.js → checkmark-B0wthWje.js} +1 -1
- package/assets/{checkmark-bold-BZz12uQW.js → checkmark-bold-D3rJPOXJ.js} +1 -1
- package/assets/{chevron-bottom-BITHvcvn.js → chevron-bottom-BdzTSFY2.js} +1 -1
- package/assets/{chevron-left-DLcgw6J3.js → chevron-left-C8bbhNcl.js} +1 -1
- package/assets/{chevron-right-CgvlwKH_.js → chevron-right-CCJu7F9K.js} +1 -1
- package/assets/{chevron-top-E2kQk6Yb.js → chevron-top-CbTESKuW.js} +1 -1
- package/assets/{chrome-store-IGBWJmfs.js → chrome-store-DxK9ysyk.js} +1 -1
- package/assets/{clock-Dnnqv_UX.js → clock-B1B6mod1.js} +1 -1
- package/assets/{close-h_pw4dRD.js → close-CA_w2TX7.js} +1 -1
- package/assets/{coinPlaceholder-CpzdwguN.js → coinPlaceholder-DDHUZdwM.js} +1 -1
- package/assets/{compass-CLIqD2Io.js → compass-Dwx8PkuI.js} +1 -1
- package/assets/{controller-DOHoljGI.js → controller-1R1nrCkG.js} +2 -2
- package/assets/{copy-56eIYa9K.js → copy-R0gnZxuz.js} +1 -1
- package/assets/{core-iy2F1EJT.js → core-9XBuvaBL.js} +3 -3
- package/assets/{createBundlerClient-Cb3DWn31.js → createBundlerClient-LPapq7hJ.js} +1 -1
- package/assets/{createClient-BJ5w543s.js → createClient-BLcyKw9o.js} +1 -1
- package/assets/{cursor-DHAIalN2.js → cursor-buHR4MvG.js} +1 -1
- package/assets/{cursor-transparent-USINvuuv.js → cursor-transparent-BlSFN96v.js} +1 -1
- package/assets/{decimals-CVjZGYo0.js → decimals-Bnh8vaOd.js} +1 -1
- package/assets/{decimals-DIZDmdnI.js → decimals-DKeocaSS.js} +1 -1
- package/assets/{desktop-Ck9zNNDL.js → desktop-iLJ0yrPC.js} +1 -1
- package/assets/{detectExtension-DQNsMd7m.js → detectExtension-gGfjMoDV.js} +1 -1
- package/assets/{disconnect-B6rD3ARw.js → disconnect-DmWVYzi9.js} +1 -1
- package/assets/{discord-QyDy6H2Z.js → discord-CdcA1Vi7.js} +1 -1
- package/assets/{emotion-react.browser.esm-BHtRLI5r.js → emotion-react.browser.esm-F9fz9FEy.js} +1 -1
- package/assets/{emotion-use-insertion-effect-with-fallbacks.browser.esm-DxyPSsfO.js → emotion-use-insertion-effect-with-fallbacks.browser.esm-Sg-5vT-t.js} +1 -1
- package/assets/{encode-JOmK-dAM.js → encode-CKwvXR_N.js} +2 -2
- package/assets/{engine-Cr6ElJJw.js → engine-DlI24UVK.js} +1 -1
- package/assets/{estimate-gas-CMPxVjuF.js → estimate-gas-BG6-Kqmv.js} +3 -3
- package/assets/{estimate-l1-fee-B90S_dRF.js → estimate-l1-fee-BgFRrIc9.js} +1 -1
- package/assets/{eth_getStorageAt-BzWA0XEw.js → eth_getStorageAt-D61Vetgg.js} +1 -1
- package/assets/{etherscan-BSyc5b_s.js → etherscan-GfR_ppjR.js} +1 -1
- package/assets/{exclamation-triangle-Cbq68j9M.js → exclamation-triangle-8iGJjWy8.js} +1 -1
- package/assets/{extension-Ef7aJ2Fj.js → extension-D6ggRkmW.js} +1 -1
- package/assets/{external-link-bVFEWzQf.js → external-link-DEfu-xG1.js} +1 -1
- package/assets/{extractIPFS-kNuMOSPp.js → extractIPFS-BmrxUMAw.js} +1 -1
- package/assets/{facebook-KWDQXnqW.js → facebook-CKEn1wyA.js} +1 -1
- package/assets/{farcaster-OZKU6ag9.js → farcaster-BjW81SyT.js} +1 -1
- package/assets/{fee-data-BCMgs11D.js → fee-data-B6rXatSB.js} +1 -1
- package/assets/{fetchTokenMetadata-BPHUGga-.js → fetchTokenMetadata-C3xqQZKk.js} +2 -2
- package/assets/{filters-hVFxrfbM.js → filters-DXEYimKv.js} +1 -1
- package/assets/{get-ecosystem-wallet-info-mPW-S8xG.js → get-ecosystem-wallet-info-DTdvgTlD.js} +1 -1
- package/assets/{getBalance-B1iUU342.js → getBalance-BhvXyjxq.js} +1 -1
- package/assets/{getInstalledModules-BnNuIBJw.js → getInstalledModules-Diize_Jb.js} +1 -1
- package/assets/{getNFT-BPxN7Ctt.js → getNFT-CT5tK0Ef.js} +1 -1
- package/assets/{getNFT-DF0DVjz_.js → getNFT-DrIJlzTC.js} +2 -2
- package/assets/{github-BzQnkFuN.js → github-BJf_xM2L.js} +1 -1
- package/assets/{google-Gdkba30S.js → google-C2-k3hmM.js} +1 -1
- package/assets/{help-circle-CzuLd4UT.js → help-circle-DhiNMkUL.js} +1 -1
- package/assets/{id--DiZoCMN.js → id-D03_zXaW.js} +1 -1
- package/assets/{image-S2doqbWs.js → image-j5GaEWNQ.js} +1 -1
- package/assets/{in-app-wallet-calls-C1SY2oWN.js → in-app-wallet-calls-DeGARlNz.js} +1 -1
- package/assets/{index-ww85HWCV.js → index-5ciQHCfO.js} +1 -1
- package/assets/{index-b9i0Ibxp.js → index-Bd_zGIWs.js} +2 -2
- package/assets/index-BjzJcZq6.js +1 -1
- package/assets/{index-D7VWCQbE.js → index-BozJS3za.js} +1 -1
- package/assets/{index-f2LDpGwT.js → index-CUrz5-ZQ.js} +3 -3
- package/assets/{index-CfDhCkmV.js → index-CZdqu4HH.js} +1 -1
- package/assets/{index-CwwTvCG6.js → index-D4ZoaFaW.js} +1 -1
- package/assets/{index-CgkAqmHX.js → index-DDgA9b7k.js} +1 -1
- package/assets/{index-1ERaFZsE.js → index-DQ85yNMU.js} +1 -1
- package/assets/{index-CH2z5aZN.js → index-DT6Vj6dy.js} +2 -2
- package/assets/index-Dy0yjznp.js +1 -1
- package/assets/{index-C52TjtZ8.js → index-L3jxSgGB.js} +1 -1
- package/assets/index-Tsk25L8E.js +1 -0
- package/assets/{index-Dg2V4ned.js → index-jI5uKA2-.js} +1 -1
- package/assets/{index-T692f3s9.js → index-uTf7Q5m-.js} +1 -1
- package/assets/{index.es-CzqZMQ08.js → index.es-CAWfybMT.js} +3 -3
- package/assets/{index.es-D_Iyl52g.js → index.es-vTDnK87g.js} +1 -1
- package/assets/{info-DEpm9K4l.js → info-DYDmmmBF.js} +1 -1
- package/assets/{info-circle-BFBSJV6L.js → info-circle-CcOS1QbV.js} +1 -1
- package/assets/jsx-runtime-DncYoG30.js +1 -1
- package/assets/{lightbulb-GZWMuOVt.js → lightbulb-Byuz2x7E.js} +1 -1
- package/assets/{localBatchGatewayRequest-Df9EBRM7.js → localBatchGatewayRequest-BOvl6QMW.js} +1 -1
- package/assets/{mail-CUdb6dNj.js → mail-Dmlstk1E.js} +1 -1
- package/assets/{mobile-BeQz2cn_.js → mobile-BHFF9Tp-.js} +1 -1
- package/assets/{more-TsN-CR-t.js → more-Uov13zHU.js} +1 -1
- package/assets/{network-placeholder-DwFC6B_7.js → network-placeholder-DPsAlG2a.js} +1 -1
- package/assets/{nftPlaceholder-CiT4A3-l.js → nftPlaceholder-CKa3uzSG.js} +1 -1
- package/assets/{off-CUv-83kc.js → off-BvxFNTc7.js} +1 -1
- package/assets/{openzeppelin-BBJIIsPB.js → openzeppelin-BmJC0lXu.js} +1 -1
- package/assets/{ownerOf-DYtTCeNU.js → ownerOf-CaDY4Qro.js} +1 -1
- package/assets/{parseNft-Buclbv5Y.js → parseNft-CwTDpy0g.js} +2 -2
- package/assets/{play-store-RQqRTPUT.js → play-store-COAN7GVZ.js} +1 -1
- package/assets/{plus-C7MITUNH.js → plus-YCFIwODs.js} +1 -1
- package/assets/preload-helper-CO43ckIt.js +1 -0
- package/assets/{qr-code-CpEPSAYR.js → qr-code-CQNjoP1_.js} +1 -1
- package/assets/{qr-overlay-DryFOQCX.js → qr-overlay-C8VtIF-5.js} +1 -1
- package/assets/{recycle-horizontal-B1QKxNTd.js → recycle-horizontal-BXBBKttg.js} +1 -1
- package/assets/{refresh-DdqLkUQx.js → refresh-DGzlkz4z.js} +1 -1
- package/assets/remoteEntry.js +1 -1
- package/assets/{reown-logo-_t3NoThE.js → reown-logo-41ZwC8Wb.js} +1 -1
- package/assets/{resolveImplementation--gaCsV-s.js → resolveImplementation-DM6BHeji.js} +1 -1
- package/assets/{search-B8WbQmvE.js → search-DkZZHruy.js} +1 -1
- package/assets/{secp256k1-DtCHzlC3.js → secp256k1-CmqR8ec3.js} +1 -1
- package/assets/{send-BFNT_o0R.js → send-DY97Hjge.js} +1 -1
- package/assets/{send-batch-transaction-ZanhTs8a.js → send-batch-transaction-BLPmGB9M.js} +1 -1
- package/assets/{send-eip712-transaction-CxRy-sD1.js → send-eip712-transaction-t91PBSUH.js} +2 -2
- package/assets/{send-gasless-transaction-Iz8ZLiHO.js → send-gasless-transaction-DRbTPij5.js} +2 -2
- package/assets/{serializeTransaction-BufQeOel.js → serializeTransaction-DePWMgRx.js} +1 -1
- package/assets/{session-proposal-BD47nRI-.js → session-proposal-BPk-6kBm.js} +1 -1
- package/assets/{session-request-TkgpbjLp.js → session-request-mTPTFyu8.js} +2 -2
- package/assets/{signing-TLGj9K79.js → signing-fd2Rp8P0.js} +3 -3
- package/assets/{swapHorizontal-BiFAMUuS.js → swapHorizontal-4B3kHTpA.js} +1 -1
- package/assets/{swapHorizontalBold-CP3dUSZb.js → swapHorizontalBold-CLCm8M1r.js} +1 -1
- package/assets/{swapHorizontalMedium-BRNlkDrO.js → swapHorizontalMedium-pth8maKg.js} +1 -1
- package/assets/{swapHorizontalRoundedBold-CHqEVcBs.js → swapHorizontalRoundedBold-D9RueXfE.js} +1 -1
- package/assets/{swapVertical-Du0QoNAI.js → swapVertical-DgFWMAab.js} +1 -1
- package/assets/{telegram-DQef1ILU.js → telegram-CRzvpklN.js} +1 -1
- package/assets/{thirdweb-E-fErz2x.js → thirdweb-BDeAJ4oX.js} +3 -3
- package/assets/{three-dots-ByXtSGCV.js → three-dots-CAGpqs78.js} +1 -1
- package/assets/{totalSupply-DNIfxfBv.js → totalSupply-BOyOYvTD.js} +1 -1
- package/assets/{twitch-DIxDFqku.js → twitch-C0_LdJeE.js} +1 -1
- package/assets/{twitterIcon-B-SNXvpz.js → twitterIcon-BA_gSMJq.js} +1 -1
- package/assets/{uid-Bq9ktEE-.js → uid-QS91sMSf.js} +3 -3
- package/assets/{verify-BT-sFhiZ.js → verify-Doijrccq.js} +1 -1
- package/assets/{verify-filled-DUDJcSxD.js → verify-filled-Dzvol2nT.js} +1 -1
- package/assets/{w3m-modal-Ck71GkBa.js → w3m-modal-XdpZEDU9.js} +1 -1
- package/assets/{wait-for-tx-receipt-C5afrCK7.js → wait-for-tx-receipt-tKiSk-wy.js} +1 -1
- package/assets/{wallet-DiXkPY80.js → wallet-aBFrt0kW.js} +1 -1
- package/assets/{wallet-placeholder-DHuJakoz.js → wallet-placeholder-CLPfteFW.js} +1 -1
- package/assets/{walletconnect-LtvddLlL.js → walletconnect-RkdjesgD.js} +1 -1
- package/assets/{wallets-BmZ-KVbp.js → wallets-z86vtyeQ.js} +5 -5
- package/assets/{warning-circle-DEf5ta8Y.js → warning-circle-C3Uif538.js} +1 -1
- package/assets/{web-connector-6KYcG8gr.js → web-connector-Cf7r9kv3.js} +3 -3
- package/assets/{webSocket-2Mm3WVrI.js → webSocket-C9MEjwL1.js} +1 -1
- package/assets/{x-Cl1yAHbN.js → x-DMVfcf_O.js} +1 -1
- package/index.html +17 -17
- package/package.json +3 -3
- package/assets/__federation_shared_@emotion/react-LISJiiTk.js +0 -1
- package/assets/index-DIxygMtO.js +0 -1
- package/assets/preload-helper-BokH5fd6.js +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const __vite__fileDeps=["assets/index-BTtTX-5z.js","assets/index-DJ7GgcJ9.js","assets/index-BAhlRyDG.js","assets/thirdweb-
|
|
2
|
-
import{importShared as R}from"./__federation_fn_import-D82-s3kA.js";import{j as q}from"./jsx-runtime-DncYoG30.js";import{c as Ec,E as Jt,u as Uo,r as Sc,i as Tc,d as xc}from"./X-_bf2yze4.js";import{c as Ut,a as Rt}from"./_commonjsHelpers-C4iS2aBk.js";import{r as Mo}from"./index-Dy0yjznp.js";import{c as se,d as Cc}from"./rich-text-react-renderer.es5-D_tE7AHo.js";import{w as Ra,s as Ic,t as Oa,j as _c,u as No,g as Ac,r as Rc,b as Oc,m as kc}from"./redux-BNDF-Lt-.js";import{d as wr}from"./defineChain-7I0Ce1VT.js";import{_ as Ue}from"./preload-helper-BokH5fd6.js";import{c as On,C as kn,P as ka,i as Dc,S as $o,M as jc,n as le,m as Da,a as je,h as Bo,Q as Lc,b as ja,f as Uc,o as La,r as Ua,d as Mc,e as Ma,g as Na,p as $a,s as Nc,j as $c}from"./QueryClientProvider-DVt1z-lo.js";var Bc=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},Ho=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Ho||{});function Ba(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}const{createAction:ct,createSlice:Ze,createSelector:Hc,createAsyncThunk:Ha,combineReducers:Qc,createNextState:Dn,isAnyOf:ir,isAllOf:kr,isAction:Fc,isPending:Qo,isRejected:jn,isFulfilled:Ve,isRejectedWithValue:Ln,isAsyncThunkAction:Qa,prepareAutoBatched:ft,SHOULD_AUTOBATCH:Fo,isPlainObject:xt,nanoid:Go}=await R("@reduxjs/toolkit");var Fa=xt;function Un(e,t){if(e===t||!(Fa(e)&&Fa(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),o=Object.keys(e);let u=n.length===o.length;const f=Array.isArray(t)?[]:{};for(const h of n)f[h]=Un(e[h],t[h]),u&&(u=e[h]===f[h]);return u?e:f}var Ga=e=>[].concat(...e);function Gc(e){return new RegExp("(^|:)//").test(e)}function Wc(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Mn(e){return e!=null}function Wa(e){return[...e?.values()??[]].filter(Mn)}function zc(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Kc=e=>e.replace(/\/$/,""),Vc=e=>e.replace(/^\//,"");function Yc(e,t){if(!e)return t;if(!t)return e;if(Gc(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Kc(e),t=Vc(t),`${e}${n}${t}`}function cr(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var on=()=>new Map,za=(...e)=>fetch(...e),Jc=e=>e.status>=200&&e.status<=299,Xc=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Ka(e){if(!xt(e))return e;const t={...e};for(const[n,o]of Object.entries(t))o===void 0&&delete t[n];return t}var Zc=e=>typeof e=="object"&&(xt(e)||Array.isArray(e)||typeof e.toJSON=="function");function eu({baseUrl:e,prepareHeaders:t=c=>c,fetchFn:n=za,paramsSerializer:o,isJsonContentType:u=Xc,jsonContentType:f="application/json",jsonReplacer:h,timeout:a,responseHandler:r,validateStatus:s,...i}={}){return typeof fetch>"u"&&n===za&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(l,d,p)=>{const{getState:g,extra:y,endpoint:P,forced:w,type:v}=d;let m,{url:b,headers:x=new Headers(i.headers),params:_=void 0,responseHandler:A=r??"json",validateStatus:T=s??Jc,timeout:E=a,...S}=typeof l=="string"?{url:l}:l,C,I=d.signal;E&&(C=new AbortController,d.signal.addEventListener("abort",C.abort),I=C.signal);let O={...i,signal:I,...S};x=new Headers(Ka(x)),O.headers=await t(x,{getState:g,arg:l,extra:y,endpoint:P,forced:w,type:v,extraOptions:p})||x;const k=Zc(O.body);if(O.body!=null&&!k&&typeof O.body!="string"&&O.headers.delete("content-type"),!O.headers.has("content-type")&&k&&O.headers.set("content-type",f),k&&u(O.headers)&&(O.body=JSON.stringify(O.body,h)),O.headers.has("accept")||(A==="json"?O.headers.set("accept","application/json"):A==="text"&&O.headers.set("accept","text/plain, text/html, */*")),_){const G=~b.indexOf("?")?"&":"?",H=o?o(_):new URLSearchParams(Ka(_));b+=G+H}b=Yc(e,b);const D=new Request(b,O);m={request:new Request(b,O)};let U,j=!1,N=C&&setTimeout(()=>{j=!0,C.abort()},E);try{U=await n(D)}catch(G){return{error:{status:j?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(G)},meta:m}}finally{N&&clearTimeout(N),C?.signal.removeEventListener("abort",C.abort)}const F=U.clone();m.response=F;let V,W="";try{let G;if(await Promise.all([c(U,A).then(H=>V=H,H=>G=H),F.text().then(H=>W=H,()=>{})]),G)throw G}catch(G){return{error:{status:"PARSING_ERROR",originalStatus:U.status,data:W,error:String(G)},meta:m}}return T(U,V)?{data:V,meta:m}:{error:{status:U.status,data:V},meta:m}};async function c(l,d){if(typeof d=="function")return d(l);if(d==="content-type"&&(d=u(l.headers)?"json":"text"),d==="json"){const p=await l.text();return p.length?JSON.parse(p):null}return l.text()}}var Va=class{constructor(e,t=void 0){this.value=e,this.meta=t}},Pr=ct("__rtkq/focused"),Nn=ct("__rtkq/unfocused"),qr=ct("__rtkq/online"),$n=ct("__rtkq/offline"),Dr=!1;function gP(e,t){function n(){const o=()=>e(Pr()),u=()=>e(Nn()),f=()=>e(qr()),h=()=>e($n()),a=()=>{window.document.visibilityState==="visible"?o():u()};return Dr||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",o,!1),window.addEventListener("online",f,!1),window.addEventListener("offline",h,!1),Dr=!0),()=>{window.removeEventListener("focus",o),window.removeEventListener("visibilitychange",a),window.removeEventListener("online",f),window.removeEventListener("offline",h),Dr=!1}}return n()}function vr(e){return e.type==="query"}function tu(e){return e.type==="mutation"}function br(e){return e.type==="infinitequery"}function ur(e){return vr(e)||br(e)}function Bn(e,t,n,o,u,f){return ru(e)?e(t,n,o,u).filter(Mn).map(cn).map(f):Array.isArray(e)?e.map(cn).map(f):[]}function ru(e){return typeof e=="function"}function cn(e){return typeof e=="string"?{type:e}:e}const{formatProdErrorMessage:mP}=await R("@reduxjs/toolkit");function nu(e,t){return e.catch(t)}var Ct=Symbol("forceQueryFn"),un=e=>typeof e[Ct]=="function";function au({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:o,api:u,context:f,getInternalState:h}){const a=m=>h(m)?.runningQueries,r=m=>h(m)?.runningMutations,{unsubscribeQueryResult:s,removeMutationResult:i,updateSubscriptionOptions:c}=u.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:w,buildInitiateMutation:v,getRunningQueryThunk:l,getRunningMutationThunk:d,getRunningQueriesThunk:p,getRunningMutationsThunk:g};function l(m,b){return x=>{const _=f.endpointDefinitions[m],A=e({queryArgs:b,endpointDefinition:_,endpointName:m});return a(x)?.get(A)}}function d(m,b){return x=>r(x)?.get(b)}function p(){return m=>Wa(a(m))}function g(){return m=>Wa(r(m))}function y(m,b){const x=(_,{subscribe:A=!0,forceRefetch:T,subscriptionOptions:E,[Ct]:S,...C}={})=>(I,O)=>{const k=e({queryArgs:_,endpointDefinition:b,endpointName:m});let D;const L={...C,type:"query",subscribe:A,forceRefetch:T,subscriptionOptions:E,endpointName:m,originalArgs:_,queryCacheKey:k,[Ct]:S};if(vr(b))D=t(L);else{const{direction:B,initialPageParam:Q}=C;D=n({...L,direction:B,initialPageParam:Q})}const U=u.endpoints[m].select(_),j=I(D),N=U(O()),{requestId:F,abort:V}=j,W=N.requestId!==F,G=a(I)?.get(k),H=()=>U(O()),Z=Object.assign(S?j.then(H):W&&!G?Promise.resolve(N):Promise.all([G,j]).then(H),{arg:_,requestId:F,subscriptionOptions:E,queryCacheKey:k,abort:V,async unwrap(){const B=await Z;if(B.isError)throw B.error;return B.data},refetch:()=>I(x(_,{subscribe:!1,forceRefetch:!0})),unsubscribe(){A&&I(s({queryCacheKey:k,requestId:F}))},updateSubscriptionOptions(B){Z.subscriptionOptions=B,I(c({endpointName:m,requestId:F,queryCacheKey:k,options:B}))}});if(!G&&!W&&!S){const B=a(I);B.set(k,Z),Z.then(()=>{B.delete(k)})}return Z};return x}function P(m,b){return y(m,b)}function w(m,b){return y(m,b)}function v(m){return(b,{track:x=!0,fixedCacheKey:_}={})=>(A,T)=>{const E=o({type:"mutation",endpointName:m,originalArgs:b,track:x,fixedCacheKey:_}),S=A(E),{requestId:C,abort:I,unwrap:O}=S,k=nu(S.unwrap().then(j=>({data:j})),j=>({error:j})),D=()=>{A(i({requestId:C,fixedCacheKey:_}))},L=Object.assign(k,{arg:S.arg,requestId:C,abort:I,unwrap:O,reset:D}),U=r(A);return U.set(C,L),L.then(()=>{U.delete(C)}),_&&(U.set(_,L),L.then(()=>{U.get(_)===L&&U.delete(_)})),L}}}var Wo=class extends Bc{constructor(e,t,n,o){super(e),this.value=t,this.schemaName=n,this._bqMeta=o}},Fe=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Ge(e,t,n,o){const u=await e["~standard"].validate(t);if(u.issues)throw new Wo(u.issues,t,n,o);return u.value}function Ya(e){return e}var pt=(e={})=>({...e,[Fo]:!0});function su({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:o,api:u,assertTagType:f,selectors:h,onSchemaFailure:a,catchSchemaFailure:r,skipSchemaValidation:s}){const i=(S,C,I,O)=>(k,D)=>{const L=n[S],U=o({queryArgs:C,endpointDefinition:L,endpointName:S});if(k(u.internalActions.queryResultPatched({queryCacheKey:U,patches:I})),!O)return;const j=u.endpoints[S].select(C)(D()),N=Bn(L.providesTags,j.data,void 0,C,{},f);k(u.internalActions.updateProvidedBy([{queryCacheKey:U,providedTags:N}]))};function c(S,C,I=0){const O=[C,...S];return I&&O.length>I?O.slice(0,-1):O}function l(S,C,I=0){const O=[...S,C];return I&&O.length>I?O.slice(1):O}const d=(S,C,I,O=!0)=>(k,D)=>{const U=u.endpoints[S].select(C)(D()),j={patches:[],inversePatches:[],undo:()=>k(u.util.patchQueryData(S,C,j.inversePatches,O))};if(U.status==="uninitialized")return j;let N;if("data"in U)if(_c(U.data)){const[F,V,W]=No(U.data,I);j.patches.push(...V),j.inversePatches.push(...W),N=F}else N=I(U.data),j.patches.push({op:"replace",path:[],value:N}),j.inversePatches.push({op:"replace",path:[],value:U.data});return j.patches.length===0||k(u.util.patchQueryData(S,C,j.patches,O)),j},p=(S,C,I)=>O=>O(u.endpoints[S].initiate(C,{subscribe:!1,forceRefetch:!0,[Ct]:()=>({data:I})})),g=(S,C)=>S.query&&S[C]?S[C]:Ya,y=async(S,{signal:C,abort:I,rejectWithValue:O,fulfillWithValue:k,dispatch:D,getState:L,extra:U})=>{const j=n[S.endpointName],{metaSchema:N,skipSchemaValidation:F=s}=j;try{let V=Ya;const W={signal:C,abort:I,dispatch:D,getState:L,extra:U,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?P(S,L()):void 0,queryCacheKey:S.type==="query"?S.queryCacheKey:void 0},G=S.type==="query"?S[Ct]:void 0;let H;const Z=async(Q,z,J,Qe)=>{if(z==null&&Q.pages.length)return Promise.resolve({data:Q});const Pe={queryArg:S.originalArgs,pageParam:z},Xe=await B(Pe),qe=Qe?c:l;return{data:{pages:qe(Q.pages,Xe.data,J),pageParams:qe(Q.pageParams,z,J)},meta:Xe.meta}};async function B(Q){let z;const{extraOptions:J,argSchema:Qe,rawResponseSchema:Pe,responseSchema:Xe}=j;if(Qe&&!Fe(F,"arg")&&(Q=await Ge(Qe,Q,"argSchema",{})),G?z=G():j.query?(V=g(j,"transformResponse"),z=await t(j.query(Q),W,J)):z=await j.queryFn(Q,W,J,ht=>t(ht,W,J)),typeof process<"u",z.error)throw new Va(z.error,z.meta);let{data:qe}=z;Pe&&!Fe(F,"rawResponse")&&(qe=await Ge(Pe,z.data,"rawResponseSchema",z.meta));let Ne=await V(qe,z.meta,Q);return Xe&&!Fe(F,"response")&&(Ne=await Ge(Xe,Ne,"responseSchema",z.meta)),{...z,data:Ne}}if(S.type==="query"&&"infiniteQueryOptions"in j){const{infiniteQueryOptions:Q}=j,{maxPages:z=1/0}=Q;let J;const Qe={pages:[],pageParams:[]},Pe=h.selectQueryEntry(L(),S.queryCacheKey)?.data,qe=P(S,L())&&!S.direction||!Pe?Qe:Pe;if("direction"in S&&S.direction&&qe.pages.length){const Ne=S.direction==="backward",Or=(Ne?zo:ln)(Q,qe,S.originalArgs);J=await Z(qe,Or,z,Ne)}else{const{initialPageParam:Ne=Q.initialPageParam}=S,ht=Pe?.pageParams??[],Or=ht[0]??Ne,vc=ht.length;J=await Z(qe,Or,z),G&&(J={data:J.data.pages[0]});for(let Aa=1;Aa<vc;Aa++){const bc=ln(Q,J.data,S.originalArgs);J=await Z(J.data,bc,z)}}H=J}else H=await B(S.originalArgs);return N&&!Fe(F,"meta")&&H.meta&&(H.meta=await Ge(N,H.meta,"metaSchema",H.meta)),k(H.data,pt({fulfilledTimeStamp:Date.now(),baseQueryMeta:H.meta}))}catch(V){let W=V;if(W instanceof Va){let G=g(j,"transformErrorResponse");const{rawErrorResponseSchema:H,errorResponseSchema:Z}=j;let{value:B,meta:Q}=W;try{H&&!Fe(F,"rawErrorResponse")&&(B=await Ge(H,B,"rawErrorResponseSchema",Q)),N&&!Fe(F,"meta")&&(Q=await Ge(N,Q,"metaSchema",Q));let z=await G(B,Q,S.originalArgs);return Z&&!Fe(F,"errorResponse")&&(z=await Ge(Z,z,"errorResponseSchema",Q)),O(z,pt({baseQueryMeta:Q}))}catch(z){W=z}}try{if(W instanceof Wo){const G={endpoint:S.endpointName,arg:S.originalArgs,type:S.type,queryCacheKey:S.type==="query"?S.queryCacheKey:void 0};j.onSchemaFailure?.(W,G),a?.(W,G);const{catchSchemaFailure:H=r}=j;if(H)return O(H(W,G),pt({baseQueryMeta:W._bqMeta}))}}catch(G){W=G}throw console.error(W),W}};function P(S,C){const I=h.selectQueryEntry(C,S.queryCacheKey),O=h.selectConfig(C).refetchOnMountOrArgChange,k=I?.fulfilledTimeStamp,D=S.forceRefetch??(S.subscribe&&O);return D?D===!0||(Number(new Date)-Number(k))/1e3>=D:!1}const w=()=>Ha(`${e}/executeQuery`,y,{getPendingMeta({arg:C}){const I=n[C.endpointName];return pt({startedTimeStamp:Date.now(),...br(I)?{direction:C.direction}:{}})},condition(C,{getState:I}){const O=I(),k=h.selectQueryEntry(O,C.queryCacheKey),D=k?.fulfilledTimeStamp,L=C.originalArgs,U=k?.originalArgs,j=n[C.endpointName],N=C.direction;return un(C)?!0:k?.status==="pending"?!1:P(C,O)||vr(j)&&j?.forceRefetch?.({currentArg:L,previousArg:U,endpointState:k,state:O})?!0:!(D&&!N)},dispatchConditionRejection:!0}),v=w(),m=w(),b=Ha(`${e}/executeMutation`,y,{getPendingMeta(){return pt({startedTimeStamp:Date.now()})}}),x=S=>"force"in S,_=S=>"ifOlderThan"in S,A=(S,C,I={})=>(O,k)=>{const D=x(I)&&I.force,L=_(I)&&I.ifOlderThan,U=(N=!0)=>{const F={forceRefetch:N,subscribe:!1};return u.endpoints[S].initiate(C,F)},j=u.endpoints[S].select(C)(k());if(D)O(U());else if(L){const N=j?.fulfilledTimeStamp;if(!N){O(U());return}(Number(new Date)-Number(new Date(N)))/1e3>=L&&O(U())}else O(U(!1))};function T(S){return C=>C?.meta?.arg?.endpointName===S}function E(S,C){return{matchPending:kr(Qo(S),T(C)),matchFulfilled:kr(Ve(S),T(C)),matchRejected:kr(jn(S),T(C))}}return{queryThunk:v,mutationThunk:b,infiniteQueryThunk:m,prefetch:A,updateQueryData:d,upsertQueryData:p,patchQueryData:i,buildMatchThunkActions:E}}function ln(e,{pages:t,pageParams:n},o){const u=t.length-1;return e.getNextPageParam(t[u],t,n[u],n,o)}function zo(e,{pages:t,pageParams:n},o){return e.getPreviousPageParam?.(t[0],t,n[0],n,o)}function Ko(e,t,n,o){return Bn(n[e.meta.arg.endpointName][t],Ve(e)?e.payload:void 0,Ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,o)}function Mt(e,t,n){const o=e[t];o&&n(o)}function It(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Ja(e,t,n){const o=e[It(t)];o&&n(o)}var Nt={};function ou({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:o,context:{endpointDefinitions:u,apiUid:f,extractRehydrationInfo:h,hasRehydrationInfo:a},assertTagType:r,config:s}){const i=ct(`${e}/resetApiState`);function c(T,E,S,C){T[E.queryCacheKey]??={status:"uninitialized",endpointName:E.endpointName},Mt(T,E.queryCacheKey,I=>{I.status="pending",I.requestId=S&&I.requestId?I.requestId:C.requestId,E.originalArgs!==void 0&&(I.originalArgs=E.originalArgs),I.startedTimeStamp=C.startedTimeStamp;const O=u[C.arg.endpointName];br(O)&&"direction"in E&&(I.direction=E.direction)})}function l(T,E,S,C){Mt(T,E.arg.queryCacheKey,I=>{if(I.requestId!==E.requestId&&!C)return;const{merge:O}=u[E.arg.endpointName];if(I.status="fulfilled",O)if(I.data!==void 0){const{fulfilledTimeStamp:k,arg:D,baseQueryMeta:L,requestId:U}=E;let j=Dn(I.data,N=>O(N,S,{arg:D.originalArgs,baseQueryMeta:L,fulfilledTimeStamp:k,requestId:U}));I.data=j}else I.data=S;else I.data=u[E.arg.endpointName].structuralSharing??!0?Un(Ac(I.data)?Rc(I.data):I.data,S):S;delete I.error,I.fulfilledTimeStamp=E.fulfilledTimeStamp})}const d=Ze({name:`${e}/queries`,initialState:Nt,reducers:{removeQueryResult:{reducer(T,{payload:{queryCacheKey:E}}){delete T[E]},prepare:ft()},cacheEntriesUpserted:{reducer(T,E){for(const S of E.payload){const{queryDescription:C,value:I}=S;c(T,C,!0,{arg:C,requestId:E.meta.requestId,startedTimeStamp:E.meta.timestamp}),l(T,{arg:C,requestId:E.meta.requestId,fulfilledTimeStamp:E.meta.timestamp,baseQueryMeta:{}},I,!0)}},prepare:T=>({payload:T.map(C=>{const{endpointName:I,arg:O,value:k}=C,D=u[I];return{queryDescription:{type:"query",endpointName:I,originalArgs:C.arg,queryCacheKey:o({queryArgs:O,endpointDefinition:D,endpointName:I})},value:k}}),meta:{[Fo]:!0,requestId:Go(),timestamp:Date.now()}})},queryResultPatched:{reducer(T,{payload:{queryCacheKey:E,patches:S}}){Mt(T,E,C=>{C.data=Oa(C.data,S.concat())})},prepare:ft()}},extraReducers(T){T.addCase(t.pending,(E,{meta:S,meta:{arg:C}})=>{const I=un(C);c(E,C,I,S)}).addCase(t.fulfilled,(E,{meta:S,payload:C})=>{const I=un(S.arg);l(E,S,C,I)}).addCase(t.rejected,(E,{meta:{condition:S,arg:C,requestId:I},error:O,payload:k})=>{Mt(E,C.queryCacheKey,D=>{if(!S){if(D.requestId!==I)return;D.status="rejected",D.error=k??O}})}).addMatcher(a,(E,S)=>{const{queries:C}=h(S);for(const[I,O]of Object.entries(C))(O?.status==="fulfilled"||O?.status==="rejected")&&(E[I]=O)})}}),p=Ze({name:`${e}/mutations`,initialState:Nt,reducers:{removeMutationResult:{reducer(T,{payload:E}){const S=It(E);S in T&&delete T[S]},prepare:ft()}},extraReducers(T){T.addCase(n.pending,(E,{meta:S,meta:{requestId:C,arg:I,startedTimeStamp:O}})=>{I.track&&(E[It(S)]={requestId:C,status:"pending",endpointName:I.endpointName,startedTimeStamp:O})}).addCase(n.fulfilled,(E,{payload:S,meta:C})=>{C.arg.track&&Ja(E,C,I=>{I.requestId===C.requestId&&(I.status="fulfilled",I.data=S,I.fulfilledTimeStamp=C.fulfilledTimeStamp)})}).addCase(n.rejected,(E,{payload:S,error:C,meta:I})=>{I.arg.track&&Ja(E,I,O=>{O.requestId===I.requestId&&(O.status="rejected",O.error=S??C)})}).addMatcher(a,(E,S)=>{const{mutations:C}=h(S);for(const[I,O]of Object.entries(C))(O?.status==="fulfilled"||O?.status==="rejected")&&I!==O?.requestId&&(E[I]=O)})}}),g={tags:{},keys:{}},y=Ze({name:`${e}/invalidation`,initialState:g,reducers:{updateProvidedBy:{reducer(T,E){for(const{queryCacheKey:S,providedTags:C}of E.payload){P(T,S);for(const{type:I,id:O}of C){const k=(T.tags[I]??={})[O||"__internal_without_id"]??=[];k.includes(S)||k.push(S)}T.keys[S]=C}},prepare:ft()}},extraReducers(T){T.addCase(d.actions.removeQueryResult,(E,{payload:{queryCacheKey:S}})=>{P(E,S)}).addMatcher(a,(E,S)=>{const{provided:C}=h(S);for(const[I,O]of Object.entries(C.tags??{}))for(const[k,D]of Object.entries(O)){const L=(E.tags[I]??={})[k||"__internal_without_id"]??=[];for(const U of D)L.includes(U)||L.push(U),E.keys[U]=C.keys[U]}}).addMatcher(ir(Ve(t),Ln(t)),(E,S)=>{w(E,[S])}).addMatcher(d.actions.cacheEntriesUpserted.match,(E,S)=>{const C=S.payload.map(({queryDescription:I,value:O})=>({type:"UNKNOWN",payload:O,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:I}}));w(E,C)})}});function P(T,E){const S=T.keys[E]??[];for(const C of S){const I=C.type,O=C.id??"__internal_without_id",k=T.tags[I]?.[O];k&&(T.tags[I][O]=k.filter(D=>D!==E))}delete T.keys[E]}function w(T,E){const S=E.map(C=>{const I=Ko(C,"providesTags",u,r),{queryCacheKey:O}=C.meta.arg;return{queryCacheKey:O,providedTags:I}});y.caseReducers.updateProvidedBy(T,y.actions.updateProvidedBy(S))}const v=Ze({name:`${e}/subscriptions`,initialState:Nt,reducers:{updateSubscriptionOptions(T,E){},unsubscribeQueryResult(T,E){},internal_getRTKQSubscriptions(){}}}),m=Ze({name:`${e}/internalSubscriptions`,initialState:Nt,reducers:{subscriptionsUpdated:{reducer(T,E){return Oa(T,E.payload)},prepare:ft()}}}),b=Ze({name:`${e}/config`,initialState:{online:zc(),focused:Wc(),middlewareRegistered:!1,...s},reducers:{middlewareRegistered(T,{payload:E}){T.middlewareRegistered=T.middlewareRegistered==="conflict"||f!==E?"conflict":!0}},extraReducers:T=>{T.addCase(qr,E=>{E.online=!0}).addCase($n,E=>{E.online=!1}).addCase(Pr,E=>{E.focused=!0}).addCase(Nn,E=>{E.focused=!1}).addMatcher(a,E=>({...E}))}}),x=Qc({queries:d.reducer,mutations:p.reducer,provided:y.reducer,subscriptions:m.reducer,config:b.reducer}),_=(T,E)=>x(i.match(E)?void 0:T,E),A={...b.actions,...d.actions,...v.actions,...m.actions,...p.actions,...y.actions,resetApiState:i};return{reducer:_,actions:A}}var ge=Symbol.for("RTKQ/skipToken"),Vo={status:"uninitialized"},Xa=Dn(Vo,()=>{}),Za=Dn(Vo,()=>{});function iu({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const o=v=>Xa,u=v=>Za;return{buildQuerySelector:l,buildInfiniteQuerySelector:d,buildMutationSelector:p,selectInvalidatedBy:g,selectCachedArgsForQuery:y,selectApiState:h,selectQueries:a,selectMutations:s,selectQueryEntry:r,selectConfig:i};function f(v){return{...v,...Ba(v.status)}}function h(v){return v[t]}function a(v){return h(v)?.queries}function r(v,m){return a(v)?.[m]}function s(v){return h(v)?.mutations}function i(v){return h(v)?.config}function c(v,m,b){return x=>{if(x===ge)return n(o,b);const _=e({queryArgs:x,endpointDefinition:m,endpointName:v});return n(T=>r(T,_)??Xa,b)}}function l(v,m){return c(v,m,f)}function d(v,m){const{infiniteQueryOptions:b}=m;function x(_){const A={..._,...Ba(_.status)},{isLoading:T,isError:E,direction:S}=A,C=S==="forward",I=S==="backward";return{...A,hasNextPage:P(b,A.data,A.originalArgs),hasPreviousPage:w(b,A.data,A.originalArgs),isFetchingNextPage:T&&C,isFetchingPreviousPage:T&&I,isFetchNextPageError:E&&C,isFetchPreviousPageError:E&&I}}return c(v,m,x)}function p(){return v=>{let m;return typeof v=="object"?m=It(v)??ge:m=v,n(m===ge?u:_=>h(_)?.mutations?.[m]??Za,f)}}function g(v,m){const b=v[t],x=new Set;for(const _ of m.filter(Mn).map(cn)){const A=b.provided.tags[_.type];if(!A)continue;let T=(_.id!==void 0?A[_.id]:Ga(Object.values(A)))??[];for(const E of T)x.add(E)}return Ga(Array.from(x.values()).map(_=>{const A=b.queries[_];return A?[{queryCacheKey:_,endpointName:A.endpointName,originalArgs:A.originalArgs}]:[]}))}function y(v,m){return Object.values(a(v)).filter(b=>b?.endpointName===m&&b.status!=="uninitialized").map(b=>b.originalArgs)}function P(v,m,b){return m?ln(v,m,b)!=null:!1}function w(v,m,b){return!m||!v.getPreviousPageParam?!1:zo(v,m,b)!=null}}const{formatProdErrorMessage:cu,formatProdErrorMessage:yP,formatProdErrorMessage:wP}=await R("@reduxjs/toolkit");var es=WeakMap?new WeakMap:void 0,ts=({endpointName:e,queryArgs:t})=>{let n="";const o=es?.get(t);if(typeof o=="string")n=o;else{const u=JSON.stringify(t,(f,h)=>(h=typeof h=="bigint"?{$bigint:h.toString()}:h,h=xt(h)?Object.keys(h).sort().reduce((a,r)=>(a[r]=h[r],a),{}):h,h));xt(t)&&es?.set(t,u),n=u}return`${e}(${n})`};function Yo(...e){return function(n){const o=Ra(s=>n.extractRehydrationInfo?.(s,{reducerPath:n.reducerPath??"api"})),u={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:o,serializeQueryArgs(s){let i=ts;if("serializeQueryArgs"in s.endpointDefinition){const c=s.endpointDefinition.serializeQueryArgs;i=l=>{const d=c(l);return typeof d=="string"?d:ts({...l,queryArgs:d})}}else n.serializeQueryArgs&&(i=n.serializeQueryArgs);return i(s)},tagTypes:[...n.tagTypes||[]]},f={endpointDefinitions:{},batch(s){s()},apiUid:Go(),extractRehydrationInfo:o,hasRehydrationInfo:Ra(s=>o(s)!=null)},h={injectEndpoints:r,enhanceEndpoints({addTagTypes:s,endpoints:i}){if(s)for(const c of s)u.tagTypes.includes(c)||u.tagTypes.push(c);if(i)for(const[c,l]of Object.entries(i))typeof l=="function"?l(f.endpointDefinitions[c]):Object.assign(f.endpointDefinitions[c]||{},l);return h}},a=e.map(s=>s.init(h,u,f));function r(s){const i=s.endpoints({query:c=>({...c,type:"query"}),mutation:c=>({...c,type:"mutation"}),infiniteQuery:c=>({...c,type:"infinitequery"})});for(const[c,l]of Object.entries(i)){if(s.overrideExisting!==!0&&c in f.endpointDefinitions){if(s.overrideExisting==="throw")throw new Error(cu(39));continue}f.endpointDefinitions[c]=l;for(const d of a)d.injectEndpoint(c,l)}return h}return h.injectEndpoints({endpoints:n.endpoints})}}const{formatProdErrorMessage:uu}=await R("@reduxjs/toolkit");function Jo(){return function(){throw new Error(uu(33))}}function Oe(e,...t){return Object.assign(e,...t)}var lu=({api:e,queryThunk:t,internalState:n,mwApi:o})=>{const u=`${e.reducerPath}/subscriptions`;let f=null,h=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:r}=e.internalActions,s=(g,y)=>{if(a.match(y)){const{queryCacheKey:w,requestId:v,options:m}=y.payload,b=g.get(w);return b?.has(v)&&b.set(v,m),!0}if(r.match(y)){const{queryCacheKey:w,requestId:v}=y.payload,m=g.get(w);return m&&m.delete(v),!0}if(e.internalActions.removeQueryResult.match(y))return g.delete(y.payload.queryCacheKey),!0;if(t.pending.match(y)){const{meta:{arg:w,requestId:v}}=y,m=cr(g,w.queryCacheKey,on);return w.subscribe&&m.set(v,w.subscriptionOptions??m.get(v)??{}),!0}let P=!1;if(t.rejected.match(y)){const{meta:{condition:w,arg:v,requestId:m}}=y;if(w&&v.subscribe){const b=cr(g,v.queryCacheKey,on);b.set(m,v.subscriptionOptions??b.get(m)??{}),P=!0}}return P},i=()=>n.currentSubscriptions,d={getSubscriptions:i,getSubscriptionCount:g=>i().get(g)?.size??0,isRequestSubscribed:(g,y)=>!!i()?.get(g)?.get(y)};function p(g){return JSON.parse(JSON.stringify(Object.fromEntries([...g].map(([y,P])=>[y,Object.fromEntries(P)]))))}return(g,y)=>{if(f||(f=p(n.currentSubscriptions)),e.util.resetApiState.match(g))return f={},n.currentSubscriptions.clear(),h=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,d];const P=s(n.currentSubscriptions,g);let w=!0;if(P){h||(h=setTimeout(()=>{const b=p(n.currentSubscriptions),[,x]=No(f,()=>b);y.next(e.internalActions.subscriptionsUpdated(x)),f=b,h=null},500));const v=typeof g.type=="string"&&!!g.type.startsWith(u),m=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;w=!v&&!m}return[w,!1]}},du=2147483647/1e3-1,hu=({reducerPath:e,api:t,queryThunk:n,context:o,internalState:u,selectors:{selectQueryEntry:f,selectConfig:h},getRunningQueryThunk:a,mwApi:r})=>{const{removeQueryResult:s,unsubscribeQueryResult:i,cacheEntriesUpserted:c}=t.internalActions,l=ir(i.match,n.fulfilled,n.rejected,c.match);function d(v){const m=u.currentSubscriptions.get(v);return m?m.size>0:!1}const p={};function g(v){for(const m of v.values())m?.abort?.()}const y=(v,m)=>{const b=m.getState(),x=h(b);if(l(v)){let _;if(c.match(v))_=v.payload.map(A=>A.queryDescription.queryCacheKey);else{const{queryCacheKey:A}=i.match(v)?v.payload:v.meta.arg;_=[A]}P(_,m,x)}if(t.util.resetApiState.match(v)){for(const[_,A]of Object.entries(p))A&&clearTimeout(A),delete p[_];g(u.runningQueries),g(u.runningMutations)}if(o.hasRehydrationInfo(v)){const{queries:_}=o.extractRehydrationInfo(v);P(Object.keys(_),m,x)}};function P(v,m,b){const x=m.getState();for(const _ of v){const A=f(x,_);A?.endpointName&&w(_,A.endpointName,m,b)}}function w(v,m,b,x){const A=o.endpointDefinitions[m]?.keepUnusedDataFor??x.keepUnusedDataFor;if(A===1/0)return;const T=Math.max(0,Math.min(A,du));if(!d(v)){const E=p[v];E&&clearTimeout(E),p[v]=setTimeout(()=>{if(!d(v)){const S=f(b.getState(),v);S?.endpointName&&b.dispatch(a(S.endpointName,S.originalArgs))?.abort(),b.dispatch(s({queryCacheKey:v}))}delete p[v]},T*1e3)}}return y},rs=new Error("Promise never resolved before cacheEntryRemoved."),fu=({api:e,reducerPath:t,context:n,queryThunk:o,mutationThunk:u,internalState:f,selectors:{selectQueryEntry:h,selectApiState:a}})=>{const r=Qa(o),s=Qa(u),i=Ve(o,u),c={};function l(P,w,v){const m=c[P];m?.valueResolved&&(m.valueResolved({data:w,meta:v}),delete m.valueResolved)}function d(P){const w=c[P];w&&(delete c[P],w.cacheEntryRemoved())}const p=(P,w,v)=>{const m=g(P);function b(x,_,A,T){const E=h(v,_),S=h(w.getState(),_);!E&&S&&y(x,T,_,w,A)}if(o.pending.match(P))b(P.meta.arg.endpointName,m,P.meta.requestId,P.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(P))for(const{queryDescription:x,value:_}of P.payload){const{endpointName:A,originalArgs:T,queryCacheKey:E}=x;b(A,E,P.meta.requestId,T),l(E,_,{})}else if(u.pending.match(P))w.getState()[t].mutations[m]&&y(P.meta.arg.endpointName,P.meta.arg.originalArgs,m,w,P.meta.requestId);else if(i(P))l(m,P.payload,P.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(P)||e.internalActions.removeMutationResult.match(P))d(m);else if(e.util.resetApiState.match(P))for(const x of Object.keys(c))d(x)};function g(P){return r(P)?P.meta.arg.queryCacheKey:s(P)?P.meta.arg.fixedCacheKey??P.meta.requestId:e.internalActions.removeQueryResult.match(P)?P.payload.queryCacheKey:e.internalActions.removeMutationResult.match(P)?It(P.payload):""}function y(P,w,v,m,b){const x=n.endpointDefinitions[P],_=x?.onCacheEntryAdded;if(!_)return;const A={},T=new Promise(k=>{A.cacheEntryRemoved=k}),E=Promise.race([new Promise(k=>{A.valueResolved=k}),T.then(()=>{throw rs})]);E.catch(()=>{}),c[v]=A;const S=e.endpoints[P].select(ur(x)?w:v),C=m.dispatch((k,D,L)=>L),I={...m,getCacheEntry:()=>S(m.getState()),requestId:b,extra:C,updateCachedData:ur(x)?k=>m.dispatch(e.util.updateQueryData(P,w,k)):void 0,cacheDataLoaded:E,cacheEntryRemoved:T},O=_(w,I);Promise.resolve(O).catch(k=>{if(k!==rs)throw k})}return p},pu=({api:e,context:{apiUid:t},reducerPath:n})=>(o,u)=>{e.util.resetApiState.match(o)&&u.dispatch(e.internalActions.middlewareRegistered(t))},gu=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:o,queryThunk:u,api:f,assertTagType:h,refetchQuery:a,internalState:r})=>{const{removeQueryResult:s}=f.internalActions,i=ir(Ve(o),Ln(o)),c=ir(Ve(o,u),jn(o,u));let l=[];const d=(y,P)=>{i(y)?g(Ko(y,"invalidatesTags",n,h),P):c(y)?g([],P):f.util.invalidateTags.match(y)&&g(Bn(y.payload,void 0,void 0,void 0,void 0,h),P)};function p(y){const{queries:P,mutations:w}=y;for(const v of[P,w])for(const m in v)if(v[m]?.status==="pending")return!0;return!1}function g(y,P){const w=P.getState(),v=w[e];if(l.push(...y),v.config.invalidationBehavior==="delayed"&&p(v))return;const m=l;if(l=[],m.length===0)return;const b=f.util.selectInvalidatedBy(w,m);t.batch(()=>{const x=Array.from(b.values());for(const{queryCacheKey:_}of x){const A=v.queries[_],T=cr(r.currentSubscriptions,_,on);A&&(T.size===0?P.dispatch(s({queryCacheKey:_})):A.status!=="uninitialized"&&P.dispatch(a(A)))}})}return d},mu=({reducerPath:e,queryThunk:t,api:n,refetchQuery:o,internalState:u})=>{const{currentPolls:f,currentSubscriptions:h}=u,a=new Set;let r=null;const s=(y,P)=>{(n.internalActions.updateSubscriptionOptions.match(y)||n.internalActions.unsubscribeQueryResult.match(y))&&i(y.payload.queryCacheKey,P),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&i(y.meta.arg.queryCacheKey,P),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&c(y.meta.arg,P),n.util.resetApiState.match(y)&&(p(),r&&(clearTimeout(r),r=null),a.clear())};function i(y,P){a.add(y),r||(r=setTimeout(()=>{for(const w of a)l({queryCacheKey:w},P);a.clear(),r=null},0))}function c({queryCacheKey:y},P){const w=P.getState()[e],v=w.queries[y],m=h.get(y);if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:b,skipPollingIfUnfocused:x}=g(m);if(!Number.isFinite(b))return;const _=f.get(y);_?.timeout&&(clearTimeout(_.timeout),_.timeout=void 0);const A=Date.now()+b;f.set(y,{nextPollTimestamp:A,pollingInterval:b,timeout:setTimeout(()=>{(w.config.focused||!x)&&P.dispatch(o(v)),c({queryCacheKey:y},P)},b)})}function l({queryCacheKey:y},P){const v=P.getState()[e].queries[y],m=h.get(y);if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:b}=g(m);if(!Number.isFinite(b)){d(y);return}const x=f.get(y),_=Date.now()+b;(!x||_<x.nextPollTimestamp)&&c({queryCacheKey:y},P)}function d(y){const P=f.get(y);P?.timeout&&clearTimeout(P.timeout),f.delete(y)}function p(){for(const y of f.keys())d(y)}function g(y=new Map){let P=!1,w=Number.POSITIVE_INFINITY;for(const v of y.values())v.pollingInterval&&(w=Math.min(v.pollingInterval,w),P=v.skipPollingIfUnfocused||P);return{lowestPollingInterval:w,skipPollingIfUnfocused:P}}return s},yu=({api:e,context:t,queryThunk:n,mutationThunk:o})=>{const u=Qo(n,o),f=jn(n,o),h=Ve(n,o),a={};return(s,i)=>{if(u(s)){const{requestId:c,arg:{endpointName:l,originalArgs:d}}=s.meta,p=t.endpointDefinitions[l],g=p?.onQueryStarted;if(g){const y={},P=new Promise((b,x)=>{y.resolve=b,y.reject=x});P.catch(()=>{}),a[c]=y;const w=e.endpoints[l].select(ur(p)?d:c),v=i.dispatch((b,x,_)=>_),m={...i,getCacheEntry:()=>w(i.getState()),requestId:c,extra:v,updateCachedData:ur(p)?b=>i.dispatch(e.util.updateQueryData(l,d,b)):void 0,queryFulfilled:P};g(d,m)}}else if(h(s)){const{requestId:c,baseQueryMeta:l}=s.meta;a[c]?.resolve({data:s.payload,meta:l}),delete a[c]}else if(f(s)){const{requestId:c,rejectedWithValue:l,baseQueryMeta:d}=s.meta;a[c]?.reject({error:s.payload??s.error,isUnhandledError:!l,meta:d}),delete a[c]}}},wu=({reducerPath:e,context:t,api:n,refetchQuery:o,internalState:u})=>{const{removeQueryResult:f}=n.internalActions,h=(r,s)=>{Pr.match(r)&&a(s,"refetchOnFocus"),qr.match(r)&&a(s,"refetchOnReconnect")};function a(r,s){const i=r.getState()[e],c=i.queries,l=u.currentSubscriptions;t.batch(()=>{for(const d of l.keys()){const p=c[d],g=l.get(d);if(!g||!p)continue;const y=[...g.values()];(y.some(w=>w[s]===!0)||y.every(w=>w[s]===void 0)&&i.config[s])&&(g.size===0?r.dispatch(f({queryCacheKey:d})):p.status!=="uninitialized"&&r.dispatch(o(p)))}})}return h};function Pu(e){const{reducerPath:t,queryThunk:n,api:o,context:u,getInternalState:f}=e,{apiUid:h}=u,a={invalidateTags:ct(`${t}/invalidateTags`)},r=l=>l.type.startsWith(`${t}/`),s=[pu,hu,gu,mu,fu,yu];return{middleware:l=>{let d=!1;const p=f(l.dispatch),g={...e,internalState:p,refetchQuery:c,isThisApiSliceAction:r,mwApi:l},y=s.map(v=>v(g)),P=lu(g),w=wu(g);return v=>m=>{if(!Fc(m))return v(m);d||(d=!0,l.dispatch(o.internalActions.middlewareRegistered(h)));const b={...l,next:v},x=l.getState(),[_,A]=P(m,b,x);let T;if(_?T=v(m):T=A,l.getState()[t]&&(w(m,b,x),r(m)||u.hasRehydrationInfo(m)))for(const E of y)E(m,b,x);return T}},actions:a};function c(l){return e.api.endpoints[l.endpointName].initiate(l.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ns=Symbol(),Xo=({createSelector:e=Hc}={})=>({name:ns,init(t,{baseQuery:n,tagTypes:o,reducerPath:u,serializeQueryArgs:f,keepUnusedDataFor:h,refetchOnMountOrArgChange:a,refetchOnFocus:r,refetchOnReconnect:s,invalidationBehavior:i,onSchemaFailure:c,catchSchemaFailure:l,skipSchemaValidation:d},p){Ic();const g=B=>B;Object.assign(t,{reducerPath:u,endpoints:{},internalActions:{onOnline:qr,onOffline:$n,onFocus:Pr,onFocusLost:Nn},util:{}});const y=iu({serializeQueryArgs:f,reducerPath:u,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:w,buildQuerySelector:v,buildInfiniteQuerySelector:m,buildMutationSelector:b}=y;Oe(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:w});const{queryThunk:x,infiniteQueryThunk:_,mutationThunk:A,patchQueryData:T,updateQueryData:E,upsertQueryData:S,prefetch:C,buildMatchThunkActions:I}=su({baseQuery:n,reducerPath:u,context:p,api:t,serializeQueryArgs:f,assertTagType:g,selectors:y,onSchemaFailure:c,catchSchemaFailure:l,skipSchemaValidation:d}),{reducer:O,actions:k}=ou({context:p,queryThunk:x,mutationThunk:A,serializeQueryArgs:f,reducerPath:u,assertTagType:g,config:{refetchOnFocus:r,refetchOnReconnect:s,refetchOnMountOrArgChange:a,keepUnusedDataFor:h,reducerPath:u,invalidationBehavior:i}});Oe(t.util,{patchQueryData:T,updateQueryData:E,upsertQueryData:S,prefetch:C,resetApiState:k.resetApiState,upsertQueryEntries:k.cacheEntriesUpserted}),Oe(t.internalActions,k);const D=new WeakMap,L=B=>cr(D,B,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:U,buildInitiateInfiniteQuery:j,buildInitiateMutation:N,getRunningMutationThunk:F,getRunningMutationsThunk:V,getRunningQueriesThunk:W,getRunningQueryThunk:G}=au({queryThunk:x,mutationThunk:A,infiniteQueryThunk:_,api:t,serializeQueryArgs:f,context:p,getInternalState:L});Oe(t.util,{getRunningMutationThunk:F,getRunningMutationsThunk:V,getRunningQueryThunk:G,getRunningQueriesThunk:W});const{middleware:H,actions:Z}=Pu({reducerPath:u,context:p,queryThunk:x,mutationThunk:A,infiniteQueryThunk:_,api:t,assertTagType:g,selectors:y,getRunningQueryThunk:G,getInternalState:L});return Oe(t.util,Z),Oe(t,{reducer:O,middleware:H}),{name:ns,injectEndpoint(B,Q){const z=t,J=z.endpoints[B]??={};vr(Q)&&Oe(J,{name:B,select:v(B,Q),initiate:U(B,Q)},I(x,B)),tu(Q)&&Oe(J,{name:B,select:b(),initiate:N(B)},I(A,B)),br(Q)&&Oe(J,{name:B,select:m(B,Q),initiate:j(B,Q)},I(x,B))}}}});Xo();function Xt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xt=function(n){return typeof n}:Xt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xt(e)}function qu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vu(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function bu(e,t,n){return t&&vu(e.prototype,t),e}function Eu(e,t){return t&&(Xt(t)==="object"||typeof t=="function")?t:Zt(e)}function dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},dn(e)}function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Su(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hn(e,t)}function hn(e,t){return hn=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},hn(e,t)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tu=await R("react"),{PureComponent:xu}=Tu;var Cu=function(e){Su(t,e);function t(){var n,o;qu(this,t);for(var u=arguments.length,f=new Array(u),h=0;h<u;h++)f[h]=arguments[h];return o=Eu(this,(n=dn(t)).call.apply(n,[this].concat(f))),er(Zt(o),"state",{bootstrapped:!1}),er(Zt(o),"_unsubscribe",void 0),er(Zt(o),"handlePersistorState",function(){var a=o.props.persistor,r=a.getState(),s=r.bootstrapped;s&&(o.props.onBeforeLift?Promise.resolve(o.props.onBeforeLift()).finally(function(){return o.setState({bootstrapped:!0})}):o.setState({bootstrapped:!0}),o._unsubscribe&&o._unsubscribe())}),o}return bu(t,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),t}(xu);er(Cu,"defaultProps",{children:null,loading:null});const Iu=wr({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),_u=wr({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Au=wr({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),Ru=wr({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),{ChainId:PP}=await R("@dcl/schemas"),Ou=[Iu,_u],ku=[Ru,Au],Hn=[...Ou,...ku];function Du(e){return Hn.some(t=>t.id===e)}const{createConnector:ju}=await R("wagmi"),{ChainId:vt}=await R("@dcl/schemas"),as={[vt.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet?project=magic",[vt.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia?project=magic",[vt.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon?project=magic",[vt.MATIC_AMOY]:"https://rpc.decentraland.org/amoy?project=magic"};function Lu(e){const{apiKey:t}=e;let n=null,o=null;async function u(f){const{Magic:h}=await Ue(async()=>{const{Magic:s}=await import("./index-BTtTX-5z.js");return{Magic:s}},__vite__mapDeps([0,1])),{OAuthExtension:a}=await Ue(async()=>{const{OAuthExtension:s}=await import("./index-BAhlRyDG.js");return{OAuthExtension:s}},__vite__mapDeps([2,1])),r=as[f]||as[vt.ETHEREUM_MAINNET];return new h(t,{extensions:[new a],network:{rpcUrl:r,chainId:f}})}return ju(f=>{async function h(){return o?await o.request({method:"eth_accounts"}):[]}async function a(r){o=await n.wallet.getProvider();const s=await h();return s.length===0?null:(await f.storage?.setItem("magicChainId",r),{accounts:s,chainId:r})}return{id:"magic",name:"Magic",type:"magic",async setup(){const s=await f.storage?.getItem("magicChainId")??f.chains[0]?.id;if(s)try{if(n=await u(s),await n.user.isLoggedIn()){const c=await a(s);c&&f.emitter.emit("connect",c)}}catch{}},async connect({chainId:r}={}){const s=r??f.chains[0].id;if(n||(n=await u(s)),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in. Please authenticate via the auth dapp first.");const c=await a(s);if(!c)throw new Error("Magic: No accounts found");return c},async disconnect(){n&&await n.user.logout(),n=null,o=null,await f.storage?.removeItem("magicChainId")},async getAccounts(){return h()},async getChainId(){return await f.storage?.getItem("magicChainId")??f.chains[0].id},async getProvider(){return!o&&n&&(o=await n.wallet.getProvider()),o},async isAuthorized(){try{if(!n){const s=await f.storage?.getItem("magicChainId")??f.chains[0]?.id;if(!s)return!1;n=await u(s)}return await n.user.isLoggedIn()}catch{return!1}},async switchChain({chainId:r}){const s=f.chains.find(c=>c.id===r);if(!s)throw new Error(`Chain ${r} not configured`);if(n=await u(r),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in");return o=await n.wallet.getProvider(),await f.storage?.setItem("magicChainId",r),f.emitter.emit("change",{chainId:r}),s},onAccountsChanged(r){r.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:r})},onChainChanged(r){const s=r.startsWith("0x")?parseInt(r,16):Number(r);f.emitter.emit("change",{chainId:s})},onDisconnect(){f.emitter.emit("disconnect"),n=null,o=null}}})}const{createConnector:Uu}=await R("wagmi"),{ChainId:ss}=await R("@dcl/schemas");function Mu(e){const{clientId:t,supportedChainIds:n=[ss.ETHEREUM_MAINNET,ss.ETHEREUM_SEPOLIA]}=e;let o=null,u=null,f=null,h=null,a=null,r=null;async function s(){if(o)return o;try{return o=(await Ue(()=>import("./thirdweb-E-fErz2x.js").then(y=>y.t),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]))).createThirdwebClient({clientId:t}),o}catch{throw new Error("Thirdweb: thirdweb package is not installed.")}}async function i(){if(u)return u;try{return u=(await Ue(()=>import("./wallets-BmZ-KVbp.js").then(y=>y.a1),__vite__mapDeps([25,12,10,5,9,8,13,14,4,6,11,7,15,26,27,28,29,30,31,32,33]))).inAppWallet(),u}catch{throw new Error("Thirdweb: thirdweb package is not installed. Run: npm install thirdweb")}}async function c(g){return f&&r===g||(f=(await Ue(()=>import("./chains-D88UzVoE.js"),__vite__mapDeps([34,4,5,23,33]))).defineChain(g),r=g),f}async function l(g,y,P){const{EIP1193:w}=await Ue(async()=>{const{EIP1193:v}=await import("./wallets-BmZ-KVbp.js").then(m=>m.a1);return{EIP1193:v}},__vite__mapDeps([25,12,10,5,9,8,13,14,4,6,11,7,15,26,27,28,29,30,31,32,33]));return w.toProvider({wallet:g,chain:y,client:P})}function d(g){if(!n.includes(g))throw new Error(`Thirdweb: Chain ${g} is not supported. Supported chains: ${n.join(", ")}`)}function p(){u=null,o=null,f=null,h=null,a=null,r=null}return Uu(g=>{async function y(P){if(!h||!u)return null;const w=await s(),v=await c(P);return a=await l(u,v,w),await g.storage?.setItem("thirdwebChainId",P),{accounts:[h.address],chainId:P}}return{id:"thirdweb",name:"Thirdweb",type:"thirdweb",async setup(){const w=await g.storage?.getItem("thirdwebChainId")??g.chains[0]?.id;if(w)try{u=await i();const v=await s();if(h=await u.autoConnect({client:v}),!h)return;const m=await y(w);if(!m)return;g.emitter.emit("connect",m)}catch{}},async connect({chainId:P}={}){const w=P??g.chains[0]?.id;if(!w)throw new Error("Thirdweb: No chain ID provided and no chains configured");d(w),u||(u=await i());const v=await s();try{h=await u.autoConnect({client:v})}catch{throw new Error("Thirdweb: No active session. User must authenticate first.")}if(!h)throw new Error("Thirdweb: No active session. User must authenticate first.");const m=await y(w);if(!m)throw new Error("Thirdweb: Failed to initialize connection");return m},async disconnect(){u&&await u.disconnect(),p(),await g.storage?.removeItem("thirdwebChainId")},async getAccounts(){return h?[h.address]:[]},async getChainId(){return await g.storage?.getItem("thirdwebChainId")??r??g.chains[0]?.id},async getProvider(){if(!a)throw new Error("Thirdweb: wallet is not connected. Call connect() first.");return new Proxy({},{get(P,w){return w==="request"?async v=>{const{method:m,params:b}=v;if(m==="wallet_switchEthereumChain"){const x=b?.[0]?.chainId,_=parseInt(x,16);if(Number.isNaN(_))throw new Error("Thirdweb: Invalid chain ID");d(_),f=null,a=null;const A=await s(),T=await i(),E=await c(_);return a=await l(T,E,A),await g.storage?.setItem("thirdwebChainId",_),g.emitter.emit("change",{chainId:_}),null}return a.request(v)}:Reflect.get(a,w)}})},async isAuthorized(){try{if(!u){if(!(await g.storage?.getItem("thirdwebChainId")??g.chains[0]?.id))return!1;u=await i();const v=await s();try{return h=await u.autoConnect({client:v}),!!h}catch{return!1}}return!!u.getAccount()}catch{return!1}},async switchChain({chainId:P}){const w=g.chains.find(b=>b.id===P);if(!w)throw new Error(`Chain ${P} not configured`);if(d(P),!u||!h)throw new Error("Thirdweb: Not connected");f=null,a=null;const v=await s(),m=await c(P);return a=await l(u,m,v),await g.storage?.setItem("thirdwebChainId",P),g.emitter.emit("change",{chainId:P}),w},onAccountsChanged(P){P.length===0?this.onDisconnect():g.emitter.emit("change",{accounts:P})},onChainChanged(P){const w=parseInt(P,16);Number.isNaN(w)||g.emitter.emit("change",{chainId:w})},onDisconnect(){g.emitter.emit("disconnect"),p(),g.storage?.removeItem("thirdwebChainId")}}})}function Nu(e){const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const o=e.transports?.[t.id]?.({chain:t});return(o?.value?.transports||[o]).map(({value:f})=>f?.url||n)}const{getAddress:at,numberToHex:lr,SwitchChainError:dr,UserRejectedRequestError:st}=await R("viem");Er.type="coinbaseWallet";function Er(e={}){return e.version==="3"||e.headlessMode?Bu(e):$u(e)}function $u(e){let t,n,o,u;return On(f=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Er.type,async connect({chainId:h,withCapabilities:a,...r}={}){try{const s=await this.getProvider(),i=(await s.request({method:"eth_requestAccounts",params:"instantOnboarding"in r&&r.instantOnboarding?[{onboarding:"instant"}]:[]})).map(l=>at(l));n||(n=this.onAccountsChanged.bind(this),s.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),s.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),s.on("disconnect",u));let c=await this.getChainId();return h&&c!==h&&(c=(await this.switchChain({chainId:h}).catch(d=>{if(d.code===st.code)throw d;return{id:c}}))?.id??c),{accounts:a?i.map(l=>({address:l,capabilities:{}})):i,chainId:c}}catch(s){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(s.message)?new st(s):s}},async disconnect(){const h=await this.getProvider();n&&(h.removeListener("accountsChanged",n),n=void 0),o&&(h.removeListener("chainChanged",o),o=void 0),u&&(h.removeListener("disconnect",u),u=void 0),h.disconnect(),h.close?.()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>at(a))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return Number(a)},async getProvider(){if(!t){const h=typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createCoinbaseWalletSDK:a}=await Ue(async()=>{const{createCoinbaseWalletSDK:s}=await import("./index-CwwTvCG6.js");return{createCoinbaseWalletSDK:s}},__vite__mapDeps([35,9,36,37,8,38,39,30,32]));t=a({...e,appChainIds:f.chains.map(s=>s.id),preference:h}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:a}){const r=f.chains.find(i=>i.id===a);if(!r)throw new dr(new kn);const s=await this.getProvider();try{return await s.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(r.id)}]}),r}catch(i){if(i.code===4902)try{let c;h?.blockExplorerUrls?c=h.blockExplorerUrls:c=r.blockExplorers?.default.url?[r.blockExplorers?.default.url]:[];let l;h?.rpcUrls?.length?l=h.rpcUrls:l=[r.rpcUrls.default?.http[0]??""];const d={blockExplorerUrls:c,chainId:lr(a),chainName:h?.chainName??r.name,iconUrls:h?.iconUrls,nativeCurrency:h?.nativeCurrency??r.nativeCurrency,rpcUrls:l};return await s.request({method:"wallet_addEthereumChain",params:[d]}),r}catch(c){throw new st(c)}throw new dr(i)}},onAccountsChanged(h){h.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:h.map(a=>at(a))})},onChainChanged(h){const a=Number(h);f.emitter.emit("change",{chainId:a})},async onDisconnect(h){f.emitter.emit("disconnect");const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),o&&(a.removeListener("chainChanged",o),o=void 0),u&&(a.removeListener("disconnect",u),u=void 0)}}))}function Bu(e){let n,o,u,f,h;return On(a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Er.type,async connect({chainId:r,withCapabilities:s}={}){try{const i=await this.getProvider(),c=(await i.request({method:"eth_requestAccounts"})).map(d=>at(d));u||(u=this.onAccountsChanged.bind(this),i.on("accountsChanged",u)),f||(f=this.onChainChanged.bind(this),i.on("chainChanged",f)),h||(h=this.onDisconnect.bind(this),i.on("disconnect",h));let l=await this.getChainId();return r&&l!==r&&(l=(await this.switchChain({chainId:r}).catch(p=>{if(p.code===st.code)throw p;return{id:l}}))?.id??l),{accounts:s?c.map(d=>({address:d,capabilities:{}})):c,chainId:l}}catch(i){throw/(user closed modal|accounts received is empty|user denied account)/i.test(i.message)?new st(i):i}},async disconnect(){const r=await this.getProvider();u&&(r.removeListener("accountsChanged",u),u=void 0),f&&(r.removeListener("chainChanged",f),f=void 0),h&&(r.removeListener("disconnect",h),h=void 0),r.disconnect(),r.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(s=>at(s))},async getChainId(){const s=await(await this.getProvider()).request({method:"eth_chainId"});return Number(s)},async getProvider(){if(!o){const r=await(async()=>{const{default:d}=await Ue(async()=>{const{default:p}=await import("./index-D7VWCQbE.js").then(g=>g.i);return{default:p}},__vite__mapDeps([40,30,41,42,43,44,39,29,45]));return typeof d!="function"&&typeof d.default=="function"?d.default:d})();n=new r({...e,reloadOnDisconnect:!1});const s=n.walletExtension?.getChainId(),i=a.chains.find(d=>e.chainId?d.id===e.chainId:d.id===s)||a.chains[0],c=e.chainId||i?.id,l=e.jsonRpcUrl||i?.rpcUrls.default.http[0];o=n.makeWeb3Provider(l,c)}return o},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:s}){const i=a.chains.find(l=>l.id===s);if(!i)throw new dr(new kn);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(i.id)}]}),i}catch(l){if(l.code===4902)try{let d;r?.blockExplorerUrls?d=r.blockExplorerUrls:d=i.blockExplorers?.default.url?[i.blockExplorers?.default.url]:[];let p;r?.rpcUrls?.length?p=r.rpcUrls:p=[i.rpcUrls.default?.http[0]??""];const g={blockExplorerUrls:d,chainId:lr(s),chainName:r?.chainName??i.name,iconUrls:r?.iconUrls,nativeCurrency:r?.nativeCurrency??i.nativeCurrency,rpcUrls:p};return await c.request({method:"wallet_addEthereumChain",params:[g]}),i}catch(d){throw new st(d)}throw new dr(l)}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(s=>at(s))})},onChainChanged(r){const s=Number(r);a.emitter.emit("change",{chainId:s})},async onDisconnect(r){a.emitter.emit("disconnect");const s=await this.getProvider();u&&(s.removeListener("accountsChanged",u),u=void 0),f&&(s.removeListener("chainChanged",f),f=void 0),h&&(s.removeListener("disconnect",h),h=void 0)}}))}const{getAddress:jr,numberToHex:os,SwitchChainError:Hu,UserRejectedRequestError:$t}=await R("viem");Qn.type="walletConnect";function Qn(e){const t=e.isNewChainsStale??!0;let n,o;const u="eip155";let f,h,a,r,s,i;return On(c=>({id:"walletConnect",name:"WalletConnect",type:Qn.type,async setup(){const l=await this.getProvider().catch(()=>null);l&&(a||(a=this.onConnect.bind(this),l.on("connect",a)),s||(s=this.onSessionDelete.bind(this),l.on("session_delete",s)))},async connect({chainId:l,withCapabilities:d,...p}={}){try{const g=await this.getProvider();if(!g)throw new ka;r||(r=this.onDisplayUri,g.on("display_uri",r));let y=l;if(!y){const m=await c.storage?.getItem("state")??{};c.chains.some(x=>x.id===m.chainId)?y=m.chainId:y=c.chains[0]?.id}if(!y)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(g.session&&P&&await g.disconnect(),!g.session||P){const m=c.chains.filter(b=>b.id!==y).map(b=>b.id);await g.connect({optionalChains:[y,...m],..."pairingTopic"in p?{pairingTopic:p.pairingTopic}:{}}),this.setRequestedChainsIds(c.chains.map(b=>b.id))}const w=(await g.enable()).map(m=>jr(m));let v=await this.getChainId();return l&&v!==l&&(v=(await this.switchChain({chainId:l}).catch(b=>{if(b.code===$t.code&&b.cause?.message!=="Missing or invalid. request() method: wallet_addEthereumChain")throw b;return{id:v}}))?.id??v),r&&(g.removeListener("display_uri",r),r=void 0),a&&(g.removeListener("connect",a),a=void 0),f||(f=this.onAccountsChanged.bind(this),g.on("accountsChanged",f)),h||(h=this.onChainChanged.bind(this),g.on("chainChanged",h)),i||(i=this.onDisconnect.bind(this),g.on("disconnect",i)),s||(s=this.onSessionDelete.bind(this),g.on("session_delete",s)),{accounts:d?w.map(m=>({address:m,capabilities:{}})):w,chainId:v}}catch(g){throw/(user rejected|connection request reset)/i.test(g?.message)?new $t(g):g}},async disconnect(){const l=await this.getProvider();try{await l?.disconnect()}catch(d){if(!/No matching key/i.test(d.message))throw d}finally{h&&(l?.removeListener("chainChanged",h),h=void 0),i&&(l?.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),l?.on("connect",a)),f&&(l?.removeListener("accountsChanged",f),f=void 0),s&&(l?.removeListener("session_delete",s),s=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(d=>jr(d))},async getProvider({chainId:l}={}){async function d(){const p=c.chains.map(y=>y.id);if(!p.length)return;const{EthereumProvider:g}=await Ue(async()=>{const{EthereumProvider:y}=await import("./index.es-CzqZMQ08.js");return{EthereumProvider:y}},__vite__mapDeps([46,8,29,30,9,31,32,47]));return await g.init({...e,disableProviderPing:!0,optionalChains:p,projectId:e.projectId,rpcMap:Object.fromEntries(c.chains.map(y=>{const[P]=Nu({chain:y,transports:c.transports});return[y.id,P]})),showQrModal:e.showQrModal??!0})}return n||(o||(o=d()),n=await o,n?.events.setMaxListeners(Number.POSITIVE_INFINITY)),l&&await this.switchChain?.({chainId:l}),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[l,d]=await Promise.all([this.getAccounts(),this.getProvider()]);return l.length?await this.isChainsStale()&&d.session?(await d.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){const p=await this.getProvider();if(!p)throw new ka;const g=c.chains.find(y=>y.id===d);if(!g)throw new Hu(new kn);try{await Promise.all([new Promise(P=>{const w=({chainId:v})=>{v===d&&(c.emitter.off("change",w),P())};c.emitter.on("change",w)}),p.request({method:"wallet_switchEthereumChain",params:[{chainId:os(d)}]})]);const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,d]),g}catch(y){const P=y;if(/(user rejected)/i.test(P.message))throw new $t(P);try{let w;l?.blockExplorerUrls?w=l.blockExplorerUrls:w=g.blockExplorers?.default.url?[g.blockExplorers?.default.url]:[];let v;l?.rpcUrls?.length?v=l.rpcUrls:v=[...g.rpcUrls.default.http];const m={blockExplorerUrls:w,chainId:os(d),chainName:l?.chainName??g.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??g.nativeCurrency,rpcUrls:v};await p.request({method:"wallet_addEthereumChain",params:[m]});const b=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...b,d]),g}catch(w){throw new $t(w)}}},onAccountsChanged(l){l.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:l.map(d=>jr(d))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=Number(l.chainId),p=await this.getAccounts();c.emitter.emit("connect",{accounts:p,chainId:d})},async onDisconnect(l){this.setRequestedChainsIds([]),c.emitter.emit("disconnect");const d=await this.getProvider();f&&(d.removeListener("accountsChanged",f),f=void 0),h&&(d.removeListener("chainChanged",h),h=void 0),i&&(d.removeListener("disconnect",i),i=void 0),s&&(d.removeListener("session_delete",s),s=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a))},onDisplayUri(l){c.emitter.emit("message",{type:"display_uri",data:l})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){return n?n.session?.namespaces[u]?.accounts?.map(d=>Number.parseInt(d.split(":")[1]||"",10))??[]:[]},async getRequestedChainsIds(){return await c.storage?.getItem(this.requestedChainsStorageKey)??[]},async isChainsStale(){if(!t)return!1;const l=c.chains.map(g=>g.id),d=this.getNamespaceChainsIds();if(d.length&&!d.some(g=>l.includes(g)))return!1;const p=await this.getRequestedChainsIds();return!l.every(g=>p.includes(g))},async setRequestedChainsIds(l){await c.storage?.setItem(this.requestedChainsStorageKey,l)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}const{createConfig:Qu,http:fn}=await R("wagmi"),{ChainId:Bt}=await R("@dcl/schemas"),et={name:"Decentraland",description:"Decentraland dApp",url:"https://decentraland.org",icons:["https://cdn.decentraland.org/@dcl/marketplace-site/6.41.1/favicon.ico"]},Fu={[Bt.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[Bt.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[Bt.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[Bt.MATIC_AMOY]:"https://rpc.decentraland.org/amoy"},Gu=Hn.reduce((e,t)=>{const n=Fu[t.id];return e[t.id]=n?fn(n):fn(),e},{});function Wu(e,t){const n=t.trim();if(!n)return e;const o=e.replace(/\/+$/,""),u=n.startsWith("/")?n:`/${n}`;return`${o}${u}`}function zu(e){if(!e)return et;const t=e.url??(e.urlPath?Wu(et.url,e.urlPath):et.url);return{name:e.name??et.name,description:e.description??et.description,url:t,icons:e.icons??et.icons}}function Ku(e={}){const{walletConnectProjectId:t,appMetadata:n,chains:o=Hn,transports:u,connectors:f={},additionalConnectors:h=[]}=e,a=zu(n),{injected:r=!0,walletConnect:s=!0,coinbaseWallet:i=!0}=f,c=o.reduce((d,p)=>(d[p.id]=u?.[p.id]??Gu[p.id]??fn(),d),{}),l=[];return r&&l.push(Dc()),s&&t&&l.push(Qn({projectId:t,metadata:{name:a.name,description:a.description??"",url:a.url??"",icons:a.icons??[]}})),i&&l.push(Er({appName:a.name})),l.push(...h),Qu({chains:o,transports:c,connectors:l})}function Vu(){if(typeof window>"u"||!window.localStorage)return;const e=[],{localStorage:t}=window;for(let n=0;n<t.length;n++){const o=t.key(n);o?.startsWith("wagmi.")&&e.push(o)}e.forEach(n=>t.removeItem(n))}var Zo={},Ee={},pn={exports:{}},gn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(o){if(o==null)throw new TypeError("Expected a string but received a ".concat(o));if(o.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(o.constructor.name))}e.exports=t.default,e.exports.default=t.default})(gn,gn.exports);var Fn=gn.exports,mn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;function n(u){return Object.prototype.toString.call(u)==="[object RegExp]"}function o(u,f){for(var h=0;h<f.length;h++){var a=f[h];if(u===a||n(a)&&a.test(u))return!0}return!1}e.exports=t.default,e.exports.default=t.default})(mn,mn.exports);var Yu=mn.exports,yn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(u,f){return u.indexOf(f)!==-1};t.default=n,e.exports=t.default,e.exports.default=t.default})(yn,yn.exports);var Ju=yn.exports,wn={exports:{}},Pn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1?arguments[1]:void 0;for(var f in u)typeof o[f]>"u"&&(o[f]=u[f]);return o}e.exports=t.default,e.exports.default=t.default})(Pn,Pn.exports);var ei=Pn.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n=u(Fn),o=u(ei);function u(a){return a&&a.__esModule?a:{default:a}}var f={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function h(a,r){(0,n.default)(a),r=(0,o.default)(r,f),r.allow_trailing_dot&&a[a.length-1]==="."&&(a=a.substring(0,a.length-1)),r.allow_wildcard===!0&&a.indexOf("*.")===0&&(a=a.substring(2));var s=a.split("."),i=s[s.length-1];return r.require_tld&&(s.length<2||!r.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i)||/\s/.test(i))||!r.allow_numeric_tld&&/^\d+$/.test(i)?!1:s.every(function(c){return!(c.length>63&&!r.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(c)||/[\uff01-\uff5e]/.test(c)||/^-|-$/.test(c)||!r.allow_underscores&&/_/.test(c))})}e.exports=t.default,e.exports.default=t.default})(wn,wn.exports);var Xu=wn.exports,qn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(Fn);function o(c){return c&&c.__esModule?c:{default:c}}function u(c){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},u(c)}var f="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",h="(".concat(f,"[.]){3}").concat(f),a=new RegExp("^".concat(h,"$")),r="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(r,":){7}(?:").concat(r,"|:)|")+"(?:".concat(r,":){6}(?:").concat(h,"|:").concat(r,"|:)|")+"(?:".concat(r,":){5}(?::").concat(h,"|(:").concat(r,"){1,2}|:)|")+"(?:".concat(r,":){4}(?:(:").concat(r,"){0,1}:").concat(h,"|(:").concat(r,"){1,3}|:)|")+"(?:".concat(r,":){3}(?:(:").concat(r,"){0,2}:").concat(h,"|(:").concat(r,"){1,4}|:)|")+"(?:".concat(r,":){2}(?:(:").concat(r,"){0,3}:").concat(h,"|(:").concat(r,"){1,5}|:)|")+"(?:".concat(r,":){1}(?:(:").concat(r,"){0,4}:").concat(h,"|(:").concat(r,"){1,6}|:)|")+"(?::((?::".concat(r,"){0,5}:").concat(h,"|(?::").concat(r,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function i(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var d=(u(l)==="object"?l.version:arguments[1])||"";return d?d.toString()==="4"?a.test(c):d.toString()==="6"?s.test(c):!1:i(c,{version:4})||i(c,{version:6})}e.exports=t.default,e.exports.default=t.default})(qn,qn.exports);var Zu=qn.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=P;var n=r(Fn),o=r(Yu),u=r(Ju),f=r(Xu),h=r(Zu),a=r(ei);function r(w){return w&&w.__esModule?w:{default:w}}function s(w,v){return p(w)||d(w,v)||c(w,v)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(w,v){if(w){if(typeof w=="string")return l(w,v);var m={}.toString.call(w).slice(8,-1);return m==="Object"&&w.constructor&&(m=w.constructor.name),m==="Map"||m==="Set"?Array.from(w):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?l(w,v):void 0}}function l(w,v){(v==null||v>w.length)&&(v=w.length);for(var m=0,b=Array(v);m<v;m++)b[m]=w[m];return b}function d(w,v){var m=w==null?null:typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(m!=null){var b,x,_,A,T=[],E=!0,S=!1;try{if(_=(m=m.call(w)).next,v!==0)for(;!(E=(b=_.call(m)).done)&&(T.push(b.value),T.length!==v);E=!0);}catch(C){S=!0,x=C}finally{try{if(!E&&m.return!=null&&(A=m.return(),Object(A)!==A))return}finally{if(S)throw x}}return T}}function p(w){if(Array.isArray(w))return w}var g={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},y=/^\[([^\]]+)\](?::([0-9]+))?$/;function P(w,v){if((0,n.default)(w),!w||/[\s<>]/.test(w)||w.indexOf("mailto:")===0||(v=(0,a.default)(v,g),v.validate_length&&w.length>v.max_allowed_length)||!v.allow_fragments&&(0,u.default)(w,"#")||!v.allow_query_components&&((0,u.default)(w,"?")||(0,u.default)(w,"&")))return!1;var m,b,x,_,A,T,E,S;E=w.split("#"),w=E.shift(),E=w.split("?"),w=E.shift();var C=w.match(/^([a-z][a-z0-9+\-.]*):/i),I=!1,O=function(Pe){return I=!0,m=Pe.toLowerCase(),v.require_valid_protocol&&v.protocols.indexOf(m)===-1?!1:w.substring(C[0].length)};if(C){var k=C[1],D=w.substring(C[0].length),L=D.slice(0,2)==="//";if(L){if(w=O(k),w===!1)return!1}else{var U=D.indexOf("/"),j=U===-1?D:D.substring(0,U),N=j.indexOf("@");if(N!==-1){var F=j.substring(0,N),V=/^[a-zA-Z0-9\-_.%:]*$/,W=V.test(F),G=/%[0-9a-fA-F]{2}/.test(F);if(W&&!G){if(v.require_protocol)return!1}else if(w=O(k),w===!1)return!1}else{var H=/^[0-9]/.test(D);if(H){if(v.require_protocol)return!1}else if(w=O(k),w===!1)return!1}}}else if(v.require_protocol)return!1;if(w.slice(0,2)==="//"){if(!I&&!v.allow_protocol_relative_urls)return!1;w=w.slice(2)}if(w==="")return!1;if(E=w.split("/"),w=E.shift(),w===""&&!v.require_host)return!0;if(E=w.split("@"),E.length>1){if(v.disallow_auth||E[0]===""||(b=E.shift(),b.indexOf(":")>=0&&b.split(":").length>2))return!1;var Z=b.split(":"),B=s(Z,2),Q=B[0],z=B[1];if(Q===""&&z==="")return!1}_=E.join("@"),T=null,S=null;var J=_.match(y);if(J?(x="",S=J[1],T=J[2]||null):(E=_.split(":"),x=E.shift(),E.length&&(T=E.join(":"))),T!==null&&T.length>0){if(A=parseInt(T,10),!/^[0-9]+$/.test(T)||A<=0||A>65535)return!1}else if(v.require_port)return!1;return v.host_whitelist?(0,o.default)(x,v.host_whitelist):x===""&&!v.require_host?!0:!(!(0,h.default)(x)&&!(0,f.default)(x,v)&&(!S||!(0,h.default)(S,6))||(x=x||S,v.host_blacklist&&(0,o.default)(x,v.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(pn,pn.exports);var el=pn.exports,Gn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localStorageClearIdentity=e.localStorageStoreIdentity=e.localStorageGetIdentity=e.createMessage=e.SINGLE_SIGN_ON_TARGET=e.Action=void 0;var t;(function(a){a.GET="get",a.STORE="store",a.CLEAR="clear",a.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function n(a){return{target:e.SINGLE_SIGN_ON_TARGET,...a}}e.createMessage=n;function o(a){const r=localStorage.getItem(h(a));if(!r)return null;let s;try{s=JSON.parse(r)}catch{return f(a),null}return s.expiration=new Date(s.expiration),s.expiration.getTime()<=Date.now()?(f(a),null):s}e.localStorageGetIdentity=o;function u(a,r){new Date(r.expiration).getTime()>Date.now()&&localStorage.setItem(h(a),JSON.stringify(r))}e.localStorageStoreIdentity=u;function f(a){localStorage.removeItem(h(a))}e.localStorageClearIdentity=f;function h(a){if(!/^0x[a-fA-F0-9]{40}$/.test(a))throw new Error("User must be a valid ethereum address");return`single-sign-on-${a.toLowerCase()}`}})(Gn);Object.defineProperty(Ee,"__esModule",{value:!0});Ee.clearIdentity=Ee.storeIdentity=Ee.getIdentity=Ee.init=void 0;const tl=el,Se=Gn,ti=Se.SINGLE_SIGN_ON_TARGET,is=500,rl=5;let cs=0,hr="";const nl={protocols:["https"],require_protocol:!0};function al(e,t={}){if(!(0,tl.default)(e,{...nl,...t}))throw new Error(`Invalid url: ${e}`);if(hr)throw new Error("Already initialized");const n=document.createElement("iframe");n.id=ti,n.src=e,n.style.width="0",n.style.height="0",n.style.border="none",n.style.position="absolute",document.body.appendChild(n),hr=e}Ee.init=al;async function sl(e){let t;try{t=(await Sr(await Wn(),Se.Action.GET,{user:e})).identity??null}catch(n){zn(n),t=(0,Se.localStorageGetIdentity)(e)}return t}Ee.getIdentity=sl;async function ol(e,t){try{await Sr(await Wn(),Se.Action.STORE,{user:e,identity:t})}catch(n){zn(n),(0,Se.localStorageStoreIdentity)(e,t)}}Ee.storeIdentity=ol;async function il(e){try{await Sr(await Wn(),Se.Action.CLEAR,{user:e})}catch(t){zn(t),(0,Se.localStorageClearIdentity)(e)}}Ee.clearIdentity=il;async function Wn(){if(!hr)throw new Error("Not initialized");for(let e=0;e<rl;e++){const n=document.getElementById(ti)?.contentWindow;if(!n){await cl(is);continue}try{await Sr(n,Se.Action.PING,{},is)}catch{continue}return n}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function Sr(e,t,n,o=0){cs++;const u=cs;let f=null;const h=new Promise((a,r)=>{f=({data:s})=>{!s||s.target!==Se.SINGLE_SIGN_ON_TARGET||s.id!==u||(s.error?r(new Error(s.error)):a(s))},window.addEventListener("message",f)});e.postMessage((0,Se.createMessage)({id:u,action:t,...n}),hr);try{return await(o?Promise.race([h,new Promise((a,r)=>setTimeout(()=>r(new Error("Did not receive a response in time")),o))]):h)}catch(a){throw a}finally{f&&window.removeEventListener("message",f)}}function cl(e){return new Promise(t=>setTimeout(t,e))}function zn(e){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",e.message)}(function(e){var t=Ut&&Ut.__createBinding||(Object.create?function(o,u,f,h){h===void 0&&(h=f);var a=Object.getOwnPropertyDescriptor(u,f);(!a||("get"in a?!u.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(o,h,a)}:function(o,u,f,h){h===void 0&&(h=f),o[h]=u[f]}),n=Ut&&Ut.__exportStar||function(o,u){for(var f in o)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,o,f)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ee,e),n(Gn,e)})(Zo);const Ot=e=>e.wallet,ri=e=>Ot(e).address,ul=e=>Ot(e).isConnected,ll=e=>Ot(e).isConnecting,dl=e=>Ot(e).isDisconnecting,hl=e=>Ot(e).error,{useCallback:us}=await R("react"),{useSelector:gt}=await R("react-redux"),{useConnect:fl,useDisconnect:pl}=await R("wagmi");function ni(){const e=gt(ri),t=gt(ul),n=gt(ll),o=gt(dl),u=gt(hl),{connect:f,connectors:h,isPending:a}=fl(),{disconnect:r,isPending:s}=pl(),i=us(l=>{f({connector:l})},[f]),c=us(()=>{r()},[r]);return{address:e,isConnected:t,isConnecting:n||a,isDisconnecting:o||s,error:u,connectors:h,connect:i,disconnect:c}}const{useEffect:gl,useState:ml}=await R("react");function yl(){const{address:e}=ni(),t=e||void 0,[n,o]=ml(void 0);return gl(()=>{if(!t){o(void 0);return}try{const u=Zo.localStorageGetIdentity(t.toLowerCase());o(u??void 0)}catch(u){console.error("[useAuthIdentity] Failed to get identity:",u),o(void 0)}},[t]),{identity:n,hasValidIdentity:!!n,address:t}}const{useCallback:qP}=await R("react"),{useSelector:vP}=await R("react-redux"),{useSwitchChain:bP}=await R("wagmi"),{useSelector:wl}=await R("react-redux"),{useBalance:Pl}=await R("wagmi");function ls(e={}){const{tokenAddress:t,address:n,chainId:o}=e,u=wl(ri),f=n??u,{data:h,isLoading:a,isError:r,error:s,refetch:i}=Pl({address:f,token:t,chainId:o,query:{enabled:!!f}});return{balance:h?.formatted??null,balanceRaw:h?.value??null,decimals:h?.decimals??null,symbol:h?.symbol??null,isLoading:a,isError:r,error:s,refetch:i}}var ql=class extends $o{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,n){const o=new jc({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:n});return this.add(o),o}add(e){this.#e.add(e);const t=Ht(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ht(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const o=n.indexOf(e);o!==-1&&n.splice(o,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ht(e);if(typeof t=="string"){const o=this.#t.get(t)?.find(u=>u.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=Ht(e);return typeof t=="string"?this.#t.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){le.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Da(t,n))}findAll(e={}){return this.getAll().filter(t=>Da(e,t))}notify(e){le.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return le.batch(()=>Promise.all(e.map(t=>t.continue().catch(je))))}};function Ht(e){return e.options.scope?.id}var vl=class extends $o{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const o=t.queryKey,u=t.queryHash??Bo(o,t);let f=this.get(u);return f||(f=new Lc({client:e,queryKey:o,queryHash:u,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(f)),f}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){le.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ja(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ja(e,n)):t}notify(e){le.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){le.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){le.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bl=class{#e;#t;#r;#a;#s;#n;#o;#i;constructor(e={}){this.#e=e.queryCache||new vl,this.#t=e.mutationCache||new ql,this.#r=e.defaultOptions||{},this.#a=new Map,this.#s=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#o=Uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=La.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),o=n.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ua(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const o=n.data;return[t,o]})}setQueryData(e,t,n){const o=this.defaultQueryOptions({queryKey:e}),f=this.#e.get(o.queryHash)?.state.data,h=Mc(t,f);if(h!==void 0)return this.#e.build(this,o).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return le.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;le.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return le.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},o=le.batch(()=>this.#e.findAll(e).map(u=>u.cancel(n)));return Promise.all(o).then(je).catch(je)}invalidateQueries(e,t={}){return le.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},o=le.batch(()=>this.#e.findAll(e).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,n);return n.throwOnError||(f=f.catch(je)),u.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(o).then(je)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ua(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(je).catch(je)}fetchInfiniteQuery(e){return e.behavior=Ma(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(je).catch(je)}ensureInfiniteQueryData(e){return e.behavior=Ma(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return La.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#a.set(Na(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(o=>{$a(e,o.queryKey)&&Object.assign(n,o.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Na(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(o=>{$a(e,o.mutationKey)&&Object.assign(n,o.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nc&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const{useMemo:El}=await R("react"),{WagmiProvider:Sl}=await R("wagmi");function Tl(){return new bl({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}})}function EP({config:e,queryClient:t,children:n}){const o=El(()=>t??Tl(),[t]);return q.jsx(Sl,{config:e,children:q.jsx($c,{client:o,children:n})})}const{createSlice:xl}=await R("@reduxjs/toolkit"),ds={chainId:null,isSupportedNetwork:!1,isNetworkSwitching:!1,error:null},Cl=xl({name:"network",initialState:ds,reducers:{setChain(e,t){e.chainId=t.payload,e.isSupportedNetwork=t.payload!==null&&Du(t.payload),e.isNetworkSwitching=!1,e.error=null},setSwitching(e,t){e.isNetworkSwitching=t.payload,t.payload&&(e.error=null)},setError(e,t){e.error=t.payload,e.isNetworkSwitching=!1},reset(){return ds}}}),{actions:hs,reducer:Il}=Cl,{createSlice:_l}=await R("@reduxjs/toolkit"),fs={address:null,isConnected:!1,isConnecting:!1,isDisconnecting:!1,error:null},Al=_l({name:"wallet",initialState:fs,reducers:{setAccount(e,t){e.address=t.payload,e.isConnected=t.payload!==null,e.isConnecting=!1,e.error=null},setConnecting(e,t){e.isConnecting=t.payload,t.payload&&(e.error=null)},setDisconnecting(e,t){e.isDisconnecting=t.payload},setError(e,t){e.error=t.payload,e.isConnecting=!1,e.isDisconnecting=!1},reset(){return fs}}}),{actions:Lr,reducer:Rl}=Al,{useEffect:ps}=await R("react"),{useDispatch:Ol}=await R("react-redux"),{useAccount:kl,useChainId:Dl}=await R("wagmi");function SP({children:e}){const t=Ol(),{address:n,isConnecting:o,isConnected:u,isReconnecting:f}=kl(),h=Dl();return ps(()=>{u&&n?(t(Lr.setAccount(n)),t(hs.setChain(h))):!u&&!o&&!f&&(t(Lr.reset()),t(hs.setChain(null)))},[t,n,u,o,f,h]),ps(()=>{t(Lr.setConnecting(o||f))},[t,o,f]),q.jsx(q.Fragment,{children:e})}const{createSlice:jl}=await R("@reduxjs/toolkit"),gs={transactions:{},pending:[]},Ll=jl({name:"transactions",initialState:gs,reducers:{addTransaction(e,t){const n=t.payload;e.transactions[n.hash]=n,n.status==="pending"&&!e.pending.includes(n.hash)&&e.pending.push(n.hash)},updateTransaction(e,t){const{hash:n,status:o,error:u}=t.payload,f=e.transactions[n];f&&(f.status=o,f.error=u,o!=="pending"&&(e.pending=e.pending.filter(h=>h!==n)))},removeTransaction(e,t){const n=t.payload;delete e.transactions[n],e.pending=e.pending.filter(o=>o!==n)},reset(){return gs}}}),{actions:TP,reducer:Ul}=Ll;var Kn="persist:",Vn="persist/FLUSH",Tr="persist/REHYDRATE",Yn="persist/PAUSE",Jn="persist/PERSIST",Xn="persist/PURGE",Zn="persist/REGISTER",Ml=-1;function tr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tr=function(n){return typeof n}:tr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},tr(e)}function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function Nl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ms(n,!0).forEach(function(o){$l(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function $l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bl(e,t,n,o){o.debug;var u=Nl({},n);return e&&tr(e)==="object"&&Object.keys(e).forEach(function(f){f!=="_persist"&&t[f]===n[f]&&(u[f]=e[f])}),u}function Hl(e){var t=e.blacklist||null,n=e.whitelist||null,o=e.transforms||[],u=e.throttle||0,f="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key),h=e.storage,a;e.serialize===!1?a=function(b){return b}:typeof e.serialize=="function"?a=e.serialize:a=Ql;var r=e.writeFailHandler||null,s={},i={},c=[],l=null,d=null,p=function(b){Object.keys(b).forEach(function(x){P(x)&&s[x]!==b[x]&&c.indexOf(x)===-1&&c.push(x)}),Object.keys(s).forEach(function(x){b[x]===void 0&&P(x)&&c.indexOf(x)===-1&&s[x]!==void 0&&c.push(x)}),l===null&&(l=setInterval(g,u)),s=b};function g(){if(c.length===0){l&&clearInterval(l),l=null;return}var m=c.shift(),b=o.reduce(function(x,_){return _.in(x,m,s)},s[m]);if(b!==void 0)try{i[m]=a(b)}catch(x){console.error("redux-persist/createPersistoid: error serializing state",x)}else delete i[m];c.length===0&&y()}function y(){Object.keys(i).forEach(function(m){s[m]===void 0&&delete i[m]}),d=h.setItem(f,a(i)).catch(w)}function P(m){return!(n&&n.indexOf(m)===-1&&m!=="_persist"||t&&t.indexOf(m)!==-1)}function w(m){r&&r(m)}var v=function(){for(;c.length!==0;)g();return d||Promise.resolve()};return{update:p,flush:v}}function Ql(e){return JSON.stringify(e)}function Fl(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key),o=e.storage;e.debug;var u;return e.deserialize===!1?u=function(h){return h}:typeof e.deserialize=="function"?u=e.deserialize:u=Gl,o.getItem(n).then(function(f){if(f)try{var h={},a=u(f);return Object.keys(a).forEach(function(r){h[r]=t.reduceRight(function(s,i){return i.out(s,r,a)},u(a[r]))}),h}catch(r){throw r}else return})}function Gl(e){return JSON.parse(e)}function Wl(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key);return t.removeItem(n,zl)}function zl(e){}function ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ys(n,!0).forEach(function(o){Kl(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ys(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vl(e,t){if(e==null)return{};var n=Yl(e,t),o,u;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(u=0;u<f.length;u++)o=f[u],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Yl(e,t){if(e==null)return{};var n={},o=Object.keys(e),u,f;for(f=0;f<o.length;f++)u=o[f],!(t.indexOf(u)>=0)&&(n[u]=e[u]);return n}var Jl=5e3;function Xl(e,t){var n=e.version!==void 0?e.version:Ml;e.debug;var o=e.stateReconciler===void 0?Bl:e.stateReconciler,u=e.getStoredState||Fl,f=e.timeout!==void 0?e.timeout:Jl,h=null,a=!1,r=!0,s=function(c){return c._persist.rehydrated&&h&&!r&&h.update(c),c};return function(i,c){var l=i||{},d=l._persist,p=Vl(l,["_persist"]),g=p;if(c.type===Jn){var y=!1,P=function(A,T){y||(c.rehydrate(e.key,A,T),y=!0)};if(f&&setTimeout(function(){!y&&P(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},f),r=!1,h||(h=Hl(e)),d)return ke({},t(g,c),{_persist:d});if(typeof c.rehydrate!="function"||typeof c.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return c.register(e.key),u(e).then(function(_){var A=e.migrate||function(T,E){return Promise.resolve(T)};A(_,n).then(function(T){P(T)},function(T){P(void 0,T)})},function(_){P(void 0,_)}),ke({},t(g,c),{_persist:{version:n,rehydrated:!1}})}else{if(c.type===Xn)return a=!0,c.result(Wl(e)),ke({},t(g,c),{_persist:d});if(c.type===Vn)return c.result(h&&h.flush()),ke({},t(g,c),{_persist:d});if(c.type===Yn)r=!0;else if(c.type===Tr){if(a)return ke({},g,{_persist:ke({},d,{rehydrated:!0})});if(c.key===e.key){var w=t(g,c),v=c.payload,m=o!==!1&&v!==void 0?o(v,i,w,e):w,b=ke({},m,{_persist:ke({},d,{rehydrated:!0})});return s(b)}}}if(!d)return t(i,c);var x=t(g,c);return x===g?i:s(ke({},x,{_persist:d}))}}function ws(e){return td(e)||ed(e)||Zl()}function Zl(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function ed(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function td(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function Ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ps(n,!0).forEach(function(o){rd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ai={registry:[],bootstrapped:!1},nd=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ai,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case Zn:return vn({},t,{registry:[].concat(ws(t.registry),[n.key])});case Tr:var o=t.registry.indexOf(n.key),u=ws(t.registry);return u.splice(o,1),vn({},t,{registry:u,bootstrapped:u.length===0});default:return t}};function ad(e,t,n){var o=Oc(nd,ai,void 0),u=function(r){o.dispatch({type:Zn,key:r})},f=function(r,s,i){var c={type:Tr,payload:s,err:i,key:r};e.dispatch(c),o.dispatch(c)},h=vn({},o,{purge:function(){var r=[];return e.dispatch({type:Xn,result:function(i){r.push(i)}}),Promise.all(r)},flush:function(){var r=[];return e.dispatch({type:Vn,result:function(i){r.push(i)}}),Promise.all(r)},pause:function(){e.dispatch({type:Yn})},persist:function(){e.dispatch({type:Jn,register:u,rehydrate:f})}});return h.persist(),h}var ea={},ta={};ta.__esModule=!0;ta.default=id;function rr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rr=function(n){return typeof n}:rr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rr(e)}function Ur(){}var sd={getItem:Ur,setItem:Ur,removeItem:Ur};function od(e){if((typeof self>"u"?"undefined":rr(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function id(e){var t="".concat(e,"Storage");return od(t)?self[t]:sd}ea.__esModule=!0;ea.default=ld;var cd=ud(ta);function ud(e){return e&&e.__esModule?e:{default:e}}function ld(e){var t=(0,cd.default)(e);return{getItem:function(o){return new Promise(function(u,f){u(t.getItem(o))})},setItem:function(o,u){return new Promise(function(f,h){f(t.setItem(o,u))})},removeItem:function(o){return new Promise(function(u,f){u(t.removeItem(o))})}}}var si=void 0,dd=hd(ea);function hd(e){return e&&e.__esModule?e:{default:e}}var fd=(0,dd.default)("local");si=fd;const{createEntityAdapter:pd,createSlice:gd}=await R("@reduxjs/toolkit"),bt=pd(),md=bt.getInitialState(),oi=gd({name:"blog",initialState:md,reducers:{postUpserted:(e,t)=>bt.upsertOne(e,t),postsUpserted:(e,t)=>bt.upsertMany(e,t),postsClear:e=>bt.removeAll(e)}}),{postUpserted:xP,postsUpserted:Mr,postsClear:CP}=oi.actions,yd=oi.reducer;bt.getSelectors();const{formatProdErrorMessage:IP}=await R("@reduxjs/toolkit"),{batch:wd,useDispatch:Pd,useSelector:qd,useStore:vd}=await R("react-redux");function Qt(e){return e.replace(e[0],e[0].toUpperCase())}function bd(e){return e.type==="query"}function Ed(e){return e.type==="mutation"}function ii(e){return e.type==="infinitequery"}function mt(e,...t){return Object.assign(e,...t)}const{formatProdErrorMessage:_P,formatProdErrorMessage:Sd}=await R("@reduxjs/toolkit"),{useCallback:We,useDebugValue:Nr,useEffect:nt,useLayoutEffect:Td,useMemo:ue,useRef:tt,useState:qs}=await R("react"),{shallowEqual:$r}=await R("react-redux");var Br=Symbol();const{useEffect:xd,useRef:Cd,useMemo:Id}=await R("react");function Hr(e){const t=Cd(e),n=Id(()=>Un(t.current,e),[e]);return xd(()=>{t.current!==n&&(t.current=n)},[n]),n}const{useEffect:_d,useRef:Ad}=await R("react"),{shallowEqual:vs}=await R("react-redux");function Ft(e){const t=Ad(e);return _d(()=>{vs(t.current,e)||(t.current=e)},[e]),vs(t.current,e)?t.current:e}var Rd=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Od=Rd(),kd=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Dd=kd(),jd=()=>Od||Dd?Td:nt,Ld=jd(),bs=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Ho.pending}:e;function Qr(e,...t){const n={};return t.forEach(o=>{n[o]=e[o]}),n}var Fr=["data","status","isLoading","isSuccess","isError","error"];function Ud({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:o,useStore:u},unstable__sideEffectsInRender:f,createSelector:h},serializeQueryArgs:a,context:r}){const s=f?m=>m():nt;return{buildQueryHooks:P,buildInfiniteQueryHooks:w,buildMutationHook:v,usePrefetch:l};function i(m,b,x){if(b?.endpointName&&m.isUninitialized){const{endpointName:C}=b,I=r.endpointDefinitions[C];x!==ge&&a({queryArgs:b.originalArgs,endpointDefinition:I,endpointName:C})===a({queryArgs:x,endpointDefinition:I,endpointName:C})&&(b=void 0)}let _=m.isSuccess?m.data:b?.data;_===void 0&&(_=m.data);const A=_!==void 0,T=m.isLoading,E=(!b||b.isLoading||b.isUninitialized)&&!A&&T,S=m.isSuccess||A&&(T&&!b?.isError||m.isUninitialized);return{...m,data:_,currentData:m.data,isFetching:T,isLoading:E,isSuccess:S}}function c(m,b,x){if(b?.endpointName&&m.isUninitialized){const{endpointName:C}=b,I=r.endpointDefinitions[C];x!==ge&&a({queryArgs:b.originalArgs,endpointDefinition:I,endpointName:C})===a({queryArgs:x,endpointDefinition:I,endpointName:C})&&(b=void 0)}let _=m.isSuccess?m.data:b?.data;_===void 0&&(_=m.data);const A=_!==void 0,T=m.isLoading,E=(!b||b.isLoading||b.isUninitialized)&&!A&&T,S=m.isSuccess||T&&A;return{...m,data:_,currentData:m.data,isFetching:T,isLoading:E,isSuccess:S}}function l(m,b){const x=n(),_=Ft(b);return We((A,T)=>x(e.util.prefetch(m,A,{..._,...T})),[m,x,_])}function d(m,b,{refetchOnReconnect:x,refetchOnFocus:_,refetchOnMountOrArgChange:A,skip:T=!1,pollingInterval:E=0,skipPollingIfUnfocused:S=!1,...C}={}){const{initiate:I}=e.endpoints[m],O=n(),k=tt(void 0);if(!k.current){const H=O(e.internalActions.internal_getRTKQSubscriptions());k.current=H}const D=Hr(T?ge:b),L=Ft({refetchOnReconnect:x,refetchOnFocus:_,pollingInterval:E,skipPollingIfUnfocused:S}),U=C.initialPageParam,j=Ft(U),N=tt(void 0);let{queryCacheKey:F,requestId:V}=N.current||{},W=!1;F&&V&&(W=k.current.isRequestSubscribed(F,V));const G=!W&&N.current!==void 0;return s(()=>{G&&(N.current=void 0)},[G]),s(()=>{const H=N.current;if(D===ge){H?.unsubscribe(),N.current=void 0;return}const Z=N.current?.subscriptionOptions;if(!H||H.arg!==D){H?.unsubscribe();const B=O(I(D,{subscriptionOptions:L,forceRefetch:A,...ii(r.endpointDefinitions[m])?{initialPageParam:j}:{}}));N.current=B}else L!==Z&&H.updateSubscriptionOptions(L)},[O,I,A,D,L,G,j,m]),[N,O,I,L]}function p(m,b){return(_,{skip:A=!1,selectFromResult:T}={})=>{const{select:E}=e.endpoints[m],S=Hr(A?ge:_),C=tt(void 0),I=ue(()=>h([E(S),(U,j)=>j,U=>S],b,{memoizeOptions:{resultEqualityCheck:$r}}),[E,S]),O=ue(()=>T?h([I],T,{devModeChecks:{identityFunctionCheck:"never"}}):I,[I,T]),k=o(U=>O(U,C.current),$r),D=u(),L=I(D.getState(),C.current);return Ld(()=>{C.current=L},[L]),k}}function g(m){nt(()=>()=>{m.current?.unsubscribe?.(),m.current=void 0},[m])}function y(m){if(!m.current)throw new Error(Sd(38));return m.current.refetch()}function P(m){const b=(A,T={})=>{const[E]=d(m,A,T);return g(E),ue(()=>({refetch:()=>y(E)}),[E])},x=({refetchOnReconnect:A,refetchOnFocus:T,pollingInterval:E=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:C}=e.endpoints[m],I=n(),[O,k]=qs(Br),D=tt(void 0),L=Ft({refetchOnReconnect:A,refetchOnFocus:T,pollingInterval:E,skipPollingIfUnfocused:S});s(()=>{const F=D.current?.subscriptionOptions;L!==F&&D.current?.updateSubscriptionOptions(L)},[L]);const U=tt(L);s(()=>{U.current=L},[L]);const j=We(function(F,V=!1){let W;return t(()=>{D.current?.unsubscribe(),D.current=W=I(C(F,{subscriptionOptions:U.current,forceRefetch:!V})),k(F)}),W},[I,C]),N=We(()=>{D.current?.queryCacheKey&&I(e.internalActions.removeQueryResult({queryCacheKey:D.current?.queryCacheKey}))},[I]);return nt(()=>()=>{D?.current?.unsubscribe()},[]),nt(()=>{O!==Br&&!D.current&&j(O,!0)},[O,j]),ue(()=>[j,O,{reset:N}],[j,O,N])},_=p(m,i);return{useQueryState:_,useQuerySubscription:b,useLazyQuerySubscription:x,useLazyQuery(A){const[T,E,{reset:S}]=x(A),C=_(E,{...A,skip:E===Br}),I=ue(()=>({lastArg:E}),[E]);return ue(()=>[T,{...C,reset:S},I],[T,C,S,I])},useQuery(A,T){const E=b(A,T),S=_(A,{selectFromResult:A===ge||T?.skip?void 0:bs,...T}),C=Qr(S,...Fr);return Nr(C),ue(()=>({...S,...E}),[S,E])}}}function w(m){const b=(_,A={})=>{const[T,E,S,C]=d(m,_,A),I=tt(C);s(()=>{I.current=C},[C]);const O=We(function(L,U){let j;return t(()=>{T.current?.unsubscribe(),T.current=j=E(S(L,{subscriptionOptions:I.current,direction:U}))}),j},[T,E,S]);g(T);const k=Hr(A.skip?ge:_),D=We(()=>y(T),[T]);return ue(()=>({trigger:O,refetch:D,fetchNextPage:()=>O(k,"forward"),fetchPreviousPage:()=>O(k,"backward")}),[D,O,k])},x=p(m,c);return{useInfiniteQueryState:x,useInfiniteQuerySubscription:b,useInfiniteQuery(_,A){const{refetch:T,fetchNextPage:E,fetchPreviousPage:S}=b(_,A),C=x(_,{selectFromResult:_===ge||A?.skip?void 0:bs,...A}),I=Qr(C,...Fr,"hasNextPage","hasPreviousPage");return Nr(I),ue(()=>({...C,fetchNextPage:E,fetchPreviousPage:S,refetch:T}),[C,E,S,T])}}}function v(m){return({selectFromResult:b,fixedCacheKey:x}={})=>{const{select:_,initiate:A}=e.endpoints[m],T=n(),[E,S]=qs();nt(()=>()=>{E?.arg.fixedCacheKey||E?.reset()},[E]);const C=We(function(F){const V=T(A(F,{fixedCacheKey:x}));return S(V),V},[T,A,x]),{requestId:I}=E||{},O=ue(()=>_({fixedCacheKey:x,requestId:E?.requestId}),[x,E,_]),k=ue(()=>b?h([O],b):O,[b,O]),D=o(k,$r),L=x==null?E?.arg.originalArgs:void 0,U=We(()=>{t(()=>{E&&S(void 0),x&&T(e.internalActions.removeMutationResult({requestId:I,fixedCacheKey:x}))})},[T,x,E,I]),j=Qr(D,...Fr,"endpointName");Nr(j);const N=ue(()=>({...D,originalArgs:L,reset:U}),[D,L,U]);return ue(()=>[C,N],[C,N])}}}var Md=Symbol(),Nd=({batch:e=wd,hooks:t={useDispatch:Pd,useSelector:qd,useStore:vd},createSelector:n=kc,unstable__sideEffectsInRender:o=!1,...u}={})=>({name:Md,init(f,{serializeQueryArgs:h},a){const r=f,{buildQueryHooks:s,buildInfiniteQueryHooks:i,buildMutationHook:c,usePrefetch:l}=Ud({api:f,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:o,createSelector:n},serializeQueryArgs:h,context:a});return mt(r,{usePrefetch:l}),mt(a,{batch:e}),{injectEndpoint(d,p){if(bd(p)){const{useQuery:g,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:v}=s(d);mt(r.endpoints[d],{useQuery:g,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:v}),f[`use${Qt(d)}Query`]=g,f[`useLazy${Qt(d)}Query`]=y}if(Ed(p)){const g=c(d);mt(r.endpoints[d],{useMutation:g}),f[`use${Qt(d)}Mutation`]=g}else if(ii(p)){const{useInfiniteQuery:g,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}=i(d);mt(r.endpoints[d],{useInfiniteQuery:g,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}),f[`use${Qt(d)}InfiniteQuery`]=g}}}}});const{configureStore:AP,formatProdErrorMessage:RP}=await R("@reduxjs/toolkit"),{useContext:OP}=await R("react"),{useEffect:kP}=await R("react");await R("react");const{Provider:DP,ReactReduxContext:jP}=await R("react-redux");var ra=Yo(Xo(),Nd());const $d="1H67SAMO2T",Bd="d7f493e3a24525b7021451b81b1d294a",Hd="blog_contentful_prd",Qd="/auth",Fd="/blog",Gd="https://cms.decentraland.zone/spaces/ea2ybdmmn1kv/environments/master",Wd="pk_live_CE856A4938B36648",zd="0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",Kd="0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",Vd="https://notifications.decentraland.zone",Yd="https://peer.decentraland.zone",Jd="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Xd="e1adce863fe287bb6cf0e3fd90bdb77f",Zd="61570c542c2d66c659492e5b24a41522",eh={ALGOLIA_APP_ID:$d,ALGOLIA_API_KEY:Bd,ALGOLIA_BLOG_INDEX:Hd,AUTH_URL:Qd,BLOG_BASE_URL:Fd,CMS_BASE_URL:Gd,MAGIC_API_KEY:Wd,MANA_TOKEN_ADDRESS_ETHEREUM:zd,MANA_TOKEN_ADDRESS_MATIC:Kd,NOTIFICATIONS_API_URL:Vd,PEER_URL:Yd,SEGMENT_API_KEY:Jd,THIRDWEB_CLIENT_ID:Xd,WALLET_CONNECT_PROJECT_ID:Zd},th="1H67SAMO2T",rh="fbdb16248a42878501d8fdf1d05ae309",nh="blog_contentful_prd",ah="https://decentraland.org/auth",sh="https://decentraland.org/blog",oh="https://cms.decentraland.org/spaces/ea2ybdmmn1kv/environments/master",ih="pk_live_212568025B158355",ch="0x0f5d2fb29fb7d3cfee444a200298f468908cc942",uh="0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4",lh="https://notifications.decentraland.org",dh="https://peer.decentraland.org",hh="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",fh="e1adce863fe287bb6cf0e3fd90bdb77f",ph="61570c542c2d66c659492e5b24a41522",gh={ALGOLIA_APP_ID:th,ALGOLIA_API_KEY:rh,ALGOLIA_BLOG_INDEX:nh,AUTH_URL:ah,BLOG_BASE_URL:sh,CMS_BASE_URL:oh,MAGIC_API_KEY:ih,MANA_TOKEN_ADDRESS_ETHEREUM:ch,MANA_TOKEN_ADDRESS_MATIC:uh,NOTIFICATIONS_API_URL:lh,PEER_URL:dh,SEGMENT_API_KEY:hh,THIRDWEB_CLIENT_ID:fh,WALLET_CONNECT_PROJECT_ID:ph},mh="1H67SAMO2T",yh="d7f493e3a24525b7021451b81b1d294a",wh="blog_contentful_prd",Ph="https://decentraland.today/auth",qh="https://decentraland.today/blog",vh="https://cms.decentraland.zone/spaces/ea2ybdmmn1kv/environments/master",bh="pk_live_CE856A4938B36648",Eh="0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",Sh="0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",Th="https://notifications.decentraland.zone",xh="https://peer.decentraland.zone",Ch="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ih="e1adce863fe287bb6cf0e3fd90bdb77f",_h="61570c542c2d66c659492e5b24a41522",Ah={ALGOLIA_APP_ID:mh,ALGOLIA_API_KEY:yh,ALGOLIA_BLOG_INDEX:wh,AUTH_URL:Ph,BLOG_BASE_URL:qh,CMS_BASE_URL:vh,MAGIC_API_KEY:bh,MANA_TOKEN_ADDRESS_ETHEREUM:Eh,MANA_TOKEN_ADDRESS_MATIC:Sh,NOTIFICATIONS_API_URL:Th,PEER_URL:xh,SEGMENT_API_KEY:Ch,THIRDWEB_CLIENT_ID:Ih,WALLET_CONNECT_PROJECT_ID:_h},ci=Ec({[Jt.DEVELOPMENT]:eh,[Jt.STAGING]:Ah,[Jt.PRODUCTION]:gh},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:"dev"}}),ee=e=>ci.get(e),Rh=ee("PEER_URL");async function Oh(e){try{const t=await fetch(`${Rh}/lambdas/profiles/${e.toLowerCase()}`);if(!t.ok)return null;const n=await t.json();return Array.isArray(n)?n[0]:n}catch{return null}}const fr=ra({reducerPath:"profileClient",baseQuery:Jo(),tagTypes:["Profile"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:e=>({getProfile:e.query({queryFn:async t=>{if(!t)return{data:null};try{return{data:await Oh(t)}}catch{return{data:null}}},providesTags:(t,n,o)=>o?[{type:"Profile",id:o}]:[]})})}),{useGetProfileQuery:kh}=fr,ui=ee("CMS_BASE_URL");if(!ui)throw new Error("CMS_BASE_URL environment variable is not set");const li=ui,pr=ra({reducerPath:"cmsClient",baseQuery:eu({baseUrl:li}),tagTypes:["BlogPosts","BlogPost","Categories","Authors"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),gr=ra({reducerPath:"algoliaClient",baseQuery:Jo(),tagTypes:["SearchResults"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),{combineReducers:Dh,configureStore:jh}=await R("@reduxjs/toolkit"),Lh={key:"blog",storage:si,whitelist:["ids","entities"]},Uh=Dh({blog:Xl(Lh,yd),network:Il,transactions:Ul,wallet:Rl,[pr.reducerPath]:pr.reducer,[gr.reducerPath]:gr.reducer,[fr.reducerPath]:fr.reducer}),Et=jh({reducer:Uh,middleware:e=>e({serializableCheck:{ignoredActions:[Vn,Tr,Yn,Jn,Xn,Zn]}}).concat(pr.middleware,gr.middleware,fr.middleware),devTools:!1}),LP=ad(Et),Es=(e,t)=>e.id||t||"",na=async(e,t)=>{const n=li,o=new URL(`${n}${e}`,window.location.origin),u=await fetch(o.toString());if(!u.ok)throw new Error(`CMS API error: ${u.status} ${u.statusText}`);return u.json()},Gr=new Map,yt=new Map,ot=new Map,be=new Map,ye=async e=>{const t=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Asset"){const n=t.sys.id;if(Gr.has(n))return Gr.get(n);if(yt.has(n))return yt.get(n);const o=na(`/assets/${n}`).then(u=>{const f=u;return Gr.set(n,f),yt.delete(n),f}).catch(()=>(yt.delete(n),e));return yt.set(n,o),o}return e};let _t=null;const UP=e=>{_t=e},ve=new Map,pe=new Map,Ss=()=>{if(!_t)return new Map;const t=_t.getState().cmsClient?.queries||{},n=Object.entries(t).find(([o])=>o.startsWith("getBlogCategories"));if(n&&n[1]?.data){const o=n[1].data,u=new Map;for(const f of o)f?.sys?.id&&u.set(f.sys.id,f);return u}return new Map},Ts=()=>{if(!_t)return new Map;const t=_t.getState().cmsClient?.queries||{},n=Object.entries(t).find(([o])=>o.startsWith("getBlogAuthors"));if(n&&n[1]?.data){const o=n[1].data,u=new Map;for(const f of o)f?.sys?.id&&u.set(f.sys.id,f);return u}return new Map},bn=async e=>{if(ot.has(e))return ot.get(e);if(be.has(e))return be.get(e);const t=na(`/entries/${e}`).then(async n=>{const o=n;return o.fields?.image&&(o.fields.image=await ye(o.fields.image)),ot.set(e,o),be.delete(e),o}).catch(()=>{throw be.delete(e),new Error(`Failed to fetch entry ${e}`)});return be.set(e,t),t},Mh=async e=>{const t=e,n=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Entry"){const o=t.sys.id;if(ve.has(o))return ve.get(o);const f=Ss().get(o);if(f)return f.fields?.image&&(f.fields.image=await ye(f.fields.image)),ve.set(o,f),f;try{const h=await bn(o);return ve.set(o,h),h}catch{return e}}if(n?.sys?.id&&n?.fields)return ve.has(n.sys.id)?ve.get(n.sys.id):(n.fields.image&&(n.fields.image=await ye(n.fields.image)),ve.set(n.sys.id,n),n);if(n?.sys?.id){if(ve.has(n.sys.id))return ve.get(n.sys.id);const u=Ss().get(n.sys.id);if(u)return u.fields?.image&&(u.fields.image=await ye(u.fields.image)),ve.set(n.sys.id,u),u}return e},Nh=async e=>{const t=e,n=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Entry"){const o=t.sys.id;if(pe.has(o))return pe.get(o);const f=Ts().get(o);if(f)return f.fields?.image&&(f.fields.image=await ye(f.fields.image)),pe.set(o,f),f;try{const h=await bn(o);return pe.set(o,h),h}catch{return e}}if(n?.sys?.id&&n?.fields)return pe.has(n.sys.id)?pe.get(n.sys.id):(n.fields.image&&(n.fields.image=await ye(n.fields.image)),pe.set(n.sys.id,n),n);if(n?.sys?.id){if(pe.has(n.sys.id))return pe.get(n.sys.id);const u=Ts().get(n.sys.id);if(u)return u.fields?.image&&(u.fields.image=await ye(u.fields.image)),pe.set(n.sys.id,u),u;try{const f=await bn(n.sys.id);return pe.set(n.sys.id,f),f}catch{return e}}return e},xs=async e=>{if(!e)return"";const o=(await ye({sys:{type:"Link",linkType:"Asset",id:e}}))?.fields?.file?.url||"";return o.startsWith("//")?`https:${o}`:o},Cs=async e=>{if(!e)return"";if(ot.has(e))return ot.get(e)?.fields?.id;if(be.has(e))return(await be.get(e))?.fields?.id;try{const t=na(`/entries/${e}`);be.set(e,t);const n=await t;return ot.set(e,n),be.delete(e),n?.fields?.id}catch{return be.delete(e),""}};function aa(e){if(!e)return"";const t=e,n=new Date(t.includes("T")?t:`${t}T00:00:00Z`);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"}).format(n)}const wt="/blog",Me={home:()=>"/",blogs:()=>wt,category:e=>`${wt}/${e}`,blog:(e,t)=>`${wt}/${e}/${t}`,author:e=>`${wt}/author/${e}`,search:e=>`${wt}/search?q=${encodeURIComponent(e)}`,twitter:e=>{const t=`${window.location.origin}${e.url}`;return`https://x.com/intent/post?text=${encodeURIComponent(e.title)}&url=${encodeURIComponent(t)}`},facebook:e=>{const t=`${window.location.origin}${e.url}`;return`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`}},di=e=>e?e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""):"";function xr(e){if(!e||!e.sys||!e.fields||!e.fields.file)return null;const t=e.fields.file.url;return t?{id:e.sys.id,url:t.startsWith("//")?`https:${t}`:t,width:e.fields.file.details?.image?.width||0,height:e.fields.file.details?.image?.height||0,mimeType:e.fields.file.contentType||"image/jpeg"}:null}function En(e){if(!e||!e.sys||!e.fields)return null;const t=e.fields.id||di(e.fields.title||"");if(!t)return null;const n=xr(e.fields.image);return n?{id:e.sys.id,slug:t,title:e.fields.title||"",description:e.fields.description||"",image:n,isShownInMenu:e.fields.isShownInMenu??!0,url:Me.category(t)}:null}function $h(e){return{id:e||"uncategorized",slug:"uncategorized",title:"Uncategorized",description:"Posts without a valid category",image:{id:"default-category-image",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},isShownInMenu:!1,url:Me.category("uncategorized")}}function Bh(e){return{id:e||"default-image",url:"https://decentraland.org/logos/png/color.png",width:1200,height:630,mimeType:"image/png"}}function Is(e){const t=e||"decentraland";return{id:e||"unknown",slug:t,title:"Decentraland",description:"Decentraland Team",image:{id:"default-avatar",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},url:Me.author(t)}}function nr(e){if(!e||!e.sys||!e.fields)return Is(e?.sys?.id);if(Object.keys(e.fields).length===0)return Is(e.sys.id);const n=e.fields.title||"",o=e.fields.id||di(n)||e.sys.id,u=xr(e.fields.image);return u?{id:e.sys.id,slug:o,title:n,description:e.fields.description||"",image:u,url:Me.author(o)}:{id:e.sys.id,slug:o,title:n||"Decentraland",description:e.fields.description||"",image:{id:"default-avatar",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},url:Me.author(o)}}function Gt(e){if(!e||!e.sys||!e.fields)return null;let t=En(e.fields.category);t||(t=$h(e.sys.id));const n=nr(e.fields.author);let o=xr(e.fields.image);o||(o=Bh(e.sys.id));const u=e.fields.title||"",f=e.fields.id,h=e.fields.publishedDate,a=e.fields.body;return{id:e.sys.id,slug:f,title:u,description:e.fields.description||"",publishedDate:aa(h),body:a||{},bodyAssets:{},image:o,category:t,author:n,url:Me.blog(t.slug,f)}}const Wr=e=>Et.getState().blog.entities[e],Wt=async e=>{const t={...e,fields:{...e.fields}},[n,o,u]=await Promise.all([t.fields.category?Mh(t.fields.category):void 0,t.fields.author?Nh(t.fields.author):void 0,t.fields.image?ye(t.fields.image):void 0]);return n&&(t.fields.category=n),o&&(t.fields.author=o),u&&(t.fields.image=u),t},zt=async e=>{const t={...e,fields:{...e.fields}};return t.fields.image&&(t.fields.image=await ye(t.fields.image)),t},ze=e=>{if(e instanceof Error)return e.message;if(typeof e=="object"&&e!==null&&"error"in e){const t=e.error;if(typeof t=="string")return t}return"Unknown error"},hi=e=>{const t=[];if(e.nodeType===se.BLOCKS.EMBEDDED_ASSET&&e.data?.target?.sys?.id&&t.push(e.data.target.sys.id),e.content)for(const n of e.content)t.push(...hi(n));return t},zr=async e=>{const t=hi(e),n=[...new Set(t)];if(n.length===0)return{};const o=await Promise.all(n.map(async f=>{const h=await ye({sys:{type:"Link",linkType:"Asset",id:f}}),a=xr(h);return{id:f,asset:a}})),u={};for(const{id:f,asset:h}of o)h&&(u[f]=h);return u},Hh=pr.injectEndpoints({endpoints:e=>({getBlogPosts:e.query({serializeQueryArgs:({queryArgs:t})=>`posts-${t.category||"all"}-${t.author||"all"}`,merge:(t,n,{arg:o})=>{if(o.skip===0)return t.posts.length>n.posts.length?t:n;const u=new Set(t.posts.map(h=>h.id)),f=n.posts.filter(h=>!u.has(h.id));return{posts:[...t.posts,...f],total:n.total,hasMore:n.hasMore,nextCmsSkip:n.nextCmsSkip}},forceRefetch:({currentArg:t,previousArg:n})=>n?t?.skip!==n?.skip&&(t?.skip??0)>(n?.skip??0):!0,query:({category:t,author:n,limit:o=20,skip:u=0})=>({url:"/blog/posts",params:{category:t,author:n,limit:o,skip:u}}),transformResponse:async(t,n,{skip:o=0})=>{try{const u=t.total,h=(await Promise.all(t.items.map(async s=>{const i=s.sys?.id;if(i){const c=Wr(i);if(c)return c}try{const c=await Wt(s);return Gt(c)}catch{return null}}))).filter(s=>s!==null);h.length>0&&Et.dispatch(Mr(h));const a=o+t.items.length,r=t.items.length===0?!1:a<u;return{posts:h,total:u,hasMore:r,nextCmsSkip:a}}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},keepUnusedDataFor:60,providesTags:t=>t?[...t.posts.map(({id:n})=>({type:"BlogPosts",id:n})),{type:"BlogPosts",id:"LIST"}]:[{type:"BlogPosts",id:"LIST"}]}),getBlogPost:e.query({query:({id:t})=>({url:`/entries/${t}`}),transformResponse:async(t,n,{id:o})=>{try{const u=Wr(o);if(u&&u.bodyAssets&&Object.keys(u.bodyAssets).length>0)return u;const f=await Wt(t),h=Gt(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map blog post: missing required fields"};return h.body&&(h.bodyAssets=await zr(h.body)),Et.dispatch(Mr([h])),h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:o.id}]:[]}),getBlogCategories:e.query({query:()=>({url:"/blog/categories"}),transformResponse:async t=>{try{return(await Promise.all(t.items.map(o=>zt(o)))).map(o=>En(o)).filter(o=>o!==null)}catch(n){throw{status:"CUSTOM_ERROR",error:ze(n)}}},providesTags:["Categories"]}),getBlogCategoryBySlug:e.query({query:()=>({url:"/blog/categories"}),transformResponse:async(t,n,{slug:o})=>{try{const u=t.items.find(a=>{const r=a.fields;return Es(r,a.sys.id)===o});if(!u)throw{status:"CUSTOM_ERROR",error:`Category with slug "${o}" not found`};const f=await zt(u),h=En(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map category: missing required fields"};return h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"Categories",id:o.slug}]:[]}),getBlogPostBySlug:e.query({query:({postSlug:t})=>({url:"/blog/posts",params:{slug:t}}),transformResponse:async(t,n,{postSlug:o})=>{try{const u=t.items.find(r=>r.fields.id===o);if(!u)throw{status:"CUSTOM_ERROR",error:`Post with slug "${o}" not found`};const f=u.sys?.id;if(f){const r=Wr(f);if(r&&r.bodyAssets&&Object.keys(r.bodyAssets).length>0)return r}const h=await Wt(u),a=Gt(h);if(!a)throw{status:"CUSTOM_ERROR",error:"Failed to map post: missing required fields"};return a.body&&(a.bodyAssets=await zr(a.body)),Et.dispatch(Mr([a])),a}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:`${o.categorySlug}/${o.postSlug}`}]:[]}),getBlogAuthors:e.query({query:()=>({url:"/blog/authors"}),transformResponse:async t=>{try{return(await Promise.all(t.items.map(o=>zt(o)))).map(o=>nr(o)).filter(o=>o!==null)}catch(n){throw{status:"CUSTOM_ERROR",error:n instanceof Error?n.message:"Unknown error"}}},providesTags:["Authors"]}),getBlogAuthor:e.query({query:({id:t})=>({url:`/entries/${t}`}),transformResponse:t=>{const n=nr(t);if(!n)throw{status:"CUSTOM_ERROR",error:"Failed to map author: missing required fields"};return n},providesTags:(t,n,o)=>t?[{type:"Authors",id:o.id}]:[]}),getBlogAuthorBySlug:e.query({query:()=>({url:"/blog/authors"}),transformResponse:async(t,n,{slug:o})=>{try{const u=t.items.find(a=>{const r=a.fields;return Es(r,a.sys.id)===o});if(!u)throw{status:"CUSTOM_ERROR",error:`Author with slug "${o}" not found`};const f=await zt(u),h=nr(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map author: missing required fields"};return h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"Authors",id:o.slug}]:[]}),getBlogPostPreview:e.query({queryFn:async({id:t,env:n,token:o,previewBaseUrl:u,spaceId:f})=>{try{const h=`${u}/spaces/${f}/environments/${n}/entries?content_type=blog_post&fields.id=${t}&access_token=${o}`,a=await fetch(h);if(!a.ok)return{error:{status:a.status,data:`Failed to fetch preview: ${a.statusText}`}};const r=await a.json();if(!r.items||r.items.length===0)return{error:{status:"CUSTOM_ERROR",error:`Preview post with id "${t}" not found`}};const s=r.items[0],i=await Wt(s),c=Gt(i);return c?(c.body&&(c.bodyAssets=await zr(c.body)),{data:c}):{error:{status:"CUSTOM_ERROR",error:"Failed to map preview post: missing required fields"}}}catch(h){return{error:{status:"CUSTOM_ERROR",error:ze(h)}}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:`preview-${o.id}`}]:[]})}),overrideExisting:!1}),{useGetBlogPostsQuery:fi,useGetBlogCategoriesQuery:Qh,useGetBlogCategoryBySlugQuery:Fh,useGetBlogPostBySlugQuery:Gh,useGetBlogAuthorBySlugQuery:Wh,useGetBlogPostPreviewQuery:zh}=Hh,Kh=ee("WALLET_CONNECT_PROJECT_ID")??"",_s=ee("MAGIC_API_KEY")??"",As=ee("THIRDWEB_CLIENT_ID")??"",Vh=[..._s?[Lu({apiKey:_s})]:[],...As?[Mu({clientId:As})]:[]],MP=Ku({walletConnectProjectId:Kh,appMetadata:{name:"Decentraland Blog",description:"The official Decentraland Blog",url:typeof window<"u"?window.location.origin:"https://decentraland.org/blog"},additionalConnectors:Vh}),Yh={title:"Blog",default_description:"Stay up to date with Decentraland announcements, updates, community highlights, and more.",all_articles:"All articles",load_more:"Load More",nothing_to_show:"Nothing to show",related_post:"Related Articles",share:"Share",posts_by:"Posts by {author}"},Jh={placeholder:"Search...",clear:"Clear search",searching:"Searching...",error:"Search error",no_matches:"No matches",try_something_else:"Try searching for something else",see_more_results:"See more results",results_for:"Search results for",no_results_for:"No results found for",title:"Search",title_with_query:"Search: {query}",description_with_query:'Search results for "{query}" in Decentraland Blog',description:"Search the Decentraland Blog"},Xh={generic:"Something went wrong. Please try again.",load_post:"Failed to load post. Please try again later.",load_posts:"Failed to load posts. Please try again later.",load_category:"Failed to load category. Please try again later.",load_author:"Failed to load author. Please try again later.",load_preview:"Failed to load preview. Please check your preview URL and try again."},Zh={mode:"Preview Mode",description:"You are viewing an unpublished post from Contentful",missing_params:"Missing preview parameters. Required: contentful_id, contentful_env, token"},ef={default_image_alt:"Decentraland - A virtual world owned by its users"},NP={blog:Yh,search:Jh,error:Xh,preview:Zh,seo:ef};var sa={};sa.match=of;sa.parse=pi;var tf=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,rf=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,nf=/^(?:(min|max)-)?(.+)/,af=/(em|rem|px|cm|mm|in|pt|pc)?$/,sf=/(dpi|dpcm|dppx)?$/;function of(e,t){return pi(e).some(function(n){var o=n.inverse,u=n.type==="all"||t.type===n.type;if(u&&o||!(u||o))return!1;var f=n.expressions.every(function(h){var a=h.feature,r=h.modifier,s=h.value,i=t[a];if(!i)return!1;switch(a){case"orientation":case"scan":return i.toLowerCase()===s.toLowerCase();case"width":case"height":case"device-width":case"device-height":s=ks(s),i=ks(i);break;case"resolution":s=Os(s),i=Os(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":s=Rs(s),i=Rs(i);break;case"grid":case"color":case"color-index":case"monochrome":s=parseInt(s,10)||1,i=parseInt(i,10)||0;break}switch(r){case"min":return i>=s;case"max":return i<=s;default:return i===s}});return f&&!o||!f&&o})}function pi(e){return e.split(",").map(function(t){t=t.trim();var n=t.match(tf),o=n[1],u=n[2],f=n[3]||"",h={};return h.inverse=!!o&&o.toLowerCase()==="not",h.type=u?u.toLowerCase():"all",f=f.match(/\([^\)]+\)/g)||[],h.expressions=f.map(function(a){var r=a.match(rf),s=r[1].toLowerCase().match(nf);return{modifier:s[1],feature:s[2],value:r[2]}}),h})}function Rs(e){var t=Number(e),n;return t||(n=e.match(/^(\d+)\s*\/\s*(\d+)$/),t=n[1]/n[2]),t}function Os(e){var t=parseFloat(e),n=String(e).match(sf)[1];switch(n){case"dpcm":return t/2.54;case"dppx":return t*96;default:return t}}function ks(e){var t=parseFloat(e),n=String(e).match(af)[1];switch(n){case"em":return t*16;case"rem":return t*16;case"cm":return t*96/2.54;case"mm":return t*96/2.54/10;case"in":return t*96;case"pt":return t*72;case"pc":return t*72/12;default:return t}}var cf=sa.match,Ds=typeof window<"u"?window.matchMedia:null;function uf(e,t,n){var o=this,u;Ds&&!n&&(u=Ds.call(window,e)),u?(this.matches=u.matches,this.media=u.media,u.addListener(a)):(this.matches=cf(e,t),this.media=e),this.addListener=f,this.removeListener=h,this.dispose=r;function f(s){u&&u.addListener(s)}function h(s){u&&u.removeListener(s)}function a(s){o.matches=s.matches,o.media=s.media}function r(){u&&u.removeListener(a)}}function lf(e,t,n){return new uf(e,t,n)}var df=lf;const hf=Rt(df);var ff=/[A-Z]/g,pf=/^ms-/,Kr={};function gf(e){return"-"+e.toLowerCase()}function gi(e){if(Kr.hasOwnProperty(e))return Kr[e];var t=e.replace(ff,gf);return Kr[e]=pf.test(t)?"-"+t:t}function mf(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),o=Object.keys(t),u=n.length;if(o.length!==u)return!1;for(let f=0;f<u;f++){const h=n[f];if(e[h]!==t[h]||!Object.prototype.hasOwnProperty.call(t,h))return!1}return!0}var mi={exports:{}},yf="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",wf=yf,Pf=wf;function yi(){}function wi(){}wi.resetWarningCache=yi;var qf=function(){function e(o,u,f,h,a,r){if(r!==Pf){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:wi,resetWarningCache:yi};return n.PropTypes=n,n};mi.exports=qf();var vf=mi.exports;const M=Rt(vf),{createContext:bf,useRef:Ef,useEffect:Ye,useContext:Sf,useState:Cr}=await R("react"),ae=M.oneOfType([M.string,M.number]),Pi={all:M.bool,grid:M.bool,aural:M.bool,braille:M.bool,handheld:M.bool,print:M.bool,projection:M.bool,screen:M.bool,tty:M.bool,tv:M.bool,embossed:M.bool},Tf={orientation:M.oneOf(["portrait","landscape"]),scan:M.oneOf(["progressive","interlace"]),aspectRatio:M.string,deviceAspectRatio:M.string,height:ae,deviceHeight:ae,width:ae,deviceWidth:ae,color:M.bool,colorIndex:M.bool,monochrome:M.bool,resolution:ae,type:Object.keys(Pi)},{type:$P,...xf}=Tf,Cf={minAspectRatio:M.string,maxAspectRatio:M.string,minDeviceAspectRatio:M.string,maxDeviceAspectRatio:M.string,minHeight:ae,maxHeight:ae,minDeviceHeight:ae,maxDeviceHeight:ae,minWidth:ae,maxWidth:ae,minDeviceWidth:ae,maxDeviceWidth:ae,minColor:M.number,maxColor:M.number,minColorIndex:M.number,maxColorIndex:M.number,minMonochrome:M.number,maxMonochrome:M.number,minResolution:ae,maxResolution:ae,...xf},If={...Pi,...Cf};var _f={all:If};const Af=e=>`not ${e}`,Rf=(e,t)=>{const n=gi(e);return typeof t=="number"&&(t=`${t}px`),t===!0?n:t===!1?Af(n):`(${n}: ${t})`},Of=e=>e.join(" and "),kf=e=>{const t=[];return Object.keys(_f.all).forEach(n=>{const o=e[n];o!=null&&t.push(Rf(n,o))}),Of(t)},Df=bf(void 0),jf=e=>e.query||kf(e),js=e=>e?Object.keys(e).reduce((n,o)=>(n[gi(o)]=e[o],n),{}):void 0,qi=()=>{const e=Ef(!1);return Ye(()=>{e.current=!0},[]),e.current},Lf=e=>{const t=Sf(Df),n=()=>js(e)||js(t),[o,u]=Cr(n);return Ye(()=>{const f=n();mf(o,f)||u(f)},[e,t]),o},Uf=e=>{const t=()=>jf(e),[n,o]=Cr(t);return Ye(()=>{const u=t();n!==u&&o(u)},[e]),n},Mf=(e,t)=>{const n=()=>hf(e,t||{},!!t),[o,u]=Cr(n),f=qi();return Ye(()=>{if(f){const h=n();return u(h),()=>{h&&h.dispose()}}},[e,t]),o},Nf=e=>{const[t,n]=Cr(e.matches);return Ye(()=>{const o=u=>{n(u.matches)};return e.addListener(o),n(e.matches),()=>{e.removeListener(o)}},[e]),t},$f=(e,t,n)=>{const o=Lf(t),u=Uf(e);if(!u)throw new Error("Invalid or missing MediaQuery!");const f=Mf(u,o),h=Nf(f);return qi(),Ye(()=>{},[h]),Ye(()=>()=>{f&&f.dispose()},[]),h},{useEffect:Bf,useRef:Hf,useState:Qf}=await R("react"),vi=e=>{const[t,n]=Qf(!1),o=Hf(null);return Bf(()=>{if(!e)return;const u=new window.Image;if(o.current=u,u.src=e,u.complete){n(!0);return}return n(!1),u.onload=()=>n(!0),u.onerror=()=>n(!0),()=>{o.current&&(o.current.onload=null,o.current.onerror=null)}},[e]),t},{Link:oa}=await R("react-router-dom"),{Box:ut,Skeleton:lt,dclColors:Ls,styled:re}=await R("decentraland-ui2"),Us=re(ut)(()=>({width:"100%",margin:"0 40px 40px 0",position:"relative",display:"flex",justifyContent:"space-between","@media (max-width: 1096px)":{display:"none"}})),Ff=re(ut)(({$imageUrl:e})=>({backgroundImage:`url("${e}")`,backgroundSize:"cover",backgroundPosition:"center",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"697px",paddingBottom:"calc(697px * 0.5)",marginRight:"31px",transition:"transform 250ms ease, box-shadow 250ms ease"})),Gf=re(oa)(()=>({display:"block","&:hover > div":{transform:"translate(0, -4px)",boxShadow:"0 10px 20px 0 rgba(0, 0, 0, 0.12)"}})),Ms=re(ut)({width:"335px"}),Wf=re("span")(({theme:e})=>({marginRight:"16px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,textDecoration:"none",textTransform:"uppercase",display:"inline"})),zf=re(oa)(()=>({color:Ls.neutral.gray3,fontSize:"13px",textDecoration:"none",textTransform:"uppercase",transition:"color 250ms ease",fontWeight:400,"&:hover":{color:Ls.neutral.gray2}})),Kf=re(oa)(({theme:e})=>({textDecoration:"none",display:"block",color:e.palette.text.primary,"& h2, & h3":{fontSize:"34px",lineHeight:"42px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),Vf=re("p")(({theme:e})=>({display:"block",fontSize:"17px",lineHeight:"26px",letterSpacing:"-0.4px",margin:0,paddingTop:"8px",fontWeight:400,color:e.palette.text.primary})),Yf=re(ut)(()=>({display:"flex",justifyContent:"space-between"})),Ns=re(lt)(()=>({width:"697px",height:"348px"})),Jf=re(lt)(()=>({width:"100%",height:"40px"})),Xf=re(lt)(()=>({width:"90%",height:"40px"})),$s=re(lt)(()=>({width:"100px"})),Vr=re(lt)(()=>({width:"100%"})),Zf=re(lt)(()=>({width:"80%"})),ep=re(ut)(({theme:e})=>({marginTop:e.spacing(2)})),tp=re(ut)(()=>({})),{Typography:rp}=await R("decentraland-ui2"),Bs=e=>{const{post:t,loading:n}=e,o=vi(t?.image?.url);return n?q.jsxs(Us,{children:[q.jsx(Ns,{variant:"rectangular"}),q.jsxs(Ms,{children:[q.jsxs(Yf,{children:[q.jsx($s,{variant:"text"}),q.jsx($s,{variant:"text"})]}),q.jsx(Jf,{variant:"text"}),q.jsx(Xf,{variant:"text"}),q.jsxs(ep,{children:[q.jsx(Vr,{variant:"text"}),q.jsx(Vr,{variant:"text"}),q.jsx(Vr,{variant:"text"}),q.jsx(Zf,{variant:"text"})]})]})]}):q.jsxs(Us,{children:[o?q.jsx(Gf,{to:t.url,children:q.jsx(Ff,{$imageUrl:t.image.url})}):q.jsx(Ns,{variant:"rectangular"}),q.jsxs(Ms,{children:[q.jsxs(tp,{children:[q.jsx(Wf,{children:t.publishedDate}),q.jsx("span",{children:q.jsx(zf,{to:t.category.url,children:t.category.title})})]}),q.jsx(Kf,{to:t.url,children:q.jsx(rp,{variant:"h3",component:"h2",children:t.title})}),q.jsx(Vf,{children:t.description})]})]})},{Link:ia}=await R("react-router-dom"),{Box:ca,Card:np,CardContent:ap,Skeleton:Ir,dclColors:Hs,styled:he}=await R("decentraland-ui2"),Qs=he(np)(()=>({display:"flex",flexDirection:"column",width:"calc((100% - (32px * 2)) / 3)",marginRight:"32px",marginBottom:"40px",position:"relative",boxShadow:"none",backgroundColor:"transparent !important",background:"transparent !important","& .MuiPaper-root":{backgroundColor:"transparent !important",background:"transparent !important"},"@media (max-width: 1096px)":{width:"calc((100% - 24px) / 2)",marginRight:0},"@media (max-width: 568px)":{width:"100%"},"&:nth-of-type(3n)":{marginRight:0}})),sp=he(ca,{shouldForwardProp:e=>e!=="$imageUrl"})(({$imageUrl:e})=>({backgroundImage:`url("${e}")`,backgroundSize:"cover",backgroundPosition:"center",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"100%",marginBottom:"12px",paddingBottom:"50%",transition:"transform 250ms ease, box-shadow 250ms ease"})),op=he(ia)(()=>({display:"block","&:hover .post-card__image, &:hover > div":{transform:"translate(0, -4px)",boxShadow:"0 10px 20px 0 rgba(0, 0, 0, 0.12)"}})),Fs=he(ap)({width:"100%",padding:0,backgroundColor:"transparent !important",background:"transparent !important","&.MuiCardContent-root":{backgroundColor:"transparent !important",background:"transparent !important"},"&:last-child":{paddingBottom:0}}),ip=he("span")(({theme:e})=>({marginRight:"16px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,textDecoration:"none",textTransform:"uppercase",display:"inline"})),cp=he(ia)(()=>({color:Hs.neutral.gray3,fontSize:"13px",textDecoration:"none",textTransform:"uppercase",transition:"color 250ms ease",fontWeight:400,"&:hover":{color:Hs.neutral.gray2}})),up=he(ia)(({theme:e})=>({textDecoration:"none",paddingTop:"8px",display:"block",color:e.palette.text.primary,"& h2, & h6":{fontSize:"20px",lineHeight:"28px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),lp=he(ca)(()=>({display:"flex",justifyContent:"space-between"})),Gs=he(Ir)(()=>({height:"200px"})),Ws=he(Ir)(()=>({width:"100px"})),dp=he(Ir)(()=>({width:"100%"})),hp=he(Ir)(()=>({width:"80%"})),fp=he(ca)(()=>({})),{Typography:pp}=await R("decentraland-ui2"),ar=e=>{const{post:t,loading:n}=e,o=vi(t?.image?.url);return n?q.jsxs(Qs,{elevation:0,children:[q.jsx(Gs,{variant:"rectangular"}),q.jsxs(Fs,{children:[q.jsxs(lp,{children:[q.jsx(Ws,{variant:"text"}),q.jsx(Ws,{variant:"text"})]}),q.jsx(dp,{variant:"text"}),q.jsx(hp,{variant:"text"})]})]}):q.jsxs(Qs,{elevation:0,children:[o?q.jsx(op,{to:t.url,children:q.jsx(sp,{$imageUrl:t.image.url})}):q.jsx(Gs,{variant:"rectangular"}),q.jsxs(Fs,{children:[q.jsxs(fp,{children:[q.jsx(ip,{children:t.publishedDate}),q.jsx("span",{children:q.jsx(cp,{to:t.category.url,children:t.category.title})})]}),q.jsx(up,{to:t.url,children:q.jsx(pp,{variant:"h6",component:"h2",children:t.title})})]})]})},{Box:bi,styled:Ei}=await R("decentraland-ui2"),zs=Ei(bi,{shouldForwardProp:e=>e!=="hasMainPost"})(({theme:e,hasMainPost:t})=>({display:"flex",flexWrap:"wrap",justifyContent:"flex-start",paddingBottom:e.spacing(2.5),"& > div:nth-of-type(3n)":{marginRight:e.spacing(4)},...t&&{"& > div:nth-of-type(3n + 1)":{marginRight:0}},...!t&&{"& > div:nth-of-type(3n + 3)":{marginRight:0}},"@media (max-width: 1096px)":{justifyContent:"space-between","& > div, & > div:nth-of-type(3n)":{marginRight:0}}}));Ei(bi)(()=>({display:"flex",flexWrap:"wrap",width:"100%",marginTop:0}));const{memo:gp}=await R("react"),Yr=e=>"isPlaceholder"in e&&e.isPlaceholder===!0,ua=gp(e=>{const{posts:t,loading:n,hasMainPost:o=!1}=e,u=$f({minWidth:1096});if(n&&t.length===0){const h=o?7:6;return q.jsxs(zs,{hasMainPost:o,children:[o&&q.jsx(Bs,{loading:!0}),Array.from(Array(h),(a,r)=>o&&r===0?null:q.jsx(ar,{loading:!0},`skeleton-${r}`))]})}if(!t||t.length===0)return null;const f=t.find(h=>!Yr(h));return q.jsxs(zs,{hasMainPost:o,children:[o&&u&&f&&q.jsx(Bs,{post:f}),t.map(h=>o&&u&&!Yr(h)&&h===f?null:Yr(h)?q.jsx(ar,{loading:!0},h.id):q.jsx(ar,{post:h},h.id))]})}),{useCallback:Kt,useEffect:mp,useMemo:yp,useState:wp}=await R("react"),{useNotifications:Pp}=await R("@dcl/hooks"),{NotificationActiveTab:qp,Profile:vp,dclAddressUtils:bp}=await R("decentraland-ui2");function Ep(e){const{identity:t,isConnected:n,locale:o="en"}=e,u=!!(t&&n),[f,h]=wp(!0),a=ee("NOTIFICATIONS_API_URL")??"https://notifications.decentraland.org";mp(()=>{u||h(!0)},[u]);const r=Kt(()=>{u&&h(b=>b&&!1)},[u]),{notifications:s,isLoading:i,isModalOpen:c,isNotificationsOnboarding:l,modalActiveTab:d,handleNotificationsOpen:p,handleOnBegin:g,handleOnChangeModalTab:y}=Pp({identity:t??void 0,isNotificationsEnabled:u&&f,initialActiveTab:qp.NEWEST,notificationsUrl:a,onError:r}),P=Kt(()=>{f||h(!0),p()},[p,f]),w=Kt((b,x)=>{y(x)},[y]),v=Kt(b=>q.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[q.jsx(vp,{address:b,size:"normal",imageOnly:!0}),bp.shorten(b)]}),[]);return{notificationProps:yp(()=>{if(u)return{locale:o,isLoading:i,isOnboarding:l,isOpen:c,items:s,activeTab:d,onClick:P,onClose:P,onBegin:g,onChangeTab:w,renderProfile:v}},[u,o,i,l,c,s,d,P,g,w,v])}}function Sp(){return/^decentraland.(zone|org|today)$/.test(window.location.host)?"/blog":""}function Tp(e,t){const n=Sp(),o=new URL(e,window.location.origin);let u=o.pathname+o.search;return n&&u.startsWith(n)&&(u=u.slice(n.length)||"/"),`${n}${u}`}function xp(){const e=ee("AUTH_URL")??"/auth";return e.startsWith("http")||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`}function Cp(){const e=window.location.pathname,t=window.location.search;return new URLSearchParams(t).get("redirectTo")??`${e}${t}`}function Si(e,t){const n=Cp(),o=Tp(n),u=xp();Vu(),window.location.replace(`${u}/login?redirectTo=${encodeURIComponent(o)}`)}function Te(){function e(t){return new Promise(n=>{let o=new XMLHttpRequest;o.open(t.method,t.url,!0),Object.keys(t.headers).forEach(a=>o.setRequestHeader(a,t.headers[a]));let u=(a,r)=>setTimeout(()=>{o.abort(),n({status:0,content:r,isTimedOut:!0})},a),f=u(t.connectTimeout,"Connection timeout"),h;o.onreadystatechange=()=>{o.readyState>o.OPENED&&h===void 0&&(clearTimeout(f),h=u(t.responseTimeout,"Socket timeout"))},o.onerror=()=>{o.status===0&&(clearTimeout(f),clearTimeout(h),n({content:o.responseText||"Network request failed",status:o.status,isTimedOut:!1}))},o.onload=()=>{clearTimeout(f),clearTimeout(h),n({content:o.responseText,status:o.status,isTimedOut:!1})},o.send(t.data)})}return{send:e}}function xe(e){let t;const n=`algolia-client-js-${e.key}`;function o(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(o().getItem(n)||"{}")}function f(a){o().setItem(n,JSON.stringify(a))}function h(){const a=e.timeToLive?e.timeToLive*1e3:null,r=u(),s=Object.fromEntries(Object.entries(r).filter(([,c])=>c.timestamp!==void 0));if(f(s),!a)return;const i=Object.fromEntries(Object.entries(s).filter(([,c])=>{const l=new Date().getTime();return!(c.timestamp+a<l)}));f(i)}return{get(a,r,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),u()[JSON.stringify(a)])).then(i=>Promise.all([i?i.value:r(),i!==void 0])).then(([i,c])=>Promise.all([i,c||s.miss(i)])).then(([i])=>i)},set(a,r){return Promise.resolve().then(()=>{const s=u();return s[JSON.stringify(a)]={timestamp:new Date().getTime(),value:r},o().setItem(n,JSON.stringify(s)),r})},delete(a){return Promise.resolve().then(()=>{const r=u();delete r[JSON.stringify(a)],o().setItem(n,JSON.stringify(r))})},clear(){return Promise.resolve().then(()=>{o().removeItem(n)})}}}function Ip(){return{get(e,t,n={miss:()=>Promise.resolve()}){return t().then(u=>Promise.all([u,n.miss(u)])).then(([u])=>u)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function ie(e){const t=[...e.caches],n=t.shift();return n===void 0?Ip():{get(o,u,f={miss:()=>Promise.resolve()}){return n.get(o,u,f).catch(()=>ie({caches:t}).get(o,u,f))},set(o,u){return n.set(o,u).catch(()=>ie({caches:t}).set(o,u))},delete(o){return n.delete(o).catch(()=>ie({caches:t}).delete(o))},clear(){return n.clear().catch(()=>ie({caches:t}).clear())}}}function K(e={serializable:!0}){let t={};return{get(n,o,u={miss:()=>Promise.resolve()}){const f=JSON.stringify(n);if(f in t)return Promise.resolve(e.serializable?JSON.parse(t[f]):t[f]);const h=o();return h.then(a=>u.miss(a)).then(()=>h)},set(n,o){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(n){return delete t[JSON.stringify(n)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function _p(e){const t={value:`Algolia for JavaScript (${e})`,add(n){const o=`; ${n.segment}${n.version!==void 0?` (${n.version})`:""}`;return t.value.indexOf(o)===-1&&(t.value=`${t.value}${o}`),t}};return t}function Ce(e,t,n="WithinHeaders"){const o={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return n==="WithinHeaders"?o:{}},queryParameters(){return n==="WithinQueryParameters"?o:{}}}}function Be({func:e,validate:t,aggregator:n,error:o,timeout:u=()=>0}){const f=h=>new Promise((a,r)=>{e(h).then(async s=>(n&&await n(s),await t(s)?a(s):o&&await o.validate(s)?r(new Error(await o.message(s))):setTimeout(()=>{f(s).then(a).catch(r)},await u()))).catch(s=>{r(s)})});return f()}function Ie({algoliaAgents:e,client:t,version:n}){const o=_p(n).add({segment:t,version:n});return e.forEach(u=>o.add(u)),o}function _e(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Ks=2*60*1e3;function Vs(e,t="up"){const n=Date.now();function o(){return t==="up"||Date.now()-n>Ks}function u(){return t==="timed out"&&Date.now()-n<=Ks}return{...e,status:t,lastUpdate:n,isUp:o,isTimedOut:u}}var Ti=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}},xi=class extends Ti{stackTrace;constructor(e,t,n){super(e,n),this.stackTrace=t}},Ap=class extends xi{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError")}},mr=class extends xi{status;constructor(e,t,n,o="ApiError"){super(e,n,o),this.status=t}},Rp=class extends Ti{response;constructor(e,t){super(e,"DeserializationError"),this.response=t}},Op=class extends mr{error;constructor(e,t,n,o){super(e,t,o,"DetailedApiError"),this.error=n}};function Ci(e){const t=e;for(let n=e.length-1;n>0;n--){const o=Math.floor(Math.random()*(n+1)),u=e[n];t[n]=e[o],t[o]=u}return t}function kp(e,t,n){const o=Dp(n);let u=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return o.length&&(u+=`?${o}`),u}function Dp(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function jp(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;const n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function Lp(e,t,n){const o={Accept:"application/json",...e,...t,...n},u={};return Object.keys(o).forEach(f=>{const h=o[f];u[f.toLowerCase()]=h}),u}function Up(e){try{return JSON.parse(e.content)}catch(t){throw new Rp(t.message,e)}}function Mp({content:e,status:t},n){try{const o=JSON.parse(e);return"error"in o?new Op(o.message,t,o.error,n):new mr(o.message,t,n)}catch{}return new mr(e,t,n)}function Np({isTimedOut:e,status:t}){return!e&&~~t===0}function $p({isTimedOut:e,status:t}){return e||Np({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Bp({status:e}){return~~(e/100)===2}function Hp(e){return e.map(t=>Ii(t))}function Ii(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function Ae({hosts:e,hostsCache:t,baseHeaders:n,logger:o,baseQueryParameters:u,algoliaAgent:f,timeouts:h,requester:a,requestsCache:r,responsesCache:s}){async function i(d){const p=await Promise.all(d.map(v=>t.get(v,()=>Promise.resolve(Vs(v))))),g=p.filter(v=>v.isUp()),y=p.filter(v=>v.isTimedOut()),P=[...g,...y];return{hosts:P.length>0?P:d,getTimeout(v,m){return(y.length===0&&v===0?1:y.length+3+v)*m}}}async function c(d,p,g=!0){const y=[],P=jp(d,p),w=Lp(n,d.headers,p.headers),v=d.method==="GET"?{...d.data,...p.data}:{},m={...u,...d.queryParameters,...v};if(f.value&&(m["x-algolia-agent"]=f.value),p&&p.queryParameters)for(const T of Object.keys(p.queryParameters))!p.queryParameters[T]||Object.prototype.toString.call(p.queryParameters[T])==="[object Object]"?m[T]=p.queryParameters[T]:m[T]=p.queryParameters[T].toString();let b=0;const x=async(T,E)=>{const S=T.pop();if(S===void 0)throw new Ap(Hp(y));const C={...h,...p.timeouts},I={data:P,headers:w,method:d.method,url:kp(S,d.path,m),connectTimeout:E(b,C.connect),responseTimeout:E(b,g?C.read:C.write)},O=D=>{const L={request:I,response:D,host:S,triesLeft:T.length};return y.push(L),L},k=await a.send(I);if($p(k)){const D=O(k);return k.isTimedOut&&b++,o.info("Retryable failure",Ii(D)),await t.set(S,Vs(S,k.isTimedOut?"timed out":"down")),x(T,E)}if(Bp(k))return Up(k);throw O(k),Mp(k,y)},_=e.filter(T=>T.accept==="readWrite"||(g?T.accept==="read":T.accept==="write")),A=await i(_);return x([...A.hosts].reverse(),A.getTimeout)}function l(d,p={}){const g=d.useReadTransporter||d.method==="GET";if(!g)return c(d,p,g);const y=()=>c(d,p);if((p.cacheable||d.cacheable)!==!0)return y();const w={request:d,requestOptions:p,transporter:{queryParameters:u,headers:n}};return s.get(w,()=>r.get(w,()=>r.set(w,y()).then(v=>Promise.all([r.delete(w),v]),v=>Promise.all([r.delete(w),Promise.reject(v)])).then(([v,m])=>m)),{miss:v=>s.set(w,v)})}return{hostsCache:t,requester:a,timeouts:h,logger:o,algoliaAgent:f,baseHeaders:n,baseQueryParameters:u,hosts:e,request:l,requestsCache:r,responsesCache:s}}var la="1.7.0",Ys=["de","us"];function Qp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Fp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Qp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"AbtestingV3",version:la}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,s){if(!r)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!r.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!r.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!r.metrics)throw new Error("Parameter `addABTestsRequest.metrics` is required when calling `addABTests`.");if(!r.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const d={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const d={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},estimateABTest(r,s){if(!r)throw new Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!r.configuration)throw new Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!r.variants)throw new Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");const d={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return a.request(d,s)},getABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `getABTest`.");const d={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTimeseries({id:r,startDate:s,endDate:i,metric:c},l){if(!r)throw new Error("Parameter `id` is required when calling `getTimeseries`.");const d="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),p={},g={};s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.metric=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},listABTests({offset:r,limit:s,indexPrefix:i,indexSuffix:c,direction:l}={},d=void 0){const p="/3/abtests",g={},y={};r!==void 0&&(y.offset=r.toString()),s!==void 0&&(y.limit=s.toString()),i!==void 0&&(y.indexPrefix=i.toString()),c!==void 0&&(y.indexSuffix=c.toString()),l!==void 0&&(y.direction=l.toString());const P={method:"GET",path:p,queryParameters:y,headers:g};return a.request(P,d)},scheduleABTest(r,s){if(!r)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!r.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!r.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!r.metrics)throw new Error("Parameter `scheduleABTestsRequest.metrics` is required when calling `scheduleABTest`.");if(!r.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!r.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const d={method:"POST",path:"/3/abtests/schedule",queryParameters:{},headers:{},data:r};return a.request(d,s)},stopABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `stopABTest`.");const d={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)}}}function _i(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Ys.includes(n)))throw new Error(`\`region\` must be one of the following: ${Ys.join(", ")}`);return Fp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${la}-${e}`}),K()]}),...o})}const Gp=Object.freeze(Object.defineProperty({__proto__:null,abtestingV3Client:_i,apiClientVersion:la},Symbol.toStringTag,{value:"Module"}));var da="5.41.0",Js=["de","us"];function Wp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function zp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Wp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Abtesting",version:da}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,s){if(!r)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!r.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!r.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!r.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const d={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const d={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},estimateABTest(r,s){if(!r)throw new Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!r.configuration)throw new Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!r.variants)throw new Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");const d={method:"POST",path:"/2/abtests/estimate",queryParameters:{},headers:{},data:r};return a.request(d,s)},getABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `getABTest`.");const d={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},listABTests({offset:r,limit:s,indexPrefix:i,indexSuffix:c}={},l=void 0){const d="/2/abtests",p={},g={};r!==void 0&&(g.offset=r.toString()),s!==void 0&&(g.limit=s.toString()),i!==void 0&&(g.indexPrefix=i.toString()),c!==void 0&&(g.indexSuffix=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},scheduleABTest(r,s){if(!r)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!r.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!r.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!r.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!r.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const d={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:r};return a.request(d,s)},stopABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `stopABTest`.");const d={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)}}}function Ai(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Js.includes(n)))throw new Error(`\`region\` must be one of the following: ${Js.join(", ")}`);return zp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${da}-${e}`}),K()]}),...o})}const Kp=Object.freeze(Object.defineProperty({__proto__:null,abtestingClient:Ai,apiClientVersion:da},Symbol.toStringTag,{value:"Module"}));var ha="5.41.0",Xs=["de","us"];function Vp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Yp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Vp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Analytics",version:ha}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},getAddToCartRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");const d="/2/conversions/addToCartRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getAverageClickPosition({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");const d="/2/clicks/averageClickPosition",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getClickPositions({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getClickPositions`.");const d="/2/clicks/positions",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getClickThroughRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");const d="/2/clicks/clickThroughRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getConversionRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getConversionRate`.");const d="/2/conversions/conversionRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getNoClickRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");const d="/2/searches/noClickRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getNoResultsRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");const d="/2/searches/noResultRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getPurchaseRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");const d="/2/conversions/purchaseRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getRevenue({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getRevenue`.");const d="/2/conversions/revenue",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getSearchesCount({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");const d="/2/searches/count",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getSearchesNoClicks({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");const g="/2/searches/noClicks",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getSearchesNoResults({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");const g="/2/searches/noResults",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getStatus({index:r},s){if(!r)throw new Error("Parameter `index` is required when calling `getStatus`.");const i="/2/status",c={},l={};r!==void 0&&(l.index=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return a.request(d,s)},getTopCountries({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getTopCountries`.");const g="/2/countries",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getTopFilterAttributes({index:r,search:s,startDate:i,endDate:c,limit:l,offset:d,tags:p},g){if(!r)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");const y="/2/filters",P={},w={};r!==void 0&&(w.index=r.toString()),s!==void 0&&(w.search=s.toString()),i!==void 0&&(w.startDate=i.toString()),c!==void 0&&(w.endDate=c.toString()),l!==void 0&&(w.limit=l.toString()),d!==void 0&&(w.offset=d.toString()),p!==void 0&&(w.tags=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},getTopFilterForAttribute({attribute:r,index:s,search:i,startDate:c,endDate:l,limit:d,offset:p,tags:g},y){if(!r)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");const P="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(r)),w={},v={};s!==void 0&&(v.index=s.toString()),i!==void 0&&(v.search=i.toString()),c!==void 0&&(v.startDate=c.toString()),l!==void 0&&(v.endDate=l.toString()),d!==void 0&&(v.limit=d.toString()),p!==void 0&&(v.offset=p.toString()),g!==void 0&&(v.tags=g.toString());const m={method:"GET",path:P,queryParameters:v,headers:w};return a.request(m,y)},getTopFiltersNoResults({index:r,search:s,startDate:i,endDate:c,limit:l,offset:d,tags:p},g){if(!r)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");const y="/2/filters/noResults",P={},w={};r!==void 0&&(w.index=r.toString()),s!==void 0&&(w.search=s.toString()),i!==void 0&&(w.startDate=i.toString()),c!==void 0&&(w.endDate=c.toString()),l!==void 0&&(w.limit=l.toString()),d!==void 0&&(w.offset=d.toString()),p!==void 0&&(w.tags=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},getTopHits({index:r,search:s,clickAnalytics:i,revenueAnalytics:c,startDate:l,endDate:d,limit:p,offset:g,tags:y},P){if(!r)throw new Error("Parameter `index` is required when calling `getTopHits`.");const w="/2/hits",v={},m={};r!==void 0&&(m.index=r.toString()),s!==void 0&&(m.search=s.toString()),i!==void 0&&(m.clickAnalytics=i.toString()),c!==void 0&&(m.revenueAnalytics=c.toString()),l!==void 0&&(m.startDate=l.toString()),d!==void 0&&(m.endDate=d.toString()),p!==void 0&&(m.limit=p.toString()),g!==void 0&&(m.offset=g.toString()),y!==void 0&&(m.tags=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},getTopSearches({index:r,clickAnalytics:s,revenueAnalytics:i,startDate:c,endDate:l,orderBy:d,direction:p,limit:g,offset:y,tags:P},w){if(!r)throw new Error("Parameter `index` is required when calling `getTopSearches`.");const v="/2/searches",m={},b={};r!==void 0&&(b.index=r.toString()),s!==void 0&&(b.clickAnalytics=s.toString()),i!==void 0&&(b.revenueAnalytics=i.toString()),c!==void 0&&(b.startDate=c.toString()),l!==void 0&&(b.endDate=l.toString()),d!==void 0&&(b.orderBy=d.toString()),p!==void 0&&(b.direction=p.toString()),g!==void 0&&(b.limit=g.toString()),y!==void 0&&(b.offset=y.toString()),P!==void 0&&(b.tags=P.toString());const x={method:"GET",path:v,queryParameters:b,headers:m};return a.request(x,w)},getUsersCount({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getUsersCount`.");const d="/2/users/count",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)}}}function Ri(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Xs.includes(n)))throw new Error(`\`region\` must be one of the following: ${Xs.join(", ")}`);return Yp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ha}-${e}`}),K()]}),...o})}const Jp=Object.freeze(Object.defineProperty({__proto__:null,analyticsClient:Ri,apiClientVersion:ha},Symbol.toStringTag,{value:"Module"}));var fa="5.41.0",Zs=["de","us"];function Xp(e){return[{url:e?"insights.{region}.algolia.io".replace("{region}",e):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Zp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Xp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Insights",version:fa}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteUserToken({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");const d={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},pushEvents(r,s){if(!r)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!r.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");const d={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:r};return a.request(d,s)}}}function Oi(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Zs.includes(n)))throw new Error(`\`region\` must be one of the following: ${Zs.join(", ")}`);return Zp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${fa}-${e}`}),K()]}),...o})}const eg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:fa,insightsClient:Oi},Symbol.toStringTag,{value:"Module"}));var pa="5.41.0",eo=["eu","us"];function tg(e){return[{url:"personalization.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function rg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:tg(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Personalization",version:pa}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteUserProfile({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");const d={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getPersonalizationStrategy(r){const l={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return a.request(l,r)},getUserTokenProfile({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");const d={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},setPersonalizationStrategy(r,s){if(!r)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!r.eventsScoring)throw new Error("Parameter `personalizationStrategyParams.eventsScoring` is required when calling `setPersonalizationStrategy`.");if(!r.facetsScoring)throw new Error("Parameter `personalizationStrategyParams.facetsScoring` is required when calling `setPersonalizationStrategy`.");if(!r.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");const d={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:r};return a.request(d,s)}}}function ki(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!eo.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${eo.join(", ")}`);return rg({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${pa}-${e}`}),K()]}),...o})}const ng=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:pa,personalizationClient:ki},Symbol.toStringTag,{value:"Module"}));var ga="5.41.0",to=["eu","us"];function ag(e){return[{url:"query-suggestions.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function sg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:ag(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"QuerySuggestions",version:ga}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},createConfig(r,s){if(!r)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");const d={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteConfig({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");const d={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getAllConfigs(r){const l={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return a.request(l,r)},getConfig({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getConfig`.");const d={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getConfigStatus({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");const d={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getLogFile({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");const d={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},updateConfig({indexName:r,configuration:s},i){if(!r)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!s)throw new Error("Parameter `configuration` is required when calling `updateConfig`.");if(!s.sourceIndices)throw new Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");const p={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)}}}function Di(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!to.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${to.join(", ")}`);return sg({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ga}-${e}`}),K()]}),...o})}const og=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ga,querySuggestionsClient:Di},Symbol.toStringTag,{value:"Module"}));var kt="5.41.0";function ig(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(Ci([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function cg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:ig(e),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Search",version:kt}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},waitForTask({indexName:a,taskID:r,maxRetries:s=50,timeout:i=l=>Math.min(l*200,5e3)},c){let l=0;return Be({func:()=>this.getTask({indexName:a,taskID:r},c),validate:d=>d.status==="published",aggregator:()=>l+=1,error:{validate:()=>l>=s,message:()=>`The maximum number of retries exceeded. (${l}/${s})`},timeout:()=>i(l)})},waitForAppTask({taskID:a,maxRetries:r=50,timeout:s=c=>Math.min(c*200,5e3)},i){let c=0;return Be({func:()=>this.getAppTask({taskID:a},i),validate:l=>l.status==="published",aggregator:()=>c+=1,error:{validate:()=>c>=r,message:()=>`The maximum number of retries exceeded. (${c}/${r})`},timeout:()=>s(c)})},waitForApiKey({operation:a,key:r,apiKey:s,maxRetries:i=50,timeout:c=d=>Math.min(d*200,5e3)},l){let d=0;const p={aggregator:()=>d+=1,error:{validate:()=>d>=i,message:()=>`The maximum number of retries exceeded. (${d}/${i})`},timeout:()=>c(d)};if(a==="update"){if(!s)throw new Error("`apiKey` is required when waiting for an `update` operation.");return Be({...p,func:()=>this.getApiKey({key:r},l),validate:g=>{for(const y of Object.keys(s)){const P=s[y],w=g[y];if(Array.isArray(P)&&Array.isArray(w)){if(P.length!==w.length||P.some((v,m)=>v!==w[m]))return!1}else if(P!==w)return!1}return!0}})}return Be({...p,func:()=>this.getApiKey({key:r},l).catch(g=>{if(g.status!==404)throw g}),validate:g=>a==="add"?g!==void 0:g===void 0})},browseObjects({indexName:a,browseParams:r,...s},i){return Be({func:c=>this.browse({indexName:a,browseParams:{cursor:c?c.cursor:void 0,hitsPerPage:1e3,...r}},i),validate:c=>c.cursor===void 0,...s})},browseRules({indexName:a,searchRulesParams:r,...s},i){const c={...r,hitsPerPage:r?.hitsPerPage||1e3};return Be({func:l=>this.searchRules({indexName:a,searchRulesParams:{...c,page:l?l.page+1:c.page||0}},i),validate:l=>l.hits.length<c.hitsPerPage,...s})},browseSynonyms({indexName:a,searchSynonymsParams:r,...s},i){const c={...r,page:r?.page||0,hitsPerPage:1e3};return Be({func:l=>{const d=this.searchSynonyms({indexName:a,searchSynonymsParams:{...c,page:c.page}},i);return c.page+=1,d},validate:l=>l.hits.length<c.hitsPerPage,...s})},async chunkedBatch({indexName:a,objects:r,action:s="addObject",waitForTasks:i,batchSize:c=1e3},l){let d=[];const p=[],g=r.entries();for(const[y,P]of g)d.push({action:s,body:P}),(d.length===c||y===r.length-1)&&(p.push(await this.batch({indexName:a,batchWriteParams:{requests:d}},l)),d=[]);if(i)for(const y of p)await this.waitForTask({indexName:a,taskID:y.taskID});return p},async saveObjects({indexName:a,objects:r,waitForTasks:s,batchSize:i},c){return await this.chunkedBatch({indexName:a,objects:r,action:"addObject",waitForTasks:s,batchSize:i},c)},async deleteObjects({indexName:a,objectIDs:r,waitForTasks:s,batchSize:i},c){return await this.chunkedBatch({indexName:a,objects:r.map(l=>({objectID:l})),action:"deleteObject",waitForTasks:s,batchSize:i},c)},async partialUpdateObjects({indexName:a,objects:r,createIfNotExists:s,waitForTasks:i,batchSize:c},l){return await this.chunkedBatch({indexName:a,objects:r,action:s?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:c,waitForTasks:i},l)},async replaceAllObjects({indexName:a,objects:r,batchSize:s,scopes:i},c){const l=Math.floor(Math.random()*1e6)+1e5,d=`${a}_tmp_${l}`;i===void 0&&(i=["settings","rules","synonyms"]);try{let p=await this.operationIndex({indexName:a,operationIndexParams:{operation:"copy",destination:d,scope:i}},c);const g=await this.chunkedBatch({indexName:d,objects:r,waitForTasks:!0,batchSize:s},c);await this.waitForTask({indexName:d,taskID:p.taskID}),p=await this.operationIndex({indexName:a,operationIndexParams:{operation:"copy",destination:d,scope:i}},c),await this.waitForTask({indexName:d,taskID:p.taskID});const y=await this.operationIndex({indexName:d,operationIndexParams:{operation:"move",destination:a}},c);return await this.waitForTask({indexName:d,taskID:y.taskID}),{copyOperationResponse:p,batchResponses:g,moveOperationResponse:y}}catch(p){throw await this.deleteIndex({indexName:d}),p}},async indexExists({indexName:a}){try{await this.getSettings({indexName:a})}catch(r){if(r instanceof mr&&r.status===404)return!1;throw r}return!0},searchForHits(a,r){return this.search(a,r)},searchForFacets(a,r){return this.search(a,r)},addApiKey(a,r){if(!a)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!a.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");const l={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:a};return h.request(l,r)},addOrUpdateObject({indexName:a,objectID:r,body:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!s)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");const p={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return h.request(p,i)},appendSource(a,r){if(!a)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!a.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");const l={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:a};return h.request(l,r)},assignUserId({xAlgoliaUserID:a,assignUserIdParams:r},s){if(!a)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!r)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!r.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");const i="/1/clusters/mapping",c={},l={};a!==void 0&&(c["X-Algolia-User-ID"]=a.toString());const d={method:"POST",path:i,queryParameters:l,headers:c,data:r};return h.request(d,s)},batch({indexName:a,batchWriteParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!r)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!r.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");const d={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},batchAssignUserIds({xAlgoliaUserID:a,batchAssignUserIdsParams:r},s){if(!a)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!r)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!r.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!r.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");const i="/1/clusters/mapping/batch",c={},l={};a!==void 0&&(c["X-Algolia-User-ID"]=a.toString());const d={method:"POST",path:i,queryParameters:l,headers:c,data:r};return h.request(d,s)},batchDictionaryEntries({dictionaryName:a,batchDictionaryEntriesParams:r},s){if(!a)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!r)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!r.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");const d={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},browse({indexName:a,browseParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `browse`.");const d={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0};return h.request(d,s)},clearObjects({indexName:a},r){if(!a)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");const l={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},clearRules({indexName:a,forwardToReplicas:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `clearRules`.");const i="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.forwardToReplicas=r.toString());const d={method:"POST",path:i,queryParameters:l,headers:c};return h.request(d,s)},clearSynonyms({indexName:a,forwardToReplicas:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");const i="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.forwardToReplicas=r.toString());const d={method:"POST",path:i,queryParameters:l,headers:c};return h.request(d,s)},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},deleteApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");const l={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteBy({indexName:a,deleteByParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!r)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");const d={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},deleteIndex({indexName:a},r){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");const l={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteObject({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");const d={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},deleteRule({indexName:a,objectID:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");const c="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"DELETE",path:c,queryParameters:d,headers:l};return h.request(p,i)},deleteSource({source:a},r){if(!a)throw new Error("Parameter `source` is required when calling `deleteSource`.");const l={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteSynonym({indexName:a,objectID:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");const c="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"DELETE",path:c,queryParameters:d,headers:l};return h.request(p,i)},getApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `getApiKey`.");const l={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getAppTask({taskID:a},r){if(!a)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");const l={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getDictionaryLanguages(a){const c={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return h.request(c,a)},getDictionarySettings(a){const c={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return h.request(c,a)},getLogs({offset:a,length:r,indexName:s,type:i}={},c=void 0){const l="/1/logs",d={},p={};a!==void 0&&(p.offset=a.toString()),r!==void 0&&(p.length=r.toString()),s!==void 0&&(p.indexName=s.toString()),i!==void 0&&(p.type=i.toString());const g={method:"GET",path:l,queryParameters:p,headers:d};return h.request(g,c)},getObject({indexName:a,objectID:r,attributesToRetrieve:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getObject`.");const c="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.attributesToRetrieve=s.toString());const p={method:"GET",path:c,queryParameters:d,headers:l};return h.request(p,i)},getObjects(a,r){if(!a)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!a.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");const l={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},getRule({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRule`.");const d={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getSettings({indexName:a,getVersion:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getSettings`.");const i="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.getVersion=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},getSources(a){const c={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return h.request(c,a)},getSynonym({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");const d={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getTask({indexName:a,taskID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const d={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(a)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getTopUserIds(a){const c={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return h.request(c,a)},getUserId({userID:a},r){if(!a)throw new Error("Parameter `userID` is required when calling `getUserId`.");const l={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},hasPendingMappings({getClusters:a}={},r=void 0){const s="/1/clusters/mapping/pending",i={},c={};a!==void 0&&(c.getClusters=a.toString());const l={method:"GET",path:s,queryParameters:c,headers:i};return h.request(l,r)},listApiKeys(a){const c={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return h.request(c,a)},listClusters(a){const c={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return h.request(c,a)},listIndices({page:a,hitsPerPage:r}={},s=void 0){const i="/1/indexes",c={},l={};a!==void 0&&(l.page=a.toString()),r!==void 0&&(l.hitsPerPage=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},listUserIds({page:a,hitsPerPage:r}={},s=void 0){const i="/1/clusters/mapping",c={},l={};a!==void 0&&(l.page=a.toString()),r!==void 0&&(l.hitsPerPage=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},multipleBatch(a,r){if(!a)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!a.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");const l={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:a};return h.request(l,r)},operationIndex({indexName:a,operationIndexParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!r)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!r.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!r.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");const d={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},partialUpdateObject({indexName:a,objectID:r,attributesToUpdate:s,createIfNotExists:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!s)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");const l="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.createIfNotExists=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},removeUserId({userID:a},r){if(!a)throw new Error("Parameter `userID` is required when calling `removeUserId`.");const l={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},replaceSources({source:a},r){if(!a)throw new Error("Parameter `source` is required when calling `replaceSources`.");const l={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:a};return h.request(l,r)},restoreApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");const l={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},saveObject({indexName:a,body:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!r)throw new Error("Parameter `body` is required when calling `saveObject`.");const d={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},saveRule({indexName:a,objectID:r,rule:s,forwardToReplicas:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!s)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!s.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");if(!s.consequence)throw new Error("Parameter `rule.consequence` is required when calling `saveRule`.");const l="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.forwardToReplicas=i.toString());const g={method:"PUT",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},saveRules({indexName:a,rules:r,forwardToReplicas:s,clearExistingRules:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!r)throw new Error("Parameter `rules` is required when calling `saveRules`.");const l="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(a)),d={},p={};s!==void 0&&(p.forwardToReplicas=s.toString()),i!==void 0&&(p.clearExistingRules=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:r};return h.request(g,c)},saveSynonym({indexName:a,objectID:r,synonymHit:s,forwardToReplicas:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!s)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!s.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!s.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");const l="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.forwardToReplicas=i.toString());const g={method:"PUT",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},saveSynonyms({indexName:a,synonymHit:r,forwardToReplicas:s,replaceExistingSynonyms:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");const l="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(a)),d={},p={};s!==void 0&&(p.forwardToReplicas=s.toString()),i!==void 0&&(p.replaceExistingSynonyms=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:r};return h.request(g,c)},search(a,r){if(a&&Array.isArray(a)&&(a={requests:a.map(({params:p,...g})=>g.type==="facet"?{...g,...p,type:"facet"}:{...g,...p,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!a)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!a.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const l={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},searchDictionaryEntries({dictionaryName:a,searchDictionaryEntriesParams:r},s){if(!a)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!r)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!r.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");const d={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchForFacetValues({indexName:a,facetName:r,searchForFacetValuesRequest:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!r)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");const p={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(a)).replace("{facetName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{},useReadTransporter:!0,cacheable:!0};return h.request(p,i)},searchRules({indexName:a,searchRulesParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchRules`.");const d={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchSingleIndex({indexName:a,searchParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");const d={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchSynonyms({indexName:a,searchSynonymsParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");const d={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchUserIds(a,r){if(!a)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!a.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");const l={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},setDictionarySettings(a,r){if(!a)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!a.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");const l={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:a};return h.request(l,r)},setSettings({indexName:a,indexSettings:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!r)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");const c="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(a)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"PUT",path:c,queryParameters:d,headers:l,data:r};return h.request(p,i)},updateApiKey({key:a,apiKey:r},s){if(!a)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!r)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");const d={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)}}}function ji(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return cg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${kt}-${e}`}),K()]}),...n})}const ug=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:kt,searchClient:ji},Symbol.toStringTag,{value:"Module"}));var ma="1.41.0",ro=["eu","us"];function lg(e){return[{url:"data.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function dg(e){return e.type==="onDemand"}function hg(e){return e.type==="schedule"}function fg(e){return e.type==="subscription"}function pg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:lg(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Ingestion",version:ma}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},async chunkedPush({indexName:r,objects:s,action:i="addObject",waitForTasks:c,batchSize:l=1e3,referenceIndexName:d},p){let g=[],y=0;const P=[],w=Math.floor(l/10)||l,v=s.entries();for(const[m,b]of v)if(g.push(b),(g.length===l||m===s.length-1)&&(P.push(await this.push({indexName:r,pushTaskPayload:{action:i,records:g},referenceIndexName:d},p)),g=[]),c&&P.length>0&&(P.length%w===0||m===s.length-1)){for(const x of P.slice(y,y+w)){if(!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let _=0;await Be({func:async()=>{if(x.eventID===void 0||!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:x.runID,eventID:x.eventID}).catch(A=>{if(A.status!==404)throw A})},validate:A=>A!==void 0,aggregator:()=>_+=1,error:{validate:()=>_>=50,message:()=>`The maximum number of retries exceeded. (${_}/50)`},timeout:()=>Math.min(_*500,5e3)})}y+=w}return P},createAuthentication(r,s){if(!r)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!r.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!r.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!r.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const d={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:r};return a.request(d,s)},createDestination(r,s){if(!r)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!r.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!r.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!r.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const d={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:r};return a.request(d,s)},createSource(r,s){if(!r)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!r.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!r.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");const d={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTask(r,s){if(!r)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!r.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!r.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!r.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const d={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTaskV1(r,s){if(!r)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!r.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!r.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!r.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!r.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");const d={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTransformation(r,s){if(!r)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");const d={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteAuthentication({authenticationID:r},s){if(!r)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const d={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteDestination({destinationID:r},s){if(!r)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const d={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteSource({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const d={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const d={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");const d={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTransformation({transformationID:r},s){if(!r)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const d={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},disableTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const d={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},disableTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");const d={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},enableTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const d={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},enableTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");const d={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getAuthentication({authenticationID:r},s){if(!r)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const d={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getDestination({destinationID:r},s){if(!r)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const d={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getEvent({runID:r,eventID:s},i){if(!r)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!s)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const p={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(r)).replace("{eventID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(p,i)},getRun({runID:r},s){if(!r)throw new Error("Parameter `runID` is required when calling `getRun`.");const d={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getSource({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const d={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const d={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");const d={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTransformation({transformationID:r},s){if(!r)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const d={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},listAuthentications({itemsPerPage:r,page:s,type:i,platform:c,sort:l,order:d}={},p=void 0){const g="/1/authentications",y={},P={};r!==void 0&&(P.itemsPerPage=r.toString()),s!==void 0&&(P.page=s.toString()),i!==void 0&&(P.type=i.toString()),c!==void 0&&(P.platform=c.toString()),l!==void 0&&(P.sort=l.toString()),d!==void 0&&(P.order=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},listDestinations({itemsPerPage:r,page:s,type:i,authenticationID:c,transformationID:l,sort:d,order:p}={},g=void 0){const y="/1/destinations",P={},w={};r!==void 0&&(w.itemsPerPage=r.toString()),s!==void 0&&(w.page=s.toString()),i!==void 0&&(w.type=i.toString()),c!==void 0&&(w.authenticationID=c.toString()),l!==void 0&&(w.transformationID=l.toString()),d!==void 0&&(w.sort=d.toString()),p!==void 0&&(w.order=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},listEvents({runID:r,itemsPerPage:s,page:i,status:c,type:l,sort:d,order:p,startDate:g,endDate:y},P){if(!r)throw new Error("Parameter `runID` is required when calling `listEvents`.");const w="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(r)),v={},m={};s!==void 0&&(m.itemsPerPage=s.toString()),i!==void 0&&(m.page=i.toString()),c!==void 0&&(m.status=c.toString()),l!==void 0&&(m.type=l.toString()),d!==void 0&&(m.sort=d.toString()),p!==void 0&&(m.order=p.toString()),g!==void 0&&(m.startDate=g.toString()),y!==void 0&&(m.endDate=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listRuns({itemsPerPage:r,page:s,status:i,type:c,taskID:l,sort:d,order:p,startDate:g,endDate:y}={},P=void 0){const w="/1/runs",v={},m={};r!==void 0&&(m.itemsPerPage=r.toString()),s!==void 0&&(m.page=s.toString()),i!==void 0&&(m.status=i.toString()),c!==void 0&&(m.type=c.toString()),l!==void 0&&(m.taskID=l.toString()),d!==void 0&&(m.sort=d.toString()),p!==void 0&&(m.order=p.toString()),g!==void 0&&(m.startDate=g.toString()),y!==void 0&&(m.endDate=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listSources({itemsPerPage:r,page:s,type:i,authenticationID:c,sort:l,order:d}={},p=void 0){const g="/1/sources",y={},P={};r!==void 0&&(P.itemsPerPage=r.toString()),s!==void 0&&(P.page=s.toString()),i!==void 0&&(P.type=i.toString()),c!==void 0&&(P.authenticationID=c.toString()),l!==void 0&&(P.sort=l.toString()),d!==void 0&&(P.order=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},listTasks({itemsPerPage:r,page:s,action:i,enabled:c,sourceID:l,sourceType:d,destinationID:p,triggerType:g,withEmailNotifications:y,sort:P,order:w}={},v=void 0){const m="/2/tasks",b={},x={};r!==void 0&&(x.itemsPerPage=r.toString()),s!==void 0&&(x.page=s.toString()),i!==void 0&&(x.action=i.toString()),c!==void 0&&(x.enabled=c.toString()),l!==void 0&&(x.sourceID=l.toString()),d!==void 0&&(x.sourceType=d.toString()),p!==void 0&&(x.destinationID=p.toString()),g!==void 0&&(x.triggerType=g.toString()),y!==void 0&&(x.withEmailNotifications=y.toString()),P!==void 0&&(x.sort=P.toString()),w!==void 0&&(x.order=w.toString());const _={method:"GET",path:m,queryParameters:x,headers:b};return a.request(_,v)},listTasksV1({itemsPerPage:r,page:s,action:i,enabled:c,sourceID:l,destinationID:d,triggerType:p,sort:g,order:y}={},P=void 0){const w="/1/tasks",v={},m={};r!==void 0&&(m.itemsPerPage=r.toString()),s!==void 0&&(m.page=s.toString()),i!==void 0&&(m.action=i.toString()),c!==void 0&&(m.enabled=c.toString()),l!==void 0&&(m.sourceID=l.toString()),d!==void 0&&(m.destinationID=d.toString()),p!==void 0&&(m.triggerType=p.toString()),g!==void 0&&(m.sort=g.toString()),y!==void 0&&(m.order=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listTransformations({itemsPerPage:r,page:s,sort:i,order:c,type:l}={},d=void 0){const p="/1/transformations",g={},y={};r!==void 0&&(y.itemsPerPage=r.toString()),s!==void 0&&(y.page=s.toString()),i!==void 0&&(y.sort=i.toString()),c!==void 0&&(y.order=c.toString()),l!==void 0&&(y.type=l.toString());const P={method:"GET",path:p,queryParameters:y,headers:g};return a.request(P,d)},push({indexName:r,pushTaskPayload:s,watch:i,referenceIndexName:c},l){if(!r)throw new Error("Parameter `indexName` is required when calling `push`.");if(!s)throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");if(!s.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");if(!s.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");const d="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(r)),p={},g={};i!==void 0&&(g.watch=i.toString()),c!==void 0&&(g.referenceIndexName=c.toString());const y={method:"POST",path:d,queryParameters:g,headers:p,data:s};return l={timeouts:{connect:18e4,read:18e4,write:18e4,...l?.timeouts}},a.request(y,l)},pushTask({taskID:r,pushTaskPayload:s,watch:i},c){if(!r)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!s)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!s.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!s.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");const l="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.watch=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:s};return c={timeouts:{connect:18e4,read:18e4,write:18e4,...c?.timeouts}},a.request(g,c)},replaceTask({taskID:r,taskReplace:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `replaceTask`.");if(!s)throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");if(!s.destinationID)throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");if(!s.action)throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");const p={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},runSource({sourceID:r,runSourcePayload:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `runSource`.");const p={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},runTask({taskID:r,runTaskPayload:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `runTask`.");const p={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},runTaskV1({taskID:r,runTaskPayload:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");const p={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},searchAuthentications(r,s){if(!r)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!r.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const d={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchDestinations(r,s){if(!r)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!r.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const d={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchSources(r,s){if(!r)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!r.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const d={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTasks(r,s){if(!r)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!r.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const d={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTasksV1(r,s){if(!r)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!r.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");const d={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTransformations(r,s){if(!r)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!r.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");const d={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},triggerDockerSourceDiscover({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const d={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},a.request(d,s)},tryTransformation(r,s){if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");const d={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:r};return a.request(d,s)},tryTransformationBeforeUpdate({transformationID:r,transformationTry:s},i){if(!r)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!s)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!s.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");const p={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateAuthentication({authenticationID:r,authenticationUpdate:s},i){if(!r)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!s)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const p={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateDestination({destinationID:r,destinationUpdate:s},i){if(!r)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!s)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const p={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateSource({sourceID:r,sourceUpdate:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!s)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const p={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTask({taskID:r,taskUpdate:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!s)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const p={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTaskV1({taskID:r,taskUpdate:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!s)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");const p={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTransformation({transformationID:r,transformationCreate:s},i){if(!r)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!s)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!s.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");const p={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},validateSource(r,s=void 0){const d={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:r||{}};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},a.request(d,s)},validateSourceBeforeUpdate({sourceID:r,sourceUpdate:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!s)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const p={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return i={timeouts:{connect:18e4,read:18e4,write:18e4,...i?.timeouts}},a.request(p,i)}}}function Sn(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!ro.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${ro.join(", ")}`);return pg({appId:e,apiKey:t,region:n,timeouts:{connect:25e3,read:25e3,write:25e3},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ma}-${e}`}),K()]}),...o})}const gg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ma,ingestionClient:Sn,isOnDemandTrigger:dg,isScheduleTrigger:hg,isSubscriptionTrigger:fg},Symbol.toStringTag,{value:"Module"}));var ya="1.41.0";function mg(){return[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function yg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:mg(),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Monitoring",version:ya}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},getClusterIncidents({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const l={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getClusterStatus({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const l={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getIncidents(a){const c={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return h.request(c,a)},getIndexingTime({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const l={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getLatency({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const l={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getMetrics({metric:a,period:r},s){if(!a)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!r)throw new Error("Parameter `period` is required when calling `getMetrics`.");const d={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(a)).replace("{period}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getReachability({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const l={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getServers(a){const c={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return h.request(c,a)},getStatus(a){const c={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return h.request(c,a)}}}function Li(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return yg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ya}-${e}`}),K()]}),...n})}const wg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ya,monitoringClient:Li},Symbol.toStringTag,{value:"Module"}));var wa="5.41.0";function Pg(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(Ci([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function qg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:Pg(e),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Recommend",version:wa}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},batchRecommendRules({indexName:a,model:r,recommendRule:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");const p={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return h.request(p,i)},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},deleteRecommendRule({indexName:a,model:r,objectID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!s)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const p={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendRule({indexName:a,model:r,objectID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!s)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const p={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendStatus({indexName:a,model:r,taskID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!s)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const p={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{taskID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendations(a,r){if(a&&Array.isArray(a)&&(a={requests:a}),!a)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!a.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const l={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},searchRecommendRules({indexName:a,model:r,searchRecommendRulesParams:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const p={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{},useReadTransporter:!0,cacheable:!0};return h.request(p,i)}}}function Ui(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return qg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${wa}-${e}`}),K()]}),...n})}const vg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:wa,recommendClient:Ui},Symbol.toStringTag,{value:"Module"}));var Mi=Object.defineProperty,bg=Object.getOwnPropertyDescriptor,Eg=Object.getOwnPropertyNames,Sg=Object.prototype.hasOwnProperty,Ni=(e,t)=>{for(var n in t)Mi(e,n,{get:t[n],enumerable:!0})},Tg=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Eg(t))!Sg.call(e,u)&&u!==n&&Mi(e,u,{get:()=>t[u],enumerable:!(o=bg(t,u))||o.enumerable});return e},we=(e,t,n)=>(Tg(e,t,"default"),n),$i={};Ni($i,{algoliasearch:()=>Tn,apiClientVersion:()=>kt});var fe={};Ni(fe,{apiClientVersion:()=>kt});we(fe,Gp);we(fe,Kp);we(fe,Jp);we(fe,eg);we(fe,ng);we(fe,og);we(fe,ug);we(fe,gg);we(fe,wg);we(fe,vg);we($i,fe);function Tn(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");const o=ji(e,t,n);let u;if(n?.transformation){if(!n.transformation.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");u=Sn(e,t,n.transformation.region,n)}return{...o,async saveObjectsWithTransformation({indexName:f,objects:h,waitForTasks:a},r){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return u.chunkedPush({indexName:f,objects:h,action:"addObject",waitForTasks:a},r)},async partialUpdateObjectsWithTransformation({indexName:f,objects:h,createIfNotExists:a,waitForTasks:r},s){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return u.chunkedPush({indexName:f,objects:h,action:a?"partialUpdateObject":"partialUpdateObjectNoCreate",waitForTasks:r},s)},async replaceAllObjectsWithTransformation({indexName:f,objects:h,batchSize:a,scopes:r},s){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");const i=Math.floor(Math.random()*1e6)+1e5,c=`${f}_tmp_${i}`;r===void 0&&(r=["settings","rules","synonyms"]);try{let l=await this.operationIndex({indexName:f,operationIndexParams:{operation:"copy",destination:c,scope:r}},s);const d=await u.chunkedPush({indexName:c,objects:h,waitForTasks:!0,batchSize:a,referenceIndexName:f},s);await this.waitForTask({indexName:c,taskID:l.taskID}),l=await this.operationIndex({indexName:f,operationIndexParams:{operation:"copy",destination:c,scope:r}},s),await this.waitForTask({indexName:c,taskID:l.taskID});const p=await this.operationIndex({indexName:c,operationIndexParams:{operation:"move",destination:f}},s);return await this.waitForTask({indexName:c,taskID:p.taskID}),{copyOperationResponse:l,watchResponses:d,moveOperationResponse:p}}catch(l){throw await this.deleteIndex({indexName:c}),l}},get _ua(){return o.transporter.algoliaAgent.value},initAbtesting:f=>Ai(f.appId||e,f.apiKey||t,f.region,f.options),initAbtestingV3:f=>_i(f.appId||e,f.apiKey||t,f.region,f.options),initAnalytics:f=>Ri(f.appId||e,f.apiKey||t,f.region,f.options),initIngestion:f=>Sn(f.appId||e,f.apiKey||t,f.region,f.options),initInsights:f=>Oi(f.appId||e,f.apiKey||t,f.region,f.options),initMonitoring:(f={})=>Li(f.appId||e,f.apiKey||t,f.options),initPersonalization:f=>ki(f.appId||e,f.apiKey||t,f.region,f.options),initQuerySuggestions:f=>Di(f.appId||e,f.apiKey||t,f.region,f.options),initRecommend:(f={})=>Ui(f.appId||e,f.apiKey||t,f.options)}}const no=ee("ALGOLIA_APP_ID")||"",ao=ee("ALGOLIA_API_KEY")||"",so=ee("ALGOLIA_BLOG_INDEX")||"decentraland-blog",xg=gr.injectEndpoints({endpoints:e=>({searchBlogPosts:e.query({queryFn:async({query:t,hitsPerPage:n=10,page:o=0})=>{try{if(t.length<3)return{data:{results:[],total:0,hasMore:!1}};const f=await Tn(no,ao).searchSingleIndex({indexName:so,searchParams:{query:t,hitsPerPage:n,page:o}}),h=f.hits||[];return{data:{results:await Promise.all(h.map(async r=>{const i=r.imageObject?.sys?.id||"",l=r.categoryObject?.sys?.id||"",[d,p]=await Promise.all([xs(i),Cs(l)]);return{url:`/blog/${p}/${r.id}`,image:d,title:r._highlightResult?.title?.value||r.title,description:r._highlightResult?.description?.value||r.description}})),total:f.nbHits||0,hasMore:(o+1)*n<(f.nbHits||0)}}}catch(u){return{error:{status:"CUSTOM_ERROR",error:u instanceof Error?u.message:"Unknown error"}}}},providesTags:(t,n,o)=>[{type:"SearchResults",id:o.query}]}),searchBlog:e.query({queryFn:async({query:t,hitsPerPage:n=10,page:o=0})=>{try{if(t.length<3)return{data:[]};const h=(await Tn(no,ao).searchSingleIndex({indexName:so,searchParams:{query:t,hitsPerPage:n,page:o}})).hits||[];return{data:await Promise.all(h.map(async r=>{const i=r.imageObject?.sys?.id||"",l=r.categoryObject?.sys?.id||"",[d,p]=await Promise.all([xs(i),Cs(l)]);return{id:r.id,categoryId:p,url:`/blog/${p}/${r.id}`,image:d,highlightedTitle:r._highlightResult?.title?.value||r.title,highlightedDescription:r._highlightResult?.description?.value||r.description}}))}}catch(u){return{error:{status:"CUSTOM_ERROR",error:u instanceof Error?u.message:"Unknown error"}}}},providesTags:(t,n,o)=>[{type:"SearchResults",id:o.query}]})}),overrideExisting:!1}),{useSearchBlogPostsQuery:Cg,useSearchBlogQuery:Ig}=xg,{Link:Bi}=await R("react-router-dom"),{Box:ce,dclColors:Pa,styled:ne}=await R("decentraland-ui2"),_g=ne(ce,{shouldForwardProp:e=>e!=="$hasResults"})(({theme:e,$hasResults:t})=>({position:"relative",width:"auto",zIndex:t?e.zIndex.modal:1,[e.breakpoints.down("sm")]:{width:"100%"}})),Ag=ne(ce)(({theme:e})=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:e.zIndex.modal-1})),Rg=ne(ce)(()=>({position:"relative",display:"flex",alignItems:"center",width:"100%"})),Og=ne(ce)(({theme:e})=>({width:"300px",padding:`${e.spacing(1.5)} ${e.spacing(5)} ${e.spacing(1.5)} ${e.spacing(2)}`,border:"1px solid rgba(255, 255, 255, 0.15)",borderRadius:e.spacing(1),backgroundColor:"rgba(255, 255, 255, 0.05)",color:e.palette.text.primary,fontSize:"15px",outline:"none",transition:"all 200ms ease","&::placeholder":{color:"rgba(255, 255, 255, 0.5)"},"&:focus":{backgroundColor:"rgba(255, 255, 255, 0.08)",borderColor:"rgba(255, 255, 255, 0.25)"},"@media (max-width: 1450px)":{width:"100%",marginBottom:e.spacing(2)}})).withComponent("input"),kg=ne(ce)(({theme:e})=>({position:"absolute",right:e.spacing(1.5),top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"rgba(255, 255, 255, 0.5)",fontSize:"24px",cursor:"pointer",padding:e.spacing(.5),lineHeight:1,transition:"color 200ms ease","&:hover":{color:e.palette.text.primary}})).withComponent("button"),Dg=ne(ce)(({theme:e})=>({position:"absolute",top:`calc(100% + ${e.spacing(1)})`,right:0,width:"500px",maxWidth:"90vw",backgroundColor:e.palette.background.paper,borderRadius:e.spacing(1.5),boxShadow:"0 8px 24px rgba(0, 0, 0, 0.4)",listStyleType:"none",margin:0,padding:e.spacing(1),maxHeight:"600px",overflowY:"auto",zIndex:e.zIndex.modal+1,"@media (max-width: 1450px)":{width:`calc(100vw - ${e.spacing(6)})`,left:0,right:"auto"}})).withComponent("ul"),jg=ne(ce,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({borderRadius:e.spacing(1),backgroundColor:t?e.palette.action.hover:"transparent",transition:"background-color 200ms ease",marginBottom:e.spacing(.5),"&:last-child":{marginBottom:0}})).withComponent("li"),Lg=ne(Bi)(({theme:e})=>({display:"flex",padding:e.spacing(1.5),textDecoration:"none",color:"inherit",gap:e.spacing(1.5)})),Ug=ne(ce,{shouldForwardProp:e=>e!=="$image"})(({theme:e,$image:t})=>({width:"80px",height:"80px",flexShrink:0,borderRadius:e.spacing(1),backgroundColor:"rgba(255, 255, 255, 0.05)",backgroundImage:t?`url(${t})`:"none",backgroundSize:"cover",backgroundPosition:"center"})),Mg=ne(ce)(({theme:e})=>({flex:1,display:"flex",flexDirection:"column",gap:e.spacing(.5),overflow:"hidden"})),Ng=ne(ce)(({theme:e})=>({color:e.palette.text.primary,fontSize:"15px",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& em":{fontStyle:"normal",color:Pa.base.primary}})),$g=ne(ce)(({theme:e})=>({color:e.palette.text.secondary,fontSize:"13px",lineHeight:"1.5",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical","& em":{fontStyle:"normal",color:Pa.base.primary}})),Jr=ne(ce)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:`${e.spacing(5)} ${e.spacing(2.5)}`,textAlign:"center",color:e.palette.text.secondary,"& strong":{color:e.palette.text.primary,fontSize:"17px",marginBottom:e.spacing(1)},"& span":{fontSize:"15px"}})).withComponent("li"),oo=ne(ce)(({theme:e})=>({fontSize:"48px",marginBottom:e.spacing(2),opacity:.5})),Bg=ne(ce,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({borderRadius:e.spacing(1),backgroundColor:t?e.palette.action.hover:"transparent",transition:"background-color 200ms ease",marginTop:e.spacing(.5)})).withComponent("li"),Hg=ne(Bi)(({theme:e})=>({display:"block",padding:e.spacing(1.5),textAlign:"center",color:Pa.base.primary,fontSize:"15px",fontWeight:500,textDecoration:"none",transition:"opacity 200ms ease","&:hover":{opacity:.8}})),{useCallback:io,useEffect:Qg,useState:Xr}=await R("react"),{useNavigate:Fg}=await R("react-router-dom"),{useTranslation:Gg}=await R("@dcl/hooks");function Wg(e,t){if(typeof e=="object"&&e!==null&&"error"in e){const n=e.error;if(typeof n=="string")return n}return t}const zg=({placeholder:e,onClose:t})=>{const{t:n}=Gg(),o=Fg(),[u,f]=Xr(""),[h,a]=Xr(-1),[r,s]=Xr("");Qg(()=>{const w=setTimeout(()=>{s(u)},300);return()=>clearTimeout(w)},[u]);const{data:i=[],isLoading:c,error:l,isError:d}=Ig({query:r,hitsPerPage:5,page:0},{skip:r.trim().length<=2}),p=io(()=>{f(""),a(-1),t?.()},[t]),g=io(w=>{const v=i.length>3?4:i.length;if(w.key==="ArrowUp")w.preventDefault(),a(m=>m<=0?v:m-1);else if(w.key==="ArrowDown")w.preventDefault(),a(m=>m>=v?0:m+1);else if(w.key==="Enter"){if(w.preventDefault(),h===4||h===-1)o(`/blog/search?q=${encodeURIComponent(u)}`);else if(h>=0&&i[h]){const m=i[h];o(`/blog/${m.categoryId}/${m.id}`)}p()}else w.key==="Escape"&&p()},[u,h,i,o,p]),y=u.trim().length>2,P=i.length>0;return q.jsxs(_g,{$hasResults:y,children:[y&&q.jsx(Ag,{onClick:p}),q.jsxs(Rg,{children:[q.jsx(Og,{type:"text",value:u,onChange:w=>f(w.target.value),onKeyDown:g,placeholder:e||n("search.placeholder")}),u&&q.jsx(kg,{onClick:p,"aria-label":n("search.clear"),children:"×"})]}),y&&q.jsxs(Dg,{children:[c&&q.jsx(Jr,{children:q.jsx("span",{children:n("search.searching")})}),!c&&d&&q.jsxs(Jr,{children:[q.jsx(oo,{children:"⚠️"}),q.jsx("strong",{children:n("search.error")}),q.jsx("span",{children:Wg(l,n("error.generic"))})]}),!c&&!d&&!P&&q.jsxs(Jr,{children:[q.jsx(oo,{children:"🔍"}),q.jsx("strong",{children:n("search.no_matches")}),q.jsx("span",{children:n("search.try_something_else")})]}),!c&&!d&&P&&i.slice(0,4).map((w,v)=>q.jsx(jg,{$selected:v===h,onMouseEnter:()=>a(v),children:q.jsxs(Lg,{to:`/blog/${w.categoryId}/${w.id}`,onClick:p,children:[q.jsx(Ug,{$image:w.image}),q.jsxs(Mg,{children:[q.jsx(Ng,{dangerouslySetInnerHTML:{__html:w.highlightedTitle}}),q.jsx($g,{dangerouslySetInnerHTML:{__html:w.highlightedDescription}})]})]})},w.id)),!c&&!d&&i.length>4&&q.jsx(Bg,{$selected:h===4,onMouseEnter:()=>a(4),children:q.jsx(Hg,{to:`/blog/search?q=${encodeURIComponent(u)}`,onClick:p,children:n("search.see_more_results")})})]})]})},{Link:Kg}=await R("react-router-dom"),{Box:dt,dclColors:Vg,styled:Je}=await R("decentraland-ui2"),Yg=Je(dt)(()=>({width:"100%"})),Jg=Je(dt)(({theme:e})=>({paddingTop:e.spacing(2),height:"84px",position:"relative",borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex","@media (max-width: 1450px)":{height:"auto"}})),Xg=Je(dt)(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:"0 auto",padding:`0 ${e.spacing(3)}`,"@media (max-width: 1450px)":{flexDirection:"column-reverse",alignItems:"flex-start"}})),Zg=Je(dt)(({theme:e})=>({overflowX:"auto",overflowY:"hidden",width:"auto","@media (max-width: 1450px)":{width:"100%",paddingBottom:e.spacing(1)}})).withComponent("nav"),em=Je(dt)(()=>({display:"flex",flexDirection:"row",listStyleType:"none",margin:0,padding:0,minWidth:"210px"})).withComponent("ul"),co=Je(dt)(({theme:e})=>({marginRight:e.spacing(4),whiteSpace:"nowrap"})).withComponent("li"),uo=Je(Kg,{shouldForwardProp:e=>e!=="$active"})(({theme:e,$active:t})=>({color:e.palette.text.primary,display:"flex",alignItems:"center",fontSize:"17px",fontWeight:t?700:400,height:"64px",padding:0,position:"relative",textDecoration:"none",WebkitTapHighlightColor:"transparent","&::after":{content:'""',position:"absolute",height:"1px",backgroundColor:Vg.base.primary,left:0,right:0,bottom:0,opacity:t?1:0,transition:"opacity 250ms ease"},"&:hover::after":{opacity:1}})),{useCallback:tm,useMemo:rm}=await R("react"),{useLocation:nm}=await R("react-router-dom"),{useTranslation:am}=await R("@dcl/hooks"),lo=({active:e})=>{const{t}=am(),n=nm(),{data:o=[]}=Qh(),u=rm(()=>o.filter(h=>h.isShownInMenu),[o]),f=tm(h=>e?e==="all_articles"&&h==="/blog"?!0:`/blog/${e}`===h:n.pathname===h,[e,n.pathname]);return q.jsx(Yg,{children:q.jsx(Jg,{children:q.jsxs(Xg,{children:[q.jsx(Zg,{children:q.jsxs(em,{children:[q.jsx(co,{children:q.jsx(uo,{to:"/blog",$active:f("/blog")||e==="all_articles",children:t("blog.all_articles")})}),u.map(h=>q.jsx(co,{children:q.jsx(uo,{to:`/blog/${h.slug}`,$active:f(`/blog/${h.slug}`),children:h.title})},h.id))]})}),q.jsx(zg,{})]})})})},{createContext:sm,useContext:BP}=await R("react"),om=sm(!0),{Box:Hi,styled:Qi}=await R("decentraland-ui2"),im=Qi(Hi)(()=>({minHeight:"100vh",display:"flex",flexDirection:"column",paddingTop:"66px"})),ho=Qi(Hi)(({theme:e})=>({flex:1,padding:e.spacing(5,0,2,0),maxWidth:e.spacing(133),margin:"0 auto",[e.breakpoints.down("md")]:{padding:e.spacing(5,2,2,2)}})),{useCallback:fo,useContext:cm,useMemo:po}=await R("react"),{useLocation:um}=await R("react-router-dom"),{usePageTracking:lm}=await R("@dcl/hooks"),{ChainId:Vt,Network:go}=await R("@dcl/schemas"),{Footer:dm,FooterLanding:hm,Navbar:fm,NavbarPages:pm,SupportedLanguage:gm}=await R("decentraland-ui2"),mo=ci.is(Jt.PRODUCTION),yo=e=>{if(e===null)return;const t=Number(e);return Number.isFinite(t)?t:void 0};function de(e){const{children:t,activeCategory:n,banner:o,showBlogNavigation:u=!1,relatedPosts:f}=e,h=cm(om),a=um(),{address:r,isConnected:s,isConnecting:i,isDisconnecting:c,disconnect:l}=ni();lm(a.pathname);const{identity:d}=yl(),{notificationProps:p}=Ep({identity:d,isConnected:s,locale:"en"}),{balance:g}=ls({tokenAddress:ee("MANA_TOKEN_ADDRESS_ETHEREUM"),chainId:mo?Vt.ETHEREUM_MAINNET:Vt.ETHEREUM_SEPOLIA}),{balance:y}=ls({tokenAddress:ee("MANA_TOKEN_ADDRESS_MATIC"),chainId:mo?Vt.MATIC_MAINNET:Vt.MATIC_AMOY}),{data:P}=kh(r??void 0,{skip:!r}),w=P?.avatars?.[0],v=po(()=>{if(!s)return{};const _={},A=yo(g),T=yo(y);return A!==void 0&&(_[go.ETHEREUM]=A),T!==void 0&&(_[go.MATIC]=T),_},[s,g,y]),m=fo(()=>{Si()},[]),b=fo(()=>{l()},[l]),x=po(()=>({activePage:pm.LEARN,isSignedIn:s,isSigningIn:i,isDisconnecting:c,address:r||void 0,avatar:w,manaBalances:v,notifications:p,onClickSignIn:m,onClickSignOut:b,onClickNavbarItem:_=>{const A=_.currentTarget;A?.href&&(window.location.href=A.href)}}),[s,i,c,r,w,v,p,m,b]);return h?q.jsxs(im,{children:[q.jsx(fm,{...x}),u&&q.jsx(lo,{active:n}),o,q.jsx(ho,{children:t}),f,q.jsx(hm,{}),q.jsx(dm,{languages:[{code:gm.EN,name:"English",flag:"🇺🇸"}],hideSocialNetworks:!0})]}):q.jsxs(q.Fragment,{children:[u&&q.jsx(lo,{active:n}),o,q.jsx(ho,{children:t}),f]})}function mm(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Fi=Mo,ym=mm(Fi);function wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var Pm=!!(typeof window<"u"&&window.document&&window.document.createElement);function qm(e,t,n){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof n<"u"&&typeof n!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function o(u){return u.displayName||u.name||"Component"}return function(f){if(typeof f!="function")throw new Error("Expected WrappedComponent to be a React component.");var h=[],a;function r(){a=e(h.map(function(i){return i.props})),s.canUseDOM?t(a):n&&(a=n(a))}var s=function(i){wm(c,i);function c(){return i.apply(this,arguments)||this}c.peek=function(){return a},c.rewind=function(){if(c.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var p=a;return a=void 0,h=[],p};var l=c.prototype;return l.UNSAFE_componentWillMount=function(){h.push(this),r()},l.componentDidUpdate=function(){r()},l.componentWillUnmount=function(){var p=h.indexOf(this);h.splice(p,1),r()},l.render=function(){return ym.createElement(f,this.props)},c}(Fi.PureComponent);return wo(s,"displayName","SideEffect("+o(f)+")"),wo(s,"canUseDOM",Pm),s}}var vm=qm;const bm=Rt(vm);var Em=typeof Element<"u",Sm=typeof Map=="function",Tm=typeof Set=="function",xm=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function sr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,u;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!sr(e[o],t[o]))return!1;return!0}var f;if(Sm&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(f=e.entries();!(o=f.next()).done;)if(!t.has(o.value[0]))return!1;for(f=e.entries();!(o=f.next()).done;)if(!sr(o.value[1],t.get(o.value[0])))return!1;return!0}if(Tm&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(f=e.entries();!(o=f.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(xm&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(u=Object.keys(e),n=u.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,u[o]))return!1;if(Em&&e instanceof Element)return!1;for(o=n;o--!==0;)if(!((u[o]==="_owner"||u[o]==="__v"||u[o]==="__o")&&e.$$typeof)&&!sr(e[u[o]],t[u[o]]))return!1;return!0}return e!==e&&t!==t}var Cm=function(t,n){try{return sr(t,n)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const Im=Rt(Cm);/*
|
|
1
|
+
const __vite__fileDeps=["assets/index-BTtTX-5z.js","assets/index-DJ7GgcJ9.js","assets/index-BAhlRyDG.js","assets/thirdweb-BDeAJ4oX.js","assets/utils-CozXUO91.js","assets/withCache-DYumIHzL.js","assets/json-BHzNJmTy.js","assets/estimate-gas-BG6-Kqmv.js","assets/preload-helper-CO43ckIt.js","assets/__federation_fn_import-BOkD8n2P.js","assets/hex-B0Rx0hII.js","assets/op-gas-fee-reducer-CfxMcvXl.js","assets/signing-fd2Rp8P0.js","assets/fee-data-B6rXatSB.js","assets/rpc-ti0b0r_u.js","assets/encode-CKwvXR_N.js","assets/wait-for-tx-receipt-tKiSk-wy.js","assets/sleep-mAKpSMLY.js","assets/eth_estimateGas-C2ENZ_HR.js","assets/eth_getStorageAt-D61Vetgg.js","assets/eth_getTransactionCount-DWnnw2mX.js","assets/decimals-Bnh8vaOd.js","assets/decimals-DKeocaSS.js","assets/zora-sepolia-DNJ2DQat.js","assets/send-batch-transaction-BLPmGB9M.js","assets/wallets-z86vtyeQ.js","assets/store-DOLZnwHk.js","assets/publicKeyToAddress-CxEKPAKT.js","assets/utils-C7urdXtO.js","assets/events-B5inrCVE.js","assets/_commonjsHelpers-C4iS2aBk.js","assets/index.es-D3pP9hN4.js","assets/index-nibyPLVP.js","assets/ethereum-dN7ENYl_.js","assets/chains-D88UzVoE.js","assets/index-D4ZoaFaW.js","assets/createBundlerClient-LPapq7hJ.js","assets/uid-QS91sMSf.js","assets/createClient-BLcyKw9o.js","assets/hooks.module-Cpp96UEK.js","assets/index-BozJS3za.js","assets/___vite-browser-external_commonjs-proxy-BqV5D26a.js","assets/index-6E4L_h32.js","assets/inherits_browser-BlmhoU4v.js","assets/index-Tsk25L8E.js","assets/tslib.es6-DbvBTznf.js","assets/index.es-CAWfybMT.js","assets/index.es-D5YKsq2-.js"],__vite__mapDeps=i=>i.map(i=>__vite__fileDeps[i]);
|
|
2
|
+
import{importShared as R}from"./__federation_fn_import-BOkD8n2P.js";import{j as q}from"./jsx-runtime-DncYoG30.js";import{c as Ec,E as Jt,u as Uo,r as Sc,i as Tc,d as xc}from"./X-Duht4Iz6.js";import{c as Ut,a as Rt}from"./_commonjsHelpers-C4iS2aBk.js";import{r as Mo}from"./index-Dy0yjznp.js";import{c as se,d as Cc}from"./rich-text-react-renderer.es5-D_tE7AHo.js";import{w as Ra,s as Ic,t as Oa,j as _c,u as No,g as Ac,r as Rc,b as Oc,m as kc}from"./redux-BNDF-Lt-.js";import{d as wr}from"./defineChain-7I0Ce1VT.js";import{_ as Ue}from"./preload-helper-CO43ckIt.js";import{c as On,C as kn,P as ka,i as Dc,S as $o,M as jc,n as le,m as Da,a as je,h as Bo,Q as Lc,b as ja,f as Uc,o as La,r as Ua,d as Mc,e as Ma,g as Na,p as $a,s as Nc,j as $c}from"./QueryClientProvider-CaylTeJU.js";var Bc=class extends Error{issues;constructor(e){super(e[0].message),this.name="SchemaError",this.issues=e}},Ho=(e=>(e.uninitialized="uninitialized",e.pending="pending",e.fulfilled="fulfilled",e.rejected="rejected",e))(Ho||{});function Ba(e){return{status:e,isUninitialized:e==="uninitialized",isLoading:e==="pending",isSuccess:e==="fulfilled",isError:e==="rejected"}}const{createAction:ct,createSlice:Ze,createSelector:Hc,createAsyncThunk:Ha,combineReducers:Qc,createNextState:Dn,isAnyOf:ir,isAllOf:kr,isAction:Fc,isPending:Qo,isRejected:jn,isFulfilled:Ve,isRejectedWithValue:Ln,isAsyncThunkAction:Qa,prepareAutoBatched:ft,SHOULD_AUTOBATCH:Fo,isPlainObject:xt,nanoid:Go}=await R("@reduxjs/toolkit");var Fa=xt;function Un(e,t){if(e===t||!(Fa(e)&&Fa(t)||Array.isArray(e)&&Array.isArray(t)))return t;const n=Object.keys(t),o=Object.keys(e);let u=n.length===o.length;const f=Array.isArray(t)?[]:{};for(const h of n)f[h]=Un(e[h],t[h]),u&&(u=e[h]===f[h]);return u?e:f}var Ga=e=>[].concat(...e);function Gc(e){return new RegExp("(^|:)//").test(e)}function Wc(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Mn(e){return e!=null}function Wa(e){return[...e?.values()??[]].filter(Mn)}function zc(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var Kc=e=>e.replace(/\/$/,""),Vc=e=>e.replace(/^\//,"");function Yc(e,t){if(!e)return t;if(!t)return e;if(Gc(t))return t;const n=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=Kc(e),t=Vc(t),`${e}${n}${t}`}function cr(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}var on=()=>new Map,za=(...e)=>fetch(...e),Jc=e=>e.status>=200&&e.status<=299,Xc=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function Ka(e){if(!xt(e))return e;const t={...e};for(const[n,o]of Object.entries(t))o===void 0&&delete t[n];return t}var Zc=e=>typeof e=="object"&&(xt(e)||Array.isArray(e)||typeof e.toJSON=="function");function eu({baseUrl:e,prepareHeaders:t=c=>c,fetchFn:n=za,paramsSerializer:o,isJsonContentType:u=Xc,jsonContentType:f="application/json",jsonReplacer:h,timeout:a,responseHandler:r,validateStatus:s,...i}={}){return typeof fetch>"u"&&n===za&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),async(l,d,p)=>{const{getState:g,extra:y,endpoint:P,forced:w,type:v}=d;let m,{url:b,headers:x=new Headers(i.headers),params:_=void 0,responseHandler:A=r??"json",validateStatus:T=s??Jc,timeout:E=a,...S}=typeof l=="string"?{url:l}:l,C,I=d.signal;E&&(C=new AbortController,d.signal.addEventListener("abort",C.abort),I=C.signal);let O={...i,signal:I,...S};x=new Headers(Ka(x)),O.headers=await t(x,{getState:g,arg:l,extra:y,endpoint:P,forced:w,type:v,extraOptions:p})||x;const k=Zc(O.body);if(O.body!=null&&!k&&typeof O.body!="string"&&O.headers.delete("content-type"),!O.headers.has("content-type")&&k&&O.headers.set("content-type",f),k&&u(O.headers)&&(O.body=JSON.stringify(O.body,h)),O.headers.has("accept")||(A==="json"?O.headers.set("accept","application/json"):A==="text"&&O.headers.set("accept","text/plain, text/html, */*")),_){const G=~b.indexOf("?")?"&":"?",H=o?o(_):new URLSearchParams(Ka(_));b+=G+H}b=Yc(e,b);const D=new Request(b,O);m={request:new Request(b,O)};let U,j=!1,N=C&&setTimeout(()=>{j=!0,C.abort()},E);try{U=await n(D)}catch(G){return{error:{status:j?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(G)},meta:m}}finally{N&&clearTimeout(N),C?.signal.removeEventListener("abort",C.abort)}const F=U.clone();m.response=F;let V,W="";try{let G;if(await Promise.all([c(U,A).then(H=>V=H,H=>G=H),F.text().then(H=>W=H,()=>{})]),G)throw G}catch(G){return{error:{status:"PARSING_ERROR",originalStatus:U.status,data:W,error:String(G)},meta:m}}return T(U,V)?{data:V,meta:m}:{error:{status:U.status,data:V},meta:m}};async function c(l,d){if(typeof d=="function")return d(l);if(d==="content-type"&&(d=u(l.headers)?"json":"text"),d==="json"){const p=await l.text();return p.length?JSON.parse(p):null}return l.text()}}var Va=class{constructor(e,t=void 0){this.value=e,this.meta=t}},Pr=ct("__rtkq/focused"),Nn=ct("__rtkq/unfocused"),qr=ct("__rtkq/online"),$n=ct("__rtkq/offline"),Dr=!1;function yP(e,t){function n(){const o=()=>e(Pr()),u=()=>e(Nn()),f=()=>e(qr()),h=()=>e($n()),a=()=>{window.document.visibilityState==="visible"?o():u()};return Dr||typeof window<"u"&&window.addEventListener&&(window.addEventListener("visibilitychange",a,!1),window.addEventListener("focus",o,!1),window.addEventListener("online",f,!1),window.addEventListener("offline",h,!1),Dr=!0),()=>{window.removeEventListener("focus",o),window.removeEventListener("visibilitychange",a),window.removeEventListener("online",f),window.removeEventListener("offline",h),Dr=!1}}return n()}function vr(e){return e.type==="query"}function tu(e){return e.type==="mutation"}function br(e){return e.type==="infinitequery"}function ur(e){return vr(e)||br(e)}function Bn(e,t,n,o,u,f){return ru(e)?e(t,n,o,u).filter(Mn).map(cn).map(f):Array.isArray(e)?e.map(cn).map(f):[]}function ru(e){return typeof e=="function"}function cn(e){return typeof e=="string"?{type:e}:e}const{formatProdErrorMessage:wP}=await R("@reduxjs/toolkit");function nu(e,t){return e.catch(t)}var Ct=Symbol("forceQueryFn"),un=e=>typeof e[Ct]=="function";function au({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:n,mutationThunk:o,api:u,context:f,getInternalState:h}){const a=m=>h(m)?.runningQueries,r=m=>h(m)?.runningMutations,{unsubscribeQueryResult:s,removeMutationResult:i,updateSubscriptionOptions:c}=u.internalActions;return{buildInitiateQuery:P,buildInitiateInfiniteQuery:w,buildInitiateMutation:v,getRunningQueryThunk:l,getRunningMutationThunk:d,getRunningQueriesThunk:p,getRunningMutationsThunk:g};function l(m,b){return x=>{const _=f.endpointDefinitions[m],A=e({queryArgs:b,endpointDefinition:_,endpointName:m});return a(x)?.get(A)}}function d(m,b){return x=>r(x)?.get(b)}function p(){return m=>Wa(a(m))}function g(){return m=>Wa(r(m))}function y(m,b){const x=(_,{subscribe:A=!0,forceRefetch:T,subscriptionOptions:E,[Ct]:S,...C}={})=>(I,O)=>{const k=e({queryArgs:_,endpointDefinition:b,endpointName:m});let D;const L={...C,type:"query",subscribe:A,forceRefetch:T,subscriptionOptions:E,endpointName:m,originalArgs:_,queryCacheKey:k,[Ct]:S};if(vr(b))D=t(L);else{const{direction:B,initialPageParam:Q}=C;D=n({...L,direction:B,initialPageParam:Q})}const U=u.endpoints[m].select(_),j=I(D),N=U(O()),{requestId:F,abort:V}=j,W=N.requestId!==F,G=a(I)?.get(k),H=()=>U(O()),Z=Object.assign(S?j.then(H):W&&!G?Promise.resolve(N):Promise.all([G,j]).then(H),{arg:_,requestId:F,subscriptionOptions:E,queryCacheKey:k,abort:V,async unwrap(){const B=await Z;if(B.isError)throw B.error;return B.data},refetch:()=>I(x(_,{subscribe:!1,forceRefetch:!0})),unsubscribe(){A&&I(s({queryCacheKey:k,requestId:F}))},updateSubscriptionOptions(B){Z.subscriptionOptions=B,I(c({endpointName:m,requestId:F,queryCacheKey:k,options:B}))}});if(!G&&!W&&!S){const B=a(I);B.set(k,Z),Z.then(()=>{B.delete(k)})}return Z};return x}function P(m,b){return y(m,b)}function w(m,b){return y(m,b)}function v(m){return(b,{track:x=!0,fixedCacheKey:_}={})=>(A,T)=>{const E=o({type:"mutation",endpointName:m,originalArgs:b,track:x,fixedCacheKey:_}),S=A(E),{requestId:C,abort:I,unwrap:O}=S,k=nu(S.unwrap().then(j=>({data:j})),j=>({error:j})),D=()=>{A(i({requestId:C,fixedCacheKey:_}))},L=Object.assign(k,{arg:S.arg,requestId:C,abort:I,unwrap:O,reset:D}),U=r(A);return U.set(C,L),L.then(()=>{U.delete(C)}),_&&(U.set(_,L),L.then(()=>{U.get(_)===L&&U.delete(_)})),L}}}var Wo=class extends Bc{constructor(e,t,n,o){super(e),this.value=t,this.schemaName=n,this._bqMeta=o}},Fe=(e,t)=>Array.isArray(e)?e.includes(t):!!e;async function Ge(e,t,n,o){const u=await e["~standard"].validate(t);if(u.issues)throw new Wo(u.issues,t,n,o);return u.value}function Ya(e){return e}var pt=(e={})=>({...e,[Fo]:!0});function su({reducerPath:e,baseQuery:t,context:{endpointDefinitions:n},serializeQueryArgs:o,api:u,assertTagType:f,selectors:h,onSchemaFailure:a,catchSchemaFailure:r,skipSchemaValidation:s}){const i=(S,C,I,O)=>(k,D)=>{const L=n[S],U=o({queryArgs:C,endpointDefinition:L,endpointName:S});if(k(u.internalActions.queryResultPatched({queryCacheKey:U,patches:I})),!O)return;const j=u.endpoints[S].select(C)(D()),N=Bn(L.providesTags,j.data,void 0,C,{},f);k(u.internalActions.updateProvidedBy([{queryCacheKey:U,providedTags:N}]))};function c(S,C,I=0){const O=[C,...S];return I&&O.length>I?O.slice(0,-1):O}function l(S,C,I=0){const O=[...S,C];return I&&O.length>I?O.slice(1):O}const d=(S,C,I,O=!0)=>(k,D)=>{const U=u.endpoints[S].select(C)(D()),j={patches:[],inversePatches:[],undo:()=>k(u.util.patchQueryData(S,C,j.inversePatches,O))};if(U.status==="uninitialized")return j;let N;if("data"in U)if(_c(U.data)){const[F,V,W]=No(U.data,I);j.patches.push(...V),j.inversePatches.push(...W),N=F}else N=I(U.data),j.patches.push({op:"replace",path:[],value:N}),j.inversePatches.push({op:"replace",path:[],value:U.data});return j.patches.length===0||k(u.util.patchQueryData(S,C,j.patches,O)),j},p=(S,C,I)=>O=>O(u.endpoints[S].initiate(C,{subscribe:!1,forceRefetch:!0,[Ct]:()=>({data:I})})),g=(S,C)=>S.query&&S[C]?S[C]:Ya,y=async(S,{signal:C,abort:I,rejectWithValue:O,fulfillWithValue:k,dispatch:D,getState:L,extra:U})=>{const j=n[S.endpointName],{metaSchema:N,skipSchemaValidation:F=s}=j;try{let V=Ya;const W={signal:C,abort:I,dispatch:D,getState:L,extra:U,endpoint:S.endpointName,type:S.type,forced:S.type==="query"?P(S,L()):void 0,queryCacheKey:S.type==="query"?S.queryCacheKey:void 0},G=S.type==="query"?S[Ct]:void 0;let H;const Z=async(Q,z,J,Qe)=>{if(z==null&&Q.pages.length)return Promise.resolve({data:Q});const Pe={queryArg:S.originalArgs,pageParam:z},Xe=await B(Pe),qe=Qe?c:l;return{data:{pages:qe(Q.pages,Xe.data,J),pageParams:qe(Q.pageParams,z,J)},meta:Xe.meta}};async function B(Q){let z;const{extraOptions:J,argSchema:Qe,rawResponseSchema:Pe,responseSchema:Xe}=j;if(Qe&&!Fe(F,"arg")&&(Q=await Ge(Qe,Q,"argSchema",{})),G?z=G():j.query?(V=g(j,"transformResponse"),z=await t(j.query(Q),W,J)):z=await j.queryFn(Q,W,J,ht=>t(ht,W,J)),typeof process<"u",z.error)throw new Va(z.error,z.meta);let{data:qe}=z;Pe&&!Fe(F,"rawResponse")&&(qe=await Ge(Pe,z.data,"rawResponseSchema",z.meta));let Ne=await V(qe,z.meta,Q);return Xe&&!Fe(F,"response")&&(Ne=await Ge(Xe,Ne,"responseSchema",z.meta)),{...z,data:Ne}}if(S.type==="query"&&"infiniteQueryOptions"in j){const{infiniteQueryOptions:Q}=j,{maxPages:z=1/0}=Q;let J;const Qe={pages:[],pageParams:[]},Pe=h.selectQueryEntry(L(),S.queryCacheKey)?.data,qe=P(S,L())&&!S.direction||!Pe?Qe:Pe;if("direction"in S&&S.direction&&qe.pages.length){const Ne=S.direction==="backward",Or=(Ne?zo:ln)(Q,qe,S.originalArgs);J=await Z(qe,Or,z,Ne)}else{const{initialPageParam:Ne=Q.initialPageParam}=S,ht=Pe?.pageParams??[],Or=ht[0]??Ne,vc=ht.length;J=await Z(qe,Or,z),G&&(J={data:J.data.pages[0]});for(let Aa=1;Aa<vc;Aa++){const bc=ln(Q,J.data,S.originalArgs);J=await Z(J.data,bc,z)}}H=J}else H=await B(S.originalArgs);return N&&!Fe(F,"meta")&&H.meta&&(H.meta=await Ge(N,H.meta,"metaSchema",H.meta)),k(H.data,pt({fulfilledTimeStamp:Date.now(),baseQueryMeta:H.meta}))}catch(V){let W=V;if(W instanceof Va){let G=g(j,"transformErrorResponse");const{rawErrorResponseSchema:H,errorResponseSchema:Z}=j;let{value:B,meta:Q}=W;try{H&&!Fe(F,"rawErrorResponse")&&(B=await Ge(H,B,"rawErrorResponseSchema",Q)),N&&!Fe(F,"meta")&&(Q=await Ge(N,Q,"metaSchema",Q));let z=await G(B,Q,S.originalArgs);return Z&&!Fe(F,"errorResponse")&&(z=await Ge(Z,z,"errorResponseSchema",Q)),O(z,pt({baseQueryMeta:Q}))}catch(z){W=z}}try{if(W instanceof Wo){const G={endpoint:S.endpointName,arg:S.originalArgs,type:S.type,queryCacheKey:S.type==="query"?S.queryCacheKey:void 0};j.onSchemaFailure?.(W,G),a?.(W,G);const{catchSchemaFailure:H=r}=j;if(H)return O(H(W,G),pt({baseQueryMeta:W._bqMeta}))}}catch(G){W=G}throw console.error(W),W}};function P(S,C){const I=h.selectQueryEntry(C,S.queryCacheKey),O=h.selectConfig(C).refetchOnMountOrArgChange,k=I?.fulfilledTimeStamp,D=S.forceRefetch??(S.subscribe&&O);return D?D===!0||(Number(new Date)-Number(k))/1e3>=D:!1}const w=()=>Ha(`${e}/executeQuery`,y,{getPendingMeta({arg:C}){const I=n[C.endpointName];return pt({startedTimeStamp:Date.now(),...br(I)?{direction:C.direction}:{}})},condition(C,{getState:I}){const O=I(),k=h.selectQueryEntry(O,C.queryCacheKey),D=k?.fulfilledTimeStamp,L=C.originalArgs,U=k?.originalArgs,j=n[C.endpointName],N=C.direction;return un(C)?!0:k?.status==="pending"?!1:P(C,O)||vr(j)&&j?.forceRefetch?.({currentArg:L,previousArg:U,endpointState:k,state:O})?!0:!(D&&!N)},dispatchConditionRejection:!0}),v=w(),m=w(),b=Ha(`${e}/executeMutation`,y,{getPendingMeta(){return pt({startedTimeStamp:Date.now()})}}),x=S=>"force"in S,_=S=>"ifOlderThan"in S,A=(S,C,I={})=>(O,k)=>{const D=x(I)&&I.force,L=_(I)&&I.ifOlderThan,U=(N=!0)=>{const F={forceRefetch:N,subscribe:!1};return u.endpoints[S].initiate(C,F)},j=u.endpoints[S].select(C)(k());if(D)O(U());else if(L){const N=j?.fulfilledTimeStamp;if(!N){O(U());return}(Number(new Date)-Number(new Date(N)))/1e3>=L&&O(U())}else O(U(!1))};function T(S){return C=>C?.meta?.arg?.endpointName===S}function E(S,C){return{matchPending:kr(Qo(S),T(C)),matchFulfilled:kr(Ve(S),T(C)),matchRejected:kr(jn(S),T(C))}}return{queryThunk:v,mutationThunk:b,infiniteQueryThunk:m,prefetch:A,updateQueryData:d,upsertQueryData:p,patchQueryData:i,buildMatchThunkActions:E}}function ln(e,{pages:t,pageParams:n},o){const u=t.length-1;return e.getNextPageParam(t[u],t,n[u],n,o)}function zo(e,{pages:t,pageParams:n},o){return e.getPreviousPageParam?.(t[0],t,n[0],n,o)}function Ko(e,t,n,o){return Bn(n[e.meta.arg.endpointName][t],Ve(e)?e.payload:void 0,Ln(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,o)}function Mt(e,t,n){const o=e[t];o&&n(o)}function It(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function Ja(e,t,n){const o=e[It(t)];o&&n(o)}var Nt={};function ou({reducerPath:e,queryThunk:t,mutationThunk:n,serializeQueryArgs:o,context:{endpointDefinitions:u,apiUid:f,extractRehydrationInfo:h,hasRehydrationInfo:a},assertTagType:r,config:s}){const i=ct(`${e}/resetApiState`);function c(T,E,S,C){T[E.queryCacheKey]??={status:"uninitialized",endpointName:E.endpointName},Mt(T,E.queryCacheKey,I=>{I.status="pending",I.requestId=S&&I.requestId?I.requestId:C.requestId,E.originalArgs!==void 0&&(I.originalArgs=E.originalArgs),I.startedTimeStamp=C.startedTimeStamp;const O=u[C.arg.endpointName];br(O)&&"direction"in E&&(I.direction=E.direction)})}function l(T,E,S,C){Mt(T,E.arg.queryCacheKey,I=>{if(I.requestId!==E.requestId&&!C)return;const{merge:O}=u[E.arg.endpointName];if(I.status="fulfilled",O)if(I.data!==void 0){const{fulfilledTimeStamp:k,arg:D,baseQueryMeta:L,requestId:U}=E;let j=Dn(I.data,N=>O(N,S,{arg:D.originalArgs,baseQueryMeta:L,fulfilledTimeStamp:k,requestId:U}));I.data=j}else I.data=S;else I.data=u[E.arg.endpointName].structuralSharing??!0?Un(Ac(I.data)?Rc(I.data):I.data,S):S;delete I.error,I.fulfilledTimeStamp=E.fulfilledTimeStamp})}const d=Ze({name:`${e}/queries`,initialState:Nt,reducers:{removeQueryResult:{reducer(T,{payload:{queryCacheKey:E}}){delete T[E]},prepare:ft()},cacheEntriesUpserted:{reducer(T,E){for(const S of E.payload){const{queryDescription:C,value:I}=S;c(T,C,!0,{arg:C,requestId:E.meta.requestId,startedTimeStamp:E.meta.timestamp}),l(T,{arg:C,requestId:E.meta.requestId,fulfilledTimeStamp:E.meta.timestamp,baseQueryMeta:{}},I,!0)}},prepare:T=>({payload:T.map(C=>{const{endpointName:I,arg:O,value:k}=C,D=u[I];return{queryDescription:{type:"query",endpointName:I,originalArgs:C.arg,queryCacheKey:o({queryArgs:O,endpointDefinition:D,endpointName:I})},value:k}}),meta:{[Fo]:!0,requestId:Go(),timestamp:Date.now()}})},queryResultPatched:{reducer(T,{payload:{queryCacheKey:E,patches:S}}){Mt(T,E,C=>{C.data=Oa(C.data,S.concat())})},prepare:ft()}},extraReducers(T){T.addCase(t.pending,(E,{meta:S,meta:{arg:C}})=>{const I=un(C);c(E,C,I,S)}).addCase(t.fulfilled,(E,{meta:S,payload:C})=>{const I=un(S.arg);l(E,S,C,I)}).addCase(t.rejected,(E,{meta:{condition:S,arg:C,requestId:I},error:O,payload:k})=>{Mt(E,C.queryCacheKey,D=>{if(!S){if(D.requestId!==I)return;D.status="rejected",D.error=k??O}})}).addMatcher(a,(E,S)=>{const{queries:C}=h(S);for(const[I,O]of Object.entries(C))(O?.status==="fulfilled"||O?.status==="rejected")&&(E[I]=O)})}}),p=Ze({name:`${e}/mutations`,initialState:Nt,reducers:{removeMutationResult:{reducer(T,{payload:E}){const S=It(E);S in T&&delete T[S]},prepare:ft()}},extraReducers(T){T.addCase(n.pending,(E,{meta:S,meta:{requestId:C,arg:I,startedTimeStamp:O}})=>{I.track&&(E[It(S)]={requestId:C,status:"pending",endpointName:I.endpointName,startedTimeStamp:O})}).addCase(n.fulfilled,(E,{payload:S,meta:C})=>{C.arg.track&&Ja(E,C,I=>{I.requestId===C.requestId&&(I.status="fulfilled",I.data=S,I.fulfilledTimeStamp=C.fulfilledTimeStamp)})}).addCase(n.rejected,(E,{payload:S,error:C,meta:I})=>{I.arg.track&&Ja(E,I,O=>{O.requestId===I.requestId&&(O.status="rejected",O.error=S??C)})}).addMatcher(a,(E,S)=>{const{mutations:C}=h(S);for(const[I,O]of Object.entries(C))(O?.status==="fulfilled"||O?.status==="rejected")&&I!==O?.requestId&&(E[I]=O)})}}),g={tags:{},keys:{}},y=Ze({name:`${e}/invalidation`,initialState:g,reducers:{updateProvidedBy:{reducer(T,E){for(const{queryCacheKey:S,providedTags:C}of E.payload){P(T,S);for(const{type:I,id:O}of C){const k=(T.tags[I]??={})[O||"__internal_without_id"]??=[];k.includes(S)||k.push(S)}T.keys[S]=C}},prepare:ft()}},extraReducers(T){T.addCase(d.actions.removeQueryResult,(E,{payload:{queryCacheKey:S}})=>{P(E,S)}).addMatcher(a,(E,S)=>{const{provided:C}=h(S);for(const[I,O]of Object.entries(C.tags??{}))for(const[k,D]of Object.entries(O)){const L=(E.tags[I]??={})[k||"__internal_without_id"]??=[];for(const U of D)L.includes(U)||L.push(U),E.keys[U]=C.keys[U]}}).addMatcher(ir(Ve(t),Ln(t)),(E,S)=>{w(E,[S])}).addMatcher(d.actions.cacheEntriesUpserted.match,(E,S)=>{const C=S.payload.map(({queryDescription:I,value:O})=>({type:"UNKNOWN",payload:O,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:I}}));w(E,C)})}});function P(T,E){const S=T.keys[E]??[];for(const C of S){const I=C.type,O=C.id??"__internal_without_id",k=T.tags[I]?.[O];k&&(T.tags[I][O]=k.filter(D=>D!==E))}delete T.keys[E]}function w(T,E){const S=E.map(C=>{const I=Ko(C,"providesTags",u,r),{queryCacheKey:O}=C.meta.arg;return{queryCacheKey:O,providedTags:I}});y.caseReducers.updateProvidedBy(T,y.actions.updateProvidedBy(S))}const v=Ze({name:`${e}/subscriptions`,initialState:Nt,reducers:{updateSubscriptionOptions(T,E){},unsubscribeQueryResult(T,E){},internal_getRTKQSubscriptions(){}}}),m=Ze({name:`${e}/internalSubscriptions`,initialState:Nt,reducers:{subscriptionsUpdated:{reducer(T,E){return Oa(T,E.payload)},prepare:ft()}}}),b=Ze({name:`${e}/config`,initialState:{online:zc(),focused:Wc(),middlewareRegistered:!1,...s},reducers:{middlewareRegistered(T,{payload:E}){T.middlewareRegistered=T.middlewareRegistered==="conflict"||f!==E?"conflict":!0}},extraReducers:T=>{T.addCase(qr,E=>{E.online=!0}).addCase($n,E=>{E.online=!1}).addCase(Pr,E=>{E.focused=!0}).addCase(Nn,E=>{E.focused=!1}).addMatcher(a,E=>({...E}))}}),x=Qc({queries:d.reducer,mutations:p.reducer,provided:y.reducer,subscriptions:m.reducer,config:b.reducer}),_=(T,E)=>x(i.match(E)?void 0:T,E),A={...b.actions,...d.actions,...v.actions,...m.actions,...p.actions,...y.actions,resetApiState:i};return{reducer:_,actions:A}}var ge=Symbol.for("RTKQ/skipToken"),Vo={status:"uninitialized"},Xa=Dn(Vo,()=>{}),Za=Dn(Vo,()=>{});function iu({serializeQueryArgs:e,reducerPath:t,createSelector:n}){const o=v=>Xa,u=v=>Za;return{buildQuerySelector:l,buildInfiniteQuerySelector:d,buildMutationSelector:p,selectInvalidatedBy:g,selectCachedArgsForQuery:y,selectApiState:h,selectQueries:a,selectMutations:s,selectQueryEntry:r,selectConfig:i};function f(v){return{...v,...Ba(v.status)}}function h(v){return v[t]}function a(v){return h(v)?.queries}function r(v,m){return a(v)?.[m]}function s(v){return h(v)?.mutations}function i(v){return h(v)?.config}function c(v,m,b){return x=>{if(x===ge)return n(o,b);const _=e({queryArgs:x,endpointDefinition:m,endpointName:v});return n(T=>r(T,_)??Xa,b)}}function l(v,m){return c(v,m,f)}function d(v,m){const{infiniteQueryOptions:b}=m;function x(_){const A={..._,...Ba(_.status)},{isLoading:T,isError:E,direction:S}=A,C=S==="forward",I=S==="backward";return{...A,hasNextPage:P(b,A.data,A.originalArgs),hasPreviousPage:w(b,A.data,A.originalArgs),isFetchingNextPage:T&&C,isFetchingPreviousPage:T&&I,isFetchNextPageError:E&&C,isFetchPreviousPageError:E&&I}}return c(v,m,x)}function p(){return v=>{let m;return typeof v=="object"?m=It(v)??ge:m=v,n(m===ge?u:_=>h(_)?.mutations?.[m]??Za,f)}}function g(v,m){const b=v[t],x=new Set;for(const _ of m.filter(Mn).map(cn)){const A=b.provided.tags[_.type];if(!A)continue;let T=(_.id!==void 0?A[_.id]:Ga(Object.values(A)))??[];for(const E of T)x.add(E)}return Ga(Array.from(x.values()).map(_=>{const A=b.queries[_];return A?[{queryCacheKey:_,endpointName:A.endpointName,originalArgs:A.originalArgs}]:[]}))}function y(v,m){return Object.values(a(v)).filter(b=>b?.endpointName===m&&b.status!=="uninitialized").map(b=>b.originalArgs)}function P(v,m,b){return m?ln(v,m,b)!=null:!1}function w(v,m,b){return!m||!v.getPreviousPageParam?!1:zo(v,m,b)!=null}}const{formatProdErrorMessage:cu,formatProdErrorMessage:PP,formatProdErrorMessage:qP}=await R("@reduxjs/toolkit");var es=WeakMap?new WeakMap:void 0,ts=({endpointName:e,queryArgs:t})=>{let n="";const o=es?.get(t);if(typeof o=="string")n=o;else{const u=JSON.stringify(t,(f,h)=>(h=typeof h=="bigint"?{$bigint:h.toString()}:h,h=xt(h)?Object.keys(h).sort().reduce((a,r)=>(a[r]=h[r],a),{}):h,h));xt(t)&&es?.set(t,u),n=u}return`${e}(${n})`};function Yo(...e){return function(n){const o=Ra(s=>n.extractRehydrationInfo?.(s,{reducerPath:n.reducerPath??"api"})),u={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...n,extractRehydrationInfo:o,serializeQueryArgs(s){let i=ts;if("serializeQueryArgs"in s.endpointDefinition){const c=s.endpointDefinition.serializeQueryArgs;i=l=>{const d=c(l);return typeof d=="string"?d:ts({...l,queryArgs:d})}}else n.serializeQueryArgs&&(i=n.serializeQueryArgs);return i(s)},tagTypes:[...n.tagTypes||[]]},f={endpointDefinitions:{},batch(s){s()},apiUid:Go(),extractRehydrationInfo:o,hasRehydrationInfo:Ra(s=>o(s)!=null)},h={injectEndpoints:r,enhanceEndpoints({addTagTypes:s,endpoints:i}){if(s)for(const c of s)u.tagTypes.includes(c)||u.tagTypes.push(c);if(i)for(const[c,l]of Object.entries(i))typeof l=="function"?l(f.endpointDefinitions[c]):Object.assign(f.endpointDefinitions[c]||{},l);return h}},a=e.map(s=>s.init(h,u,f));function r(s){const i=s.endpoints({query:c=>({...c,type:"query"}),mutation:c=>({...c,type:"mutation"}),infiniteQuery:c=>({...c,type:"infinitequery"})});for(const[c,l]of Object.entries(i)){if(s.overrideExisting!==!0&&c in f.endpointDefinitions){if(s.overrideExisting==="throw")throw new Error(cu(39));continue}f.endpointDefinitions[c]=l;for(const d of a)d.injectEndpoint(c,l)}return h}return h.injectEndpoints({endpoints:n.endpoints})}}const{formatProdErrorMessage:uu}=await R("@reduxjs/toolkit");function Jo(){return function(){throw new Error(uu(33))}}function Oe(e,...t){return Object.assign(e,...t)}var lu=({api:e,queryThunk:t,internalState:n,mwApi:o})=>{const u=`${e.reducerPath}/subscriptions`;let f=null,h=null;const{updateSubscriptionOptions:a,unsubscribeQueryResult:r}=e.internalActions,s=(g,y)=>{if(a.match(y)){const{queryCacheKey:w,requestId:v,options:m}=y.payload,b=g.get(w);return b?.has(v)&&b.set(v,m),!0}if(r.match(y)){const{queryCacheKey:w,requestId:v}=y.payload,m=g.get(w);return m&&m.delete(v),!0}if(e.internalActions.removeQueryResult.match(y))return g.delete(y.payload.queryCacheKey),!0;if(t.pending.match(y)){const{meta:{arg:w,requestId:v}}=y,m=cr(g,w.queryCacheKey,on);return w.subscribe&&m.set(v,w.subscriptionOptions??m.get(v)??{}),!0}let P=!1;if(t.rejected.match(y)){const{meta:{condition:w,arg:v,requestId:m}}=y;if(w&&v.subscribe){const b=cr(g,v.queryCacheKey,on);b.set(m,v.subscriptionOptions??b.get(m)??{}),P=!0}}return P},i=()=>n.currentSubscriptions,d={getSubscriptions:i,getSubscriptionCount:g=>i().get(g)?.size??0,isRequestSubscribed:(g,y)=>!!i()?.get(g)?.get(y)};function p(g){return JSON.parse(JSON.stringify(Object.fromEntries([...g].map(([y,P])=>[y,Object.fromEntries(P)]))))}return(g,y)=>{if(f||(f=p(n.currentSubscriptions)),e.util.resetApiState.match(g))return f={},n.currentSubscriptions.clear(),h=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(g))return[!1,d];const P=s(n.currentSubscriptions,g);let w=!0;if(P){h||(h=setTimeout(()=>{const b=p(n.currentSubscriptions),[,x]=No(f,()=>b);y.next(e.internalActions.subscriptionsUpdated(x)),f=b,h=null},500));const v=typeof g.type=="string"&&!!g.type.startsWith(u),m=t.rejected.match(g)&&g.meta.condition&&!!g.meta.arg.subscribe;w=!v&&!m}return[w,!1]}},du=2147483647/1e3-1,hu=({reducerPath:e,api:t,queryThunk:n,context:o,internalState:u,selectors:{selectQueryEntry:f,selectConfig:h},getRunningQueryThunk:a,mwApi:r})=>{const{removeQueryResult:s,unsubscribeQueryResult:i,cacheEntriesUpserted:c}=t.internalActions,l=ir(i.match,n.fulfilled,n.rejected,c.match);function d(v){const m=u.currentSubscriptions.get(v);return m?m.size>0:!1}const p={};function g(v){for(const m of v.values())m?.abort?.()}const y=(v,m)=>{const b=m.getState(),x=h(b);if(l(v)){let _;if(c.match(v))_=v.payload.map(A=>A.queryDescription.queryCacheKey);else{const{queryCacheKey:A}=i.match(v)?v.payload:v.meta.arg;_=[A]}P(_,m,x)}if(t.util.resetApiState.match(v)){for(const[_,A]of Object.entries(p))A&&clearTimeout(A),delete p[_];g(u.runningQueries),g(u.runningMutations)}if(o.hasRehydrationInfo(v)){const{queries:_}=o.extractRehydrationInfo(v);P(Object.keys(_),m,x)}};function P(v,m,b){const x=m.getState();for(const _ of v){const A=f(x,_);A?.endpointName&&w(_,A.endpointName,m,b)}}function w(v,m,b,x){const A=o.endpointDefinitions[m]?.keepUnusedDataFor??x.keepUnusedDataFor;if(A===1/0)return;const T=Math.max(0,Math.min(A,du));if(!d(v)){const E=p[v];E&&clearTimeout(E),p[v]=setTimeout(()=>{if(!d(v)){const S=f(b.getState(),v);S?.endpointName&&b.dispatch(a(S.endpointName,S.originalArgs))?.abort(),b.dispatch(s({queryCacheKey:v}))}delete p[v]},T*1e3)}}return y},rs=new Error("Promise never resolved before cacheEntryRemoved."),fu=({api:e,reducerPath:t,context:n,queryThunk:o,mutationThunk:u,internalState:f,selectors:{selectQueryEntry:h,selectApiState:a}})=>{const r=Qa(o),s=Qa(u),i=Ve(o,u),c={};function l(P,w,v){const m=c[P];m?.valueResolved&&(m.valueResolved({data:w,meta:v}),delete m.valueResolved)}function d(P){const w=c[P];w&&(delete c[P],w.cacheEntryRemoved())}const p=(P,w,v)=>{const m=g(P);function b(x,_,A,T){const E=h(v,_),S=h(w.getState(),_);!E&&S&&y(x,T,_,w,A)}if(o.pending.match(P))b(P.meta.arg.endpointName,m,P.meta.requestId,P.meta.arg.originalArgs);else if(e.internalActions.cacheEntriesUpserted.match(P))for(const{queryDescription:x,value:_}of P.payload){const{endpointName:A,originalArgs:T,queryCacheKey:E}=x;b(A,E,P.meta.requestId,T),l(E,_,{})}else if(u.pending.match(P))w.getState()[t].mutations[m]&&y(P.meta.arg.endpointName,P.meta.arg.originalArgs,m,w,P.meta.requestId);else if(i(P))l(m,P.payload,P.meta.baseQueryMeta);else if(e.internalActions.removeQueryResult.match(P)||e.internalActions.removeMutationResult.match(P))d(m);else if(e.util.resetApiState.match(P))for(const x of Object.keys(c))d(x)};function g(P){return r(P)?P.meta.arg.queryCacheKey:s(P)?P.meta.arg.fixedCacheKey??P.meta.requestId:e.internalActions.removeQueryResult.match(P)?P.payload.queryCacheKey:e.internalActions.removeMutationResult.match(P)?It(P.payload):""}function y(P,w,v,m,b){const x=n.endpointDefinitions[P],_=x?.onCacheEntryAdded;if(!_)return;const A={},T=new Promise(k=>{A.cacheEntryRemoved=k}),E=Promise.race([new Promise(k=>{A.valueResolved=k}),T.then(()=>{throw rs})]);E.catch(()=>{}),c[v]=A;const S=e.endpoints[P].select(ur(x)?w:v),C=m.dispatch((k,D,L)=>L),I={...m,getCacheEntry:()=>S(m.getState()),requestId:b,extra:C,updateCachedData:ur(x)?k=>m.dispatch(e.util.updateQueryData(P,w,k)):void 0,cacheDataLoaded:E,cacheEntryRemoved:T},O=_(w,I);Promise.resolve(O).catch(k=>{if(k!==rs)throw k})}return p},pu=({api:e,context:{apiUid:t},reducerPath:n})=>(o,u)=>{e.util.resetApiState.match(o)&&u.dispatch(e.internalActions.middlewareRegistered(t))},gu=({reducerPath:e,context:t,context:{endpointDefinitions:n},mutationThunk:o,queryThunk:u,api:f,assertTagType:h,refetchQuery:a,internalState:r})=>{const{removeQueryResult:s}=f.internalActions,i=ir(Ve(o),Ln(o)),c=ir(Ve(o,u),jn(o,u));let l=[];const d=(y,P)=>{i(y)?g(Ko(y,"invalidatesTags",n,h),P):c(y)?g([],P):f.util.invalidateTags.match(y)&&g(Bn(y.payload,void 0,void 0,void 0,void 0,h),P)};function p(y){const{queries:P,mutations:w}=y;for(const v of[P,w])for(const m in v)if(v[m]?.status==="pending")return!0;return!1}function g(y,P){const w=P.getState(),v=w[e];if(l.push(...y),v.config.invalidationBehavior==="delayed"&&p(v))return;const m=l;if(l=[],m.length===0)return;const b=f.util.selectInvalidatedBy(w,m);t.batch(()=>{const x=Array.from(b.values());for(const{queryCacheKey:_}of x){const A=v.queries[_],T=cr(r.currentSubscriptions,_,on);A&&(T.size===0?P.dispatch(s({queryCacheKey:_})):A.status!=="uninitialized"&&P.dispatch(a(A)))}})}return d},mu=({reducerPath:e,queryThunk:t,api:n,refetchQuery:o,internalState:u})=>{const{currentPolls:f,currentSubscriptions:h}=u,a=new Set;let r=null;const s=(y,P)=>{(n.internalActions.updateSubscriptionOptions.match(y)||n.internalActions.unsubscribeQueryResult.match(y))&&i(y.payload.queryCacheKey,P),(t.pending.match(y)||t.rejected.match(y)&&y.meta.condition)&&i(y.meta.arg.queryCacheKey,P),(t.fulfilled.match(y)||t.rejected.match(y)&&!y.meta.condition)&&c(y.meta.arg,P),n.util.resetApiState.match(y)&&(p(),r&&(clearTimeout(r),r=null),a.clear())};function i(y,P){a.add(y),r||(r=setTimeout(()=>{for(const w of a)l({queryCacheKey:w},P);a.clear(),r=null},0))}function c({queryCacheKey:y},P){const w=P.getState()[e],v=w.queries[y],m=h.get(y);if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:b,skipPollingIfUnfocused:x}=g(m);if(!Number.isFinite(b))return;const _=f.get(y);_?.timeout&&(clearTimeout(_.timeout),_.timeout=void 0);const A=Date.now()+b;f.set(y,{nextPollTimestamp:A,pollingInterval:b,timeout:setTimeout(()=>{(w.config.focused||!x)&&P.dispatch(o(v)),c({queryCacheKey:y},P)},b)})}function l({queryCacheKey:y},P){const v=P.getState()[e].queries[y],m=h.get(y);if(!v||v.status==="uninitialized")return;const{lowestPollingInterval:b}=g(m);if(!Number.isFinite(b)){d(y);return}const x=f.get(y),_=Date.now()+b;(!x||_<x.nextPollTimestamp)&&c({queryCacheKey:y},P)}function d(y){const P=f.get(y);P?.timeout&&clearTimeout(P.timeout),f.delete(y)}function p(){for(const y of f.keys())d(y)}function g(y=new Map){let P=!1,w=Number.POSITIVE_INFINITY;for(const v of y.values())v.pollingInterval&&(w=Math.min(v.pollingInterval,w),P=v.skipPollingIfUnfocused||P);return{lowestPollingInterval:w,skipPollingIfUnfocused:P}}return s},yu=({api:e,context:t,queryThunk:n,mutationThunk:o})=>{const u=Qo(n,o),f=jn(n,o),h=Ve(n,o),a={};return(s,i)=>{if(u(s)){const{requestId:c,arg:{endpointName:l,originalArgs:d}}=s.meta,p=t.endpointDefinitions[l],g=p?.onQueryStarted;if(g){const y={},P=new Promise((b,x)=>{y.resolve=b,y.reject=x});P.catch(()=>{}),a[c]=y;const w=e.endpoints[l].select(ur(p)?d:c),v=i.dispatch((b,x,_)=>_),m={...i,getCacheEntry:()=>w(i.getState()),requestId:c,extra:v,updateCachedData:ur(p)?b=>i.dispatch(e.util.updateQueryData(l,d,b)):void 0,queryFulfilled:P};g(d,m)}}else if(h(s)){const{requestId:c,baseQueryMeta:l}=s.meta;a[c]?.resolve({data:s.payload,meta:l}),delete a[c]}else if(f(s)){const{requestId:c,rejectedWithValue:l,baseQueryMeta:d}=s.meta;a[c]?.reject({error:s.payload??s.error,isUnhandledError:!l,meta:d}),delete a[c]}}},wu=({reducerPath:e,context:t,api:n,refetchQuery:o,internalState:u})=>{const{removeQueryResult:f}=n.internalActions,h=(r,s)=>{Pr.match(r)&&a(s,"refetchOnFocus"),qr.match(r)&&a(s,"refetchOnReconnect")};function a(r,s){const i=r.getState()[e],c=i.queries,l=u.currentSubscriptions;t.batch(()=>{for(const d of l.keys()){const p=c[d],g=l.get(d);if(!g||!p)continue;const y=[...g.values()];(y.some(w=>w[s]===!0)||y.every(w=>w[s]===void 0)&&i.config[s])&&(g.size===0?r.dispatch(f({queryCacheKey:d})):p.status!=="uninitialized"&&r.dispatch(o(p)))}})}return h};function Pu(e){const{reducerPath:t,queryThunk:n,api:o,context:u,getInternalState:f}=e,{apiUid:h}=u,a={invalidateTags:ct(`${t}/invalidateTags`)},r=l=>l.type.startsWith(`${t}/`),s=[pu,hu,gu,mu,fu,yu];return{middleware:l=>{let d=!1;const p=f(l.dispatch),g={...e,internalState:p,refetchQuery:c,isThisApiSliceAction:r,mwApi:l},y=s.map(v=>v(g)),P=lu(g),w=wu(g);return v=>m=>{if(!Fc(m))return v(m);d||(d=!0,l.dispatch(o.internalActions.middlewareRegistered(h)));const b={...l,next:v},x=l.getState(),[_,A]=P(m,b,x);let T;if(_?T=v(m):T=A,l.getState()[t]&&(w(m,b,x),r(m)||u.hasRehydrationInfo(m)))for(const E of y)E(m,b,x);return T}},actions:a};function c(l){return e.api.endpoints[l.endpointName].initiate(l.originalArgs,{subscribe:!1,forceRefetch:!0})}}var ns=Symbol(),Xo=({createSelector:e=Hc}={})=>({name:ns,init(t,{baseQuery:n,tagTypes:o,reducerPath:u,serializeQueryArgs:f,keepUnusedDataFor:h,refetchOnMountOrArgChange:a,refetchOnFocus:r,refetchOnReconnect:s,invalidationBehavior:i,onSchemaFailure:c,catchSchemaFailure:l,skipSchemaValidation:d},p){Ic();const g=B=>B;Object.assign(t,{reducerPath:u,endpoints:{},internalActions:{onOnline:qr,onOffline:$n,onFocus:Pr,onFocusLost:Nn},util:{}});const y=iu({serializeQueryArgs:f,reducerPath:u,createSelector:e}),{selectInvalidatedBy:P,selectCachedArgsForQuery:w,buildQuerySelector:v,buildInfiniteQuerySelector:m,buildMutationSelector:b}=y;Oe(t.util,{selectInvalidatedBy:P,selectCachedArgsForQuery:w});const{queryThunk:x,infiniteQueryThunk:_,mutationThunk:A,patchQueryData:T,updateQueryData:E,upsertQueryData:S,prefetch:C,buildMatchThunkActions:I}=su({baseQuery:n,reducerPath:u,context:p,api:t,serializeQueryArgs:f,assertTagType:g,selectors:y,onSchemaFailure:c,catchSchemaFailure:l,skipSchemaValidation:d}),{reducer:O,actions:k}=ou({context:p,queryThunk:x,mutationThunk:A,serializeQueryArgs:f,reducerPath:u,assertTagType:g,config:{refetchOnFocus:r,refetchOnReconnect:s,refetchOnMountOrArgChange:a,keepUnusedDataFor:h,reducerPath:u,invalidationBehavior:i}});Oe(t.util,{patchQueryData:T,updateQueryData:E,upsertQueryData:S,prefetch:C,resetApiState:k.resetApiState,upsertQueryEntries:k.cacheEntriesUpserted}),Oe(t.internalActions,k);const D=new WeakMap,L=B=>cr(D,B,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:U,buildInitiateInfiniteQuery:j,buildInitiateMutation:N,getRunningMutationThunk:F,getRunningMutationsThunk:V,getRunningQueriesThunk:W,getRunningQueryThunk:G}=au({queryThunk:x,mutationThunk:A,infiniteQueryThunk:_,api:t,serializeQueryArgs:f,context:p,getInternalState:L});Oe(t.util,{getRunningMutationThunk:F,getRunningMutationsThunk:V,getRunningQueryThunk:G,getRunningQueriesThunk:W});const{middleware:H,actions:Z}=Pu({reducerPath:u,context:p,queryThunk:x,mutationThunk:A,infiniteQueryThunk:_,api:t,assertTagType:g,selectors:y,getRunningQueryThunk:G,getInternalState:L});return Oe(t.util,Z),Oe(t,{reducer:O,middleware:H}),{name:ns,injectEndpoint(B,Q){const z=t,J=z.endpoints[B]??={};vr(Q)&&Oe(J,{name:B,select:v(B,Q),initiate:U(B,Q)},I(x,B)),tu(Q)&&Oe(J,{name:B,select:b(),initiate:N(B)},I(A,B)),br(Q)&&Oe(J,{name:B,select:m(B,Q),initiate:j(B,Q)},I(x,B))}}}});Xo();function Xt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Xt=function(n){return typeof n}:Xt=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Xt(e)}function qu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vu(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function bu(e,t,n){return t&&vu(e.prototype,t),e}function Eu(e,t){return t&&(Xt(t)==="object"||typeof t=="function")?t:Zt(e)}function dn(e){return dn=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},dn(e)}function Zt(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Su(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&hn(e,t)}function hn(e,t){return hn=Object.setPrototypeOf||function(o,u){return o.__proto__=u,o},hn(e,t)}function er(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Tu=await R("react"),{PureComponent:xu}=Tu;var Cu=function(e){Su(t,e);function t(){var n,o;qu(this,t);for(var u=arguments.length,f=new Array(u),h=0;h<u;h++)f[h]=arguments[h];return o=Eu(this,(n=dn(t)).call.apply(n,[this].concat(f))),er(Zt(o),"state",{bootstrapped:!1}),er(Zt(o),"_unsubscribe",void 0),er(Zt(o),"handlePersistorState",function(){var a=o.props.persistor,r=a.getState(),s=r.bootstrapped;s&&(o.props.onBeforeLift?Promise.resolve(o.props.onBeforeLift()).finally(function(){return o.setState({bootstrapped:!0})}):o.setState({bootstrapped:!0}),o._unsubscribe&&o._unsubscribe())}),o}return bu(t,[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return typeof this.props.children=="function"?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}]),t}(xu);er(Cu,"defaultProps",{children:null,loading:null});const Iu=wr({id:1,name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:12e3,rpcUrls:{default:{http:["https://eth.merkle.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://etherscan.io",apiUrl:"https://api.etherscan.io/api"}},contracts:{ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:23085558},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:14353601}}}),_u=wr({id:137,name:"Polygon",blockTime:2e3,nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://polygon-rpc.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:25770160}}}),Au=wr({id:80002,name:"Polygon Amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://amoy.polygonscan.com",apiUrl:"https://api.etherscan.io/v2/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:3127388}},testnet:!0}),Ru=wr({id:11155111,name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://11155111.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"Etherscan",url:"https://sepolia.etherscan.io",apiUrl:"https://api-sepolia.etherscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:751532},ensUniversalResolver:{address:"0xeeeeeeee14d718c2b47d9923deab1335e144eeee",blockCreated:8928790}},testnet:!0}),{ChainId:vP}=await R("@dcl/schemas"),Ou=[Iu,_u],ku=[Ru,Au],Hn=[...Ou,...ku];function Du(e){return Hn.some(t=>t.id===e)}const{createConnector:ju}=await R("wagmi"),{ChainId:vt}=await R("@dcl/schemas"),as={[vt.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet?project=magic",[vt.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia?project=magic",[vt.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon?project=magic",[vt.MATIC_AMOY]:"https://rpc.decentraland.org/amoy?project=magic"};function Lu(e){const{apiKey:t}=e;let n=null,o=null;async function u(f){const{Magic:h}=await Ue(async()=>{const{Magic:s}=await import("./index-BTtTX-5z.js");return{Magic:s}},__vite__mapDeps([0,1])),{OAuthExtension:a}=await Ue(async()=>{const{OAuthExtension:s}=await import("./index-BAhlRyDG.js");return{OAuthExtension:s}},__vite__mapDeps([2,1])),r=as[f]||as[vt.ETHEREUM_MAINNET];return new h(t,{extensions:[new a],network:{rpcUrl:r,chainId:f}})}return ju(f=>{async function h(){return o?await o.request({method:"eth_accounts"}):[]}async function a(r){o=await n.wallet.getProvider();const s=await h();return s.length===0?null:(await f.storage?.setItem("magicChainId",r),{accounts:s,chainId:r})}return{id:"magic",name:"Magic",type:"magic",async setup(){const s=await f.storage?.getItem("magicChainId")??f.chains[0]?.id;if(s)try{if(n=await u(s),await n.user.isLoggedIn()){const c=await a(s);c&&f.emitter.emit("connect",c)}}catch{}},async connect({chainId:r}={}){const s=r??f.chains[0].id;if(n||(n=await u(s)),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in. Please authenticate via the auth dapp first.");const c=await a(s);if(!c)throw new Error("Magic: No accounts found");return c},async disconnect(){n&&await n.user.logout(),n=null,o=null,await f.storage?.removeItem("magicChainId")},async getAccounts(){return h()},async getChainId(){return await f.storage?.getItem("magicChainId")??f.chains[0].id},async getProvider(){return!o&&n&&(o=await n.wallet.getProvider()),o},async isAuthorized(){try{if(!n){const s=await f.storage?.getItem("magicChainId")??f.chains[0]?.id;if(!s)return!1;n=await u(s)}return await n.user.isLoggedIn()}catch{return!1}},async switchChain({chainId:r}){const s=f.chains.find(c=>c.id===r);if(!s)throw new Error(`Chain ${r} not configured`);if(n=await u(r),!await n.user.isLoggedIn())throw new Error("Magic: User is not logged in");return o=await n.wallet.getProvider(),await f.storage?.setItem("magicChainId",r),f.emitter.emit("change",{chainId:r}),s},onAccountsChanged(r){r.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:r})},onChainChanged(r){const s=r.startsWith("0x")?parseInt(r,16):Number(r);f.emitter.emit("change",{chainId:s})},onDisconnect(){f.emitter.emit("disconnect"),n=null,o=null}}})}const{createConnector:Uu}=await R("wagmi"),{ChainId:ss}=await R("@dcl/schemas");function Mu(e){const{clientId:t,supportedChainIds:n=[ss.ETHEREUM_MAINNET,ss.ETHEREUM_SEPOLIA]}=e;let o=null,u=null,f=null,h=null,a=null,r=null;async function s(){if(o)return o;try{return o=(await Ue(()=>import("./thirdweb-BDeAJ4oX.js").then(y=>y.t),__vite__mapDeps([3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24]))).createThirdwebClient({clientId:t}),o}catch{throw new Error("Thirdweb: thirdweb package is not installed.")}}async function i(){if(u)return u;try{return u=(await Ue(()=>import("./wallets-z86vtyeQ.js").then(y=>y.a1),__vite__mapDeps([25,12,10,5,9,8,13,14,4,6,11,7,15,26,27,28,29,30,31,32,33]))).inAppWallet(),u}catch{throw new Error("Thirdweb: thirdweb package is not installed. Run: npm install thirdweb")}}async function c(g){return f&&r===g||(f=(await Ue(()=>import("./chains-D88UzVoE.js"),__vite__mapDeps([34,4,5,23,33]))).defineChain(g),r=g),f}async function l(g,y,P){const{EIP1193:w}=await Ue(async()=>{const{EIP1193:v}=await import("./wallets-z86vtyeQ.js").then(m=>m.a1);return{EIP1193:v}},__vite__mapDeps([25,12,10,5,9,8,13,14,4,6,11,7,15,26,27,28,29,30,31,32,33]));return w.toProvider({wallet:g,chain:y,client:P})}function d(g){if(!n.includes(g))throw new Error(`Thirdweb: Chain ${g} is not supported. Supported chains: ${n.join(", ")}`)}function p(){u=null,o=null,f=null,h=null,a=null,r=null}return Uu(g=>{async function y(P){if(!h||!u)return null;const w=await s(),v=await c(P);return a=await l(u,v,w),await g.storage?.setItem("thirdwebChainId",P),{accounts:[h.address],chainId:P}}return{id:"thirdweb",name:"Thirdweb",type:"thirdweb",async setup(){const w=await g.storage?.getItem("thirdwebChainId")??g.chains[0]?.id;if(w)try{u=await i();const v=await s();if(h=await u.autoConnect({client:v}),!h)return;const m=await y(w);if(!m)return;g.emitter.emit("connect",m)}catch{}},async connect({chainId:P}={}){const w=P??g.chains[0]?.id;if(!w)throw new Error("Thirdweb: No chain ID provided and no chains configured");d(w),u||(u=await i());const v=await s();try{h=await u.autoConnect({client:v})}catch{throw new Error("Thirdweb: No active session. User must authenticate first.")}if(!h)throw new Error("Thirdweb: No active session. User must authenticate first.");const m=await y(w);if(!m)throw new Error("Thirdweb: Failed to initialize connection");return m},async disconnect(){u&&await u.disconnect(),p(),await g.storage?.removeItem("thirdwebChainId")},async getAccounts(){return h?[h.address]:[]},async getChainId(){return await g.storage?.getItem("thirdwebChainId")??r??g.chains[0]?.id},async getProvider(){if(!a)throw new Error("Thirdweb: wallet is not connected. Call connect() first.");return new Proxy({},{get(P,w){return w==="request"?async v=>{const{method:m,params:b}=v;if(m==="wallet_switchEthereumChain"){const x=b?.[0]?.chainId,_=parseInt(x,16);if(Number.isNaN(_))throw new Error("Thirdweb: Invalid chain ID");d(_),f=null,a=null;const A=await s(),T=await i(),E=await c(_);return a=await l(T,E,A),await g.storage?.setItem("thirdwebChainId",_),g.emitter.emit("change",{chainId:_}),null}return a.request(v)}:Reflect.get(a,w)}})},async isAuthorized(){try{if(!u){if(!(await g.storage?.getItem("thirdwebChainId")??g.chains[0]?.id))return!1;u=await i();const v=await s();try{return h=await u.autoConnect({client:v}),!!h}catch{return!1}}return!!u.getAccount()}catch{return!1}},async switchChain({chainId:P}){const w=g.chains.find(b=>b.id===P);if(!w)throw new Error(`Chain ${P} not configured`);if(d(P),!u||!h)throw new Error("Thirdweb: Not connected");f=null,a=null;const v=await s(),m=await c(P);return a=await l(u,m,v),await g.storage?.setItem("thirdwebChainId",P),g.emitter.emit("change",{chainId:P}),w},onAccountsChanged(P){P.length===0?this.onDisconnect():g.emitter.emit("change",{accounts:P})},onChainChanged(P){const w=parseInt(P,16);Number.isNaN(w)||g.emitter.emit("change",{chainId:w})},onDisconnect(){g.emitter.emit("disconnect"),p(),g.storage?.removeItem("thirdwebChainId")}}})}function Nu(e){const{chain:t}=e,n=t.rpcUrls.default.http[0];if(!e.transports)return[n];const o=e.transports?.[t.id]?.({chain:t});return(o?.value?.transports||[o]).map(({value:f})=>f?.url||n)}const{getAddress:at,numberToHex:lr,SwitchChainError:dr,UserRejectedRequestError:st}=await R("viem");Er.type="coinbaseWallet";function Er(e={}){return e.version==="3"||e.headlessMode?Bu(e):$u(e)}function $u(e){let t,n,o,u;return On(f=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Er.type,async connect({chainId:h,withCapabilities:a,...r}={}){try{const s=await this.getProvider(),i=(await s.request({method:"eth_requestAccounts",params:"instantOnboarding"in r&&r.instantOnboarding?[{onboarding:"instant"}]:[]})).map(l=>at(l));n||(n=this.onAccountsChanged.bind(this),s.on("accountsChanged",n)),o||(o=this.onChainChanged.bind(this),s.on("chainChanged",o)),u||(u=this.onDisconnect.bind(this),s.on("disconnect",u));let c=await this.getChainId();return h&&c!==h&&(c=(await this.switchChain({chainId:h}).catch(d=>{if(d.code===st.code)throw d;return{id:c}}))?.id??c),{accounts:a?i.map(l=>({address:l,capabilities:{}})):i,chainId:c}}catch(s){throw/(user closed modal|accounts received is empty|user denied account|request rejected)/i.test(s.message)?new st(s):s}},async disconnect(){const h=await this.getProvider();n&&(h.removeListener("accountsChanged",n),n=void 0),o&&(h.removeListener("chainChanged",o),o=void 0),u&&(h.removeListener("disconnect",u),u=void 0),h.disconnect(),h.close?.()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(a=>at(a))},async getChainId(){const a=await(await this.getProvider()).request({method:"eth_chainId"});return Number(a)},async getProvider(){if(!t){const h=typeof e.preference=="string"?{options:e.preference}:{...e.preference,options:e.preference?.options??"all"},{createCoinbaseWalletSDK:a}=await Ue(async()=>{const{createCoinbaseWalletSDK:s}=await import("./index-D4ZoaFaW.js");return{createCoinbaseWalletSDK:s}},__vite__mapDeps([35,9,36,37,8,38,39,30,32]));t=a({...e,appChainIds:f.chains.map(s=>s.id),preference:h}).getProvider()}return t},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:h,chainId:a}){const r=f.chains.find(i=>i.id===a);if(!r)throw new dr(new kn);const s=await this.getProvider();try{return await s.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(r.id)}]}),r}catch(i){if(i.code===4902)try{let c;h?.blockExplorerUrls?c=h.blockExplorerUrls:c=r.blockExplorers?.default.url?[r.blockExplorers?.default.url]:[];let l;h?.rpcUrls?.length?l=h.rpcUrls:l=[r.rpcUrls.default?.http[0]??""];const d={blockExplorerUrls:c,chainId:lr(a),chainName:h?.chainName??r.name,iconUrls:h?.iconUrls,nativeCurrency:h?.nativeCurrency??r.nativeCurrency,rpcUrls:l};return await s.request({method:"wallet_addEthereumChain",params:[d]}),r}catch(c){throw new st(c)}throw new dr(i)}},onAccountsChanged(h){h.length===0?this.onDisconnect():f.emitter.emit("change",{accounts:h.map(a=>at(a))})},onChainChanged(h){const a=Number(h);f.emitter.emit("change",{chainId:a})},async onDisconnect(h){f.emitter.emit("disconnect");const a=await this.getProvider();n&&(a.removeListener("accountsChanged",n),n=void 0),o&&(a.removeListener("chainChanged",o),o=void 0),u&&(a.removeListener("disconnect",u),u=void 0)}}))}function Bu(e){let n,o,u,f,h;return On(a=>({id:"coinbaseWalletSDK",name:"Coinbase Wallet",rdns:"com.coinbase.wallet",type:Er.type,async connect({chainId:r,withCapabilities:s}={}){try{const i=await this.getProvider(),c=(await i.request({method:"eth_requestAccounts"})).map(d=>at(d));u||(u=this.onAccountsChanged.bind(this),i.on("accountsChanged",u)),f||(f=this.onChainChanged.bind(this),i.on("chainChanged",f)),h||(h=this.onDisconnect.bind(this),i.on("disconnect",h));let l=await this.getChainId();return r&&l!==r&&(l=(await this.switchChain({chainId:r}).catch(p=>{if(p.code===st.code)throw p;return{id:l}}))?.id??l),{accounts:s?c.map(d=>({address:d,capabilities:{}})):c,chainId:l}}catch(i){throw/(user closed modal|accounts received is empty|user denied account)/i.test(i.message)?new st(i):i}},async disconnect(){const r=await this.getProvider();u&&(r.removeListener("accountsChanged",u),u=void 0),f&&(r.removeListener("chainChanged",f),f=void 0),h&&(r.removeListener("disconnect",h),h=void 0),r.disconnect(),r.close()},async getAccounts(){return(await(await this.getProvider()).request({method:"eth_accounts"})).map(s=>at(s))},async getChainId(){const s=await(await this.getProvider()).request({method:"eth_chainId"});return Number(s)},async getProvider(){if(!o){const r=await(async()=>{const{default:d}=await Ue(async()=>{const{default:p}=await import("./index-BozJS3za.js").then(g=>g.i);return{default:p}},__vite__mapDeps([40,30,41,42,43,44,39,29,45]));return typeof d!="function"&&typeof d.default=="function"?d.default:d})();n=new r({...e,reloadOnDisconnect:!1});const s=n.walletExtension?.getChainId(),i=a.chains.find(d=>e.chainId?d.id===e.chainId:d.id===s)||a.chains[0],c=e.chainId||i?.id,l=e.jsonRpcUrl||i?.rpcUrls.default.http[0];o=n.makeWeb3Provider(l,c)}return o},async isAuthorized(){try{return!!(await this.getAccounts()).length}catch{return!1}},async switchChain({addEthereumChainParameter:r,chainId:s}){const i=a.chains.find(l=>l.id===s);if(!i)throw new dr(new kn);const c=await this.getProvider();try{return await c.request({method:"wallet_switchEthereumChain",params:[{chainId:lr(i.id)}]}),i}catch(l){if(l.code===4902)try{let d;r?.blockExplorerUrls?d=r.blockExplorerUrls:d=i.blockExplorers?.default.url?[i.blockExplorers?.default.url]:[];let p;r?.rpcUrls?.length?p=r.rpcUrls:p=[i.rpcUrls.default?.http[0]??""];const g={blockExplorerUrls:d,chainId:lr(s),chainName:r?.chainName??i.name,iconUrls:r?.iconUrls,nativeCurrency:r?.nativeCurrency??i.nativeCurrency,rpcUrls:p};return await c.request({method:"wallet_addEthereumChain",params:[g]}),i}catch(d){throw new st(d)}throw new dr(l)}},onAccountsChanged(r){r.length===0?this.onDisconnect():a.emitter.emit("change",{accounts:r.map(s=>at(s))})},onChainChanged(r){const s=Number(r);a.emitter.emit("change",{chainId:s})},async onDisconnect(r){a.emitter.emit("disconnect");const s=await this.getProvider();u&&(s.removeListener("accountsChanged",u),u=void 0),f&&(s.removeListener("chainChanged",f),f=void 0),h&&(s.removeListener("disconnect",h),h=void 0)}}))}const{getAddress:jr,numberToHex:os,SwitchChainError:Hu,UserRejectedRequestError:$t}=await R("viem");Qn.type="walletConnect";function Qn(e){const t=e.isNewChainsStale??!0;let n,o;const u="eip155";let f,h,a,r,s,i;return On(c=>({id:"walletConnect",name:"WalletConnect",type:Qn.type,async setup(){const l=await this.getProvider().catch(()=>null);l&&(a||(a=this.onConnect.bind(this),l.on("connect",a)),s||(s=this.onSessionDelete.bind(this),l.on("session_delete",s)))},async connect({chainId:l,withCapabilities:d,...p}={}){try{const g=await this.getProvider();if(!g)throw new ka;r||(r=this.onDisplayUri,g.on("display_uri",r));let y=l;if(!y){const m=await c.storage?.getItem("state")??{};c.chains.some(x=>x.id===m.chainId)?y=m.chainId:y=c.chains[0]?.id}if(!y)throw new Error("No chains found on connector.");const P=await this.isChainsStale();if(g.session&&P&&await g.disconnect(),!g.session||P){const m=c.chains.filter(b=>b.id!==y).map(b=>b.id);await g.connect({optionalChains:[y,...m],..."pairingTopic"in p?{pairingTopic:p.pairingTopic}:{}}),this.setRequestedChainsIds(c.chains.map(b=>b.id))}const w=(await g.enable()).map(m=>jr(m));let v=await this.getChainId();return l&&v!==l&&(v=(await this.switchChain({chainId:l}).catch(b=>{if(b.code===$t.code&&b.cause?.message!=="Missing or invalid. request() method: wallet_addEthereumChain")throw b;return{id:v}}))?.id??v),r&&(g.removeListener("display_uri",r),r=void 0),a&&(g.removeListener("connect",a),a=void 0),f||(f=this.onAccountsChanged.bind(this),g.on("accountsChanged",f)),h||(h=this.onChainChanged.bind(this),g.on("chainChanged",h)),i||(i=this.onDisconnect.bind(this),g.on("disconnect",i)),s||(s=this.onSessionDelete.bind(this),g.on("session_delete",s)),{accounts:d?w.map(m=>({address:m,capabilities:{}})):w,chainId:v}}catch(g){throw/(user rejected|connection request reset)/i.test(g?.message)?new $t(g):g}},async disconnect(){const l=await this.getProvider();try{await l?.disconnect()}catch(d){if(!/No matching key/i.test(d.message))throw d}finally{h&&(l?.removeListener("chainChanged",h),h=void 0),i&&(l?.removeListener("disconnect",i),i=void 0),a||(a=this.onConnect.bind(this),l?.on("connect",a)),f&&(l?.removeListener("accountsChanged",f),f=void 0),s&&(l?.removeListener("session_delete",s),s=void 0),this.setRequestedChainsIds([])}},async getAccounts(){return(await this.getProvider()).accounts.map(d=>jr(d))},async getProvider({chainId:l}={}){async function d(){const p=c.chains.map(y=>y.id);if(!p.length)return;const{EthereumProvider:g}=await Ue(async()=>{const{EthereumProvider:y}=await import("./index.es-CAWfybMT.js");return{EthereumProvider:y}},__vite__mapDeps([46,8,29,30,9,31,32,47]));return await g.init({...e,disableProviderPing:!0,optionalChains:p,projectId:e.projectId,rpcMap:Object.fromEntries(c.chains.map(y=>{const[P]=Nu({chain:y,transports:c.transports});return[y.id,P]})),showQrModal:e.showQrModal??!0})}return n||(o||(o=d()),n=await o,n?.events.setMaxListeners(Number.POSITIVE_INFINITY)),l&&await this.switchChain?.({chainId:l}),n},async getChainId(){return(await this.getProvider()).chainId},async isAuthorized(){try{const[l,d]=await Promise.all([this.getAccounts(),this.getProvider()]);return l.length?await this.isChainsStale()&&d.session?(await d.disconnect().catch(()=>{}),!1):!0:!1}catch{return!1}},async switchChain({addEthereumChainParameter:l,chainId:d}){const p=await this.getProvider();if(!p)throw new ka;const g=c.chains.find(y=>y.id===d);if(!g)throw new Hu(new kn);try{await Promise.all([new Promise(P=>{const w=({chainId:v})=>{v===d&&(c.emitter.off("change",w),P())};c.emitter.on("change",w)}),p.request({method:"wallet_switchEthereumChain",params:[{chainId:os(d)}]})]);const y=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...y,d]),g}catch(y){const P=y;if(/(user rejected)/i.test(P.message))throw new $t(P);try{let w;l?.blockExplorerUrls?w=l.blockExplorerUrls:w=g.blockExplorers?.default.url?[g.blockExplorers?.default.url]:[];let v;l?.rpcUrls?.length?v=l.rpcUrls:v=[...g.rpcUrls.default.http];const m={blockExplorerUrls:w,chainId:os(d),chainName:l?.chainName??g.name,iconUrls:l?.iconUrls,nativeCurrency:l?.nativeCurrency??g.nativeCurrency,rpcUrls:v};await p.request({method:"wallet_addEthereumChain",params:[m]});const b=await this.getRequestedChainsIds();return this.setRequestedChainsIds([...b,d]),g}catch(w){throw new $t(w)}}},onAccountsChanged(l){l.length===0?this.onDisconnect():c.emitter.emit("change",{accounts:l.map(d=>jr(d))})},onChainChanged(l){const d=Number(l);c.emitter.emit("change",{chainId:d})},async onConnect(l){const d=Number(l.chainId),p=await this.getAccounts();c.emitter.emit("connect",{accounts:p,chainId:d})},async onDisconnect(l){this.setRequestedChainsIds([]),c.emitter.emit("disconnect");const d=await this.getProvider();f&&(d.removeListener("accountsChanged",f),f=void 0),h&&(d.removeListener("chainChanged",h),h=void 0),i&&(d.removeListener("disconnect",i),i=void 0),s&&(d.removeListener("session_delete",s),s=void 0),a||(a=this.onConnect.bind(this),d.on("connect",a))},onDisplayUri(l){c.emitter.emit("message",{type:"display_uri",data:l})},onSessionDelete(){this.onDisconnect()},getNamespaceChainsIds(){return n?n.session?.namespaces[u]?.accounts?.map(d=>Number.parseInt(d.split(":")[1]||"",10))??[]:[]},async getRequestedChainsIds(){return await c.storage?.getItem(this.requestedChainsStorageKey)??[]},async isChainsStale(){if(!t)return!1;const l=c.chains.map(g=>g.id),d=this.getNamespaceChainsIds();if(d.length&&!d.some(g=>l.includes(g)))return!1;const p=await this.getRequestedChainsIds();return!l.every(g=>p.includes(g))},async setRequestedChainsIds(l){await c.storage?.setItem(this.requestedChainsStorageKey,l)},get requestedChainsStorageKey(){return`${this.id}.requestedChains`}}))}const{createConfig:Qu,http:fn}=await R("wagmi"),{ChainId:Bt}=await R("@dcl/schemas"),et={name:"Decentraland",description:"Decentraland dApp",url:"https://decentraland.org",icons:["https://cdn.decentraland.org/@dcl/marketplace-site/6.41.1/favicon.ico"]},Fu={[Bt.ETHEREUM_MAINNET]:"https://rpc.decentraland.org/mainnet",[Bt.ETHEREUM_SEPOLIA]:"https://rpc.decentraland.org/sepolia",[Bt.MATIC_MAINNET]:"https://rpc.decentraland.org/polygon",[Bt.MATIC_AMOY]:"https://rpc.decentraland.org/amoy"},Gu=Hn.reduce((e,t)=>{const n=Fu[t.id];return e[t.id]=n?fn(n):fn(),e},{});function Wu(e,t){const n=t.trim();if(!n)return e;const o=e.replace(/\/+$/,""),u=n.startsWith("/")?n:`/${n}`;return`${o}${u}`}function zu(e){if(!e)return et;const t=e.url??(e.urlPath?Wu(et.url,e.urlPath):et.url);return{name:e.name??et.name,description:e.description??et.description,url:t,icons:e.icons??et.icons}}function Ku(e={}){const{walletConnectProjectId:t,appMetadata:n,chains:o=Hn,transports:u,connectors:f={},additionalConnectors:h=[]}=e,a=zu(n),{injected:r=!0,walletConnect:s=!0,coinbaseWallet:i=!0}=f,c=o.reduce((d,p)=>(d[p.id]=u?.[p.id]??Gu[p.id]??fn(),d),{}),l=[];return r&&l.push(Dc()),s&&t&&l.push(Qn({projectId:t,metadata:{name:a.name,description:a.description??"",url:a.url??"",icons:a.icons??[]}})),i&&l.push(Er({appName:a.name})),l.push(...h),Qu({chains:o,transports:c,connectors:l})}function Vu(){if(typeof window>"u"||!window.localStorage)return;const e=[],{localStorage:t}=window;for(let n=0;n<t.length;n++){const o=t.key(n);o?.startsWith("wagmi.")&&e.push(o)}e.forEach(n=>t.removeItem(n))}var Zo={},Ee={},pn={exports:{}},gn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(o){if(o==null)throw new TypeError("Expected a string but received a ".concat(o));if(o.constructor.name!=="String")throw new TypeError("Expected a string but received a ".concat(o.constructor.name))}e.exports=t.default,e.exports.default=t.default})(gn,gn.exports);var Fn=gn.exports,mn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=o;function n(u){return Object.prototype.toString.call(u)==="[object RegExp]"}function o(u,f){for(var h=0;h<f.length;h++){var a=f[h];if(u===a||n(a)&&a.test(u))return!0}return!1}e.exports=t.default,e.exports.default=t.default})(mn,mn.exports);var Yu=mn.exports,yn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(u,f){return u.indexOf(f)!==-1};t.default=n,e.exports=t.default,e.exports.default=t.default})(yn,yn.exports);var Ju=yn.exports,wn={exports:{}},Pn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=n;function n(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},u=arguments.length>1?arguments[1]:void 0;for(var f in u)typeof o[f]>"u"&&(o[f]=u[f]);return o}e.exports=t.default,e.exports.default=t.default})(Pn,Pn.exports);var ei=Pn.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=h;var n=u(Fn),o=u(ei);function u(a){return a&&a.__esModule?a:{default:a}}var f={require_tld:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_numeric_tld:!1,allow_wildcard:!1,ignore_max_length:!1};function h(a,r){(0,n.default)(a),r=(0,o.default)(r,f),r.allow_trailing_dot&&a[a.length-1]==="."&&(a=a.substring(0,a.length-1)),r.allow_wildcard===!0&&a.indexOf("*.")===0&&(a=a.substring(2));var s=a.split("."),i=s[s.length-1];return r.require_tld&&(s.length<2||!r.allow_numeric_tld&&!/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(i)||/\s/.test(i))||!r.allow_numeric_tld&&/^\d+$/.test(i)?!1:s.every(function(c){return!(c.length>63&&!r.ignore_max_length||!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(c)||/[\uff01-\uff5e]/.test(c)||/^-|-$/.test(c)||!r.allow_underscores&&/_/.test(c))})}e.exports=t.default,e.exports.default=t.default})(wn,wn.exports);var Xu=wn.exports,qn={exports:{}};(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=i;var n=o(Fn);function o(c){return c&&c.__esModule?c:{default:c}}function u(c){"@babel/helpers - typeof";return u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},u(c)}var f="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",h="(".concat(f,"[.]){3}").concat(f),a=new RegExp("^".concat(h,"$")),r="(?:[0-9a-fA-F]{1,4})",s=new RegExp("^("+"(?:".concat(r,":){7}(?:").concat(r,"|:)|")+"(?:".concat(r,":){6}(?:").concat(h,"|:").concat(r,"|:)|")+"(?:".concat(r,":){5}(?::").concat(h,"|(:").concat(r,"){1,2}|:)|")+"(?:".concat(r,":){4}(?:(:").concat(r,"){0,1}:").concat(h,"|(:").concat(r,"){1,3}|:)|")+"(?:".concat(r,":){3}(?:(:").concat(r,"){0,2}:").concat(h,"|(:").concat(r,"){1,4}|:)|")+"(?:".concat(r,":){2}(?:(:").concat(r,"){0,3}:").concat(h,"|(:").concat(r,"){1,5}|:)|")+"(?:".concat(r,":){1}(?:(:").concat(r,"){0,4}:").concat(h,"|(:").concat(r,"){1,6}|:)|")+"(?::((?::".concat(r,"){0,5}:").concat(h,"|(?::").concat(r,"){1,7}|:))")+")(%[0-9a-zA-Z.]{1,})?$");function i(c){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(0,n.default)(c);var d=(u(l)==="object"?l.version:arguments[1])||"";return d?d.toString()==="4"?a.test(c):d.toString()==="6"?s.test(c):!1:i(c,{version:4})||i(c,{version:6})}e.exports=t.default,e.exports.default=t.default})(qn,qn.exports);var Zu=qn.exports;(function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=P;var n=r(Fn),o=r(Yu),u=r(Ju),f=r(Xu),h=r(Zu),a=r(ei);function r(w){return w&&w.__esModule?w:{default:w}}function s(w,v){return p(w)||d(w,v)||c(w,v)||i()}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function c(w,v){if(w){if(typeof w=="string")return l(w,v);var m={}.toString.call(w).slice(8,-1);return m==="Object"&&w.constructor&&(m=w.constructor.name),m==="Map"||m==="Set"?Array.from(w):m==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(m)?l(w,v):void 0}}function l(w,v){(v==null||v>w.length)&&(v=w.length);for(var m=0,b=Array(v);m<v;m++)b[m]=w[m];return b}function d(w,v){var m=w==null?null:typeof Symbol<"u"&&w[Symbol.iterator]||w["@@iterator"];if(m!=null){var b,x,_,A,T=[],E=!0,S=!1;try{if(_=(m=m.call(w)).next,v!==0)for(;!(E=(b=_.call(m)).done)&&(T.push(b.value),T.length!==v);E=!0);}catch(C){S=!0,x=C}finally{try{if(!E&&m.return!=null&&(A=m.return(),Object(A)!==A))return}finally{if(S)throw x}}return T}}function p(w){if(Array.isArray(w))return w}var g={protocols:["http","https","ftp"],require_tld:!0,require_protocol:!1,require_host:!0,require_port:!1,require_valid_protocol:!0,allow_underscores:!1,allow_trailing_dot:!1,allow_protocol_relative_urls:!1,allow_fragments:!0,allow_query_components:!0,validate_length:!0,max_allowed_length:2084},y=/^\[([^\]]+)\](?::([0-9]+))?$/;function P(w,v){if((0,n.default)(w),!w||/[\s<>]/.test(w)||w.indexOf("mailto:")===0||(v=(0,a.default)(v,g),v.validate_length&&w.length>v.max_allowed_length)||!v.allow_fragments&&(0,u.default)(w,"#")||!v.allow_query_components&&((0,u.default)(w,"?")||(0,u.default)(w,"&")))return!1;var m,b,x,_,A,T,E,S;E=w.split("#"),w=E.shift(),E=w.split("?"),w=E.shift();var C=w.match(/^([a-z][a-z0-9+\-.]*):/i),I=!1,O=function(Pe){return I=!0,m=Pe.toLowerCase(),v.require_valid_protocol&&v.protocols.indexOf(m)===-1?!1:w.substring(C[0].length)};if(C){var k=C[1],D=w.substring(C[0].length),L=D.slice(0,2)==="//";if(L){if(w=O(k),w===!1)return!1}else{var U=D.indexOf("/"),j=U===-1?D:D.substring(0,U),N=j.indexOf("@");if(N!==-1){var F=j.substring(0,N),V=/^[a-zA-Z0-9\-_.%:]*$/,W=V.test(F),G=/%[0-9a-fA-F]{2}/.test(F);if(W&&!G){if(v.require_protocol)return!1}else if(w=O(k),w===!1)return!1}else{var H=/^[0-9]/.test(D);if(H){if(v.require_protocol)return!1}else if(w=O(k),w===!1)return!1}}}else if(v.require_protocol)return!1;if(w.slice(0,2)==="//"){if(!I&&!v.allow_protocol_relative_urls)return!1;w=w.slice(2)}if(w==="")return!1;if(E=w.split("/"),w=E.shift(),w===""&&!v.require_host)return!0;if(E=w.split("@"),E.length>1){if(v.disallow_auth||E[0]===""||(b=E.shift(),b.indexOf(":")>=0&&b.split(":").length>2))return!1;var Z=b.split(":"),B=s(Z,2),Q=B[0],z=B[1];if(Q===""&&z==="")return!1}_=E.join("@"),T=null,S=null;var J=_.match(y);if(J?(x="",S=J[1],T=J[2]||null):(E=_.split(":"),x=E.shift(),E.length&&(T=E.join(":"))),T!==null&&T.length>0){if(A=parseInt(T,10),!/^[0-9]+$/.test(T)||A<=0||A>65535)return!1}else if(v.require_port)return!1;return v.host_whitelist?(0,o.default)(x,v.host_whitelist):x===""&&!v.require_host?!0:!(!(0,h.default)(x)&&!(0,f.default)(x,v)&&(!S||!(0,h.default)(S,6))||(x=x||S,v.host_blacklist&&(0,o.default)(x,v.host_blacklist)))}e.exports=t.default,e.exports.default=t.default})(pn,pn.exports);var el=pn.exports,Gn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.localStorageClearIdentity=e.localStorageStoreIdentity=e.localStorageGetIdentity=e.createMessage=e.SINGLE_SIGN_ON_TARGET=e.Action=void 0;var t;(function(a){a.GET="get",a.STORE="store",a.CLEAR="clear",a.PING="ping"})(t||(e.Action=t={})),e.SINGLE_SIGN_ON_TARGET="single-sign-on";function n(a){return{target:e.SINGLE_SIGN_ON_TARGET,...a}}e.createMessage=n;function o(a){const r=localStorage.getItem(h(a));if(!r)return null;let s;try{s=JSON.parse(r)}catch{return f(a),null}return s.expiration=new Date(s.expiration),s.expiration.getTime()<=Date.now()?(f(a),null):s}e.localStorageGetIdentity=o;function u(a,r){new Date(r.expiration).getTime()>Date.now()&&localStorage.setItem(h(a),JSON.stringify(r))}e.localStorageStoreIdentity=u;function f(a){localStorage.removeItem(h(a))}e.localStorageClearIdentity=f;function h(a){if(!/^0x[a-fA-F0-9]{40}$/.test(a))throw new Error("User must be a valid ethereum address");return`single-sign-on-${a.toLowerCase()}`}})(Gn);Object.defineProperty(Ee,"__esModule",{value:!0});Ee.clearIdentity=Ee.storeIdentity=Ee.getIdentity=Ee.init=void 0;const tl=el,Se=Gn,ti=Se.SINGLE_SIGN_ON_TARGET,is=500,rl=5;let cs=0,hr="";const nl={protocols:["https"],require_protocol:!0};function al(e,t={}){if(!(0,tl.default)(e,{...nl,...t}))throw new Error(`Invalid url: ${e}`);if(hr)throw new Error("Already initialized");const n=document.createElement("iframe");n.id=ti,n.src=e,n.style.width="0",n.style.height="0",n.style.border="none",n.style.position="absolute",document.body.appendChild(n),hr=e}Ee.init=al;async function sl(e){let t;try{t=(await Sr(await Wn(),Se.Action.GET,{user:e})).identity??null}catch(n){zn(n),t=(0,Se.localStorageGetIdentity)(e)}return t}Ee.getIdentity=sl;async function ol(e,t){try{await Sr(await Wn(),Se.Action.STORE,{user:e,identity:t})}catch(n){zn(n),(0,Se.localStorageStoreIdentity)(e,t)}}Ee.storeIdentity=ol;async function il(e){try{await Sr(await Wn(),Se.Action.CLEAR,{user:e})}catch(t){zn(t),(0,Se.localStorageClearIdentity)(e)}}Ee.clearIdentity=il;async function Wn(){if(!hr)throw new Error("Not initialized");for(let e=0;e<rl;e++){const n=document.getElementById(ti)?.contentWindow;if(!n){await cl(is);continue}try{await Sr(n,Se.Action.PING,{},is)}catch{continue}return n}throw new Error("Could not get iframe because it is not ready or cannot be communicated with")}async function Sr(e,t,n,o=0){cs++;const u=cs;let f=null;const h=new Promise((a,r)=>{f=({data:s})=>{!s||s.target!==Se.SINGLE_SIGN_ON_TARGET||s.id!==u||(s.error?r(new Error(s.error)):a(s))},window.addEventListener("message",f)});e.postMessage((0,Se.createMessage)({id:u,action:t,...n}),hr);try{return await(o?Promise.race([h,new Promise((a,r)=>setTimeout(()=>r(new Error("Did not receive a response in time")),o))]):h)}catch(a){throw a}finally{f&&window.removeEventListener("message",f)}}function cl(e){return new Promise(t=>setTimeout(t,e))}function zn(e){console.warn("Could not get identity from iframe, falling back to localStorage. Error:",e.message)}(function(e){var t=Ut&&Ut.__createBinding||(Object.create?function(o,u,f,h){h===void 0&&(h=f);var a=Object.getOwnPropertyDescriptor(u,f);(!a||("get"in a?!u.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return u[f]}}),Object.defineProperty(o,h,a)}:function(o,u,f,h){h===void 0&&(h=f),o[h]=u[f]}),n=Ut&&Ut.__exportStar||function(o,u){for(var f in o)f!=="default"&&!Object.prototype.hasOwnProperty.call(u,f)&&t(u,o,f)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ee,e),n(Gn,e)})(Zo);const Ot=e=>e.wallet,ri=e=>Ot(e).address,ul=e=>Ot(e).isConnected,ll=e=>Ot(e).isConnecting,dl=e=>Ot(e).isDisconnecting,hl=e=>Ot(e).error,{useCallback:us}=await R("react"),{useSelector:gt}=await R("react-redux"),{useConnect:fl,useDisconnect:pl}=await R("wagmi");function ni(){const e=gt(ri),t=gt(ul),n=gt(ll),o=gt(dl),u=gt(hl),{connect:f,connectors:h,isPending:a}=fl(),{disconnect:r,isPending:s}=pl(),i=us(l=>{f({connector:l})},[f]),c=us(()=>{r()},[r]);return{address:e,isConnected:t,isConnecting:n||a,isDisconnecting:o||s,error:u,connectors:h,connect:i,disconnect:c}}const{useEffect:gl,useState:ml}=await R("react");function yl(){const{address:e}=ni(),t=e||void 0,[n,o]=ml(void 0);return gl(()=>{if(!t){o(void 0);return}try{const u=Zo.localStorageGetIdentity(t.toLowerCase());o(u??void 0)}catch(u){console.error("[useAuthIdentity] Failed to get identity:",u),o(void 0)}},[t]),{identity:n,hasValidIdentity:!!n,address:t}}const{useCallback:bP}=await R("react"),{useSelector:EP}=await R("react-redux"),{useSwitchChain:SP}=await R("wagmi"),{useSelector:wl}=await R("react-redux"),{useBalance:Pl}=await R("wagmi");function ls(e={}){const{tokenAddress:t,address:n,chainId:o}=e,u=wl(ri),f=n??u,{data:h,isLoading:a,isError:r,error:s,refetch:i}=Pl({address:f,token:t,chainId:o,query:{enabled:!!f}});return{balance:h?.formatted??null,balanceRaw:h?.value??null,decimals:h?.decimals??null,symbol:h?.symbol??null,isLoading:a,isError:r,error:s,refetch:i}}var ql=class extends $o{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#r=0}#e;#t;#r;build(e,t,n){const o=new jc({client:e,mutationCache:this,mutationId:++this.#r,options:e.defaultMutationOptions(t),state:n});return this.add(o),o}add(e){this.#e.add(e);const t=Ht(e);if(typeof t=="string"){const n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#e.delete(e)){const t=Ht(e);if(typeof t=="string"){const n=this.#t.get(t);if(n)if(n.length>1){const o=n.indexOf(e);o!==-1&&n.splice(o,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Ht(e);if(typeof t=="string"){const o=this.#t.get(t)?.find(u=>u.state.status==="pending");return!o||o===e}else return!0}runNext(e){const t=Ht(e);return typeof t=="string"?this.#t.get(t)?.find(o=>o!==e&&o.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){le.batch(()=>{this.#e.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){const t={exact:!0,...e};return this.getAll().find(n=>Da(t,n))}findAll(e={}){return this.getAll().filter(t=>Da(e,t))}notify(e){le.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return le.batch(()=>Promise.all(e.map(t=>t.continue().catch(je))))}};function Ht(e){return e.options.scope?.id}var vl=class extends $o{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){const o=t.queryKey,u=t.queryHash??Bo(o,t);let f=this.get(u);return f||(f=new Lc({client:e,queryKey:o,queryHash:u,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(o)}),this.add(f)),f}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){le.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){const t={exact:!0,...e};return this.getAll().find(n=>ja(t,n))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(n=>ja(e,n)):t}notify(e){le.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){le.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){le.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},bl=class{#e;#t;#r;#a;#s;#n;#o;#i;constructor(e={}){this.#e=e.queryCache||new vl,this.#t=e.mutationCache||new ql,this.#r=e.defaultOptions||{},this.#a=new Map,this.#s=new Map,this.#n=0}mount(){this.#n++,this.#n===1&&(this.#o=Uc.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#i=La.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#n--,this.#n===0&&(this.#o?.(),this.#o=void 0,this.#i?.(),this.#i=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#t.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=this.#e.build(this,t),o=n.state.data;return o===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Ua(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(o))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:t,state:n})=>{const o=n.data;return[t,o]})}setQueryData(e,t,n){const o=this.defaultQueryOptions({queryKey:e}),f=this.#e.get(o.queryHash)?.state.data,h=Mc(t,f);if(h!==void 0)return this.#e.build(this,o).setData(h,{...n,manual:!0})}setQueriesData(e,t,n){return le.batch(()=>this.#e.findAll(e).map(({queryKey:o})=>[o,this.setQueryData(o,t,n)]))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){const t=this.#e;le.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=this.#e;return le.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},o=le.batch(()=>this.#e.findAll(e).map(u=>u.cancel(n)));return Promise.all(o).then(je).catch(je)}invalidateQueries(e,t={}){return le.batch(()=>(this.#e.findAll(e).forEach(n=>{n.invalidate()}),e?.refetchType==="none"?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},o=le.batch(()=>this.#e.findAll(e).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let f=u.fetch(void 0,n);return n.throwOnError||(f=f.catch(je)),u.state.fetchStatus==="paused"?Promise.resolve():f}));return Promise.all(o).then(je)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=this.#e.build(this,t);return n.isStaleByTime(Ua(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(je).catch(je)}fetchInfiniteQuery(e){return e.behavior=Ma(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(je).catch(je)}ensureInfiniteQueryData(e){return e.behavior=Ma(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return La.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#r}setDefaultOptions(e){this.#r=e}setQueryDefaults(e,t){this.#a.set(Na(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#a.values()],n={};return t.forEach(o=>{$a(e,o.queryKey)&&Object.assign(n,o.defaultOptions)}),n}setMutationDefaults(e,t){this.#s.set(Na(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#s.values()],n={};return t.forEach(o=>{$a(e,o.mutationKey)&&Object.assign(n,o.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#r.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Bo(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===Nc&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#r.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};const{useMemo:El}=await R("react"),{WagmiProvider:Sl}=await R("wagmi");function Tl(){return new bl({defaultOptions:{queries:{staleTime:1e3*60,retry:1}}})}function TP({config:e,queryClient:t,children:n}){const o=El(()=>t??Tl(),[t]);return q.jsx(Sl,{config:e,children:q.jsx($c,{client:o,children:n})})}const{createSlice:xl}=await R("@reduxjs/toolkit"),ds={chainId:null,isSupportedNetwork:!1,isNetworkSwitching:!1,error:null},Cl=xl({name:"network",initialState:ds,reducers:{setChain(e,t){e.chainId=t.payload,e.isSupportedNetwork=t.payload!==null&&Du(t.payload),e.isNetworkSwitching=!1,e.error=null},setSwitching(e,t){e.isNetworkSwitching=t.payload,t.payload&&(e.error=null)},setError(e,t){e.error=t.payload,e.isNetworkSwitching=!1},reset(){return ds}}}),{actions:hs,reducer:Il}=Cl,{createSlice:_l}=await R("@reduxjs/toolkit"),fs={address:null,isConnected:!1,isConnecting:!1,isDisconnecting:!1,error:null},Al=_l({name:"wallet",initialState:fs,reducers:{setAccount(e,t){e.address=t.payload,e.isConnected=t.payload!==null,e.isConnecting=!1,e.error=null},setConnecting(e,t){e.isConnecting=t.payload,t.payload&&(e.error=null)},setDisconnecting(e,t){e.isDisconnecting=t.payload},setError(e,t){e.error=t.payload,e.isConnecting=!1,e.isDisconnecting=!1},reset(){return fs}}}),{actions:Lr,reducer:Rl}=Al,{useEffect:ps}=await R("react"),{useDispatch:Ol}=await R("react-redux"),{useAccount:kl,useChainId:Dl}=await R("wagmi");function xP({children:e}){const t=Ol(),{address:n,isConnecting:o,isConnected:u,isReconnecting:f}=kl(),h=Dl();return ps(()=>{u&&n?(t(Lr.setAccount(n)),t(hs.setChain(h))):!u&&!o&&!f&&(t(Lr.reset()),t(hs.setChain(null)))},[t,n,u,o,f,h]),ps(()=>{t(Lr.setConnecting(o||f))},[t,o,f]),q.jsx(q.Fragment,{children:e})}const{createSlice:jl}=await R("@reduxjs/toolkit"),gs={transactions:{},pending:[]},Ll=jl({name:"transactions",initialState:gs,reducers:{addTransaction(e,t){const n=t.payload;e.transactions[n.hash]=n,n.status==="pending"&&!e.pending.includes(n.hash)&&e.pending.push(n.hash)},updateTransaction(e,t){const{hash:n,status:o,error:u}=t.payload,f=e.transactions[n];f&&(f.status=o,f.error=u,o!=="pending"&&(e.pending=e.pending.filter(h=>h!==n)))},removeTransaction(e,t){const n=t.payload;delete e.transactions[n],e.pending=e.pending.filter(o=>o!==n)},reset(){return gs}}}),{actions:CP,reducer:Ul}=Ll;var Kn="persist:",Vn="persist/FLUSH",Tr="persist/REHYDRATE",Yn="persist/PAUSE",Jn="persist/PERSIST",Xn="persist/PURGE",Zn="persist/REGISTER",Ml=-1;function tr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?tr=function(n){return typeof n}:tr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},tr(e)}function ms(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function Nl(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ms(n,!0).forEach(function(o){$l(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ms(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function $l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Bl(e,t,n,o){o.debug;var u=Nl({},n);return e&&tr(e)==="object"&&Object.keys(e).forEach(function(f){f!=="_persist"&&t[f]===n[f]&&(u[f]=e[f])}),u}function Hl(e){var t=e.blacklist||null,n=e.whitelist||null,o=e.transforms||[],u=e.throttle||0,f="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key),h=e.storage,a;e.serialize===!1?a=function(b){return b}:typeof e.serialize=="function"?a=e.serialize:a=Ql;var r=e.writeFailHandler||null,s={},i={},c=[],l=null,d=null,p=function(b){Object.keys(b).forEach(function(x){P(x)&&s[x]!==b[x]&&c.indexOf(x)===-1&&c.push(x)}),Object.keys(s).forEach(function(x){b[x]===void 0&&P(x)&&c.indexOf(x)===-1&&s[x]!==void 0&&c.push(x)}),l===null&&(l=setInterval(g,u)),s=b};function g(){if(c.length===0){l&&clearInterval(l),l=null;return}var m=c.shift(),b=o.reduce(function(x,_){return _.in(x,m,s)},s[m]);if(b!==void 0)try{i[m]=a(b)}catch(x){console.error("redux-persist/createPersistoid: error serializing state",x)}else delete i[m];c.length===0&&y()}function y(){Object.keys(i).forEach(function(m){s[m]===void 0&&delete i[m]}),d=h.setItem(f,a(i)).catch(w)}function P(m){return!(n&&n.indexOf(m)===-1&&m!=="_persist"||t&&t.indexOf(m)!==-1)}function w(m){r&&r(m)}var v=function(){for(;c.length!==0;)g();return d||Promise.resolve()};return{update:p,flush:v}}function Ql(e){return JSON.stringify(e)}function Fl(e){var t=e.transforms||[],n="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key),o=e.storage;e.debug;var u;return e.deserialize===!1?u=function(h){return h}:typeof e.deserialize=="function"?u=e.deserialize:u=Gl,o.getItem(n).then(function(f){if(f)try{var h={},a=u(f);return Object.keys(a).forEach(function(r){h[r]=t.reduceRight(function(s,i){return i.out(s,r,a)},u(a[r]))}),h}catch(r){throw r}else return})}function Gl(e){return JSON.parse(e)}function Wl(e){var t=e.storage,n="".concat(e.keyPrefix!==void 0?e.keyPrefix:Kn).concat(e.key);return t.removeItem(n,zl)}function zl(e){}function ys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function ke(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ys(n,!0).forEach(function(o){Kl(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ys(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function Kl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Vl(e,t){if(e==null)return{};var n=Yl(e,t),o,u;if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(e);for(u=0;u<f.length;u++)o=f[u],!(t.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}function Yl(e,t){if(e==null)return{};var n={},o=Object.keys(e),u,f;for(f=0;f<o.length;f++)u=o[f],!(t.indexOf(u)>=0)&&(n[u]=e[u]);return n}var Jl=5e3;function Xl(e,t){var n=e.version!==void 0?e.version:Ml;e.debug;var o=e.stateReconciler===void 0?Bl:e.stateReconciler,u=e.getStoredState||Fl,f=e.timeout!==void 0?e.timeout:Jl,h=null,a=!1,r=!0,s=function(c){return c._persist.rehydrated&&h&&!r&&h.update(c),c};return function(i,c){var l=i||{},d=l._persist,p=Vl(l,["_persist"]),g=p;if(c.type===Jn){var y=!1,P=function(A,T){y||(c.rehydrate(e.key,A,T),y=!0)};if(f&&setTimeout(function(){!y&&P(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(e.key,'"')))},f),r=!1,h||(h=Hl(e)),d)return ke({},t(g,c),{_persist:d});if(typeof c.rehydrate!="function"||typeof c.register!="function")throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return c.register(e.key),u(e).then(function(_){var A=e.migrate||function(T,E){return Promise.resolve(T)};A(_,n).then(function(T){P(T)},function(T){P(void 0,T)})},function(_){P(void 0,_)}),ke({},t(g,c),{_persist:{version:n,rehydrated:!1}})}else{if(c.type===Xn)return a=!0,c.result(Wl(e)),ke({},t(g,c),{_persist:d});if(c.type===Vn)return c.result(h&&h.flush()),ke({},t(g,c),{_persist:d});if(c.type===Yn)r=!0;else if(c.type===Tr){if(a)return ke({},g,{_persist:ke({},d,{rehydrated:!0})});if(c.key===e.key){var w=t(g,c),v=c.payload,m=o!==!1&&v!==void 0?o(v,i,w,e):w,b=ke({},m,{_persist:ke({},d,{rehydrated:!0})});return s(b)}}}if(!d)return t(i,c);var x=t(g,c);return x===g?i:s(ke({},x,{_persist:d}))}}function ws(e){return td(e)||ed(e)||Zl()}function Zl(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function ed(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function td(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function Ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable})),n.push.apply(n,o)}return n}function vn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ps(n,!0).forEach(function(o){rd(e,o,n[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(n).forEach(function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})}return e}function rd(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ai={registry:[],bootstrapped:!1},nd=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:ai,n=arguments.length>1?arguments[1]:void 0;switch(n.type){case Zn:return vn({},t,{registry:[].concat(ws(t.registry),[n.key])});case Tr:var o=t.registry.indexOf(n.key),u=ws(t.registry);return u.splice(o,1),vn({},t,{registry:u,bootstrapped:u.length===0});default:return t}};function ad(e,t,n){var o=Oc(nd,ai,void 0),u=function(r){o.dispatch({type:Zn,key:r})},f=function(r,s,i){var c={type:Tr,payload:s,err:i,key:r};e.dispatch(c),o.dispatch(c)},h=vn({},o,{purge:function(){var r=[];return e.dispatch({type:Xn,result:function(i){r.push(i)}}),Promise.all(r)},flush:function(){var r=[];return e.dispatch({type:Vn,result:function(i){r.push(i)}}),Promise.all(r)},pause:function(){e.dispatch({type:Yn})},persist:function(){e.dispatch({type:Jn,register:u,rehydrate:f})}});return h.persist(),h}var ea={},ta={};ta.__esModule=!0;ta.default=id;function rr(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?rr=function(n){return typeof n}:rr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},rr(e)}function Ur(){}var sd={getItem:Ur,setItem:Ur,removeItem:Ur};function od(e){if((typeof self>"u"?"undefined":rr(self))!=="object"||!(e in self))return!1;try{var t=self[e],n="redux-persist ".concat(e," test");t.setItem(n,"test"),t.getItem(n),t.removeItem(n)}catch{return!1}return!0}function id(e){var t="".concat(e,"Storage");return od(t)?self[t]:sd}ea.__esModule=!0;ea.default=ld;var cd=ud(ta);function ud(e){return e&&e.__esModule?e:{default:e}}function ld(e){var t=(0,cd.default)(e);return{getItem:function(o){return new Promise(function(u,f){u(t.getItem(o))})},setItem:function(o,u){return new Promise(function(f,h){f(t.setItem(o,u))})},removeItem:function(o){return new Promise(function(u,f){u(t.removeItem(o))})}}}var si=void 0,dd=hd(ea);function hd(e){return e&&e.__esModule?e:{default:e}}var fd=(0,dd.default)("local");si=fd;const{createEntityAdapter:pd,createSlice:gd}=await R("@reduxjs/toolkit"),bt=pd(),md=bt.getInitialState(),oi=gd({name:"blog",initialState:md,reducers:{postUpserted:(e,t)=>bt.upsertOne(e,t),postsUpserted:(e,t)=>bt.upsertMany(e,t),postsClear:e=>bt.removeAll(e)}}),{postUpserted:IP,postsUpserted:Mr,postsClear:_P}=oi.actions,yd=oi.reducer;bt.getSelectors();const{formatProdErrorMessage:AP}=await R("@reduxjs/toolkit"),{batch:wd,useDispatch:Pd,useSelector:qd,useStore:vd}=await R("react-redux");function Qt(e){return e.replace(e[0],e[0].toUpperCase())}function bd(e){return e.type==="query"}function Ed(e){return e.type==="mutation"}function ii(e){return e.type==="infinitequery"}function mt(e,...t){return Object.assign(e,...t)}const{formatProdErrorMessage:RP,formatProdErrorMessage:Sd}=await R("@reduxjs/toolkit"),{useCallback:We,useDebugValue:Nr,useEffect:nt,useLayoutEffect:Td,useMemo:ue,useRef:tt,useState:qs}=await R("react"),{shallowEqual:$r}=await R("react-redux");var Br=Symbol();const{useEffect:xd,useRef:Cd,useMemo:Id}=await R("react");function Hr(e){const t=Cd(e),n=Id(()=>Un(t.current,e),[e]);return xd(()=>{t.current!==n&&(t.current=n)},[n]),n}const{useEffect:_d,useRef:Ad}=await R("react"),{shallowEqual:vs}=await R("react-redux");function Ft(e){const t=Ad(e);return _d(()=>{vs(t.current,e)||(t.current=e)},[e]),vs(t.current,e)?t.current:e}var Rd=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Od=Rd(),kd=()=>typeof navigator<"u"&&navigator.product==="ReactNative",Dd=kd(),jd=()=>Od||Dd?Td:nt,Ld=jd(),bs=e=>e.isUninitialized?{...e,isUninitialized:!1,isFetching:!0,isLoading:e.data===void 0,status:Ho.pending}:e;function Qr(e,...t){const n={};return t.forEach(o=>{n[o]=e[o]}),n}var Fr=["data","status","isLoading","isSuccess","isError","error"];function Ud({api:e,moduleOptions:{batch:t,hooks:{useDispatch:n,useSelector:o,useStore:u},unstable__sideEffectsInRender:f,createSelector:h},serializeQueryArgs:a,context:r}){const s=f?m=>m():nt;return{buildQueryHooks:P,buildInfiniteQueryHooks:w,buildMutationHook:v,usePrefetch:l};function i(m,b,x){if(b?.endpointName&&m.isUninitialized){const{endpointName:C}=b,I=r.endpointDefinitions[C];x!==ge&&a({queryArgs:b.originalArgs,endpointDefinition:I,endpointName:C})===a({queryArgs:x,endpointDefinition:I,endpointName:C})&&(b=void 0)}let _=m.isSuccess?m.data:b?.data;_===void 0&&(_=m.data);const A=_!==void 0,T=m.isLoading,E=(!b||b.isLoading||b.isUninitialized)&&!A&&T,S=m.isSuccess||A&&(T&&!b?.isError||m.isUninitialized);return{...m,data:_,currentData:m.data,isFetching:T,isLoading:E,isSuccess:S}}function c(m,b,x){if(b?.endpointName&&m.isUninitialized){const{endpointName:C}=b,I=r.endpointDefinitions[C];x!==ge&&a({queryArgs:b.originalArgs,endpointDefinition:I,endpointName:C})===a({queryArgs:x,endpointDefinition:I,endpointName:C})&&(b=void 0)}let _=m.isSuccess?m.data:b?.data;_===void 0&&(_=m.data);const A=_!==void 0,T=m.isLoading,E=(!b||b.isLoading||b.isUninitialized)&&!A&&T,S=m.isSuccess||T&&A;return{...m,data:_,currentData:m.data,isFetching:T,isLoading:E,isSuccess:S}}function l(m,b){const x=n(),_=Ft(b);return We((A,T)=>x(e.util.prefetch(m,A,{..._,...T})),[m,x,_])}function d(m,b,{refetchOnReconnect:x,refetchOnFocus:_,refetchOnMountOrArgChange:A,skip:T=!1,pollingInterval:E=0,skipPollingIfUnfocused:S=!1,...C}={}){const{initiate:I}=e.endpoints[m],O=n(),k=tt(void 0);if(!k.current){const H=O(e.internalActions.internal_getRTKQSubscriptions());k.current=H}const D=Hr(T?ge:b),L=Ft({refetchOnReconnect:x,refetchOnFocus:_,pollingInterval:E,skipPollingIfUnfocused:S}),U=C.initialPageParam,j=Ft(U),N=tt(void 0);let{queryCacheKey:F,requestId:V}=N.current||{},W=!1;F&&V&&(W=k.current.isRequestSubscribed(F,V));const G=!W&&N.current!==void 0;return s(()=>{G&&(N.current=void 0)},[G]),s(()=>{const H=N.current;if(D===ge){H?.unsubscribe(),N.current=void 0;return}const Z=N.current?.subscriptionOptions;if(!H||H.arg!==D){H?.unsubscribe();const B=O(I(D,{subscriptionOptions:L,forceRefetch:A,...ii(r.endpointDefinitions[m])?{initialPageParam:j}:{}}));N.current=B}else L!==Z&&H.updateSubscriptionOptions(L)},[O,I,A,D,L,G,j,m]),[N,O,I,L]}function p(m,b){return(_,{skip:A=!1,selectFromResult:T}={})=>{const{select:E}=e.endpoints[m],S=Hr(A?ge:_),C=tt(void 0),I=ue(()=>h([E(S),(U,j)=>j,U=>S],b,{memoizeOptions:{resultEqualityCheck:$r}}),[E,S]),O=ue(()=>T?h([I],T,{devModeChecks:{identityFunctionCheck:"never"}}):I,[I,T]),k=o(U=>O(U,C.current),$r),D=u(),L=I(D.getState(),C.current);return Ld(()=>{C.current=L},[L]),k}}function g(m){nt(()=>()=>{m.current?.unsubscribe?.(),m.current=void 0},[m])}function y(m){if(!m.current)throw new Error(Sd(38));return m.current.refetch()}function P(m){const b=(A,T={})=>{const[E]=d(m,A,T);return g(E),ue(()=>({refetch:()=>y(E)}),[E])},x=({refetchOnReconnect:A,refetchOnFocus:T,pollingInterval:E=0,skipPollingIfUnfocused:S=!1}={})=>{const{initiate:C}=e.endpoints[m],I=n(),[O,k]=qs(Br),D=tt(void 0),L=Ft({refetchOnReconnect:A,refetchOnFocus:T,pollingInterval:E,skipPollingIfUnfocused:S});s(()=>{const F=D.current?.subscriptionOptions;L!==F&&D.current?.updateSubscriptionOptions(L)},[L]);const U=tt(L);s(()=>{U.current=L},[L]);const j=We(function(F,V=!1){let W;return t(()=>{D.current?.unsubscribe(),D.current=W=I(C(F,{subscriptionOptions:U.current,forceRefetch:!V})),k(F)}),W},[I,C]),N=We(()=>{D.current?.queryCacheKey&&I(e.internalActions.removeQueryResult({queryCacheKey:D.current?.queryCacheKey}))},[I]);return nt(()=>()=>{D?.current?.unsubscribe()},[]),nt(()=>{O!==Br&&!D.current&&j(O,!0)},[O,j]),ue(()=>[j,O,{reset:N}],[j,O,N])},_=p(m,i);return{useQueryState:_,useQuerySubscription:b,useLazyQuerySubscription:x,useLazyQuery(A){const[T,E,{reset:S}]=x(A),C=_(E,{...A,skip:E===Br}),I=ue(()=>({lastArg:E}),[E]);return ue(()=>[T,{...C,reset:S},I],[T,C,S,I])},useQuery(A,T){const E=b(A,T),S=_(A,{selectFromResult:A===ge||T?.skip?void 0:bs,...T}),C=Qr(S,...Fr);return Nr(C),ue(()=>({...S,...E}),[S,E])}}}function w(m){const b=(_,A={})=>{const[T,E,S,C]=d(m,_,A),I=tt(C);s(()=>{I.current=C},[C]);const O=We(function(L,U){let j;return t(()=>{T.current?.unsubscribe(),T.current=j=E(S(L,{subscriptionOptions:I.current,direction:U}))}),j},[T,E,S]);g(T);const k=Hr(A.skip?ge:_),D=We(()=>y(T),[T]);return ue(()=>({trigger:O,refetch:D,fetchNextPage:()=>O(k,"forward"),fetchPreviousPage:()=>O(k,"backward")}),[D,O,k])},x=p(m,c);return{useInfiniteQueryState:x,useInfiniteQuerySubscription:b,useInfiniteQuery(_,A){const{refetch:T,fetchNextPage:E,fetchPreviousPage:S}=b(_,A),C=x(_,{selectFromResult:_===ge||A?.skip?void 0:bs,...A}),I=Qr(C,...Fr,"hasNextPage","hasPreviousPage");return Nr(I),ue(()=>({...C,fetchNextPage:E,fetchPreviousPage:S,refetch:T}),[C,E,S,T])}}}function v(m){return({selectFromResult:b,fixedCacheKey:x}={})=>{const{select:_,initiate:A}=e.endpoints[m],T=n(),[E,S]=qs();nt(()=>()=>{E?.arg.fixedCacheKey||E?.reset()},[E]);const C=We(function(F){const V=T(A(F,{fixedCacheKey:x}));return S(V),V},[T,A,x]),{requestId:I}=E||{},O=ue(()=>_({fixedCacheKey:x,requestId:E?.requestId}),[x,E,_]),k=ue(()=>b?h([O],b):O,[b,O]),D=o(k,$r),L=x==null?E?.arg.originalArgs:void 0,U=We(()=>{t(()=>{E&&S(void 0),x&&T(e.internalActions.removeMutationResult({requestId:I,fixedCacheKey:x}))})},[T,x,E,I]),j=Qr(D,...Fr,"endpointName");Nr(j);const N=ue(()=>({...D,originalArgs:L,reset:U}),[D,L,U]);return ue(()=>[C,N],[C,N])}}}var Md=Symbol(),Nd=({batch:e=wd,hooks:t={useDispatch:Pd,useSelector:qd,useStore:vd},createSelector:n=kc,unstable__sideEffectsInRender:o=!1,...u}={})=>({name:Md,init(f,{serializeQueryArgs:h},a){const r=f,{buildQueryHooks:s,buildInfiniteQueryHooks:i,buildMutationHook:c,usePrefetch:l}=Ud({api:f,moduleOptions:{batch:e,hooks:t,unstable__sideEffectsInRender:o,createSelector:n},serializeQueryArgs:h,context:a});return mt(r,{usePrefetch:l}),mt(a,{batch:e}),{injectEndpoint(d,p){if(bd(p)){const{useQuery:g,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:v}=s(d);mt(r.endpoints[d],{useQuery:g,useLazyQuery:y,useLazyQuerySubscription:P,useQueryState:w,useQuerySubscription:v}),f[`use${Qt(d)}Query`]=g,f[`useLazy${Qt(d)}Query`]=y}if(Ed(p)){const g=c(d);mt(r.endpoints[d],{useMutation:g}),f[`use${Qt(d)}Mutation`]=g}else if(ii(p)){const{useInfiniteQuery:g,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}=i(d);mt(r.endpoints[d],{useInfiniteQuery:g,useInfiniteQuerySubscription:y,useInfiniteQueryState:P}),f[`use${Qt(d)}InfiniteQuery`]=g}}}}});const{configureStore:OP,formatProdErrorMessage:kP}=await R("@reduxjs/toolkit"),{useContext:DP}=await R("react"),{useEffect:jP}=await R("react");await R("react");const{Provider:LP,ReactReduxContext:UP}=await R("react-redux");var ra=Yo(Xo(),Nd());const $d="1H67SAMO2T",Bd="d7f493e3a24525b7021451b81b1d294a",Hd="blog_contentful_prd",Qd="/auth",Fd="/blog",Gd="https://cms.decentraland.zone/spaces/ea2ybdmmn1kv/environments/master",Wd="pk_live_CE856A4938B36648",zd="0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",Kd="0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",Vd="https://notifications.decentraland.zone",Yd="https://peer.decentraland.zone",Jd="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Xd="e1adce863fe287bb6cf0e3fd90bdb77f",Zd="61570c542c2d66c659492e5b24a41522",eh={ALGOLIA_APP_ID:$d,ALGOLIA_API_KEY:Bd,ALGOLIA_BLOG_INDEX:Hd,AUTH_URL:Qd,BLOG_BASE_URL:Fd,CMS_BASE_URL:Gd,MAGIC_API_KEY:Wd,MANA_TOKEN_ADDRESS_ETHEREUM:zd,MANA_TOKEN_ADDRESS_MATIC:Kd,NOTIFICATIONS_API_URL:Vd,PEER_URL:Yd,SEGMENT_API_KEY:Jd,THIRDWEB_CLIENT_ID:Xd,WALLET_CONNECT_PROJECT_ID:Zd},th="1H67SAMO2T",rh="fbdb16248a42878501d8fdf1d05ae309",nh="blog_contentful_prd",ah="https://decentraland.org/auth",sh="https://decentraland.org/blog",oh="https://cms.decentraland.org/spaces/ea2ybdmmn1kv/environments/master",ih="pk_live_212568025B158355",ch="0x0f5d2fb29fb7d3cfee444a200298f468908cc942",uh="0xa1c57f48f0deb89f569dfbe6e2b7f46d33606fd4",lh="https://notifications.decentraland.org",dh="https://peer.decentraland.org",hh="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",fh="e1adce863fe287bb6cf0e3fd90bdb77f",ph="61570c542c2d66c659492e5b24a41522",gh={ALGOLIA_APP_ID:th,ALGOLIA_API_KEY:rh,ALGOLIA_BLOG_INDEX:nh,AUTH_URL:ah,BLOG_BASE_URL:sh,CMS_BASE_URL:oh,MAGIC_API_KEY:ih,MANA_TOKEN_ADDRESS_ETHEREUM:ch,MANA_TOKEN_ADDRESS_MATIC:uh,NOTIFICATIONS_API_URL:lh,PEER_URL:dh,SEGMENT_API_KEY:hh,THIRDWEB_CLIENT_ID:fh,WALLET_CONNECT_PROJECT_ID:ph},mh="1H67SAMO2T",yh="d7f493e3a24525b7021451b81b1d294a",wh="blog_contentful_prd",Ph="https://decentraland.today/auth",qh="https://decentraland.today/blog",vh="https://cms.decentraland.zone/spaces/ea2ybdmmn1kv/environments/master",bh="pk_live_CE856A4938B36648",Eh="0xfa04d2e2ba9aec166c93dfeeba7427b2303befa9",Sh="0x7ad72b9f944ea9793cf4055d88f81138cc2c63a0",Th="https://notifications.decentraland.zone",xh="https://peer.decentraland.zone",Ch="f0S2L1sWumT8BPjBmIBDTN5gIWjhrRHG",Ih="e1adce863fe287bb6cf0e3fd90bdb77f",_h="61570c542c2d66c659492e5b24a41522",Ah={ALGOLIA_APP_ID:mh,ALGOLIA_API_KEY:yh,ALGOLIA_BLOG_INDEX:wh,AUTH_URL:Ph,BLOG_BASE_URL:qh,CMS_BASE_URL:vh,MAGIC_API_KEY:bh,MANA_TOKEN_ADDRESS_ETHEREUM:Eh,MANA_TOKEN_ADDRESS_MATIC:Sh,NOTIFICATIONS_API_URL:Th,PEER_URL:xh,SEGMENT_API_KEY:Ch,THIRDWEB_CLIENT_ID:Ih,WALLET_CONNECT_PROJECT_ID:_h},ci=Ec({[Jt.DEVELOPMENT]:eh,[Jt.STAGING]:Ah,[Jt.PRODUCTION]:gh},{systemEnvVariables:{REACT_APP_DCL_DEFAULT_ENV:"dev"}}),ee=e=>ci.get(e),Rh=ee("PEER_URL");async function Oh(e){try{const t=await fetch(`${Rh}/lambdas/profiles/${e.toLowerCase()}`);if(!t.ok)return null;const n=await t.json();return Array.isArray(n)?n[0]:n}catch{return null}}const fr=ra({reducerPath:"profileClient",baseQuery:Jo(),tagTypes:["Profile"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:e=>({getProfile:e.query({queryFn:async t=>{if(!t)return{data:null};try{return{data:await Oh(t)}}catch{return{data:null}}},providesTags:(t,n,o)=>o?[{type:"Profile",id:o}]:[]})})}),{useGetProfileQuery:kh}=fr,ui=ee("CMS_BASE_URL");if(!ui)throw new Error("CMS_BASE_URL environment variable is not set");const li=ui,pr=ra({reducerPath:"cmsClient",baseQuery:eu({baseUrl:li}),tagTypes:["BlogPosts","BlogPost","Categories","Authors"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),gr=ra({reducerPath:"algoliaClient",baseQuery:Jo(),tagTypes:["SearchResults"],keepUnusedDataFor:300,refetchOnFocus:!1,refetchOnReconnect:!1,endpoints:()=>({})}),{combineReducers:Dh,configureStore:jh}=await R("@reduxjs/toolkit"),Lh={key:"blog",storage:si,whitelist:["ids","entities"]},Uh=Dh({blog:Xl(Lh,yd),network:Il,transactions:Ul,wallet:Rl,[pr.reducerPath]:pr.reducer,[gr.reducerPath]:gr.reducer,[fr.reducerPath]:fr.reducer}),Et=jh({reducer:Uh,middleware:e=>e({serializableCheck:{ignoredActions:[Vn,Tr,Yn,Jn,Xn,Zn]}}).concat(pr.middleware,gr.middleware,fr.middleware),devTools:!1}),MP=ad(Et),Es=(e,t)=>e.id||t||"",na=async(e,t)=>{const n=li,o=new URL(`${n}${e}`,window.location.origin),u=await fetch(o.toString());if(!u.ok)throw new Error(`CMS API error: ${u.status} ${u.statusText}`);return u.json()},Gr=new Map,yt=new Map,ot=new Map,be=new Map,ye=async e=>{const t=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Asset"){const n=t.sys.id;if(Gr.has(n))return Gr.get(n);if(yt.has(n))return yt.get(n);const o=na(`/assets/${n}`).then(u=>{const f=u;return Gr.set(n,f),yt.delete(n),f}).catch(()=>(yt.delete(n),e));return yt.set(n,o),o}return e};let _t=null;const NP=e=>{_t=e},ve=new Map,pe=new Map,Ss=()=>{if(!_t)return new Map;const t=_t.getState().cmsClient?.queries||{},n=Object.entries(t).find(([o])=>o.startsWith("getBlogCategories"));if(n&&n[1]?.data){const o=n[1].data,u=new Map;for(const f of o)f?.sys?.id&&u.set(f.sys.id,f);return u}return new Map},Ts=()=>{if(!_t)return new Map;const t=_t.getState().cmsClient?.queries||{},n=Object.entries(t).find(([o])=>o.startsWith("getBlogAuthors"));if(n&&n[1]?.data){const o=n[1].data,u=new Map;for(const f of o)f?.sys?.id&&u.set(f.sys.id,f);return u}return new Map},bn=async e=>{if(ot.has(e))return ot.get(e);if(be.has(e))return be.get(e);const t=na(`/entries/${e}`).then(async n=>{const o=n;return o.fields?.image&&(o.fields.image=await ye(o.fields.image)),ot.set(e,o),be.delete(e),o}).catch(()=>{throw be.delete(e),new Error(`Failed to fetch entry ${e}`)});return be.set(e,t),t},Mh=async e=>{const t=e,n=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Entry"){const o=t.sys.id;if(ve.has(o))return ve.get(o);const f=Ss().get(o);if(f)return f.fields?.image&&(f.fields.image=await ye(f.fields.image)),ve.set(o,f),f;try{const h=await bn(o);return ve.set(o,h),h}catch{return e}}if(n?.sys?.id&&n?.fields)return ve.has(n.sys.id)?ve.get(n.sys.id):(n.fields.image&&(n.fields.image=await ye(n.fields.image)),ve.set(n.sys.id,n),n);if(n?.sys?.id){if(ve.has(n.sys.id))return ve.get(n.sys.id);const u=Ss().get(n.sys.id);if(u)return u.fields?.image&&(u.fields.image=await ye(u.fields.image)),ve.set(n.sys.id,u),u}return e},Nh=async e=>{const t=e,n=e;if(t?.sys?.type==="Link"&&t.sys.linkType==="Entry"){const o=t.sys.id;if(pe.has(o))return pe.get(o);const f=Ts().get(o);if(f)return f.fields?.image&&(f.fields.image=await ye(f.fields.image)),pe.set(o,f),f;try{const h=await bn(o);return pe.set(o,h),h}catch{return e}}if(n?.sys?.id&&n?.fields)return pe.has(n.sys.id)?pe.get(n.sys.id):(n.fields.image&&(n.fields.image=await ye(n.fields.image)),pe.set(n.sys.id,n),n);if(n?.sys?.id){if(pe.has(n.sys.id))return pe.get(n.sys.id);const u=Ts().get(n.sys.id);if(u)return u.fields?.image&&(u.fields.image=await ye(u.fields.image)),pe.set(n.sys.id,u),u;try{const f=await bn(n.sys.id);return pe.set(n.sys.id,f),f}catch{return e}}return e},xs=async e=>{if(!e)return"";const o=(await ye({sys:{type:"Link",linkType:"Asset",id:e}}))?.fields?.file?.url||"";return o.startsWith("//")?`https:${o}`:o},Cs=async e=>{if(!e)return"";if(ot.has(e))return ot.get(e)?.fields?.id;if(be.has(e))return(await be.get(e))?.fields?.id;try{const t=na(`/entries/${e}`);be.set(e,t);const n=await t;return ot.set(e,n),be.delete(e),n?.fields?.id}catch{return be.delete(e),""}};function aa(e){if(!e)return"";const t=e,n=new Date(t.includes("T")?t:`${t}T00:00:00Z`);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat("en-US",{timeZone:"UTC",month:"short",day:"2-digit",year:"numeric"}).format(n)}const wt="/blog",Me={home:()=>"/",blogs:()=>wt,category:e=>`${wt}/${e}`,blog:(e,t)=>`${wt}/${e}/${t}`,author:e=>`${wt}/author/${e}`,search:e=>`${wt}/search?q=${encodeURIComponent(e)}`,twitter:e=>{const t=`${window.location.origin}${e.url}`;return`https://x.com/intent/post?text=${encodeURIComponent(e.title)}&url=${encodeURIComponent(t)}`},facebook:e=>{const t=`${window.location.origin}${e.url}`;return`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(t)}`}},di=e=>e?e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,""):"";function xr(e){if(!e||!e.sys||!e.fields||!e.fields.file)return null;const t=e.fields.file.url;return t?{id:e.sys.id,url:t.startsWith("//")?`https:${t}`:t,width:e.fields.file.details?.image?.width||0,height:e.fields.file.details?.image?.height||0,mimeType:e.fields.file.contentType||"image/jpeg"}:null}function En(e){if(!e||!e.sys||!e.fields)return null;const t=e.fields.id||di(e.fields.title||"");if(!t)return null;const n=xr(e.fields.image);return n?{id:e.sys.id,slug:t,title:e.fields.title||"",description:e.fields.description||"",image:n,isShownInMenu:e.fields.isShownInMenu??!0,url:Me.category(t)}:null}function $h(e){return{id:e||"uncategorized",slug:"uncategorized",title:"Uncategorized",description:"Posts without a valid category",image:{id:"default-category-image",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},isShownInMenu:!1,url:Me.category("uncategorized")}}function Bh(e){return{id:e||"default-image",url:"https://decentraland.org/logos/png/color.png",width:1200,height:630,mimeType:"image/png"}}function Is(e){const t=e||"decentraland";return{id:e||"unknown",slug:t,title:"Decentraland",description:"Decentraland Team",image:{id:"default-avatar",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},url:Me.author(t)}}function nr(e){if(!e||!e.sys||!e.fields)return Is(e?.sys?.id);if(Object.keys(e.fields).length===0)return Is(e.sys.id);const n=e.fields.title||"",o=e.fields.id||di(n)||e.sys.id,u=xr(e.fields.image);return u?{id:e.sys.id,slug:o,title:n,description:e.fields.description||"",image:u,url:Me.author(o)}:{id:e.sys.id,slug:o,title:n||"Decentraland",description:e.fields.description||"",image:{id:"default-avatar",url:"https://decentraland.org/logos/png/color.png",width:200,height:200,mimeType:"image/png"},url:Me.author(o)}}function Gt(e){if(!e||!e.sys||!e.fields)return null;let t=En(e.fields.category);t||(t=$h(e.sys.id));const n=nr(e.fields.author);let o=xr(e.fields.image);o||(o=Bh(e.sys.id));const u=e.fields.title||"",f=e.fields.id,h=e.fields.publishedDate,a=e.fields.body;return{id:e.sys.id,slug:f,title:u,description:e.fields.description||"",publishedDate:aa(h),body:a||{},bodyAssets:{},image:o,category:t,author:n,url:Me.blog(t.slug,f)}}const Wr=e=>Et.getState().blog.entities[e],Wt=async e=>{const t={...e,fields:{...e.fields}},[n,o,u]=await Promise.all([t.fields.category?Mh(t.fields.category):void 0,t.fields.author?Nh(t.fields.author):void 0,t.fields.image?ye(t.fields.image):void 0]);return n&&(t.fields.category=n),o&&(t.fields.author=o),u&&(t.fields.image=u),t},zt=async e=>{const t={...e,fields:{...e.fields}};return t.fields.image&&(t.fields.image=await ye(t.fields.image)),t},ze=e=>{if(e instanceof Error)return e.message;if(typeof e=="object"&&e!==null&&"error"in e){const t=e.error;if(typeof t=="string")return t}return"Unknown error"},hi=e=>{const t=[];if(e.nodeType===se.BLOCKS.EMBEDDED_ASSET&&e.data?.target?.sys?.id&&t.push(e.data.target.sys.id),e.content)for(const n of e.content)t.push(...hi(n));return t},zr=async e=>{const t=hi(e),n=[...new Set(t)];if(n.length===0)return{};const o=await Promise.all(n.map(async f=>{const h=await ye({sys:{type:"Link",linkType:"Asset",id:f}}),a=xr(h);return{id:f,asset:a}})),u={};for(const{id:f,asset:h}of o)h&&(u[f]=h);return u},Hh=pr.injectEndpoints({endpoints:e=>({getBlogPosts:e.query({serializeQueryArgs:({queryArgs:t})=>`posts-${t.category||"all"}-${t.author||"all"}`,merge:(t,n,{arg:o})=>{if(o.skip===0)return t.posts.length>n.posts.length?t:n;const u=new Set(t.posts.map(h=>h.id)),f=n.posts.filter(h=>!u.has(h.id));return{posts:[...t.posts,...f],total:n.total,hasMore:n.hasMore,nextCmsSkip:n.nextCmsSkip}},forceRefetch:({currentArg:t,previousArg:n})=>n?t?.skip!==n?.skip&&(t?.skip??0)>(n?.skip??0):!0,query:({category:t,author:n,limit:o=20,skip:u=0})=>({url:"/blog/posts",params:{category:t,author:n,limit:o,skip:u}}),transformResponse:async(t,n,{skip:o=0})=>{try{const u=t.total,h=(await Promise.all(t.items.map(async s=>{const i=s.sys?.id;if(i){const c=Wr(i);if(c)return c}try{const c=await Wt(s);return Gt(c)}catch{return null}}))).filter(s=>s!==null);h.length>0&&Et.dispatch(Mr(h));const a=o+t.items.length,r=t.items.length===0?!1:a<u;return{posts:h,total:u,hasMore:r,nextCmsSkip:a}}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},keepUnusedDataFor:60,providesTags:t=>t?[...t.posts.map(({id:n})=>({type:"BlogPosts",id:n})),{type:"BlogPosts",id:"LIST"}]:[{type:"BlogPosts",id:"LIST"}]}),getBlogPost:e.query({query:({id:t})=>({url:`/entries/${t}`}),transformResponse:async(t,n,{id:o})=>{try{const u=Wr(o);if(u&&u.bodyAssets&&Object.keys(u.bodyAssets).length>0)return u;const f=await Wt(t),h=Gt(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map blog post: missing required fields"};return h.body&&(h.bodyAssets=await zr(h.body)),Et.dispatch(Mr([h])),h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:o.id}]:[]}),getBlogCategories:e.query({query:()=>({url:"/blog/categories"}),transformResponse:async t=>{try{return(await Promise.all(t.items.map(o=>zt(o)))).map(o=>En(o)).filter(o=>o!==null)}catch(n){throw{status:"CUSTOM_ERROR",error:ze(n)}}},providesTags:["Categories"]}),getBlogCategoryBySlug:e.query({query:()=>({url:"/blog/categories"}),transformResponse:async(t,n,{slug:o})=>{try{const u=t.items.find(a=>{const r=a.fields;return Es(r,a.sys.id)===o});if(!u)throw{status:"CUSTOM_ERROR",error:`Category with slug "${o}" not found`};const f=await zt(u),h=En(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map category: missing required fields"};return h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"Categories",id:o.slug}]:[]}),getBlogPostBySlug:e.query({query:({postSlug:t})=>({url:"/blog/posts",params:{slug:t}}),transformResponse:async(t,n,{postSlug:o})=>{try{const u=t.items.find(r=>r.fields.id===o);if(!u)throw{status:"CUSTOM_ERROR",error:`Post with slug "${o}" not found`};const f=u.sys?.id;if(f){const r=Wr(f);if(r&&r.bodyAssets&&Object.keys(r.bodyAssets).length>0)return r}const h=await Wt(u),a=Gt(h);if(!a)throw{status:"CUSTOM_ERROR",error:"Failed to map post: missing required fields"};return a.body&&(a.bodyAssets=await zr(a.body)),Et.dispatch(Mr([a])),a}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:`${o.categorySlug}/${o.postSlug}`}]:[]}),getBlogAuthors:e.query({query:()=>({url:"/blog/authors"}),transformResponse:async t=>{try{return(await Promise.all(t.items.map(o=>zt(o)))).map(o=>nr(o)).filter(o=>o!==null)}catch(n){throw{status:"CUSTOM_ERROR",error:n instanceof Error?n.message:"Unknown error"}}},providesTags:["Authors"]}),getBlogAuthor:e.query({query:({id:t})=>({url:`/entries/${t}`}),transformResponse:t=>{const n=nr(t);if(!n)throw{status:"CUSTOM_ERROR",error:"Failed to map author: missing required fields"};return n},providesTags:(t,n,o)=>t?[{type:"Authors",id:o.id}]:[]}),getBlogAuthorBySlug:e.query({query:()=>({url:"/blog/authors"}),transformResponse:async(t,n,{slug:o})=>{try{const u=t.items.find(a=>{const r=a.fields;return Es(r,a.sys.id)===o});if(!u)throw{status:"CUSTOM_ERROR",error:`Author with slug "${o}" not found`};const f=await zt(u),h=nr(f);if(!h)throw{status:"CUSTOM_ERROR",error:"Failed to map author: missing required fields"};return h}catch(u){throw{status:"CUSTOM_ERROR",error:ze(u)}}},providesTags:(t,n,o)=>t?[{type:"Authors",id:o.slug}]:[]}),getBlogPostPreview:e.query({queryFn:async({id:t,env:n,token:o,previewBaseUrl:u,spaceId:f})=>{try{const h=`${u}/spaces/${f}/environments/${n}/entries?content_type=blog_post&fields.id=${t}&access_token=${o}`,a=await fetch(h);if(!a.ok)return{error:{status:a.status,data:`Failed to fetch preview: ${a.statusText}`}};const r=await a.json();if(!r.items||r.items.length===0)return{error:{status:"CUSTOM_ERROR",error:`Preview post with id "${t}" not found`}};const s=r.items[0],i=await Wt(s),c=Gt(i);return c?(c.body&&(c.bodyAssets=await zr(c.body)),{data:c}):{error:{status:"CUSTOM_ERROR",error:"Failed to map preview post: missing required fields"}}}catch(h){return{error:{status:"CUSTOM_ERROR",error:ze(h)}}}},providesTags:(t,n,o)=>t?[{type:"BlogPost",id:`preview-${o.id}`}]:[]})}),overrideExisting:!1}),{useGetBlogPostsQuery:fi,useGetBlogCategoriesQuery:Qh,useGetBlogCategoryBySlugQuery:Fh,useGetBlogPostBySlugQuery:Gh,useGetBlogAuthorBySlugQuery:Wh,useGetBlogPostPreviewQuery:zh}=Hh,Kh=ee("WALLET_CONNECT_PROJECT_ID")??"",_s=ee("MAGIC_API_KEY")??"",As=ee("THIRDWEB_CLIENT_ID")??"",Vh=[..._s?[Lu({apiKey:_s})]:[],...As?[Mu({clientId:As})]:[]],$P=Ku({walletConnectProjectId:Kh,appMetadata:{name:"Decentraland Blog",description:"The official Decentraland Blog",url:typeof window<"u"?window.location.origin:"https://decentraland.org/blog"},additionalConnectors:Vh}),Yh={title:"Blog",default_description:"Stay up to date with Decentraland announcements, updates, community highlights, and more.",all_articles:"All articles",load_more:"Load More",nothing_to_show:"Nothing to show",related_post:"Related Articles",share:"Share",posts_by:"Posts by {author}"},Jh={placeholder:"Search...",clear:"Clear search",searching:"Searching...",error:"Search error",no_matches:"No matches",try_something_else:"Try searching for something else",see_more_results:"See more results",results_for:"Search results for",no_results_for:"No results found for",title:"Search",title_with_query:"Search: {query}",description_with_query:'Search results for "{query}" in Decentraland Blog',description:"Search the Decentraland Blog"},Xh={generic:"Something went wrong. Please try again.",load_post:"Failed to load post. Please try again later.",load_posts:"Failed to load posts. Please try again later.",load_category:"Failed to load category. Please try again later.",load_author:"Failed to load author. Please try again later.",load_preview:"Failed to load preview. Please check your preview URL and try again."},Zh={mode:"Preview Mode",description:"You are viewing an unpublished post from Contentful",missing_params:"Missing preview parameters. Required: contentful_id, contentful_env, token"},ef={default_image_alt:"Decentraland - A virtual world owned by its users"},BP={blog:Yh,search:Jh,error:Xh,preview:Zh,seo:ef};var sa={};sa.match=of;sa.parse=pi;var tf=/(?:(only|not)?\s*([^\s\(\)]+)(?:\s*and)?\s*)?(.+)?/i,rf=/\(\s*([^\s\:\)]+)\s*(?:\:\s*([^\s\)]+))?\s*\)/,nf=/^(?:(min|max)-)?(.+)/,af=/(em|rem|px|cm|mm|in|pt|pc)?$/,sf=/(dpi|dpcm|dppx)?$/;function of(e,t){return pi(e).some(function(n){var o=n.inverse,u=n.type==="all"||t.type===n.type;if(u&&o||!(u||o))return!1;var f=n.expressions.every(function(h){var a=h.feature,r=h.modifier,s=h.value,i=t[a];if(!i)return!1;switch(a){case"orientation":case"scan":return i.toLowerCase()===s.toLowerCase();case"width":case"height":case"device-width":case"device-height":s=ks(s),i=ks(i);break;case"resolution":s=Os(s),i=Os(i);break;case"aspect-ratio":case"device-aspect-ratio":case"device-pixel-ratio":s=Rs(s),i=Rs(i);break;case"grid":case"color":case"color-index":case"monochrome":s=parseInt(s,10)||1,i=parseInt(i,10)||0;break}switch(r){case"min":return i>=s;case"max":return i<=s;default:return i===s}});return f&&!o||!f&&o})}function pi(e){return e.split(",").map(function(t){t=t.trim();var n=t.match(tf),o=n[1],u=n[2],f=n[3]||"",h={};return h.inverse=!!o&&o.toLowerCase()==="not",h.type=u?u.toLowerCase():"all",f=f.match(/\([^\)]+\)/g)||[],h.expressions=f.map(function(a){var r=a.match(rf),s=r[1].toLowerCase().match(nf);return{modifier:s[1],feature:s[2],value:r[2]}}),h})}function Rs(e){var t=Number(e),n;return t||(n=e.match(/^(\d+)\s*\/\s*(\d+)$/),t=n[1]/n[2]),t}function Os(e){var t=parseFloat(e),n=String(e).match(sf)[1];switch(n){case"dpcm":return t/2.54;case"dppx":return t*96;default:return t}}function ks(e){var t=parseFloat(e),n=String(e).match(af)[1];switch(n){case"em":return t*16;case"rem":return t*16;case"cm":return t*96/2.54;case"mm":return t*96/2.54/10;case"in":return t*96;case"pt":return t*72;case"pc":return t*72/12;default:return t}}var cf=sa.match,Ds=typeof window<"u"?window.matchMedia:null;function uf(e,t,n){var o=this,u;Ds&&!n&&(u=Ds.call(window,e)),u?(this.matches=u.matches,this.media=u.media,u.addListener(a)):(this.matches=cf(e,t),this.media=e),this.addListener=f,this.removeListener=h,this.dispose=r;function f(s){u&&u.addListener(s)}function h(s){u&&u.removeListener(s)}function a(s){o.matches=s.matches,o.media=s.media}function r(){u&&u.removeListener(a)}}function lf(e,t,n){return new uf(e,t,n)}var df=lf;const hf=Rt(df);var ff=/[A-Z]/g,pf=/^ms-/,Kr={};function gf(e){return"-"+e.toLowerCase()}function gi(e){if(Kr.hasOwnProperty(e))return Kr[e];var t=e.replace(ff,gf);return Kr[e]=pf.test(t)?"-"+t:t}function mf(e,t){if(e===t)return!0;if(!e||!t)return!1;const n=Object.keys(e),o=Object.keys(t),u=n.length;if(o.length!==u)return!1;for(let f=0;f<u;f++){const h=n[f];if(e[h]!==t[h]||!Object.prototype.hasOwnProperty.call(t,h))return!1}return!0}var mi={exports:{}},yf="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",wf=yf,Pf=wf;function yi(){}function wi(){}wi.resetWarningCache=yi;var qf=function(){function e(o,u,f,h,a,r){if(r!==Pf){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:wi,resetWarningCache:yi};return n.PropTypes=n,n};mi.exports=qf();var vf=mi.exports;const M=Rt(vf),{createContext:bf,useRef:Ef,useEffect:Ye,useContext:Sf,useState:Cr}=await R("react"),ae=M.oneOfType([M.string,M.number]),Pi={all:M.bool,grid:M.bool,aural:M.bool,braille:M.bool,handheld:M.bool,print:M.bool,projection:M.bool,screen:M.bool,tty:M.bool,tv:M.bool,embossed:M.bool},Tf={orientation:M.oneOf(["portrait","landscape"]),scan:M.oneOf(["progressive","interlace"]),aspectRatio:M.string,deviceAspectRatio:M.string,height:ae,deviceHeight:ae,width:ae,deviceWidth:ae,color:M.bool,colorIndex:M.bool,monochrome:M.bool,resolution:ae,type:Object.keys(Pi)},{type:HP,...xf}=Tf,Cf={minAspectRatio:M.string,maxAspectRatio:M.string,minDeviceAspectRatio:M.string,maxDeviceAspectRatio:M.string,minHeight:ae,maxHeight:ae,minDeviceHeight:ae,maxDeviceHeight:ae,minWidth:ae,maxWidth:ae,minDeviceWidth:ae,maxDeviceWidth:ae,minColor:M.number,maxColor:M.number,minColorIndex:M.number,maxColorIndex:M.number,minMonochrome:M.number,maxMonochrome:M.number,minResolution:ae,maxResolution:ae,...xf},If={...Pi,...Cf};var _f={all:If};const Af=e=>`not ${e}`,Rf=(e,t)=>{const n=gi(e);return typeof t=="number"&&(t=`${t}px`),t===!0?n:t===!1?Af(n):`(${n}: ${t})`},Of=e=>e.join(" and "),kf=e=>{const t=[];return Object.keys(_f.all).forEach(n=>{const o=e[n];o!=null&&t.push(Rf(n,o))}),Of(t)},Df=bf(void 0),jf=e=>e.query||kf(e),js=e=>e?Object.keys(e).reduce((n,o)=>(n[gi(o)]=e[o],n),{}):void 0,qi=()=>{const e=Ef(!1);return Ye(()=>{e.current=!0},[]),e.current},Lf=e=>{const t=Sf(Df),n=()=>js(e)||js(t),[o,u]=Cr(n);return Ye(()=>{const f=n();mf(o,f)||u(f)},[e,t]),o},Uf=e=>{const t=()=>jf(e),[n,o]=Cr(t);return Ye(()=>{const u=t();n!==u&&o(u)},[e]),n},Mf=(e,t)=>{const n=()=>hf(e,t||{},!!t),[o,u]=Cr(n),f=qi();return Ye(()=>{if(f){const h=n();return u(h),()=>{h&&h.dispose()}}},[e,t]),o},Nf=e=>{const[t,n]=Cr(e.matches);return Ye(()=>{const o=u=>{n(u.matches)};return e.addListener(o),n(e.matches),()=>{e.removeListener(o)}},[e]),t},$f=(e,t,n)=>{const o=Lf(t),u=Uf(e);if(!u)throw new Error("Invalid or missing MediaQuery!");const f=Mf(u,o),h=Nf(f);return qi(),Ye(()=>{},[h]),Ye(()=>()=>{f&&f.dispose()},[]),h},{useEffect:Bf,useRef:Hf,useState:Qf}=await R("react"),vi=e=>{const[t,n]=Qf(!1),o=Hf(null);return Bf(()=>{if(!e)return;const u=new window.Image;if(o.current=u,u.src=e,u.complete){n(!0);return}return n(!1),u.onload=()=>n(!0),u.onerror=()=>n(!0),()=>{o.current&&(o.current.onload=null,o.current.onerror=null)}},[e]),t},{Link:oa}=await R("react-router-dom"),{Box:ut,Skeleton:lt,dclColors:Ls,styled:re}=await R("decentraland-ui2"),Us=re(ut)(()=>({width:"100%",margin:"0 40px 40px 0",position:"relative",display:"flex",justifyContent:"space-between","@media (max-width: 1096px)":{display:"none"}})),Ff=re(ut)(({$imageUrl:e})=>({backgroundImage:`url("${e}")`,backgroundSize:"cover",backgroundPosition:"center",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"697px",paddingBottom:"calc(697px * 0.5)",marginRight:"31px",transition:"transform 250ms ease, box-shadow 250ms ease"})),Gf=re(oa)(()=>({display:"block","&:hover > div":{transform:"translate(0, -4px)",boxShadow:"0 10px 20px 0 rgba(0, 0, 0, 0.12)"}})),Ms=re(ut)({width:"335px"}),Wf=re("span")(({theme:e})=>({marginRight:"16px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,textDecoration:"none",textTransform:"uppercase",display:"inline"})),zf=re(oa)(()=>({color:Ls.neutral.gray3,fontSize:"13px",textDecoration:"none",textTransform:"uppercase",transition:"color 250ms ease",fontWeight:400,"&:hover":{color:Ls.neutral.gray2}})),Kf=re(oa)(({theme:e})=>({textDecoration:"none",display:"block",color:e.palette.text.primary,"& h2, & h3":{fontSize:"34px",lineHeight:"42px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),Vf=re("p")(({theme:e})=>({display:"block",fontSize:"17px",lineHeight:"26px",letterSpacing:"-0.4px",margin:0,paddingTop:"8px",fontWeight:400,color:e.palette.text.primary})),Yf=re(ut)(()=>({display:"flex",justifyContent:"space-between"})),Ns=re(lt)(()=>({width:"697px",height:"348px"})),Jf=re(lt)(()=>({width:"100%",height:"40px"})),Xf=re(lt)(()=>({width:"90%",height:"40px"})),$s=re(lt)(()=>({width:"100px"})),Vr=re(lt)(()=>({width:"100%"})),Zf=re(lt)(()=>({width:"80%"})),ep=re(ut)(({theme:e})=>({marginTop:e.spacing(2)})),tp=re(ut)(()=>({})),{Typography:rp}=await R("decentraland-ui2"),Bs=e=>{const{post:t,loading:n}=e,o=vi(t?.image?.url);return n?q.jsxs(Us,{children:[q.jsx(Ns,{variant:"rectangular"}),q.jsxs(Ms,{children:[q.jsxs(Yf,{children:[q.jsx($s,{variant:"text"}),q.jsx($s,{variant:"text"})]}),q.jsx(Jf,{variant:"text"}),q.jsx(Xf,{variant:"text"}),q.jsxs(ep,{children:[q.jsx(Vr,{variant:"text"}),q.jsx(Vr,{variant:"text"}),q.jsx(Vr,{variant:"text"}),q.jsx(Zf,{variant:"text"})]})]})]}):q.jsxs(Us,{children:[o?q.jsx(Gf,{to:t.url,children:q.jsx(Ff,{$imageUrl:t.image.url})}):q.jsx(Ns,{variant:"rectangular"}),q.jsxs(Ms,{children:[q.jsxs(tp,{children:[q.jsx(Wf,{children:t.publishedDate}),q.jsx("span",{children:q.jsx(zf,{to:t.category.url,children:t.category.title})})]}),q.jsx(Kf,{to:t.url,children:q.jsx(rp,{variant:"h3",component:"h2",children:t.title})}),q.jsx(Vf,{children:t.description})]})]})},{Link:ia}=await R("react-router-dom"),{Box:ca,Card:np,CardContent:ap,Skeleton:Ir,dclColors:Hs,styled:he}=await R("decentraland-ui2"),Qs=he(np)(()=>({display:"flex",flexDirection:"column",width:"calc((100% - (32px * 2)) / 3)",marginRight:"32px",marginBottom:"40px",position:"relative",boxShadow:"none",backgroundColor:"transparent !important",background:"transparent !important","& .MuiPaper-root":{backgroundColor:"transparent !important",background:"transparent !important"},"@media (max-width: 1096px)":{width:"calc((100% - 24px) / 2)",marginRight:0},"@media (max-width: 568px)":{width:"100%"},"&:nth-of-type(3n)":{marginRight:0}})),sp=he(ca,{shouldForwardProp:e=>e!=="$imageUrl"})(({$imageUrl:e})=>({backgroundImage:`url("${e}")`,backgroundSize:"cover",backgroundPosition:"center",boxShadow:"0 2px 4px 0 rgba(0, 0, 0, 0.16)",borderRadius:"5px",width:"100%",marginBottom:"12px",paddingBottom:"50%",transition:"transform 250ms ease, box-shadow 250ms ease"})),op=he(ia)(()=>({display:"block","&:hover .post-card__image, &:hover > div":{transform:"translate(0, -4px)",boxShadow:"0 10px 20px 0 rgba(0, 0, 0, 0.12)"}})),Fs=he(ap)({width:"100%",padding:0,backgroundColor:"transparent !important",background:"transparent !important","&.MuiCardContent-root":{backgroundColor:"transparent !important",background:"transparent !important"},"&:last-child":{paddingBottom:0}}),ip=he("span")(({theme:e})=>({marginRight:"16px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,textDecoration:"none",textTransform:"uppercase",display:"inline"})),cp=he(ia)(()=>({color:Hs.neutral.gray3,fontSize:"13px",textDecoration:"none",textTransform:"uppercase",transition:"color 250ms ease",fontWeight:400,"&:hover":{color:Hs.neutral.gray2}})),up=he(ia)(({theme:e})=>({textDecoration:"none",paddingTop:"8px",display:"block",color:e.palette.text.primary,"& h2, & h6":{fontSize:"20px",lineHeight:"28px",color:e.palette.text.primary,fontWeight:500},"&:visited, &:link, &:active":{color:e.palette.text.primary},"& *":{color:e.palette.text.primary}})),lp=he(ca)(()=>({display:"flex",justifyContent:"space-between"})),Gs=he(Ir)(()=>({height:"200px"})),Ws=he(Ir)(()=>({width:"100px"})),dp=he(Ir)(()=>({width:"100%"})),hp=he(Ir)(()=>({width:"80%"})),fp=he(ca)(()=>({})),{Typography:pp}=await R("decentraland-ui2"),ar=e=>{const{post:t,loading:n}=e,o=vi(t?.image?.url);return n?q.jsxs(Qs,{elevation:0,children:[q.jsx(Gs,{variant:"rectangular"}),q.jsxs(Fs,{children:[q.jsxs(lp,{children:[q.jsx(Ws,{variant:"text"}),q.jsx(Ws,{variant:"text"})]}),q.jsx(dp,{variant:"text"}),q.jsx(hp,{variant:"text"})]})]}):q.jsxs(Qs,{elevation:0,children:[o?q.jsx(op,{to:t.url,children:q.jsx(sp,{$imageUrl:t.image.url})}):q.jsx(Gs,{variant:"rectangular"}),q.jsxs(Fs,{children:[q.jsxs(fp,{children:[q.jsx(ip,{children:t.publishedDate}),q.jsx("span",{children:q.jsx(cp,{to:t.category.url,children:t.category.title})})]}),q.jsx(up,{to:t.url,children:q.jsx(pp,{variant:"h6",component:"h2",children:t.title})})]})]})},{Box:bi,styled:Ei}=await R("decentraland-ui2"),zs=Ei(bi,{shouldForwardProp:e=>e!=="hasMainPost"})(({theme:e,hasMainPost:t})=>({display:"flex",flexWrap:"wrap",justifyContent:"flex-start",paddingBottom:e.spacing(2.5),"& > div:nth-of-type(3n)":{marginRight:e.spacing(4)},...t&&{"& > div:nth-of-type(3n + 1)":{marginRight:0}},...!t&&{"& > div:nth-of-type(3n + 3)":{marginRight:0}},"@media (max-width: 1096px)":{justifyContent:"space-between","& > div, & > div:nth-of-type(3n)":{marginRight:0}}}));Ei(bi)(()=>({display:"flex",flexWrap:"wrap",width:"100%",marginTop:0}));const{memo:gp}=await R("react"),Yr=e=>"isPlaceholder"in e&&e.isPlaceholder===!0,ua=gp(e=>{const{posts:t,loading:n,hasMainPost:o=!1}=e,u=$f({minWidth:1096});if(n&&t.length===0){const h=o?7:6;return q.jsxs(zs,{hasMainPost:o,children:[o&&q.jsx(Bs,{loading:!0}),Array.from(Array(h),(a,r)=>o&&r===0?null:q.jsx(ar,{loading:!0},`skeleton-${r}`))]})}if(!t||t.length===0)return null;const f=t.find(h=>!Yr(h));return q.jsxs(zs,{hasMainPost:o,children:[o&&u&&f&&q.jsx(Bs,{post:f}),t.map(h=>o&&u&&!Yr(h)&&h===f?null:Yr(h)?q.jsx(ar,{loading:!0},h.id):q.jsx(ar,{post:h},h.id))]})}),{useCallback:Kt,useEffect:mp,useMemo:yp,useState:wp}=await R("react"),{useNotifications:Pp}=await R("@dcl/hooks"),{NotificationActiveTab:qp,Profile:vp,dclAddressUtils:bp}=await R("decentraland-ui2");function Ep(e){const{identity:t,isConnected:n,locale:o="en"}=e,u=!!(t&&n),[f,h]=wp(!0),a=ee("NOTIFICATIONS_API_URL")??"https://notifications.decentraland.org";mp(()=>{u||h(!0)},[u]);const r=Kt(()=>{u&&h(b=>b&&!1)},[u]),{notifications:s,isLoading:i,isModalOpen:c,isNotificationsOnboarding:l,modalActiveTab:d,handleNotificationsOpen:p,handleOnBegin:g,handleOnChangeModalTab:y}=Pp({identity:t??void 0,isNotificationsEnabled:u&&f,initialActiveTab:qp.NEWEST,notificationsUrl:a,onError:r}),P=Kt(()=>{f||h(!0),p()},[p,f]),w=Kt((b,x)=>{y(x)},[y]),v=Kt(b=>q.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[q.jsx(vp,{address:b,size:"normal",imageOnly:!0}),bp.shorten(b)]}),[]);return{notificationProps:yp(()=>{if(u)return{locale:o,isLoading:i,isOnboarding:l,isOpen:c,items:s,activeTab:d,onClick:P,onClose:P,onBegin:g,onChangeTab:w,renderProfile:v}},[u,o,i,l,c,s,d,P,g,w,v])}}function Sp(){return/^decentraland.(zone|org|today)$/.test(window.location.host)?"/blog":""}function Tp(e,t){const n=Sp(),o=new URL(e,window.location.origin);let u=o.pathname+o.search;return n&&u.startsWith(n)&&(u=u.slice(n.length)||"/"),`${n}${u}`}function xp(){const e=ee("AUTH_URL")??"/auth";return e.startsWith("http")||window.location.hostname==="localhost"||window.location.hostname==="127.0.0.1"?e:`${window.location.origin}${e.startsWith("/")?"":"/"}${e}`}function Cp(){const e=window.location.pathname,t=window.location.search;return new URLSearchParams(t).get("redirectTo")??`${e}${t}`}function Si(e,t){const n=Cp(),o=Tp(n),u=xp();Vu(),window.location.replace(`${u}/login?redirectTo=${encodeURIComponent(o)}`)}function Te(){function e(t){return new Promise(n=>{let o=new XMLHttpRequest;o.open(t.method,t.url,!0),Object.keys(t.headers).forEach(a=>o.setRequestHeader(a,t.headers[a]));let u=(a,r)=>setTimeout(()=>{o.abort(),n({status:0,content:r,isTimedOut:!0})},a),f=u(t.connectTimeout,"Connection timeout"),h;o.onreadystatechange=()=>{o.readyState>o.OPENED&&h===void 0&&(clearTimeout(f),h=u(t.responseTimeout,"Socket timeout"))},o.onerror=()=>{o.status===0&&(clearTimeout(f),clearTimeout(h),n({content:o.responseText||"Network request failed",status:o.status,isTimedOut:!1}))},o.onload=()=>{clearTimeout(f),clearTimeout(h),n({content:o.responseText,status:o.status,isTimedOut:!1})},o.send(t.data)})}return{send:e}}function xe(e){let t;const n=`algolia-client-js-${e.key}`;function o(){return t===void 0&&(t=e.localStorage||window.localStorage),t}function u(){return JSON.parse(o().getItem(n)||"{}")}function f(a){o().setItem(n,JSON.stringify(a))}function h(){const a=e.timeToLive?e.timeToLive*1e3:null,r=u(),s=Object.fromEntries(Object.entries(r).filter(([,c])=>c.timestamp!==void 0));if(f(s),!a)return;const i=Object.fromEntries(Object.entries(s).filter(([,c])=>{const l=new Date().getTime();return!(c.timestamp+a<l)}));f(i)}return{get(a,r,s={miss:()=>Promise.resolve()}){return Promise.resolve().then(()=>(h(),u()[JSON.stringify(a)])).then(i=>Promise.all([i?i.value:r(),i!==void 0])).then(([i,c])=>Promise.all([i,c||s.miss(i)])).then(([i])=>i)},set(a,r){return Promise.resolve().then(()=>{const s=u();return s[JSON.stringify(a)]={timestamp:new Date().getTime(),value:r},o().setItem(n,JSON.stringify(s)),r})},delete(a){return Promise.resolve().then(()=>{const r=u();delete r[JSON.stringify(a)],o().setItem(n,JSON.stringify(r))})},clear(){return Promise.resolve().then(()=>{o().removeItem(n)})}}}function Ip(){return{get(e,t,n={miss:()=>Promise.resolve()}){return t().then(u=>Promise.all([u,n.miss(u)])).then(([u])=>u)},set(e,t){return Promise.resolve(t)},delete(e){return Promise.resolve()},clear(){return Promise.resolve()}}}function ie(e){const t=[...e.caches],n=t.shift();return n===void 0?Ip():{get(o,u,f={miss:()=>Promise.resolve()}){return n.get(o,u,f).catch(()=>ie({caches:t}).get(o,u,f))},set(o,u){return n.set(o,u).catch(()=>ie({caches:t}).set(o,u))},delete(o){return n.delete(o).catch(()=>ie({caches:t}).delete(o))},clear(){return n.clear().catch(()=>ie({caches:t}).clear())}}}function K(e={serializable:!0}){let t={};return{get(n,o,u={miss:()=>Promise.resolve()}){const f=JSON.stringify(n);if(f in t)return Promise.resolve(e.serializable?JSON.parse(t[f]):t[f]);const h=o();return h.then(a=>u.miss(a)).then(()=>h)},set(n,o){return t[JSON.stringify(n)]=e.serializable?JSON.stringify(o):o,Promise.resolve(o)},delete(n){return delete t[JSON.stringify(n)],Promise.resolve()},clear(){return t={},Promise.resolve()}}}function _p(e){const t={value:`Algolia for JavaScript (${e})`,add(n){const o=`; ${n.segment}${n.version!==void 0?` (${n.version})`:""}`;return t.value.indexOf(o)===-1&&(t.value=`${t.value}${o}`),t}};return t}function Ce(e,t,n="WithinHeaders"){const o={"x-algolia-api-key":t,"x-algolia-application-id":e};return{headers(){return n==="WithinHeaders"?o:{}},queryParameters(){return n==="WithinQueryParameters"?o:{}}}}function Be({func:e,validate:t,aggregator:n,error:o,timeout:u=()=>0}){const f=h=>new Promise((a,r)=>{e(h).then(async s=>(n&&await n(s),await t(s)?a(s):o&&await o.validate(s)?r(new Error(await o.message(s))):setTimeout(()=>{f(s).then(a).catch(r)},await u()))).catch(s=>{r(s)})});return f()}function Ie({algoliaAgents:e,client:t,version:n}){const o=_p(n).add({segment:t,version:n});return e.forEach(u=>o.add(u)),o}function _e(){return{debug(e,t){return Promise.resolve()},info(e,t){return Promise.resolve()},error(e,t){return Promise.resolve()}}}var Ks=2*60*1e3;function Vs(e,t="up"){const n=Date.now();function o(){return t==="up"||Date.now()-n>Ks}function u(){return t==="timed out"&&Date.now()-n<=Ks}return{...e,status:t,lastUpdate:n,isUp:o,isTimedOut:u}}var Ti=class extends Error{name="AlgoliaError";constructor(e,t){super(e),t&&(this.name=t)}},xi=class extends Ti{stackTrace;constructor(e,t,n){super(e,n),this.stackTrace=t}},Ap=class extends xi{constructor(e){super("Unreachable hosts - your application id may be incorrect. If the error persists, please visit our help center https://alg.li/support-unreachable-hosts or reach out to the Algolia Support team: https://alg.li/support",e,"RetryError")}},mr=class extends xi{status;constructor(e,t,n,o="ApiError"){super(e,n,o),this.status=t}},Rp=class extends Ti{response;constructor(e,t){super(e,"DeserializationError"),this.response=t}},Op=class extends mr{error;constructor(e,t,n,o){super(e,t,o,"DetailedApiError"),this.error=n}};function Ci(e){const t=e;for(let n=e.length-1;n>0;n--){const o=Math.floor(Math.random()*(n+1)),u=e[n];t[n]=e[o],t[o]=u}return t}function kp(e,t,n){const o=Dp(n);let u=`${e.protocol}://${e.url}${e.port?`:${e.port}`:""}/${t.charAt(0)==="/"?t.substring(1):t}`;return o.length&&(u+=`?${o}`),u}function Dp(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort().map(t=>`${t}=${encodeURIComponent(Object.prototype.toString.call(e[t])==="[object Array]"?e[t].join(","):e[t]).replace(/\+/g,"%20")}`).join("&")}function jp(e,t){if(e.method==="GET"||e.data===void 0&&t.data===void 0)return;const n=Array.isArray(e.data)?e.data:{...e.data,...t.data};return JSON.stringify(n)}function Lp(e,t,n){const o={Accept:"application/json",...e,...t,...n},u={};return Object.keys(o).forEach(f=>{const h=o[f];u[f.toLowerCase()]=h}),u}function Up(e){try{return JSON.parse(e.content)}catch(t){throw new Rp(t.message,e)}}function Mp({content:e,status:t},n){try{const o=JSON.parse(e);return"error"in o?new Op(o.message,t,o.error,n):new mr(o.message,t,n)}catch{}return new mr(e,t,n)}function Np({isTimedOut:e,status:t}){return!e&&~~t===0}function $p({isTimedOut:e,status:t}){return e||Np({isTimedOut:e,status:t})||~~(t/100)!==2&&~~(t/100)!==4}function Bp({status:e}){return~~(e/100)===2}function Hp(e){return e.map(t=>Ii(t))}function Ii(e){const t=e.request.headers["x-algolia-api-key"]?{"x-algolia-api-key":"*****"}:{};return{...e,request:{...e.request,headers:{...e.request.headers,...t}}}}function Ae({hosts:e,hostsCache:t,baseHeaders:n,logger:o,baseQueryParameters:u,algoliaAgent:f,timeouts:h,requester:a,requestsCache:r,responsesCache:s}){async function i(d){const p=await Promise.all(d.map(v=>t.get(v,()=>Promise.resolve(Vs(v))))),g=p.filter(v=>v.isUp()),y=p.filter(v=>v.isTimedOut()),P=[...g,...y];return{hosts:P.length>0?P:d,getTimeout(v,m){return(y.length===0&&v===0?1:y.length+3+v)*m}}}async function c(d,p,g=!0){const y=[],P=jp(d,p),w=Lp(n,d.headers,p.headers),v=d.method==="GET"?{...d.data,...p.data}:{},m={...u,...d.queryParameters,...v};if(f.value&&(m["x-algolia-agent"]=f.value),p&&p.queryParameters)for(const T of Object.keys(p.queryParameters))!p.queryParameters[T]||Object.prototype.toString.call(p.queryParameters[T])==="[object Object]"?m[T]=p.queryParameters[T]:m[T]=p.queryParameters[T].toString();let b=0;const x=async(T,E)=>{const S=T.pop();if(S===void 0)throw new Ap(Hp(y));const C={...h,...p.timeouts},I={data:P,headers:w,method:d.method,url:kp(S,d.path,m),connectTimeout:E(b,C.connect),responseTimeout:E(b,g?C.read:C.write)},O=D=>{const L={request:I,response:D,host:S,triesLeft:T.length};return y.push(L),L},k=await a.send(I);if($p(k)){const D=O(k);return k.isTimedOut&&b++,o.info("Retryable failure",Ii(D)),await t.set(S,Vs(S,k.isTimedOut?"timed out":"down")),x(T,E)}if(Bp(k))return Up(k);throw O(k),Mp(k,y)},_=e.filter(T=>T.accept==="readWrite"||(g?T.accept==="read":T.accept==="write")),A=await i(_);return x([...A.hosts].reverse(),A.getTimeout)}function l(d,p={}){const g=d.useReadTransporter||d.method==="GET";if(!g)return c(d,p,g);const y=()=>c(d,p);if((p.cacheable||d.cacheable)!==!0)return y();const w={request:d,requestOptions:p,transporter:{queryParameters:u,headers:n}};return s.get(w,()=>r.get(w,()=>r.set(w,y()).then(v=>Promise.all([r.delete(w),v]),v=>Promise.all([r.delete(w),Promise.reject(v)])).then(([v,m])=>m)),{miss:v=>s.set(w,v)})}return{hostsCache:t,requester:a,timeouts:h,logger:o,algoliaAgent:f,baseHeaders:n,baseQueryParameters:u,hosts:e,request:l,requestsCache:r,responsesCache:s}}var la="1.7.0",Ys=["de","us"];function Qp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Fp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Qp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"AbtestingV3",version:la}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,s){if(!r)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!r.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!r.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!r.metrics)throw new Error("Parameter `addABTestsRequest.metrics` is required when calling `addABTests`.");if(!r.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const d={method:"POST",path:"/3/abtests",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const d={method:"DELETE",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},estimateABTest(r,s){if(!r)throw new Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!r.configuration)throw new Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!r.variants)throw new Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");const d={method:"POST",path:"/3/abtests/estimate",queryParameters:{},headers:{},data:r};return a.request(d,s)},getABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `getABTest`.");const d={method:"GET",path:"/3/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTimeseries({id:r,startDate:s,endDate:i,metric:c},l){if(!r)throw new Error("Parameter `id` is required when calling `getTimeseries`.");const d="/3/abtests/{id}/timeseries".replace("{id}",encodeURIComponent(r)),p={},g={};s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.metric=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},listABTests({offset:r,limit:s,indexPrefix:i,indexSuffix:c,direction:l}={},d=void 0){const p="/3/abtests",g={},y={};r!==void 0&&(y.offset=r.toString()),s!==void 0&&(y.limit=s.toString()),i!==void 0&&(y.indexPrefix=i.toString()),c!==void 0&&(y.indexSuffix=c.toString()),l!==void 0&&(y.direction=l.toString());const P={method:"GET",path:p,queryParameters:y,headers:g};return a.request(P,d)},scheduleABTest(r,s){if(!r)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!r.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!r.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!r.metrics)throw new Error("Parameter `scheduleABTestsRequest.metrics` is required when calling `scheduleABTest`.");if(!r.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!r.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const d={method:"POST",path:"/3/abtests/schedule",queryParameters:{},headers:{},data:r};return a.request(d,s)},stopABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `stopABTest`.");const d={method:"POST",path:"/3/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)}}}function _i(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Ys.includes(n)))throw new Error(`\`region\` must be one of the following: ${Ys.join(", ")}`);return Fp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${la}-${e}`}),K()]}),...o})}const Gp=Object.freeze(Object.defineProperty({__proto__:null,abtestingV3Client:_i,apiClientVersion:la},Symbol.toStringTag,{value:"Module"}));var da="5.41.0",Js=["de","us"];function Wp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function zp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Wp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Abtesting",version:da}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},addABTests(r,s){if(!r)throw new Error("Parameter `addABTestsRequest` is required when calling `addABTests`.");if(!r.name)throw new Error("Parameter `addABTestsRequest.name` is required when calling `addABTests`.");if(!r.variants)throw new Error("Parameter `addABTestsRequest.variants` is required when calling `addABTests`.");if(!r.endAt)throw new Error("Parameter `addABTestsRequest.endAt` is required when calling `addABTests`.");const d={method:"POST",path:"/2/abtests",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `deleteABTest`.");const d={method:"DELETE",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},estimateABTest(r,s){if(!r)throw new Error("Parameter `estimateABTestRequest` is required when calling `estimateABTest`.");if(!r.configuration)throw new Error("Parameter `estimateABTestRequest.configuration` is required when calling `estimateABTest`.");if(!r.variants)throw new Error("Parameter `estimateABTestRequest.variants` is required when calling `estimateABTest`.");const d={method:"POST",path:"/2/abtests/estimate",queryParameters:{},headers:{},data:r};return a.request(d,s)},getABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `getABTest`.");const d={method:"GET",path:"/2/abtests/{id}".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},listABTests({offset:r,limit:s,indexPrefix:i,indexSuffix:c}={},l=void 0){const d="/2/abtests",p={},g={};r!==void 0&&(g.offset=r.toString()),s!==void 0&&(g.limit=s.toString()),i!==void 0&&(g.indexPrefix=i.toString()),c!==void 0&&(g.indexSuffix=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},scheduleABTest(r,s){if(!r)throw new Error("Parameter `scheduleABTestsRequest` is required when calling `scheduleABTest`.");if(!r.name)throw new Error("Parameter `scheduleABTestsRequest.name` is required when calling `scheduleABTest`.");if(!r.variants)throw new Error("Parameter `scheduleABTestsRequest.variants` is required when calling `scheduleABTest`.");if(!r.scheduledAt)throw new Error("Parameter `scheduleABTestsRequest.scheduledAt` is required when calling `scheduleABTest`.");if(!r.endAt)throw new Error("Parameter `scheduleABTestsRequest.endAt` is required when calling `scheduleABTest`.");const d={method:"POST",path:"/2/abtests/schedule",queryParameters:{},headers:{},data:r};return a.request(d,s)},stopABTest({id:r},s){if(!r)throw new Error("Parameter `id` is required when calling `stopABTest`.");const d={method:"POST",path:"/2/abtests/{id}/stop".replace("{id}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)}}}function Ai(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Js.includes(n)))throw new Error(`\`region\` must be one of the following: ${Js.join(", ")}`);return zp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${da}-${e}`}),K()]}),...o})}const Kp=Object.freeze(Object.defineProperty({__proto__:null,abtestingClient:Ai,apiClientVersion:da},Symbol.toStringTag,{value:"Module"}));var ha="5.41.0",Xs=["de","us"];function Vp(e){return[{url:e?"analytics.{region}.algolia.com".replace("{region}",e):"analytics.algolia.com",accept:"readWrite",protocol:"https"}]}function Yp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Vp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Analytics",version:ha}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},getAddToCartRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getAddToCartRate`.");const d="/2/conversions/addToCartRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getAverageClickPosition({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getAverageClickPosition`.");const d="/2/clicks/averageClickPosition",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getClickPositions({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getClickPositions`.");const d="/2/clicks/positions",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getClickThroughRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getClickThroughRate`.");const d="/2/clicks/clickThroughRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getConversionRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getConversionRate`.");const d="/2/conversions/conversionRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getNoClickRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getNoClickRate`.");const d="/2/searches/noClickRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getNoResultsRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getNoResultsRate`.");const d="/2/searches/noResultRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getPurchaseRate({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getPurchaseRate`.");const d="/2/conversions/purchaseRate",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getRevenue({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getRevenue`.");const d="/2/conversions/revenue",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getSearchesCount({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesCount`.");const d="/2/searches/count",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)},getSearchesNoClicks({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesNoClicks`.");const g="/2/searches/noClicks",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getSearchesNoResults({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getSearchesNoResults`.");const g="/2/searches/noResults",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getStatus({index:r},s){if(!r)throw new Error("Parameter `index` is required when calling `getStatus`.");const i="/2/status",c={},l={};r!==void 0&&(l.index=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return a.request(d,s)},getTopCountries({index:r,startDate:s,endDate:i,limit:c,offset:l,tags:d},p){if(!r)throw new Error("Parameter `index` is required when calling `getTopCountries`.");const g="/2/countries",y={},P={};r!==void 0&&(P.index=r.toString()),s!==void 0&&(P.startDate=s.toString()),i!==void 0&&(P.endDate=i.toString()),c!==void 0&&(P.limit=c.toString()),l!==void 0&&(P.offset=l.toString()),d!==void 0&&(P.tags=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},getTopFilterAttributes({index:r,search:s,startDate:i,endDate:c,limit:l,offset:d,tags:p},g){if(!r)throw new Error("Parameter `index` is required when calling `getTopFilterAttributes`.");const y="/2/filters",P={},w={};r!==void 0&&(w.index=r.toString()),s!==void 0&&(w.search=s.toString()),i!==void 0&&(w.startDate=i.toString()),c!==void 0&&(w.endDate=c.toString()),l!==void 0&&(w.limit=l.toString()),d!==void 0&&(w.offset=d.toString()),p!==void 0&&(w.tags=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},getTopFilterForAttribute({attribute:r,index:s,search:i,startDate:c,endDate:l,limit:d,offset:p,tags:g},y){if(!r)throw new Error("Parameter `attribute` is required when calling `getTopFilterForAttribute`.");if(!s)throw new Error("Parameter `index` is required when calling `getTopFilterForAttribute`.");const P="/2/filters/{attribute}".replace("{attribute}",encodeURIComponent(r)),w={},v={};s!==void 0&&(v.index=s.toString()),i!==void 0&&(v.search=i.toString()),c!==void 0&&(v.startDate=c.toString()),l!==void 0&&(v.endDate=l.toString()),d!==void 0&&(v.limit=d.toString()),p!==void 0&&(v.offset=p.toString()),g!==void 0&&(v.tags=g.toString());const m={method:"GET",path:P,queryParameters:v,headers:w};return a.request(m,y)},getTopFiltersNoResults({index:r,search:s,startDate:i,endDate:c,limit:l,offset:d,tags:p},g){if(!r)throw new Error("Parameter `index` is required when calling `getTopFiltersNoResults`.");const y="/2/filters/noResults",P={},w={};r!==void 0&&(w.index=r.toString()),s!==void 0&&(w.search=s.toString()),i!==void 0&&(w.startDate=i.toString()),c!==void 0&&(w.endDate=c.toString()),l!==void 0&&(w.limit=l.toString()),d!==void 0&&(w.offset=d.toString()),p!==void 0&&(w.tags=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},getTopHits({index:r,search:s,clickAnalytics:i,revenueAnalytics:c,startDate:l,endDate:d,limit:p,offset:g,tags:y},P){if(!r)throw new Error("Parameter `index` is required when calling `getTopHits`.");const w="/2/hits",v={},m={};r!==void 0&&(m.index=r.toString()),s!==void 0&&(m.search=s.toString()),i!==void 0&&(m.clickAnalytics=i.toString()),c!==void 0&&(m.revenueAnalytics=c.toString()),l!==void 0&&(m.startDate=l.toString()),d!==void 0&&(m.endDate=d.toString()),p!==void 0&&(m.limit=p.toString()),g!==void 0&&(m.offset=g.toString()),y!==void 0&&(m.tags=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},getTopSearches({index:r,clickAnalytics:s,revenueAnalytics:i,startDate:c,endDate:l,orderBy:d,direction:p,limit:g,offset:y,tags:P},w){if(!r)throw new Error("Parameter `index` is required when calling `getTopSearches`.");const v="/2/searches",m={},b={};r!==void 0&&(b.index=r.toString()),s!==void 0&&(b.clickAnalytics=s.toString()),i!==void 0&&(b.revenueAnalytics=i.toString()),c!==void 0&&(b.startDate=c.toString()),l!==void 0&&(b.endDate=l.toString()),d!==void 0&&(b.orderBy=d.toString()),p!==void 0&&(b.direction=p.toString()),g!==void 0&&(b.limit=g.toString()),y!==void 0&&(b.offset=y.toString()),P!==void 0&&(b.tags=P.toString());const x={method:"GET",path:v,queryParameters:b,headers:m};return a.request(x,w)},getUsersCount({index:r,startDate:s,endDate:i,tags:c},l){if(!r)throw new Error("Parameter `index` is required when calling `getUsersCount`.");const d="/2/users/count",p={},g={};r!==void 0&&(g.index=r.toString()),s!==void 0&&(g.startDate=s.toString()),i!==void 0&&(g.endDate=i.toString()),c!==void 0&&(g.tags=c.toString());const y={method:"GET",path:d,queryParameters:g,headers:p};return a.request(y,l)}}}function Ri(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Xs.includes(n)))throw new Error(`\`region\` must be one of the following: ${Xs.join(", ")}`);return Yp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ha}-${e}`}),K()]}),...o})}const Jp=Object.freeze(Object.defineProperty({__proto__:null,analyticsClient:Ri,apiClientVersion:ha},Symbol.toStringTag,{value:"Module"}));var fa="5.41.0",Zs=["de","us"];function Xp(e){return[{url:e?"insights.{region}.algolia.io".replace("{region}",e):"insights.algolia.io",accept:"readWrite",protocol:"https"}]}function Zp({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:Xp(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Insights",version:fa}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteUserToken({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `deleteUserToken`.");const d={method:"DELETE",path:"/1/usertokens/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},pushEvents(r,s){if(!r)throw new Error("Parameter `insightsEvents` is required when calling `pushEvents`.");if(!r.events)throw new Error("Parameter `insightsEvents.events` is required when calling `pushEvents`.");const d={method:"POST",path:"/1/events",queryParameters:{},headers:{},data:r};return a.request(d,s)}}}function Oi(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(n&&(typeof n!="string"||!Zs.includes(n)))throw new Error(`\`region\` must be one of the following: ${Zs.join(", ")}`);return Zp({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${fa}-${e}`}),K()]}),...o})}const eg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:fa,insightsClient:Oi},Symbol.toStringTag,{value:"Module"}));var pa="5.41.0",eo=["eu","us"];function tg(e){return[{url:"personalization.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function rg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:tg(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Personalization",version:pa}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteUserProfile({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `deleteUserProfile`.");const d={method:"DELETE",path:"/1/profiles/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getPersonalizationStrategy(r){const l={method:"GET",path:"/1/strategies/personalization",queryParameters:{},headers:{}};return a.request(l,r)},getUserTokenProfile({userToken:r},s){if(!r)throw new Error("Parameter `userToken` is required when calling `getUserTokenProfile`.");const d={method:"GET",path:"/1/profiles/personalization/{userToken}".replace("{userToken}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},setPersonalizationStrategy(r,s){if(!r)throw new Error("Parameter `personalizationStrategyParams` is required when calling `setPersonalizationStrategy`.");if(!r.eventsScoring)throw new Error("Parameter `personalizationStrategyParams.eventsScoring` is required when calling `setPersonalizationStrategy`.");if(!r.facetsScoring)throw new Error("Parameter `personalizationStrategyParams.facetsScoring` is required when calling `setPersonalizationStrategy`.");if(!r.personalizationImpact)throw new Error("Parameter `personalizationStrategyParams.personalizationImpact` is required when calling `setPersonalizationStrategy`.");const d={method:"POST",path:"/1/strategies/personalization",queryParameters:{},headers:{},data:r};return a.request(d,s)}}}function ki(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!eo.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${eo.join(", ")}`);return rg({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${pa}-${e}`}),K()]}),...o})}const ng=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:pa,personalizationClient:ki},Symbol.toStringTag,{value:"Module"}));var ga="5.41.0",to=["eu","us"];function ag(e){return[{url:"query-suggestions.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function sg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:ag(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"QuerySuggestions",version:ga}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},createConfig(r,s){if(!r)throw new Error("Parameter `configurationWithIndex` is required when calling `createConfig`.");const d={method:"POST",path:"/1/configs",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteConfig({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `deleteConfig`.");const d={method:"DELETE",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getAllConfigs(r){const l={method:"GET",path:"/1/configs",queryParameters:{},headers:{}};return a.request(l,r)},getConfig({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getConfig`.");const d={method:"GET",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getConfigStatus({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getConfigStatus`.");const d={method:"GET",path:"/1/configs/{indexName}/status".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getLogFile({indexName:r},s){if(!r)throw new Error("Parameter `indexName` is required when calling `getLogFile`.");const d={method:"GET",path:"/1/logs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},updateConfig({indexName:r,configuration:s},i){if(!r)throw new Error("Parameter `indexName` is required when calling `updateConfig`.");if(!s)throw new Error("Parameter `configuration` is required when calling `updateConfig`.");if(!s.sourceIndices)throw new Error("Parameter `configuration.sourceIndices` is required when calling `updateConfig`.");const p={method:"PUT",path:"/1/configs/{indexName}".replace("{indexName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)}}}function Di(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!to.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${to.join(", ")}`);return sg({appId:e,apiKey:t,region:n,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ga}-${e}`}),K()]}),...o})}const og=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ga,querySuggestionsClient:Di},Symbol.toStringTag,{value:"Module"}));var kt="5.41.0";function ig(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(Ci([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function cg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:ig(e),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Search",version:kt}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},waitForTask({indexName:a,taskID:r,maxRetries:s=50,timeout:i=l=>Math.min(l*200,5e3)},c){let l=0;return Be({func:()=>this.getTask({indexName:a,taskID:r},c),validate:d=>d.status==="published",aggregator:()=>l+=1,error:{validate:()=>l>=s,message:()=>`The maximum number of retries exceeded. (${l}/${s})`},timeout:()=>i(l)})},waitForAppTask({taskID:a,maxRetries:r=50,timeout:s=c=>Math.min(c*200,5e3)},i){let c=0;return Be({func:()=>this.getAppTask({taskID:a},i),validate:l=>l.status==="published",aggregator:()=>c+=1,error:{validate:()=>c>=r,message:()=>`The maximum number of retries exceeded. (${c}/${r})`},timeout:()=>s(c)})},waitForApiKey({operation:a,key:r,apiKey:s,maxRetries:i=50,timeout:c=d=>Math.min(d*200,5e3)},l){let d=0;const p={aggregator:()=>d+=1,error:{validate:()=>d>=i,message:()=>`The maximum number of retries exceeded. (${d}/${i})`},timeout:()=>c(d)};if(a==="update"){if(!s)throw new Error("`apiKey` is required when waiting for an `update` operation.");return Be({...p,func:()=>this.getApiKey({key:r},l),validate:g=>{for(const y of Object.keys(s)){const P=s[y],w=g[y];if(Array.isArray(P)&&Array.isArray(w)){if(P.length!==w.length||P.some((v,m)=>v!==w[m]))return!1}else if(P!==w)return!1}return!0}})}return Be({...p,func:()=>this.getApiKey({key:r},l).catch(g=>{if(g.status!==404)throw g}),validate:g=>a==="add"?g!==void 0:g===void 0})},browseObjects({indexName:a,browseParams:r,...s},i){return Be({func:c=>this.browse({indexName:a,browseParams:{cursor:c?c.cursor:void 0,hitsPerPage:1e3,...r}},i),validate:c=>c.cursor===void 0,...s})},browseRules({indexName:a,searchRulesParams:r,...s},i){const c={...r,hitsPerPage:r?.hitsPerPage||1e3};return Be({func:l=>this.searchRules({indexName:a,searchRulesParams:{...c,page:l?l.page+1:c.page||0}},i),validate:l=>l.hits.length<c.hitsPerPage,...s})},browseSynonyms({indexName:a,searchSynonymsParams:r,...s},i){const c={...r,page:r?.page||0,hitsPerPage:1e3};return Be({func:l=>{const d=this.searchSynonyms({indexName:a,searchSynonymsParams:{...c,page:c.page}},i);return c.page+=1,d},validate:l=>l.hits.length<c.hitsPerPage,...s})},async chunkedBatch({indexName:a,objects:r,action:s="addObject",waitForTasks:i,batchSize:c=1e3},l){let d=[];const p=[],g=r.entries();for(const[y,P]of g)d.push({action:s,body:P}),(d.length===c||y===r.length-1)&&(p.push(await this.batch({indexName:a,batchWriteParams:{requests:d}},l)),d=[]);if(i)for(const y of p)await this.waitForTask({indexName:a,taskID:y.taskID});return p},async saveObjects({indexName:a,objects:r,waitForTasks:s,batchSize:i},c){return await this.chunkedBatch({indexName:a,objects:r,action:"addObject",waitForTasks:s,batchSize:i},c)},async deleteObjects({indexName:a,objectIDs:r,waitForTasks:s,batchSize:i},c){return await this.chunkedBatch({indexName:a,objects:r.map(l=>({objectID:l})),action:"deleteObject",waitForTasks:s,batchSize:i},c)},async partialUpdateObjects({indexName:a,objects:r,createIfNotExists:s,waitForTasks:i,batchSize:c},l){return await this.chunkedBatch({indexName:a,objects:r,action:s?"partialUpdateObject":"partialUpdateObjectNoCreate",batchSize:c,waitForTasks:i},l)},async replaceAllObjects({indexName:a,objects:r,batchSize:s,scopes:i},c){const l=Math.floor(Math.random()*1e6)+1e5,d=`${a}_tmp_${l}`;i===void 0&&(i=["settings","rules","synonyms"]);try{let p=await this.operationIndex({indexName:a,operationIndexParams:{operation:"copy",destination:d,scope:i}},c);const g=await this.chunkedBatch({indexName:d,objects:r,waitForTasks:!0,batchSize:s},c);await this.waitForTask({indexName:d,taskID:p.taskID}),p=await this.operationIndex({indexName:a,operationIndexParams:{operation:"copy",destination:d,scope:i}},c),await this.waitForTask({indexName:d,taskID:p.taskID});const y=await this.operationIndex({indexName:d,operationIndexParams:{operation:"move",destination:a}},c);return await this.waitForTask({indexName:d,taskID:y.taskID}),{copyOperationResponse:p,batchResponses:g,moveOperationResponse:y}}catch(p){throw await this.deleteIndex({indexName:d}),p}},async indexExists({indexName:a}){try{await this.getSettings({indexName:a})}catch(r){if(r instanceof mr&&r.status===404)return!1;throw r}return!0},searchForHits(a,r){return this.search(a,r)},searchForFacets(a,r){return this.search(a,r)},addApiKey(a,r){if(!a)throw new Error("Parameter `apiKey` is required when calling `addApiKey`.");if(!a.acl)throw new Error("Parameter `apiKey.acl` is required when calling `addApiKey`.");const l={method:"POST",path:"/1/keys",queryParameters:{},headers:{},data:a};return h.request(l,r)},addOrUpdateObject({indexName:a,objectID:r,body:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `addOrUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `addOrUpdateObject`.");if(!s)throw new Error("Parameter `body` is required when calling `addOrUpdateObject`.");const p={method:"PUT",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return h.request(p,i)},appendSource(a,r){if(!a)throw new Error("Parameter `source` is required when calling `appendSource`.");if(!a.source)throw new Error("Parameter `source.source` is required when calling `appendSource`.");const l={method:"POST",path:"/1/security/sources/append",queryParameters:{},headers:{},data:a};return h.request(l,r)},assignUserId({xAlgoliaUserID:a,assignUserIdParams:r},s){if(!a)throw new Error("Parameter `xAlgoliaUserID` is required when calling `assignUserId`.");if(!r)throw new Error("Parameter `assignUserIdParams` is required when calling `assignUserId`.");if(!r.cluster)throw new Error("Parameter `assignUserIdParams.cluster` is required when calling `assignUserId`.");const i="/1/clusters/mapping",c={},l={};a!==void 0&&(c["X-Algolia-User-ID"]=a.toString());const d={method:"POST",path:i,queryParameters:l,headers:c,data:r};return h.request(d,s)},batch({indexName:a,batchWriteParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `batch`.");if(!r)throw new Error("Parameter `batchWriteParams` is required when calling `batch`.");if(!r.requests)throw new Error("Parameter `batchWriteParams.requests` is required when calling `batch`.");const d={method:"POST",path:"/1/indexes/{indexName}/batch".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},batchAssignUserIds({xAlgoliaUserID:a,batchAssignUserIdsParams:r},s){if(!a)throw new Error("Parameter `xAlgoliaUserID` is required when calling `batchAssignUserIds`.");if(!r)throw new Error("Parameter `batchAssignUserIdsParams` is required when calling `batchAssignUserIds`.");if(!r.cluster)throw new Error("Parameter `batchAssignUserIdsParams.cluster` is required when calling `batchAssignUserIds`.");if(!r.users)throw new Error("Parameter `batchAssignUserIdsParams.users` is required when calling `batchAssignUserIds`.");const i="/1/clusters/mapping/batch",c={},l={};a!==void 0&&(c["X-Algolia-User-ID"]=a.toString());const d={method:"POST",path:i,queryParameters:l,headers:c,data:r};return h.request(d,s)},batchDictionaryEntries({dictionaryName:a,batchDictionaryEntriesParams:r},s){if(!a)throw new Error("Parameter `dictionaryName` is required when calling `batchDictionaryEntries`.");if(!r)throw new Error("Parameter `batchDictionaryEntriesParams` is required when calling `batchDictionaryEntries`.");if(!r.requests)throw new Error("Parameter `batchDictionaryEntriesParams.requests` is required when calling `batchDictionaryEntries`.");const d={method:"POST",path:"/1/dictionaries/{dictionaryName}/batch".replace("{dictionaryName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},browse({indexName:a,browseParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `browse`.");const d={method:"POST",path:"/1/indexes/{indexName}/browse".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0};return h.request(d,s)},clearObjects({indexName:a},r){if(!a)throw new Error("Parameter `indexName` is required when calling `clearObjects`.");const l={method:"POST",path:"/1/indexes/{indexName}/clear".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},clearRules({indexName:a,forwardToReplicas:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `clearRules`.");const i="/1/indexes/{indexName}/rules/clear".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.forwardToReplicas=r.toString());const d={method:"POST",path:i,queryParameters:l,headers:c};return h.request(d,s)},clearSynonyms({indexName:a,forwardToReplicas:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `clearSynonyms`.");const i="/1/indexes/{indexName}/synonyms/clear".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.forwardToReplicas=r.toString());const d={method:"POST",path:i,queryParameters:l,headers:c};return h.request(d,s)},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},deleteApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `deleteApiKey`.");const l={method:"DELETE",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteBy({indexName:a,deleteByParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteBy`.");if(!r)throw new Error("Parameter `deleteByParams` is required when calling `deleteBy`.");const d={method:"POST",path:"/1/indexes/{indexName}/deleteByQuery".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},deleteIndex({indexName:a},r){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteIndex`.");const l={method:"DELETE",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteObject({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteObject`.");const d={method:"DELETE",path:"/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},deleteRule({indexName:a,objectID:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteRule`.");const c="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"DELETE",path:c,queryParameters:d,headers:l};return h.request(p,i)},deleteSource({source:a},r){if(!a)throw new Error("Parameter `source` is required when calling `deleteSource`.");const l={method:"DELETE",path:"/1/security/sources/{source}".replace("{source}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},deleteSynonym({indexName:a,objectID:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `deleteSynonym`.");const c="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"DELETE",path:c,queryParameters:d,headers:l};return h.request(p,i)},getApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `getApiKey`.");const l={method:"GET",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getAppTask({taskID:a},r){if(!a)throw new Error("Parameter `taskID` is required when calling `getAppTask`.");const l={method:"GET",path:"/1/task/{taskID}".replace("{taskID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getDictionaryLanguages(a){const c={method:"GET",path:"/1/dictionaries/*/languages",queryParameters:{},headers:{}};return h.request(c,a)},getDictionarySettings(a){const c={method:"GET",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{}};return h.request(c,a)},getLogs({offset:a,length:r,indexName:s,type:i}={},c=void 0){const l="/1/logs",d={},p={};a!==void 0&&(p.offset=a.toString()),r!==void 0&&(p.length=r.toString()),s!==void 0&&(p.indexName=s.toString()),i!==void 0&&(p.type=i.toString());const g={method:"GET",path:l,queryParameters:p,headers:d};return h.request(g,c)},getObject({indexName:a,objectID:r,attributesToRetrieve:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getObject`.");const c="/1/indexes/{indexName}/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),l={},d={};s!==void 0&&(d.attributesToRetrieve=s.toString());const p={method:"GET",path:c,queryParameters:d,headers:l};return h.request(p,i)},getObjects(a,r){if(!a)throw new Error("Parameter `getObjectsParams` is required when calling `getObjects`.");if(!a.requests)throw new Error("Parameter `getObjectsParams.requests` is required when calling `getObjects`.");const l={method:"POST",path:"/1/indexes/*/objects",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},getRule({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getRule`.");const d={method:"GET",path:"/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getSettings({indexName:a,getVersion:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getSettings`.");const i="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(a)),c={},l={};r!==void 0&&(l.getVersion=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},getSources(a){const c={method:"GET",path:"/1/security/sources",queryParameters:{},headers:{}};return h.request(c,a)},getSynonym({indexName:a,objectID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `getSynonym`.");const d={method:"GET",path:"/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getTask({indexName:a,taskID:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `getTask`.");if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const d={method:"GET",path:"/1/indexes/{indexName}/task/{taskID}".replace("{indexName}",encodeURIComponent(a)).replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getTopUserIds(a){const c={method:"GET",path:"/1/clusters/mapping/top",queryParameters:{},headers:{}};return h.request(c,a)},getUserId({userID:a},r){if(!a)throw new Error("Parameter `userID` is required when calling `getUserId`.");const l={method:"GET",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},hasPendingMappings({getClusters:a}={},r=void 0){const s="/1/clusters/mapping/pending",i={},c={};a!==void 0&&(c.getClusters=a.toString());const l={method:"GET",path:s,queryParameters:c,headers:i};return h.request(l,r)},listApiKeys(a){const c={method:"GET",path:"/1/keys",queryParameters:{},headers:{}};return h.request(c,a)},listClusters(a){const c={method:"GET",path:"/1/clusters",queryParameters:{},headers:{}};return h.request(c,a)},listIndices({page:a,hitsPerPage:r}={},s=void 0){const i="/1/indexes",c={},l={};a!==void 0&&(l.page=a.toString()),r!==void 0&&(l.hitsPerPage=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},listUserIds({page:a,hitsPerPage:r}={},s=void 0){const i="/1/clusters/mapping",c={},l={};a!==void 0&&(l.page=a.toString()),r!==void 0&&(l.hitsPerPage=r.toString());const d={method:"GET",path:i,queryParameters:l,headers:c};return h.request(d,s)},multipleBatch(a,r){if(!a)throw new Error("Parameter `batchParams` is required when calling `multipleBatch`.");if(!a.requests)throw new Error("Parameter `batchParams.requests` is required when calling `multipleBatch`.");const l={method:"POST",path:"/1/indexes/*/batch",queryParameters:{},headers:{},data:a};return h.request(l,r)},operationIndex({indexName:a,operationIndexParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `operationIndex`.");if(!r)throw new Error("Parameter `operationIndexParams` is required when calling `operationIndex`.");if(!r.operation)throw new Error("Parameter `operationIndexParams.operation` is required when calling `operationIndex`.");if(!r.destination)throw new Error("Parameter `operationIndexParams.destination` is required when calling `operationIndex`.");const d={method:"POST",path:"/1/indexes/{indexName}/operation".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},partialUpdateObject({indexName:a,objectID:r,attributesToUpdate:s,createIfNotExists:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `partialUpdateObject`.");if(!r)throw new Error("Parameter `objectID` is required when calling `partialUpdateObject`.");if(!s)throw new Error("Parameter `attributesToUpdate` is required when calling `partialUpdateObject`.");const l="/1/indexes/{indexName}/{objectID}/partial".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.createIfNotExists=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},removeUserId({userID:a},r){if(!a)throw new Error("Parameter `userID` is required when calling `removeUserId`.");const l={method:"DELETE",path:"/1/clusters/mapping/{userID}".replace("{userID}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},replaceSources({source:a},r){if(!a)throw new Error("Parameter `source` is required when calling `replaceSources`.");const l={method:"PUT",path:"/1/security/sources",queryParameters:{},headers:{},data:a};return h.request(l,r)},restoreApiKey({key:a},r){if(!a)throw new Error("Parameter `key` is required when calling `restoreApiKey`.");const l={method:"POST",path:"/1/keys/{key}/restore".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},saveObject({indexName:a,body:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `saveObject`.");if(!r)throw new Error("Parameter `body` is required when calling `saveObject`.");const d={method:"POST",path:"/1/indexes/{indexName}".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)},saveRule({indexName:a,objectID:r,rule:s,forwardToReplicas:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveRule`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveRule`.");if(!s)throw new Error("Parameter `rule` is required when calling `saveRule`.");if(!s.objectID)throw new Error("Parameter `rule.objectID` is required when calling `saveRule`.");if(!s.consequence)throw new Error("Parameter `rule.consequence` is required when calling `saveRule`.");const l="/1/indexes/{indexName}/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.forwardToReplicas=i.toString());const g={method:"PUT",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},saveRules({indexName:a,rules:r,forwardToReplicas:s,clearExistingRules:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveRules`.");if(!r)throw new Error("Parameter `rules` is required when calling `saveRules`.");const l="/1/indexes/{indexName}/rules/batch".replace("{indexName}",encodeURIComponent(a)),d={},p={};s!==void 0&&(p.forwardToReplicas=s.toString()),i!==void 0&&(p.clearExistingRules=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:r};return h.request(g,c)},saveSynonym({indexName:a,objectID:r,synonymHit:s,forwardToReplicas:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveSynonym`.");if(!r)throw new Error("Parameter `objectID` is required when calling `saveSynonym`.");if(!s)throw new Error("Parameter `synonymHit` is required when calling `saveSynonym`.");if(!s.objectID)throw new Error("Parameter `synonymHit.objectID` is required when calling `saveSynonym`.");if(!s.type)throw new Error("Parameter `synonymHit.type` is required when calling `saveSynonym`.");const l="/1/indexes/{indexName}/synonyms/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{objectID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.forwardToReplicas=i.toString());const g={method:"PUT",path:l,queryParameters:p,headers:d,data:s};return h.request(g,c)},saveSynonyms({indexName:a,synonymHit:r,forwardToReplicas:s,replaceExistingSynonyms:i},c){if(!a)throw new Error("Parameter `indexName` is required when calling `saveSynonyms`.");if(!r)throw new Error("Parameter `synonymHit` is required when calling `saveSynonyms`.");const l="/1/indexes/{indexName}/synonyms/batch".replace("{indexName}",encodeURIComponent(a)),d={},p={};s!==void 0&&(p.forwardToReplicas=s.toString()),i!==void 0&&(p.replaceExistingSynonyms=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:r};return h.request(g,c)},search(a,r){if(a&&Array.isArray(a)&&(a={requests:a.map(({params:p,...g})=>g.type==="facet"?{...g,...p,type:"facet"}:{...g,...p,facet:void 0,maxFacetHits:void 0,facetQuery:void 0})}),!a)throw new Error("Parameter `searchMethodParams` is required when calling `search`.");if(!a.requests)throw new Error("Parameter `searchMethodParams.requests` is required when calling `search`.");const l={method:"POST",path:"/1/indexes/*/queries",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},searchDictionaryEntries({dictionaryName:a,searchDictionaryEntriesParams:r},s){if(!a)throw new Error("Parameter `dictionaryName` is required when calling `searchDictionaryEntries`.");if(!r)throw new Error("Parameter `searchDictionaryEntriesParams` is required when calling `searchDictionaryEntries`.");if(!r.query)throw new Error("Parameter `searchDictionaryEntriesParams.query` is required when calling `searchDictionaryEntries`.");const d={method:"POST",path:"/1/dictionaries/{dictionaryName}/search".replace("{dictionaryName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r,useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchForFacetValues({indexName:a,facetName:r,searchForFacetValuesRequest:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `searchForFacetValues`.");if(!r)throw new Error("Parameter `facetName` is required when calling `searchForFacetValues`.");const p={method:"POST",path:"/1/indexes/{indexName}/facets/{facetName}/query".replace("{indexName}",encodeURIComponent(a)).replace("{facetName}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{},useReadTransporter:!0,cacheable:!0};return h.request(p,i)},searchRules({indexName:a,searchRulesParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchRules`.");const d={method:"POST",path:"/1/indexes/{indexName}/rules/search".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchSingleIndex({indexName:a,searchParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchSingleIndex`.");const d={method:"POST",path:"/1/indexes/{indexName}/query".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchSynonyms({indexName:a,searchSynonymsParams:r},s){if(!a)throw new Error("Parameter `indexName` is required when calling `searchSynonyms`.");const d={method:"POST",path:"/1/indexes/{indexName}/synonyms/search".replace("{indexName}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r||{},useReadTransporter:!0,cacheable:!0};return h.request(d,s)},searchUserIds(a,r){if(!a)throw new Error("Parameter `searchUserIdsParams` is required when calling `searchUserIds`.");if(!a.query)throw new Error("Parameter `searchUserIdsParams.query` is required when calling `searchUserIds`.");const l={method:"POST",path:"/1/clusters/mapping/search",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},setDictionarySettings(a,r){if(!a)throw new Error("Parameter `dictionarySettingsParams` is required when calling `setDictionarySettings`.");if(!a.disableStandardEntries)throw new Error("Parameter `dictionarySettingsParams.disableStandardEntries` is required when calling `setDictionarySettings`.");const l={method:"PUT",path:"/1/dictionaries/*/settings",queryParameters:{},headers:{},data:a};return h.request(l,r)},setSettings({indexName:a,indexSettings:r,forwardToReplicas:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `setSettings`.");if(!r)throw new Error("Parameter `indexSettings` is required when calling `setSettings`.");const c="/1/indexes/{indexName}/settings".replace("{indexName}",encodeURIComponent(a)),l={},d={};s!==void 0&&(d.forwardToReplicas=s.toString());const p={method:"PUT",path:c,queryParameters:d,headers:l,data:r};return h.request(p,i)},updateApiKey({key:a,apiKey:r},s){if(!a)throw new Error("Parameter `key` is required when calling `updateApiKey`.");if(!r)throw new Error("Parameter `apiKey` is required when calling `updateApiKey`.");if(!r.acl)throw new Error("Parameter `apiKey.acl` is required when calling `updateApiKey`.");const d={method:"PUT",path:"/1/keys/{key}".replace("{key}",encodeURIComponent(a)),queryParameters:{},headers:{},data:r};return h.request(d,s)}}}function ji(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return cg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${kt}-${e}`}),K()]}),...n})}const ug=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:kt,searchClient:ji},Symbol.toStringTag,{value:"Module"}));var ma="1.41.0",ro=["eu","us"];function lg(e){return[{url:"data.{region}.algolia.com".replace("{region}",e),accept:"readWrite",protocol:"https"}]}function dg(e){return e.type==="onDemand"}function hg(e){return e.type==="schedule"}function fg(e){return e.type==="subscription"}function pg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,region:u,...f}){const h=Ce(e,t,n),a=Ae({hosts:lg(u),...f,algoliaAgent:Ie({algoliaAgents:o,client:"Ingestion",version:ma}),baseHeaders:{"content-type":"text/plain",...h.headers(),...f.baseHeaders},baseQueryParameters:{...h.queryParameters(),...f.baseQueryParameters}});return{transporter:a,appId:e,apiKey:t,clearCache(){return Promise.all([a.requestsCache.clear(),a.responsesCache.clear()]).then(()=>{})},get _ua(){return a.algoliaAgent.value},addAlgoliaAgent(r,s){a.algoliaAgent.add({segment:r,version:s})},setClientApiKey({apiKey:r}){!n||n==="WithinHeaders"?a.baseHeaders["x-algolia-api-key"]=r:a.baseQueryParameters["x-algolia-api-key"]=r},async chunkedPush({indexName:r,objects:s,action:i="addObject",waitForTasks:c,batchSize:l=1e3,referenceIndexName:d},p){let g=[],y=0;const P=[],w=Math.floor(l/10)||l,v=s.entries();for(const[m,b]of v)if(g.push(b),(g.length===l||m===s.length-1)&&(P.push(await this.push({indexName:r,pushTaskPayload:{action:i,records:g},referenceIndexName:d},p)),g=[]),c&&P.length>0&&(P.length%w===0||m===s.length-1)){for(const x of P.slice(y,y+w)){if(!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");let _=0;await Be({func:async()=>{if(x.eventID===void 0||!x.eventID)throw new Error("received unexpected response from the push endpoint, eventID must not be undefined");return this.getEvent({runID:x.runID,eventID:x.eventID}).catch(A=>{if(A.status!==404)throw A})},validate:A=>A!==void 0,aggregator:()=>_+=1,error:{validate:()=>_>=50,message:()=>`The maximum number of retries exceeded. (${_}/50)`},timeout:()=>Math.min(_*500,5e3)})}y+=w}return P},createAuthentication(r,s){if(!r)throw new Error("Parameter `authenticationCreate` is required when calling `createAuthentication`.");if(!r.type)throw new Error("Parameter `authenticationCreate.type` is required when calling `createAuthentication`.");if(!r.name)throw new Error("Parameter `authenticationCreate.name` is required when calling `createAuthentication`.");if(!r.input)throw new Error("Parameter `authenticationCreate.input` is required when calling `createAuthentication`.");const d={method:"POST",path:"/1/authentications",queryParameters:{},headers:{},data:r};return a.request(d,s)},createDestination(r,s){if(!r)throw new Error("Parameter `destinationCreate` is required when calling `createDestination`.");if(!r.type)throw new Error("Parameter `destinationCreate.type` is required when calling `createDestination`.");if(!r.name)throw new Error("Parameter `destinationCreate.name` is required when calling `createDestination`.");if(!r.input)throw new Error("Parameter `destinationCreate.input` is required when calling `createDestination`.");const d={method:"POST",path:"/1/destinations",queryParameters:{},headers:{},data:r};return a.request(d,s)},createSource(r,s){if(!r)throw new Error("Parameter `sourceCreate` is required when calling `createSource`.");if(!r.type)throw new Error("Parameter `sourceCreate.type` is required when calling `createSource`.");if(!r.name)throw new Error("Parameter `sourceCreate.name` is required when calling `createSource`.");const d={method:"POST",path:"/1/sources",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTask(r,s){if(!r)throw new Error("Parameter `taskCreate` is required when calling `createTask`.");if(!r.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTask`.");if(!r.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTask`.");if(!r.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTask`.");const d={method:"POST",path:"/2/tasks",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTaskV1(r,s){if(!r)throw new Error("Parameter `taskCreate` is required when calling `createTaskV1`.");if(!r.sourceID)throw new Error("Parameter `taskCreate.sourceID` is required when calling `createTaskV1`.");if(!r.destinationID)throw new Error("Parameter `taskCreate.destinationID` is required when calling `createTaskV1`.");if(!r.trigger)throw new Error("Parameter `taskCreate.trigger` is required when calling `createTaskV1`.");if(!r.action)throw new Error("Parameter `taskCreate.action` is required when calling `createTaskV1`.");const d={method:"POST",path:"/1/tasks",queryParameters:{},headers:{},data:r};return a.request(d,s)},createTransformation(r,s){if(!r)throw new Error("Parameter `transformationCreate` is required when calling `createTransformation`.");if(!r.name)throw new Error("Parameter `transformationCreate.name` is required when calling `createTransformation`.");const d={method:"POST",path:"/1/transformations",queryParameters:{},headers:{},data:r};return a.request(d,s)},customDelete({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customDelete`.");const p={method:"DELETE",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customGet({path:r,parameters:s},i){if(!r)throw new Error("Parameter `path` is required when calling `customGet`.");const p={method:"GET",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{}};return a.request(p,i)},customPost({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPost`.");const g={method:"POST",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},customPut({path:r,parameters:s,body:i},c){if(!r)throw new Error("Parameter `path` is required when calling `customPut`.");const g={method:"PUT",path:"/{path}".replace("{path}",r),queryParameters:s||{},headers:{},data:i||{}};return a.request(g,c)},deleteAuthentication({authenticationID:r},s){if(!r)throw new Error("Parameter `authenticationID` is required when calling `deleteAuthentication`.");const d={method:"DELETE",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteDestination({destinationID:r},s){if(!r)throw new Error("Parameter `destinationID` is required when calling `deleteDestination`.");const d={method:"DELETE",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteSource({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `deleteSource`.");const d={method:"DELETE",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `deleteTask`.");const d={method:"DELETE",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `deleteTaskV1`.");const d={method:"DELETE",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},deleteTransformation({transformationID:r},s){if(!r)throw new Error("Parameter `transformationID` is required when calling `deleteTransformation`.");const d={method:"DELETE",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},disableTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `disableTask`.");const d={method:"PUT",path:"/2/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},disableTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `disableTaskV1`.");const d={method:"PUT",path:"/1/tasks/{taskID}/disable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},enableTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `enableTask`.");const d={method:"PUT",path:"/2/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},enableTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `enableTaskV1`.");const d={method:"PUT",path:"/1/tasks/{taskID}/enable".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getAuthentication({authenticationID:r},s){if(!r)throw new Error("Parameter `authenticationID` is required when calling `getAuthentication`.");const d={method:"GET",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getDestination({destinationID:r},s){if(!r)throw new Error("Parameter `destinationID` is required when calling `getDestination`.");const d={method:"GET",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getEvent({runID:r,eventID:s},i){if(!r)throw new Error("Parameter `runID` is required when calling `getEvent`.");if(!s)throw new Error("Parameter `eventID` is required when calling `getEvent`.");const p={method:"GET",path:"/1/runs/{runID}/events/{eventID}".replace("{runID}",encodeURIComponent(r)).replace("{eventID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return a.request(p,i)},getRun({runID:r},s){if(!r)throw new Error("Parameter `runID` is required when calling `getRun`.");const d={method:"GET",path:"/1/runs/{runID}".replace("{runID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getSource({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `getSource`.");const d={method:"GET",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTask({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `getTask`.");const d={method:"GET",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTaskV1({taskID:r},s){if(!r)throw new Error("Parameter `taskID` is required when calling `getTaskV1`.");const d={method:"GET",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},getTransformation({transformationID:r},s){if(!r)throw new Error("Parameter `transformationID` is required when calling `getTransformation`.");const d={method:"GET",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return a.request(d,s)},listAuthentications({itemsPerPage:r,page:s,type:i,platform:c,sort:l,order:d}={},p=void 0){const g="/1/authentications",y={},P={};r!==void 0&&(P.itemsPerPage=r.toString()),s!==void 0&&(P.page=s.toString()),i!==void 0&&(P.type=i.toString()),c!==void 0&&(P.platform=c.toString()),l!==void 0&&(P.sort=l.toString()),d!==void 0&&(P.order=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},listDestinations({itemsPerPage:r,page:s,type:i,authenticationID:c,transformationID:l,sort:d,order:p}={},g=void 0){const y="/1/destinations",P={},w={};r!==void 0&&(w.itemsPerPage=r.toString()),s!==void 0&&(w.page=s.toString()),i!==void 0&&(w.type=i.toString()),c!==void 0&&(w.authenticationID=c.toString()),l!==void 0&&(w.transformationID=l.toString()),d!==void 0&&(w.sort=d.toString()),p!==void 0&&(w.order=p.toString());const v={method:"GET",path:y,queryParameters:w,headers:P};return a.request(v,g)},listEvents({runID:r,itemsPerPage:s,page:i,status:c,type:l,sort:d,order:p,startDate:g,endDate:y},P){if(!r)throw new Error("Parameter `runID` is required when calling `listEvents`.");const w="/1/runs/{runID}/events".replace("{runID}",encodeURIComponent(r)),v={},m={};s!==void 0&&(m.itemsPerPage=s.toString()),i!==void 0&&(m.page=i.toString()),c!==void 0&&(m.status=c.toString()),l!==void 0&&(m.type=l.toString()),d!==void 0&&(m.sort=d.toString()),p!==void 0&&(m.order=p.toString()),g!==void 0&&(m.startDate=g.toString()),y!==void 0&&(m.endDate=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listRuns({itemsPerPage:r,page:s,status:i,type:c,taskID:l,sort:d,order:p,startDate:g,endDate:y}={},P=void 0){const w="/1/runs",v={},m={};r!==void 0&&(m.itemsPerPage=r.toString()),s!==void 0&&(m.page=s.toString()),i!==void 0&&(m.status=i.toString()),c!==void 0&&(m.type=c.toString()),l!==void 0&&(m.taskID=l.toString()),d!==void 0&&(m.sort=d.toString()),p!==void 0&&(m.order=p.toString()),g!==void 0&&(m.startDate=g.toString()),y!==void 0&&(m.endDate=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listSources({itemsPerPage:r,page:s,type:i,authenticationID:c,sort:l,order:d}={},p=void 0){const g="/1/sources",y={},P={};r!==void 0&&(P.itemsPerPage=r.toString()),s!==void 0&&(P.page=s.toString()),i!==void 0&&(P.type=i.toString()),c!==void 0&&(P.authenticationID=c.toString()),l!==void 0&&(P.sort=l.toString()),d!==void 0&&(P.order=d.toString());const w={method:"GET",path:g,queryParameters:P,headers:y};return a.request(w,p)},listTasks({itemsPerPage:r,page:s,action:i,enabled:c,sourceID:l,sourceType:d,destinationID:p,triggerType:g,withEmailNotifications:y,sort:P,order:w}={},v=void 0){const m="/2/tasks",b={},x={};r!==void 0&&(x.itemsPerPage=r.toString()),s!==void 0&&(x.page=s.toString()),i!==void 0&&(x.action=i.toString()),c!==void 0&&(x.enabled=c.toString()),l!==void 0&&(x.sourceID=l.toString()),d!==void 0&&(x.sourceType=d.toString()),p!==void 0&&(x.destinationID=p.toString()),g!==void 0&&(x.triggerType=g.toString()),y!==void 0&&(x.withEmailNotifications=y.toString()),P!==void 0&&(x.sort=P.toString()),w!==void 0&&(x.order=w.toString());const _={method:"GET",path:m,queryParameters:x,headers:b};return a.request(_,v)},listTasksV1({itemsPerPage:r,page:s,action:i,enabled:c,sourceID:l,destinationID:d,triggerType:p,sort:g,order:y}={},P=void 0){const w="/1/tasks",v={},m={};r!==void 0&&(m.itemsPerPage=r.toString()),s!==void 0&&(m.page=s.toString()),i!==void 0&&(m.action=i.toString()),c!==void 0&&(m.enabled=c.toString()),l!==void 0&&(m.sourceID=l.toString()),d!==void 0&&(m.destinationID=d.toString()),p!==void 0&&(m.triggerType=p.toString()),g!==void 0&&(m.sort=g.toString()),y!==void 0&&(m.order=y.toString());const b={method:"GET",path:w,queryParameters:m,headers:v};return a.request(b,P)},listTransformations({itemsPerPage:r,page:s,sort:i,order:c,type:l}={},d=void 0){const p="/1/transformations",g={},y={};r!==void 0&&(y.itemsPerPage=r.toString()),s!==void 0&&(y.page=s.toString()),i!==void 0&&(y.sort=i.toString()),c!==void 0&&(y.order=c.toString()),l!==void 0&&(y.type=l.toString());const P={method:"GET",path:p,queryParameters:y,headers:g};return a.request(P,d)},push({indexName:r,pushTaskPayload:s,watch:i,referenceIndexName:c},l){if(!r)throw new Error("Parameter `indexName` is required when calling `push`.");if(!s)throw new Error("Parameter `pushTaskPayload` is required when calling `push`.");if(!s.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `push`.");if(!s.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `push`.");const d="/1/push/{indexName}".replace("{indexName}",encodeURIComponent(r)),p={},g={};i!==void 0&&(g.watch=i.toString()),c!==void 0&&(g.referenceIndexName=c.toString());const y={method:"POST",path:d,queryParameters:g,headers:p,data:s};return l={timeouts:{connect:18e4,read:18e4,write:18e4,...l?.timeouts}},a.request(y,l)},pushTask({taskID:r,pushTaskPayload:s,watch:i},c){if(!r)throw new Error("Parameter `taskID` is required when calling `pushTask`.");if(!s)throw new Error("Parameter `pushTaskPayload` is required when calling `pushTask`.");if(!s.action)throw new Error("Parameter `pushTaskPayload.action` is required when calling `pushTask`.");if(!s.records)throw new Error("Parameter `pushTaskPayload.records` is required when calling `pushTask`.");const l="/2/tasks/{taskID}/push".replace("{taskID}",encodeURIComponent(r)),d={},p={};i!==void 0&&(p.watch=i.toString());const g={method:"POST",path:l,queryParameters:p,headers:d,data:s};return c={timeouts:{connect:18e4,read:18e4,write:18e4,...c?.timeouts}},a.request(g,c)},replaceTask({taskID:r,taskReplace:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `replaceTask`.");if(!s)throw new Error("Parameter `taskReplace` is required when calling `replaceTask`.");if(!s.destinationID)throw new Error("Parameter `taskReplace.destinationID` is required when calling `replaceTask`.");if(!s.action)throw new Error("Parameter `taskReplace.action` is required when calling `replaceTask`.");const p={method:"PUT",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},runSource({sourceID:r,runSourcePayload:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `runSource`.");const p={method:"POST",path:"/1/sources/{sourceID}/run".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},runTask({taskID:r,runTaskPayload:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `runTask`.");const p={method:"POST",path:"/2/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},runTaskV1({taskID:r,runTaskPayload:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `runTaskV1`.");const p={method:"POST",path:"/1/tasks/{taskID}/run".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return a.request(p,i)},searchAuthentications(r,s){if(!r)throw new Error("Parameter `authenticationSearch` is required when calling `searchAuthentications`.");if(!r.authenticationIDs)throw new Error("Parameter `authenticationSearch.authenticationIDs` is required when calling `searchAuthentications`.");const d={method:"POST",path:"/1/authentications/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchDestinations(r,s){if(!r)throw new Error("Parameter `destinationSearch` is required when calling `searchDestinations`.");if(!r.destinationIDs)throw new Error("Parameter `destinationSearch.destinationIDs` is required when calling `searchDestinations`.");const d={method:"POST",path:"/1/destinations/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchSources(r,s){if(!r)throw new Error("Parameter `sourceSearch` is required when calling `searchSources`.");if(!r.sourceIDs)throw new Error("Parameter `sourceSearch.sourceIDs` is required when calling `searchSources`.");const d={method:"POST",path:"/1/sources/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTasks(r,s){if(!r)throw new Error("Parameter `taskSearch` is required when calling `searchTasks`.");if(!r.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasks`.");const d={method:"POST",path:"/2/tasks/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTasksV1(r,s){if(!r)throw new Error("Parameter `taskSearch` is required when calling `searchTasksV1`.");if(!r.taskIDs)throw new Error("Parameter `taskSearch.taskIDs` is required when calling `searchTasksV1`.");const d={method:"POST",path:"/1/tasks/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},searchTransformations(r,s){if(!r)throw new Error("Parameter `transformationSearch` is required when calling `searchTransformations`.");if(!r.transformationIDs)throw new Error("Parameter `transformationSearch.transformationIDs` is required when calling `searchTransformations`.");const d={method:"POST",path:"/1/transformations/search",queryParameters:{},headers:{},data:r};return a.request(d,s)},triggerDockerSourceDiscover({sourceID:r},s){if(!r)throw new Error("Parameter `sourceID` is required when calling `triggerDockerSourceDiscover`.");const d={method:"POST",path:"/1/sources/{sourceID}/discover".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{}};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},a.request(d,s)},tryTransformation(r,s){if(!r)throw new Error("Parameter `transformationTry` is required when calling `tryTransformation`.");if(!r.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformation`.");const d={method:"POST",path:"/1/transformations/try",queryParameters:{},headers:{},data:r};return a.request(d,s)},tryTransformationBeforeUpdate({transformationID:r,transformationTry:s},i){if(!r)throw new Error("Parameter `transformationID` is required when calling `tryTransformationBeforeUpdate`.");if(!s)throw new Error("Parameter `transformationTry` is required when calling `tryTransformationBeforeUpdate`.");if(!s.sampleRecord)throw new Error("Parameter `transformationTry.sampleRecord` is required when calling `tryTransformationBeforeUpdate`.");const p={method:"POST",path:"/1/transformations/{transformationID}/try".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateAuthentication({authenticationID:r,authenticationUpdate:s},i){if(!r)throw new Error("Parameter `authenticationID` is required when calling `updateAuthentication`.");if(!s)throw new Error("Parameter `authenticationUpdate` is required when calling `updateAuthentication`.");const p={method:"PATCH",path:"/1/authentications/{authenticationID}".replace("{authenticationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateDestination({destinationID:r,destinationUpdate:s},i){if(!r)throw new Error("Parameter `destinationID` is required when calling `updateDestination`.");if(!s)throw new Error("Parameter `destinationUpdate` is required when calling `updateDestination`.");const p={method:"PATCH",path:"/1/destinations/{destinationID}".replace("{destinationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateSource({sourceID:r,sourceUpdate:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `updateSource`.");if(!s)throw new Error("Parameter `sourceUpdate` is required when calling `updateSource`.");const p={method:"PATCH",path:"/1/sources/{sourceID}".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTask({taskID:r,taskUpdate:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `updateTask`.");if(!s)throw new Error("Parameter `taskUpdate` is required when calling `updateTask`.");const p={method:"PATCH",path:"/2/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTaskV1({taskID:r,taskUpdate:s},i){if(!r)throw new Error("Parameter `taskID` is required when calling `updateTaskV1`.");if(!s)throw new Error("Parameter `taskUpdate` is required when calling `updateTaskV1`.");const p={method:"PATCH",path:"/1/tasks/{taskID}".replace("{taskID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},updateTransformation({transformationID:r,transformationCreate:s},i){if(!r)throw new Error("Parameter `transformationID` is required when calling `updateTransformation`.");if(!s)throw new Error("Parameter `transformationCreate` is required when calling `updateTransformation`.");if(!s.name)throw new Error("Parameter `transformationCreate.name` is required when calling `updateTransformation`.");const p={method:"PUT",path:"/1/transformations/{transformationID}".replace("{transformationID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return a.request(p,i)},validateSource(r,s=void 0){const d={method:"POST",path:"/1/sources/validate",queryParameters:{},headers:{},data:r||{}};return s={timeouts:{connect:18e4,read:18e4,write:18e4,...s?.timeouts}},a.request(d,s)},validateSourceBeforeUpdate({sourceID:r,sourceUpdate:s},i){if(!r)throw new Error("Parameter `sourceID` is required when calling `validateSourceBeforeUpdate`.");if(!s)throw new Error("Parameter `sourceUpdate` is required when calling `validateSourceBeforeUpdate`.");const p={method:"POST",path:"/1/sources/{sourceID}/validate".replace("{sourceID}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s};return i={timeouts:{connect:18e4,read:18e4,write:18e4,...i?.timeouts}},a.request(p,i)}}}function Sn(e,t,n,o){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");if(!n||n&&(typeof n!="string"||!ro.includes(n)))throw new Error(`\`region\` is required and must be one of the following: ${ro.join(", ")}`);return pg({appId:e,apiKey:t,region:n,timeouts:{connect:25e3,read:25e3,write:25e3},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ma}-${e}`}),K()]}),...o})}const gg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ma,ingestionClient:Sn,isOnDemandTrigger:dg,isScheduleTrigger:hg,isSubscriptionTrigger:fg},Symbol.toStringTag,{value:"Module"}));var ya="1.41.0";function mg(){return[{url:"status.algolia.com",accept:"readWrite",protocol:"https"}]}function yg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:mg(),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Monitoring",version:ya}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},getClusterIncidents({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getClusterIncidents`.");const l={method:"GET",path:"/1/incidents/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getClusterStatus({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getClusterStatus`.");const l={method:"GET",path:"/1/status/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getIncidents(a){const c={method:"GET",path:"/1/incidents",queryParameters:{},headers:{}};return h.request(c,a)},getIndexingTime({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getIndexingTime`.");const l={method:"GET",path:"/1/indexing/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getLatency({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getLatency`.");const l={method:"GET",path:"/1/latency/{clusters}".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getMetrics({metric:a,period:r},s){if(!a)throw new Error("Parameter `metric` is required when calling `getMetrics`.");if(!r)throw new Error("Parameter `period` is required when calling `getMetrics`.");const d={method:"GET",path:"/1/infrastructure/{metric}/period/{period}".replace("{metric}",encodeURIComponent(a)).replace("{period}",encodeURIComponent(r)),queryParameters:{},headers:{}};return h.request(d,s)},getReachability({clusters:a},r){if(!a)throw new Error("Parameter `clusters` is required when calling `getReachability`.");const l={method:"GET",path:"/1/reachability/{clusters}/probes".replace("{clusters}",encodeURIComponent(a)),queryParameters:{},headers:{}};return h.request(l,r)},getServers(a){const c={method:"GET",path:"/1/inventory/servers",queryParameters:{},headers:{}};return h.request(c,a)},getStatus(a){const c={method:"GET",path:"/1/status",queryParameters:{},headers:{}};return h.request(c,a)}}}function Li(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return yg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${ya}-${e}`}),K()]}),...n})}const wg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:ya,monitoringClient:Li},Symbol.toStringTag,{value:"Module"}));var wa="5.41.0";function Pg(e){return[{url:`${e}-dsn.algolia.net`,accept:"read",protocol:"https"},{url:`${e}.algolia.net`,accept:"write",protocol:"https"}].concat(Ci([{url:`${e}-1.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-2.algolianet.com`,accept:"readWrite",protocol:"https"},{url:`${e}-3.algolianet.com`,accept:"readWrite",protocol:"https"}]))}function qg({appId:e,apiKey:t,authMode:n,algoliaAgents:o,...u}){const f=Ce(e,t,n),h=Ae({hosts:Pg(e),...u,algoliaAgent:Ie({algoliaAgents:o,client:"Recommend",version:wa}),baseHeaders:{"content-type":"text/plain",...f.headers(),...u.baseHeaders},baseQueryParameters:{...f.queryParameters(),...u.baseQueryParameters}});return{transporter:h,appId:e,apiKey:t,clearCache(){return Promise.all([h.requestsCache.clear(),h.responsesCache.clear()]).then(()=>{})},get _ua(){return h.algoliaAgent.value},addAlgoliaAgent(a,r){h.algoliaAgent.add({segment:a,version:r})},setClientApiKey({apiKey:a}){!n||n==="WithinHeaders"?h.baseHeaders["x-algolia-api-key"]=a:h.baseQueryParameters["x-algolia-api-key"]=a},batchRecommendRules({indexName:a,model:r,recommendRule:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `batchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `batchRecommendRules`.");const p={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/batch".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{}};return h.request(p,i)},customDelete({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customDelete`.");const d={method:"DELETE",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customGet({path:a,parameters:r},s){if(!a)throw new Error("Parameter `path` is required when calling `customGet`.");const d={method:"GET",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{}};return h.request(d,s)},customPost({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPost`.");const p={method:"POST",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},customPut({path:a,parameters:r,body:s},i){if(!a)throw new Error("Parameter `path` is required when calling `customPut`.");const p={method:"PUT",path:"/{path}".replace("{path}",a),queryParameters:r||{},headers:{},data:s||{}};return h.request(p,i)},deleteRecommendRule({indexName:a,model:r,objectID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `deleteRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `deleteRecommendRule`.");if(!s)throw new Error("Parameter `objectID` is required when calling `deleteRecommendRule`.");const p={method:"DELETE",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendRule({indexName:a,model:r,objectID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getRecommendRule`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendRule`.");if(!s)throw new Error("Parameter `objectID` is required when calling `getRecommendRule`.");const p={method:"GET",path:"/1/indexes/{indexName}/{model}/recommend/rules/{objectID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{objectID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendStatus({indexName:a,model:r,taskID:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `getRecommendStatus`.");if(!r)throw new Error("Parameter `model` is required when calling `getRecommendStatus`.");if(!s)throw new Error("Parameter `taskID` is required when calling `getRecommendStatus`.");const p={method:"GET",path:"/1/indexes/{indexName}/{model}/task/{taskID}".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)).replace("{taskID}",encodeURIComponent(s)),queryParameters:{},headers:{}};return h.request(p,i)},getRecommendations(a,r){if(a&&Array.isArray(a)&&(a={requests:a}),!a)throw new Error("Parameter `getRecommendationsParams` is required when calling `getRecommendations`.");if(!a.requests)throw new Error("Parameter `getRecommendationsParams.requests` is required when calling `getRecommendations`.");const l={method:"POST",path:"/1/indexes/*/recommendations",queryParameters:{},headers:{},data:a,useReadTransporter:!0,cacheable:!0};return h.request(l,r)},searchRecommendRules({indexName:a,model:r,searchRecommendRulesParams:s},i){if(!a)throw new Error("Parameter `indexName` is required when calling `searchRecommendRules`.");if(!r)throw new Error("Parameter `model` is required when calling `searchRecommendRules`.");const p={method:"POST",path:"/1/indexes/{indexName}/{model}/recommend/rules/search".replace("{indexName}",encodeURIComponent(a)).replace("{model}",encodeURIComponent(r)),queryParameters:{},headers:{},data:s||{},useReadTransporter:!0,cacheable:!0};return h.request(p,i)}}}function Ui(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");return qg({appId:e,apiKey:t,timeouts:{connect:1e3,read:2e3,write:3e4},logger:_e(),requester:Te(),algoliaAgents:[{segment:"Browser"}],authMode:"WithinQueryParameters",responsesCache:K(),requestsCache:K({serializable:!1}),hostsCache:ie({caches:[xe({key:`${wa}-${e}`}),K()]}),...n})}const vg=Object.freeze(Object.defineProperty({__proto__:null,apiClientVersion:wa,recommendClient:Ui},Symbol.toStringTag,{value:"Module"}));var Mi=Object.defineProperty,bg=Object.getOwnPropertyDescriptor,Eg=Object.getOwnPropertyNames,Sg=Object.prototype.hasOwnProperty,Ni=(e,t)=>{for(var n in t)Mi(e,n,{get:t[n],enumerable:!0})},Tg=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of Eg(t))!Sg.call(e,u)&&u!==n&&Mi(e,u,{get:()=>t[u],enumerable:!(o=bg(t,u))||o.enumerable});return e},we=(e,t,n)=>(Tg(e,t,"default"),n),$i={};Ni($i,{algoliasearch:()=>Tn,apiClientVersion:()=>kt});var fe={};Ni(fe,{apiClientVersion:()=>kt});we(fe,Gp);we(fe,Kp);we(fe,Jp);we(fe,eg);we(fe,ng);we(fe,og);we(fe,ug);we(fe,gg);we(fe,wg);we(fe,vg);we($i,fe);function Tn(e,t,n){if(!e||typeof e!="string")throw new Error("`appId` is missing.");if(!t||typeof t!="string")throw new Error("`apiKey` is missing.");const o=ji(e,t,n);let u;if(n?.transformation){if(!n.transformation.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");u=Sn(e,t,n.transformation.region,n)}return{...o,async saveObjectsWithTransformation({indexName:f,objects:h,waitForTasks:a},r){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return u.chunkedPush({indexName:f,objects:h,action:"addObject",waitForTasks:a},r)},async partialUpdateObjectsWithTransformation({indexName:f,objects:h,createIfNotExists:a,waitForTasks:r},s){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");return u.chunkedPush({indexName:f,objects:h,action:a?"partialUpdateObject":"partialUpdateObjectNoCreate",waitForTasks:r},s)},async replaceAllObjectsWithTransformation({indexName:f,objects:h,batchSize:a,scopes:r},s){if(!u)throw new Error("`transformation.region` must be provided at client instantiation before calling this method.");if(!n?.transformation?.region)throw new Error("`region` must be provided when leveraging the transformation pipeline");const i=Math.floor(Math.random()*1e6)+1e5,c=`${f}_tmp_${i}`;r===void 0&&(r=["settings","rules","synonyms"]);try{let l=await this.operationIndex({indexName:f,operationIndexParams:{operation:"copy",destination:c,scope:r}},s);const d=await u.chunkedPush({indexName:c,objects:h,waitForTasks:!0,batchSize:a,referenceIndexName:f},s);await this.waitForTask({indexName:c,taskID:l.taskID}),l=await this.operationIndex({indexName:f,operationIndexParams:{operation:"copy",destination:c,scope:r}},s),await this.waitForTask({indexName:c,taskID:l.taskID});const p=await this.operationIndex({indexName:c,operationIndexParams:{operation:"move",destination:f}},s);return await this.waitForTask({indexName:c,taskID:p.taskID}),{copyOperationResponse:l,watchResponses:d,moveOperationResponse:p}}catch(l){throw await this.deleteIndex({indexName:c}),l}},get _ua(){return o.transporter.algoliaAgent.value},initAbtesting:f=>Ai(f.appId||e,f.apiKey||t,f.region,f.options),initAbtestingV3:f=>_i(f.appId||e,f.apiKey||t,f.region,f.options),initAnalytics:f=>Ri(f.appId||e,f.apiKey||t,f.region,f.options),initIngestion:f=>Sn(f.appId||e,f.apiKey||t,f.region,f.options),initInsights:f=>Oi(f.appId||e,f.apiKey||t,f.region,f.options),initMonitoring:(f={})=>Li(f.appId||e,f.apiKey||t,f.options),initPersonalization:f=>ki(f.appId||e,f.apiKey||t,f.region,f.options),initQuerySuggestions:f=>Di(f.appId||e,f.apiKey||t,f.region,f.options),initRecommend:(f={})=>Ui(f.appId||e,f.apiKey||t,f.options)}}const no=ee("ALGOLIA_APP_ID")||"",ao=ee("ALGOLIA_API_KEY")||"",so=ee("ALGOLIA_BLOG_INDEX")||"decentraland-blog",xg=gr.injectEndpoints({endpoints:e=>({searchBlogPosts:e.query({queryFn:async({query:t,hitsPerPage:n=10,page:o=0})=>{try{if(t.length<3)return{data:{results:[],total:0,hasMore:!1}};const f=await Tn(no,ao).searchSingleIndex({indexName:so,searchParams:{query:t,hitsPerPage:n,page:o}}),h=f.hits||[];return{data:{results:await Promise.all(h.map(async r=>{const i=r.imageObject?.sys?.id||"",l=r.categoryObject?.sys?.id||"",[d,p]=await Promise.all([xs(i),Cs(l)]);return{url:`/blog/${p}/${r.id}`,image:d,title:r._highlightResult?.title?.value||r.title,description:r._highlightResult?.description?.value||r.description}})),total:f.nbHits||0,hasMore:(o+1)*n<(f.nbHits||0)}}}catch(u){return{error:{status:"CUSTOM_ERROR",error:u instanceof Error?u.message:"Unknown error"}}}},providesTags:(t,n,o)=>[{type:"SearchResults",id:o.query}]}),searchBlog:e.query({queryFn:async({query:t,hitsPerPage:n=10,page:o=0})=>{try{if(t.length<3)return{data:[]};const h=(await Tn(no,ao).searchSingleIndex({indexName:so,searchParams:{query:t,hitsPerPage:n,page:o}})).hits||[];return{data:await Promise.all(h.map(async r=>{const i=r.imageObject?.sys?.id||"",l=r.categoryObject?.sys?.id||"",[d,p]=await Promise.all([xs(i),Cs(l)]);return{id:r.id,categoryId:p,url:`/blog/${p}/${r.id}`,image:d,highlightedTitle:r._highlightResult?.title?.value||r.title,highlightedDescription:r._highlightResult?.description?.value||r.description}}))}}catch(u){return{error:{status:"CUSTOM_ERROR",error:u instanceof Error?u.message:"Unknown error"}}}},providesTags:(t,n,o)=>[{type:"SearchResults",id:o.query}]})}),overrideExisting:!1}),{useSearchBlogPostsQuery:Cg,useSearchBlogQuery:Ig}=xg,{Link:Bi}=await R("react-router-dom"),{Box:ce,dclColors:Pa,styled:ne}=await R("decentraland-ui2"),_g=ne(ce,{shouldForwardProp:e=>e!=="$hasResults"})(({theme:e,$hasResults:t})=>({position:"relative",width:"auto",zIndex:t?e.zIndex.modal:1,[e.breakpoints.down("sm")]:{width:"100%"}})),Ag=ne(ce)(({theme:e})=>({position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",zIndex:e.zIndex.modal-1})),Rg=ne(ce)(()=>({position:"relative",display:"flex",alignItems:"center",width:"100%"})),Og=ne(ce)(({theme:e})=>({width:"300px",padding:`${e.spacing(1.5)} ${e.spacing(5)} ${e.spacing(1.5)} ${e.spacing(2)}`,border:"1px solid rgba(255, 255, 255, 0.15)",borderRadius:e.spacing(1),backgroundColor:"rgba(255, 255, 255, 0.05)",color:e.palette.text.primary,fontSize:"15px",outline:"none",transition:"all 200ms ease","&::placeholder":{color:"rgba(255, 255, 255, 0.5)"},"&:focus":{backgroundColor:"rgba(255, 255, 255, 0.08)",borderColor:"rgba(255, 255, 255, 0.25)"},"@media (max-width: 1450px)":{width:"100%",marginBottom:e.spacing(2)}})).withComponent("input"),kg=ne(ce)(({theme:e})=>({position:"absolute",right:e.spacing(1.5),top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"rgba(255, 255, 255, 0.5)",fontSize:"24px",cursor:"pointer",padding:e.spacing(.5),lineHeight:1,transition:"color 200ms ease","&:hover":{color:e.palette.text.primary}})).withComponent("button"),Dg=ne(ce)(({theme:e})=>({position:"absolute",top:`calc(100% + ${e.spacing(1)})`,right:0,width:"500px",maxWidth:"90vw",backgroundColor:e.palette.background.paper,borderRadius:e.spacing(1.5),boxShadow:"0 8px 24px rgba(0, 0, 0, 0.4)",listStyleType:"none",margin:0,padding:e.spacing(1),maxHeight:"600px",overflowY:"auto",zIndex:e.zIndex.modal+1,"@media (max-width: 1450px)":{width:`calc(100vw - ${e.spacing(6)})`,left:0,right:"auto"}})).withComponent("ul"),jg=ne(ce,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({borderRadius:e.spacing(1),backgroundColor:t?e.palette.action.hover:"transparent",transition:"background-color 200ms ease",marginBottom:e.spacing(.5),"&:last-child":{marginBottom:0}})).withComponent("li"),Lg=ne(Bi)(({theme:e})=>({display:"flex",padding:e.spacing(1.5),textDecoration:"none",color:"inherit",gap:e.spacing(1.5)})),Ug=ne(ce,{shouldForwardProp:e=>e!=="$image"})(({theme:e,$image:t})=>({width:"80px",height:"80px",flexShrink:0,borderRadius:e.spacing(1),backgroundColor:"rgba(255, 255, 255, 0.05)",backgroundImage:t?`url(${t})`:"none",backgroundSize:"cover",backgroundPosition:"center"})),Mg=ne(ce)(({theme:e})=>({flex:1,display:"flex",flexDirection:"column",gap:e.spacing(.5),overflow:"hidden"})),Ng=ne(ce)(({theme:e})=>({color:e.palette.text.primary,fontSize:"15px",fontWeight:600,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& em":{fontStyle:"normal",color:Pa.base.primary}})),$g=ne(ce)(({theme:e})=>({color:e.palette.text.secondary,fontSize:"13px",lineHeight:"1.5",overflow:"hidden",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical","& em":{fontStyle:"normal",color:Pa.base.primary}})),Jr=ne(ce)(({theme:e})=>({display:"flex",flexDirection:"column",alignItems:"center",padding:`${e.spacing(5)} ${e.spacing(2.5)}`,textAlign:"center",color:e.palette.text.secondary,"& strong":{color:e.palette.text.primary,fontSize:"17px",marginBottom:e.spacing(1)},"& span":{fontSize:"15px"}})).withComponent("li"),oo=ne(ce)(({theme:e})=>({fontSize:"48px",marginBottom:e.spacing(2),opacity:.5})),Bg=ne(ce,{shouldForwardProp:e=>e!=="$selected"})(({theme:e,$selected:t})=>({borderRadius:e.spacing(1),backgroundColor:t?e.palette.action.hover:"transparent",transition:"background-color 200ms ease",marginTop:e.spacing(.5)})).withComponent("li"),Hg=ne(Bi)(({theme:e})=>({display:"block",padding:e.spacing(1.5),textAlign:"center",color:Pa.base.primary,fontSize:"15px",fontWeight:500,textDecoration:"none",transition:"opacity 200ms ease","&:hover":{opacity:.8}})),{useCallback:io,useEffect:Qg,useState:Xr}=await R("react"),{useNavigate:Fg}=await R("react-router-dom"),{useTranslation:Gg}=await R("@dcl/hooks");function Wg(e,t){if(typeof e=="object"&&e!==null&&"error"in e){const n=e.error;if(typeof n=="string")return n}return t}const zg=({placeholder:e,onClose:t})=>{const{t:n}=Gg(),o=Fg(),[u,f]=Xr(""),[h,a]=Xr(-1),[r,s]=Xr("");Qg(()=>{const w=setTimeout(()=>{s(u)},300);return()=>clearTimeout(w)},[u]);const{data:i=[],isLoading:c,error:l,isError:d}=Ig({query:r,hitsPerPage:5,page:0},{skip:r.trim().length<=2}),p=io(()=>{f(""),a(-1),t?.()},[t]),g=io(w=>{const v=i.length>3?4:i.length;if(w.key==="ArrowUp")w.preventDefault(),a(m=>m<=0?v:m-1);else if(w.key==="ArrowDown")w.preventDefault(),a(m=>m>=v?0:m+1);else if(w.key==="Enter"){if(w.preventDefault(),h===4||h===-1)o(`/blog/search?q=${encodeURIComponent(u)}`);else if(h>=0&&i[h]){const m=i[h];o(`/blog/${m.categoryId}/${m.id}`)}p()}else w.key==="Escape"&&p()},[u,h,i,o,p]),y=u.trim().length>2,P=i.length>0;return q.jsxs(_g,{$hasResults:y,children:[y&&q.jsx(Ag,{onClick:p}),q.jsxs(Rg,{children:[q.jsx(Og,{type:"text",value:u,onChange:w=>f(w.target.value),onKeyDown:g,placeholder:e||n("search.placeholder")}),u&&q.jsx(kg,{onClick:p,"aria-label":n("search.clear"),children:"×"})]}),y&&q.jsxs(Dg,{children:[c&&q.jsx(Jr,{children:q.jsx("span",{children:n("search.searching")})}),!c&&d&&q.jsxs(Jr,{children:[q.jsx(oo,{children:"⚠️"}),q.jsx("strong",{children:n("search.error")}),q.jsx("span",{children:Wg(l,n("error.generic"))})]}),!c&&!d&&!P&&q.jsxs(Jr,{children:[q.jsx(oo,{children:"🔍"}),q.jsx("strong",{children:n("search.no_matches")}),q.jsx("span",{children:n("search.try_something_else")})]}),!c&&!d&&P&&i.slice(0,4).map((w,v)=>q.jsx(jg,{$selected:v===h,onMouseEnter:()=>a(v),children:q.jsxs(Lg,{to:`/blog/${w.categoryId}/${w.id}`,onClick:p,children:[q.jsx(Ug,{$image:w.image}),q.jsxs(Mg,{children:[q.jsx(Ng,{dangerouslySetInnerHTML:{__html:w.highlightedTitle}}),q.jsx($g,{dangerouslySetInnerHTML:{__html:w.highlightedDescription}})]})]})},w.id)),!c&&!d&&i.length>4&&q.jsx(Bg,{$selected:h===4,onMouseEnter:()=>a(4),children:q.jsx(Hg,{to:`/blog/search?q=${encodeURIComponent(u)}`,onClick:p,children:n("search.see_more_results")})})]})]})},{Link:Kg}=await R("react-router-dom"),{Box:dt,dclColors:Vg,styled:Je}=await R("decentraland-ui2"),Yg="96px",Jg=Je(dt,{shouldForwardProp:e=>e!=="$embedded"})(({$embedded:e})=>({width:"100%",...e&&{marginTop:Yg}})),Xg=Je(dt)(({theme:e})=>({paddingTop:e.spacing(2),height:"84px",position:"relative",borderBottom:"1px solid",borderColor:e.palette.divider,display:"flex","@media (max-width: 1450px)":{height:"auto"}})),Zg=Je(dt)(({theme:e})=>({display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"100%",margin:"0 auto",padding:`0 ${e.spacing(3)}`,"@media (max-width: 1450px)":{flexDirection:"column-reverse",alignItems:"flex-start"}})),em=Je(dt)(({theme:e})=>({overflowX:"auto",overflowY:"hidden",width:"auto","@media (max-width: 1450px)":{width:"100%",paddingBottom:e.spacing(1)}})).withComponent("nav"),tm=Je(dt)(()=>({display:"flex",flexDirection:"row",listStyleType:"none",margin:0,padding:0,minWidth:"210px"})).withComponent("ul"),co=Je(dt)(({theme:e})=>({marginRight:e.spacing(4),whiteSpace:"nowrap"})).withComponent("li"),uo=Je(Kg,{shouldForwardProp:e=>e!=="$active"})(({theme:e,$active:t})=>({color:e.palette.text.primary,display:"flex",alignItems:"center",fontSize:"17px",fontWeight:t?700:400,height:"64px",padding:0,position:"relative",textDecoration:"none",WebkitTapHighlightColor:"transparent","&::after":{content:'""',position:"absolute",height:"1px",backgroundColor:Vg.base.primary,left:0,right:0,bottom:0,opacity:t?1:0,transition:"opacity 250ms ease"},"&:hover::after":{opacity:1}})),{useCallback:rm,useMemo:nm}=await R("react"),{useLocation:am}=await R("react-router-dom"),{useTranslation:sm}=await R("@dcl/hooks"),lo=({active:e,embedded:t})=>{const{t:n}=sm(),o=am(),{data:u=[]}=Qh(),f=nm(()=>u.filter(a=>a.isShownInMenu),[u]),h=rm(a=>e?e==="all_articles"&&a==="/blog"?!0:`/blog/${e}`===a:o.pathname===a,[e,o.pathname]);return q.jsx(Jg,{$embedded:t,children:q.jsx(Xg,{children:q.jsxs(Zg,{children:[q.jsx(em,{children:q.jsxs(tm,{children:[q.jsx(co,{children:q.jsx(uo,{to:"/blog",$active:h("/blog")||e==="all_articles",children:n("blog.all_articles")})}),f.map(a=>q.jsx(co,{children:q.jsx(uo,{to:`/blog/${a.slug}`,$active:h(`/blog/${a.slug}`),children:a.title})},a.id))]})}),q.jsx(zg,{})]})})})},{createContext:om,useContext:QP}=await R("react"),im=om(!0),{Box:Hi,styled:Qi}=await R("decentraland-ui2"),cm="66px",um=Qi(Hi)(()=>({minHeight:"100vh",display:"flex",flexDirection:"column",paddingTop:cm})),ho=Qi(Hi)(({theme:e})=>({flex:1,padding:e.spacing(5,0,2,0),maxWidth:e.spacing(133),margin:"0 auto",[e.breakpoints.down("md")]:{padding:e.spacing(5,2,2,2)}})),{useCallback:fo,useContext:lm,useMemo:po}=await R("react"),{useLocation:dm}=await R("react-router-dom"),{usePageTracking:hm}=await R("@dcl/hooks"),{ChainId:Vt,Network:go}=await R("@dcl/schemas"),{Footer:fm,FooterLanding:pm,Navbar:gm,NavbarPages:mm,SupportedLanguage:ym}=await R("decentraland-ui2"),mo=ci.is(Jt.PRODUCTION),yo=e=>{if(e===null)return;const t=Number(e);return Number.isFinite(t)?t:void 0};function de(e){const{children:t,activeCategory:n,banner:o,showBlogNavigation:u=!1,relatedPosts:f}=e,h=lm(im),a=dm(),{address:r,isConnected:s,isConnecting:i,isDisconnecting:c,disconnect:l}=ni();hm(a.pathname);const{identity:d}=yl(),{notificationProps:p}=Ep({identity:d,isConnected:s,locale:"en"}),{balance:g}=ls({tokenAddress:ee("MANA_TOKEN_ADDRESS_ETHEREUM"),chainId:mo?Vt.ETHEREUM_MAINNET:Vt.ETHEREUM_SEPOLIA}),{balance:y}=ls({tokenAddress:ee("MANA_TOKEN_ADDRESS_MATIC"),chainId:mo?Vt.MATIC_MAINNET:Vt.MATIC_AMOY}),{data:P}=kh(r??void 0,{skip:!r}),w=P?.avatars?.[0],v=po(()=>{if(!s)return{};const _={},A=yo(g),T=yo(y);return A!==void 0&&(_[go.ETHEREUM]=A),T!==void 0&&(_[go.MATIC]=T),_},[s,g,y]),m=fo(()=>{Si()},[]),b=fo(()=>{l()},[l]),x=po(()=>({activePage:mm.LEARN,isSignedIn:s,isSigningIn:i,isDisconnecting:c,address:r||void 0,avatar:w,manaBalances:v,notifications:p,onClickSignIn:m,onClickSignOut:b,onClickNavbarItem:_=>{const A=_.currentTarget;A?.href&&(window.location.href=A.href)}}),[s,i,c,r,w,v,p,m,b]);return h?q.jsxs(um,{children:[q.jsx(gm,{...x}),u&&q.jsx(lo,{active:n}),o,q.jsx(ho,{children:t}),f,q.jsx(pm,{}),q.jsx(fm,{languages:[{code:ym.EN,name:"English",flag:"🇺🇸"}],hideSocialNetworks:!0})]}):q.jsxs(q.Fragment,{children:[u&&q.jsx(lo,{active:n,embedded:!0}),o,q.jsx(ho,{children:t}),f]})}function wm(e){return e&&typeof e=="object"&&"default"in e?e.default:e}var Fi=Mo,Pm=wm(Fi);function wo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qm(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var vm=!!(typeof window<"u"&&window.document&&window.document.createElement);function bm(e,t,n){if(typeof e!="function")throw new Error("Expected reducePropsToState to be a function.");if(typeof t!="function")throw new Error("Expected handleStateChangeOnClient to be a function.");if(typeof n<"u"&&typeof n!="function")throw new Error("Expected mapStateOnServer to either be undefined or a function.");function o(u){return u.displayName||u.name||"Component"}return function(f){if(typeof f!="function")throw new Error("Expected WrappedComponent to be a React component.");var h=[],a;function r(){a=e(h.map(function(i){return i.props})),s.canUseDOM?t(a):n&&(a=n(a))}var s=function(i){qm(c,i);function c(){return i.apply(this,arguments)||this}c.peek=function(){return a},c.rewind=function(){if(c.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var p=a;return a=void 0,h=[],p};var l=c.prototype;return l.UNSAFE_componentWillMount=function(){h.push(this),r()},l.componentDidUpdate=function(){r()},l.componentWillUnmount=function(){var p=h.indexOf(this);h.splice(p,1),r()},l.render=function(){return Pm.createElement(f,this.props)},c}(Fi.PureComponent);return wo(s,"displayName","SideEffect("+o(f)+")"),wo(s,"canUseDOM",vm),s}}var Em=bm;const Sm=Rt(Em);var Tm=typeof Element<"u",xm=typeof Map=="function",Cm=typeof Set=="function",Im=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function sr(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,o,u;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(!sr(e[o],t[o]))return!1;return!0}var f;if(xm&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(f=e.entries();!(o=f.next()).done;)if(!t.has(o.value[0]))return!1;for(f=e.entries();!(o=f.next()).done;)if(!sr(o.value[1],t.get(o.value[0])))return!1;return!0}if(Cm&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(f=e.entries();!(o=f.next()).done;)if(!t.has(o.value[0]))return!1;return!0}if(Im&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(o=n;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(u=Object.keys(e),n=u.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,u[o]))return!1;if(Tm&&e instanceof Element)return!1;for(o=n;o--!==0;)if(!((u[o]==="_owner"||u[o]==="__v"||u[o]==="__o")&&e.$$typeof)&&!sr(e[u[o]],t[u[o]]))return!1;return!0}return e!==e&&t!==t}var _m=function(t,n){try{return sr(t,n)}catch(o){if((o.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw o}};const Am=Rt(_m);/*
|
|
4
4
|
object-assign
|
|
5
5
|
(c) Sindre Sorhus
|
|
6
6
|
@license MIT
|
|
7
|
-
*/var Po=Object.getOwnPropertySymbols,_m=Object.prototype.hasOwnProperty,Am=Object.prototype.propertyIsEnumerable;function Rm(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Om(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var o=Object.getOwnPropertyNames(t).map(function(f){return t[f]});if(o.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var km=Om()?Object.assign:function(e,t){for(var n,o=Rm(e),u,f=1;f<arguments.length;f++){n=Object(arguments[f]);for(var h in n)_m.call(n,h)&&(o[h]=n[h]);if(Po){u=Po(n);for(var a=0;a<u.length;a++)Am.call(n,u[a])&&(o[u[a]]=n[u[a]])}}return o};const Dm=Rt(km),St=await R("react");var Ke={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},$={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys($).map(function(e){return $[e]});var Y={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},yr={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},At={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},jm=Object.keys(yr).reduce(function(e,t){return e[yr[t]]=t,e},{}),Lm=[$.NOSCRIPT,$.SCRIPT,$.STYLE],me="data-react-helmet",Um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Mm=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Nm=function(){function e(t,n){for(var o=0;o<n.length;o++){var u=n[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},$m=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},qo=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},Bm=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},xn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},Hm=function(t){var n=it(t,$.TITLE),o=it(t,At.TITLE_TEMPLATE);if(o&&n)return o.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var u=it(t,At.DEFAULT_TITLE);return n||u||void 0},Qm=function(t){return it(t,At.ON_CHANGE_CLIENT_STATE)||function(){}},Zr=function(t,n){return n.filter(function(o){return typeof o[t]<"u"}).map(function(o){return o[t]}).reduce(function(o,u){return oe({},o,u)},{})},Fm=function(t,n){return n.filter(function(o){return typeof o[$.BASE]<"u"}).map(function(o){return o[$.BASE]}).reverse().reduce(function(o,u){if(!o.length)for(var f=Object.keys(u),h=0;h<f.length;h++){var a=f[h],r=a.toLowerCase();if(t.indexOf(r)!==-1&&u[r])return o.concat(u)}return o},[])},Pt=function(t,n,o){var u={};return o.filter(function(f){return Array.isArray(f[t])?!0:(typeof f[t]<"u"&&Km("Helmet: "+t+' should be of type "Array". Instead found type "'+Um(f[t])+'"'),!1)}).map(function(f){return f[t]}).reverse().reduce(function(f,h){var a={};h.filter(function(l){for(var d=void 0,p=Object.keys(l),g=0;g<p.length;g++){var y=p[g],P=y.toLowerCase();n.indexOf(P)!==-1&&!(d===Y.REL&&l[d].toLowerCase()==="canonical")&&!(P===Y.REL&&l[P].toLowerCase()==="stylesheet")&&(d=P),n.indexOf(y)!==-1&&(y===Y.INNER_HTML||y===Y.CSS_TEXT||y===Y.ITEM_PROP)&&(d=y)}if(!d||!l[d])return!1;var w=l[d].toLowerCase();return u[d]||(u[d]={}),a[d]||(a[d]={}),u[d][w]?!1:(a[d][w]=!0,!0)}).reverse().forEach(function(l){return f.push(l)});for(var r=Object.keys(a),s=0;s<r.length;s++){var i=r[s],c=Dm({},u[i],a[i]);u[i]=c}return f},[]).reverse()},it=function(t,n){for(var o=t.length-1;o>=0;o--){var u=t[o];if(u.hasOwnProperty(n))return u[n]}return null},Gm=function(t){return{baseTag:Fm([Y.HREF,Y.TARGET],t),bodyAttributes:Zr(Ke.BODY,t),defer:it(t,At.DEFER),encode:it(t,At.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Zr(Ke.HTML,t),linkTags:Pt($.LINK,[Y.REL,Y.HREF],t),metaTags:Pt($.META,[Y.NAME,Y.CHARSET,Y.HTTPEQUIV,Y.PROPERTY,Y.ITEM_PROP],t),noscriptTags:Pt($.NOSCRIPT,[Y.INNER_HTML],t),onChangeClientState:Qm(t),scriptTags:Pt($.SCRIPT,[Y.SRC,Y.INNER_HTML],t),styleTags:Pt($.STYLE,[Y.CSS_TEXT],t),title:Hm(t),titleAttributes:Zr(Ke.TITLE,t)}},Cn=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Cn(t)},0)}}(),vo=function(t){return clearTimeout(t)},Wm=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Cn:global.requestAnimationFrame||Cn,zm=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||vo:global.cancelAnimationFrame||vo,Km=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},qt=null,Vm=function(t){qt&&zm(qt),t.defer?qt=Wm(function(){bo(t,function(){qt=null})}):(bo(t),qt=null)},bo=function(t,n){var o=t.baseTag,u=t.bodyAttributes,f=t.htmlAttributes,h=t.linkTags,a=t.metaTags,r=t.noscriptTags,s=t.onChangeClientState,i=t.scriptTags,c=t.styleTags,l=t.title,d=t.titleAttributes;In($.BODY,u),In($.HTML,f),Ym(l,d);var p={baseTag:rt($.BASE,o),linkTags:rt($.LINK,h),metaTags:rt($.META,a),noscriptTags:rt($.NOSCRIPT,r),scriptTags:rt($.SCRIPT,i),styleTags:rt($.STYLE,c)},g={},y={};Object.keys(p).forEach(function(P){var w=p[P],v=w.newTags,m=w.oldTags;v.length&&(g[P]=v),m.length&&(y[P]=p[P].oldTags)}),n&&n(),s(t,g,y)},Gi=function(t){return Array.isArray(t)?t.join(""):t},Ym=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=Gi(t)),In($.TITLE,n)},In=function(t,n){var o=document.getElementsByTagName(t)[0];if(o){for(var u=o.getAttribute(me),f=u?u.split(","):[],h=[].concat(f),a=Object.keys(n),r=0;r<a.length;r++){var s=a[r],i=n[s]||"";o.getAttribute(s)!==i&&o.setAttribute(s,i),f.indexOf(s)===-1&&f.push(s);var c=h.indexOf(s);c!==-1&&h.splice(c,1)}for(var l=h.length-1;l>=0;l--)o.removeAttribute(h[l]);f.length===h.length?o.removeAttribute(me):o.getAttribute(me)!==a.join(",")&&o.setAttribute(me,a.join(","))}},rt=function(t,n){var o=document.head||document.querySelector($.HEAD),u=o.querySelectorAll(t+"["+me+"]"),f=Array.prototype.slice.call(u),h=[],a=void 0;return n&&n.length&&n.forEach(function(r){var s=document.createElement(t);for(var i in r)if(r.hasOwnProperty(i))if(i===Y.INNER_HTML)s.innerHTML=r.innerHTML;else if(i===Y.CSS_TEXT)s.styleSheet?s.styleSheet.cssText=r.cssText:s.appendChild(document.createTextNode(r.cssText));else{var c=typeof r[i]>"u"?"":r[i];s.setAttribute(i,c)}s.setAttribute(me,"true"),f.some(function(l,d){return a=d,s.isEqualNode(l)})?f.splice(a,1):h.push(s)}),f.forEach(function(r){return r.parentNode.removeChild(r)}),h.forEach(function(r){return o.appendChild(r)}),{oldTags:f,newTags:h}},Wi=function(t){return Object.keys(t).reduce(function(n,o){var u=typeof t[o]<"u"?o+'="'+t[o]+'"':""+o;return n?n+" "+u:u},"")},Jm=function(t,n,o,u){var f=Wi(o),h=Gi(n);return f?"<"+t+" "+me+'="true" '+f+">"+xn(h,u)+"</"+t+">":"<"+t+" "+me+'="true">'+xn(h,u)+"</"+t+">"},Xm=function(t,n,o){return n.reduce(function(u,f){var h=Object.keys(f).filter(function(s){return!(s===Y.INNER_HTML||s===Y.CSS_TEXT)}).reduce(function(s,i){var c=typeof f[i]>"u"?i:i+'="'+xn(f[i],o)+'"';return s?s+" "+c:c},""),a=f.innerHTML||f.cssText||"",r=Lm.indexOf(t)===-1;return u+"<"+t+" "+me+'="true" '+h+(r?"/>":">"+a+"</"+t+">")},"")},zi=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(o,u){return o[yr[u]||u]=t[u],o},n)},Zm=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(o,u){return o[jm[u]||u]=t[u],o},n)},ey=function(t,n,o){var u,f=(u={key:n},u[me]=!0,u),h=zi(o,f);return[St.createElement($.TITLE,h,n)]},ty=function(t,n){return n.map(function(o,u){var f,h=(f={key:u},f[me]=!0,f);return Object.keys(o).forEach(function(a){var r=yr[a]||a;if(r===Y.INNER_HTML||r===Y.CSS_TEXT){var s=o.innerHTML||o.cssText;h.dangerouslySetInnerHTML={__html:s}}else h[r]=o[a]}),St.createElement(t,h)})},De=function(t,n,o){switch(t){case $.TITLE:return{toComponent:function(){return ey(t,n.title,n.titleAttributes)},toString:function(){return Jm(t,n.title,n.titleAttributes,o)}};case Ke.BODY:case Ke.HTML:return{toComponent:function(){return zi(n)},toString:function(){return Wi(n)}};default:return{toComponent:function(){return ty(t,n)},toString:function(){return Xm(t,n,o)}}}},Ki=function(t){var n=t.baseTag,o=t.bodyAttributes,u=t.encode,f=t.htmlAttributes,h=t.linkTags,a=t.metaTags,r=t.noscriptTags,s=t.scriptTags,i=t.styleTags,c=t.title,l=c===void 0?"":c,d=t.titleAttributes;return{base:De($.BASE,n,u),bodyAttributes:De(Ke.BODY,o,u),htmlAttributes:De(Ke.HTML,f,u),link:De($.LINK,h,u),meta:De($.META,a,u),noscript:De($.NOSCRIPT,r,u),script:De($.SCRIPT,s,u),style:De($.STYLE,i,u),title:De($.TITLE,{title:l,titleAttributes:d},u)}},ry=function(t){var n,o;return o=n=function(u){$m(f,u);function f(){return Mm(this,f),Bm(this,u.apply(this,arguments))}return f.prototype.shouldComponentUpdate=function(a){return!Im(this.props,a)},f.prototype.mapNestedChildrenToProps=function(a,r){if(!r)return null;switch(a.type){case $.SCRIPT:case $.NOSCRIPT:return{innerHTML:r};case $.STYLE:return{cssText:r}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},f.prototype.flattenArrayTypeChildren=function(a){var r,s=a.child,i=a.arrayTypeChildren,c=a.newChildProps,l=a.nestedChildren;return oe({},i,(r={},r[s.type]=[].concat(i[s.type]||[],[oe({},c,this.mapNestedChildrenToProps(s,l))]),r))},f.prototype.mapObjectTypeChildren=function(a){var r,s,i=a.child,c=a.newProps,l=a.newChildProps,d=a.nestedChildren;switch(i.type){case $.TITLE:return oe({},c,(r={},r[i.type]=d,r.titleAttributes=oe({},l),r));case $.BODY:return oe({},c,{bodyAttributes:oe({},l)});case $.HTML:return oe({},c,{htmlAttributes:oe({},l)})}return oe({},c,(s={},s[i.type]=oe({},l),s))},f.prototype.mapArrayTypeChildrenToProps=function(a,r){var s=oe({},r);return Object.keys(a).forEach(function(i){var c;s=oe({},s,(c={},c[i]=a[i],c))}),s},f.prototype.warnOnInvalidChildren=function(a,r){return!0},f.prototype.mapChildrenToProps=function(a,r){var s=this,i={};return St.Children.forEach(a,function(c){if(!(!c||!c.props)){var l=c.props,d=l.children,p=qo(l,["children"]),g=Zm(p);switch(s.warnOnInvalidChildren(c,d),c.type){case $.LINK:case $.META:case $.NOSCRIPT:case $.SCRIPT:case $.STYLE:i=s.flattenArrayTypeChildren({child:c,arrayTypeChildren:i,newChildProps:g,nestedChildren:d});break;default:r=s.mapObjectTypeChildren({child:c,newProps:r,newChildProps:g,nestedChildren:d});break}}}),r=this.mapArrayTypeChildrenToProps(i,r),r},f.prototype.render=function(){var a=this.props,r=a.children,s=qo(a,["children"]),i=oe({},s);return r&&(i=this.mapChildrenToProps(r,i)),St.createElement(t,i)},Nm(f,null,[{key:"canUseDOM",set:function(a){t.canUseDOM=a}}]),f}(St.Component),n.propTypes={base:M.object,bodyAttributes:M.object,children:M.oneOfType([M.arrayOf(M.node),M.node]),defaultTitle:M.string,defer:M.bool,encodeSpecialCharacters:M.bool,htmlAttributes:M.object,link:M.arrayOf(M.object),meta:M.arrayOf(M.object),noscript:M.arrayOf(M.object),onChangeClientState:M.func,script:M.arrayOf(M.object),style:M.arrayOf(M.object),title:M.string,titleAttributes:M.object,titleTemplate:M.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var u=t.rewind();return u||(u=Ki({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),u},o},ny=function(){return null},ay=bm(Gm,Vm,Ki)(ny),_n=ry(ay);_n.renderStatic=_n.rewind;var Le=(e=>(e.WEBSITE="website",e.ARTICLE="article",e.PROFILE="profile",e))(Le||{});const{useTranslation:sy}=await R("@dcl/hooks"),oy="https://cms-images.decentraland.org/ea2ybdmmn1kv/7tYISdowuJYIbSIDqij87H/f3524d454d8e29702792a6b674f5550d/GI_Landscape.Small.png",en="Decentraland",iy="en_US",Dt=e=>{const{t}=sy(),n={url:oy,width:1200,height:630,alt:t("seo.default_image_alt"),type:"image/jpeg"},{title:o,description:u,image:f=n,type:h=Le.WEBSITE,url:a,locale:r=iy,author:s,publishedTime:i,modifiedTime:c,section:l,tags:d}=e,p=ee("BLOG_BASE_URL")||"",g=o?`${o} | ${en}`:en,y=a||p,P=typeof f=="string"?{url:f}:f;return q.jsxs(_n,{children:[q.jsx("title",{children:g}),q.jsx("meta",{name:"description",content:u}),q.jsx("link",{rel:"canonical",href:y}),q.jsx("meta",{property:"og:site_name",content:en}),q.jsx("meta",{property:"og:title",content:g}),q.jsx("meta",{property:"og:description",content:u}),q.jsx("meta",{property:"og:type",content:h}),q.jsx("meta",{property:"og:url",content:y}),q.jsx("meta",{property:"og:locale",content:r}),q.jsx("meta",{property:"og:image",content:P.url}),P.width&&q.jsx("meta",{property:"og:image:width",content:String(P.width)}),P.height&&q.jsx("meta",{property:"og:image:height",content:String(P.height)}),P.alt&&q.jsx("meta",{property:"og:image:alt",content:P.alt}),P.type&&q.jsx("meta",{property:"og:image:type",content:P.type}),q.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),q.jsx("meta",{name:"twitter:title",content:g}),q.jsx("meta",{name:"twitter:description",content:u}),q.jsx("meta",{name:"twitter:image",content:P.url}),P.alt&&q.jsx("meta",{name:"twitter:image:alt",content:P.alt}),h===Le.ARTICLE&&s&&q.jsx("meta",{property:"article:author",content:s}),h===Le.ARTICLE&&i&&q.jsx("meta",{property:"article:published_time",content:i}),h===Le.ARTICLE&&c&&q.jsx("meta",{property:"article:modified_time",content:c}),h===Le.ARTICLE&&l&&q.jsx("meta",{property:"article:section",content:l}),h===Le.ARTICLE&&d?.map(w=>q.jsx("meta",{property:"article:tag",content:w},w))]})},{useCallback:cy,useEffect:Eo,useMemo:uy,useRef:ly,useState:So}=await R("react"),{useInfiniteScroll:dy}=await R("@dcl/hooks"),hy=7,To=6,fy=(e,t)=>Array.from({length:e},(n,o)=>({id:`placeholder-${t}-${o}`,isPlaceholder:!0}));function qa({category:e,author:t}={}){const[n,o]=So(0),[u,f]=So(!1),h=ly(0),{data:a,isLoading:r,error:s,isFetching:i}=fi({category:e,author:t,limit:n===0?hy:To,skip:n}),c=uy(()=>{const g=a?.posts??[];return u&&i?[...g,...fy(To,h.current)]:g},[a?.posts,u,i]),l=a?.hasMore??!0,d=r&&n===0;Eo(()=>{o(0),f(!1),h.current=0},[e,t]),Eo(()=>{i&&n>0?(h.current+=1,f(!0)):i||f(!1)},[i,n]);const p=cy(()=>{i||!l||!a||o(a.nextCmsSkip)},[i,l,a]);return dy({onLoadMore:p,hasMore:l,isLoading:i}),{posts:c,isLoading:r,isLoadingInitial:d,isFetching:i,hasMore:l,error:s}}const{Box:Vi,styled:va}=await R("decentraland-ui2"),py=va(Vi)(({theme:e})=>({marginBottom:e.spacing(6),display:"flex",flexDirection:"column",alignItems:"left",gap:e.spacing(4)})),gy=va("img")(()=>({width:"150px",height:"150px",borderRadius:"50%",objectFit:"cover"})),An=va(Vi)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)})),{useParams:my}=await R("react-router-dom"),{useTranslation:Yi}=await R("@dcl/hooks"),{CircularProgress:yy,Typography:or}=await R("decentraland-ui2"),wy=({author:e})=>{const{t}=Yi(),{posts:n,isLoadingInitial:o,error:u}=qa({author:e.slug});return u?q.jsx(An,{children:q.jsx(or,{color:"error",children:t("error.load_posts")})}):q.jsxs(q.Fragment,{children:[q.jsxs(py,{children:[e.image&&q.jsx(gy,{src:e.image.url,alt:e.title}),q.jsx(or,{variant:"h5",children:e.title}),q.jsx(or,{variant:"body1",color:"textSecondary",children:e.description})]}),q.jsx(ua,{posts:n,loading:o,hasMainPost:!1})]})},HP=()=>{const{t:e}=Yi(),{authorSlug:t}=my(),{data:n,isLoading:o,error:u}=Wh({slug:t||""}),f=ee("BLOG_BASE_URL")||"";return u?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(An,{children:q.jsx(or,{color:"error",children:e("error.load_author")})})}):q.jsxs(de,{showBlogNavigation:!0,children:[q.jsx(Dt,{title:n?.title?e("blog.posts_by",{author:n.title}):void 0,description:n?.description||e("blog.default_description"),url:`${f}/author/${t}`,type:Le.PROFILE,image:n?.image?{url:n.image.url,alt:n.title}:void 0}),o?q.jsx(An,{children:q.jsx(yy,{})}):n?q.jsx(wy,{author:n},n.id):null]})},{Box:ba,styled:Ea}=await R("decentraland-ui2");Ea(ba)(({theme:e})=>({marginTop:e.spacing(6),display:"flex",justifyContent:"center"}));Ea(ba)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));const Py=Ea(ba)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(4),paddingBottom:e.spacing(4)})),{useMemo:qy}=await R("react"),{useTranslation:vy}=await R("@dcl/hooks"),{Typography:by}=await R("decentraland-ui2"),QP=()=>{const{t:e}=vy(),t=Uo(),{posts:n,isLoadingInitial:o,error:u}=qa(),f=qy(()=>n.find(a=>!("isPlaceholder"in a)),[n]);return q.jsxs(de,{showBlogNavigation:!0,activeCategory:"all_articles",children:[q.jsx(Dt,{title:e("blog.title"),description:f?.description||e("blog.default_description"),image:f?.image?{url:f.image.url,width:f.image.width,height:f.image.height,alt:f.title}:void 0}),u?q.jsx(Py,{children:q.jsx(by,{color:"error",children:e("error.load_posts")})}):q.jsx(ua,{posts:n,loading:o,hasMainPost:!t})]})},{Box:Ji,Typography:Ey,styled:Sa}=await R("decentraland-ui2"),Sy=Sa(Ji)(({theme:e,imageUrl:t})=>({backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("${t}")`,backgroundSize:"cover",backgroundPosition:"center",width:"100%",height:"248px",display:"flex",alignItems:"center",justifyContent:"flex-start",marginBottom:e.spacing(6),[e.breakpoints.down("sm")]:{height:"180px",justifyContent:"center"}})),Ty=Sa(Ji)(({theme:e})=>({textAlign:"left",color:e.palette.common.white,maxWidth:e.spacing(133),width:"100%",margin:"0 auto",padding:e.spacing(3),"& p":{fontSize:"18px",lineHeight:"28px",textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},[e.breakpoints.down("sm")]:{textAlign:"center"}})),xy=Sa(Ey)(({theme:e})=>({marginBottom:e.spacing(2),textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)",[e.breakpoints.down("sm")]:{fontSize:e.typography.h4.fontSize,fontWeight:e.typography.h4.fontWeight,lineHeight:e.typography.h4.lineHeight}})),{memo:Cy}=await R("react"),{Typography:Iy}=await R("decentraland-ui2"),_y=Cy(e=>{const{category:t,description:n,image:o}=e;return q.jsx(Sy,{imageUrl:o,children:q.jsxs(Ty,{children:[q.jsx(xy,{variant:"h3",children:t}),q.jsx(Iy,{variant:"body1",children:n})]})})}),{Box:Ta,styled:xa}=await R("decentraland-ui2"),Rn=xa(Ta)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)}));xa(Ta)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));xa(Ta)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));const{useParams:Ay}=await R("react-router-dom"),{useTranslation:Xi}=await R("@dcl/hooks"),{CircularProgress:Ry,Typography:Zi}=await R("decentraland-ui2"),Oy=({category:e})=>{const{t}=Xi(),n=Uo(),{posts:o,isLoadingInitial:u,error:f}=qa({category:e.slug});return f?q.jsx(Rn,{children:q.jsx(Zi,{color:"error",children:t("error.load_posts")})}):q.jsx(ua,{posts:o,loading:u,hasMainPost:!n})},FP=()=>{const{t:e}=Xi(),{categorySlug:t}=Ay(),{data:n,isLoading:o,error:u}=Fh({slug:t||""}),f=ee("BLOG_BASE_URL")||"";return u?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Rn,{children:q.jsx(Zi,{color:"error",children:e("error.load_category")})})}):q.jsxs(de,{showBlogNavigation:!0,activeCategory:t,banner:n?q.jsx(_y,{category:n.title,description:n.description,image:n.image.url}):void 0,children:[q.jsx(Dt,{title:n?.title,description:n?.description||e("blog.default_description"),url:`${f}/${t}`,image:n?.image?{url:n.image.url,width:n.image.width,height:n.image.height,alt:n.title}:void 0}),o?q.jsx(Rn,{children:q.jsx(Ry,{})}):n?q.jsx(Oy,{category:n},n.id):null]})};var Ca={},ky=Tc;Object.defineProperty(Ca,"__esModule",{value:!0});var ec=Ca.default=void 0;Ly(Mo);var Dy=ky(Sc()),jy=q;function tc(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(tc=function(o){return o?n:t})(e)}function Ly(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=tc(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if(f!=="default"&&Object.prototype.hasOwnProperty.call(e,f)){var h=u?Object.getOwnPropertyDescriptor(e,f):null;h&&(h.get||h.set)?Object.defineProperty(o,f,h):o[f]=e[f]}return o.default=e,n&&n.set(e,o),o}ec=Ca.default=(0,Dy.default)((0,jy.jsx)("path",{d:"M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m13 2h-2.5A3.5 3.5 0 0 0 12 8.5V11h-2v3h2v7h3v-7h3v-3h-3V9a1 1 0 0 1 1-1h2V5z"}),"Facebook");const{useDispatch:GP,useSelector:Uy}=await R("react-redux"),My=Uy,{Box:rc,Typography:Ny,dclColors:$y,styled:_r}=await R("decentraland-ui2"),By=_r("section")(({theme:e})=>({backgroundColor:$y.neutral.softBlack2,paddingBottom:e.spacing(13),paddingTop:e.spacing(12),width:"100%"})),Hy=_r(rc)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),width:"100%",maxWidth:e.spacing(136.875),margin:"0 auto"})),Qy=_r(Ny)(({theme:e})=>({...e.typography.h6,color:e.palette.text.primary})),Fy=_r(rc)(({theme:e})=>({display:"flex",flexWrap:"nowrap",justifyContent:"flex-start",gap:e.spacing(4),[e.breakpoints.down("xs")]:{justifyContent:"center",flexWrap:"wrap"}})),{memo:Gy}=await R("react"),{useTranslation:Wy}=await R("@dcl/hooks"),zy=3,Ky=Gy(e=>{const{posts:t=[],loading:n=!1,maxItems:o=zy}=e,u=t.slice(0,o),{t:f}=Wy();return n||u.length===0?null:q.jsx(By,{children:q.jsxs(Hy,{children:[q.jsx(Qy,{variant:"h6",children:f("blog.related_post")}),q.jsx(Fy,{children:u.map(h=>q.jsx(ar,{post:h},h.id))})]})})});var tn={exports:{}};/*!
|
|
7
|
+
*/var Po=Object.getOwnPropertySymbols,Rm=Object.prototype.hasOwnProperty,Om=Object.prototype.propertyIsEnumerable;function km(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function Dm(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var o=Object.getOwnPropertyNames(t).map(function(f){return t[f]});if(o.join("")!=="0123456789")return!1;var u={};return"abcdefghijklmnopqrst".split("").forEach(function(f){u[f]=f}),Object.keys(Object.assign({},u)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var jm=Dm()?Object.assign:function(e,t){for(var n,o=km(e),u,f=1;f<arguments.length;f++){n=Object(arguments[f]);for(var h in n)Rm.call(n,h)&&(o[h]=n[h]);if(Po){u=Po(n);for(var a=0;a<u.length;a++)Om.call(n,u[a])&&(o[u[a]]=n[u[a]])}}return o};const Lm=Rt(jm),St=await R("react");var Ke={BODY:"bodyAttributes",HTML:"htmlAttributes",TITLE:"titleAttributes"},$={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"};Object.keys($).map(function(e){return $[e]});var Y={CHARSET:"charset",CSS_TEXT:"cssText",HREF:"href",HTTPEQUIV:"http-equiv",INNER_HTML:"innerHTML",ITEM_PROP:"itemprop",NAME:"name",PROPERTY:"property",REL:"rel",SRC:"src",TARGET:"target"},yr={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},At={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate"},Um=Object.keys(yr).reduce(function(e,t){return e[yr[t]]=t,e},{}),Mm=[$.NOSCRIPT,$.SCRIPT,$.STYLE],me="data-react-helmet",Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},$m=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},Bm=function(){function e(t,n){for(var o=0;o<n.length;o++){var u=n[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(t,u.key,u)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),oe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Hm=function(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},qo=function(e,t){var n={};for(var o in e)t.indexOf(o)>=0||Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return n},Qm=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t&&(typeof t=="object"||typeof t=="function")?t:e},xn=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return n===!1?String(t):String(t).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},Fm=function(t){var n=it(t,$.TITLE),o=it(t,At.TITLE_TEMPLATE);if(o&&n)return o.replace(/%s/g,function(){return Array.isArray(n)?n.join(""):n});var u=it(t,At.DEFAULT_TITLE);return n||u||void 0},Gm=function(t){return it(t,At.ON_CHANGE_CLIENT_STATE)||function(){}},Zr=function(t,n){return n.filter(function(o){return typeof o[t]<"u"}).map(function(o){return o[t]}).reduce(function(o,u){return oe({},o,u)},{})},Wm=function(t,n){return n.filter(function(o){return typeof o[$.BASE]<"u"}).map(function(o){return o[$.BASE]}).reverse().reduce(function(o,u){if(!o.length)for(var f=Object.keys(u),h=0;h<f.length;h++){var a=f[h],r=a.toLowerCase();if(t.indexOf(r)!==-1&&u[r])return o.concat(u)}return o},[])},Pt=function(t,n,o){var u={};return o.filter(function(f){return Array.isArray(f[t])?!0:(typeof f[t]<"u"&&Ym("Helmet: "+t+' should be of type "Array". Instead found type "'+Nm(f[t])+'"'),!1)}).map(function(f){return f[t]}).reverse().reduce(function(f,h){var a={};h.filter(function(l){for(var d=void 0,p=Object.keys(l),g=0;g<p.length;g++){var y=p[g],P=y.toLowerCase();n.indexOf(P)!==-1&&!(d===Y.REL&&l[d].toLowerCase()==="canonical")&&!(P===Y.REL&&l[P].toLowerCase()==="stylesheet")&&(d=P),n.indexOf(y)!==-1&&(y===Y.INNER_HTML||y===Y.CSS_TEXT||y===Y.ITEM_PROP)&&(d=y)}if(!d||!l[d])return!1;var w=l[d].toLowerCase();return u[d]||(u[d]={}),a[d]||(a[d]={}),u[d][w]?!1:(a[d][w]=!0,!0)}).reverse().forEach(function(l){return f.push(l)});for(var r=Object.keys(a),s=0;s<r.length;s++){var i=r[s],c=Lm({},u[i],a[i]);u[i]=c}return f},[]).reverse()},it=function(t,n){for(var o=t.length-1;o>=0;o--){var u=t[o];if(u.hasOwnProperty(n))return u[n]}return null},zm=function(t){return{baseTag:Wm([Y.HREF,Y.TARGET],t),bodyAttributes:Zr(Ke.BODY,t),defer:it(t,At.DEFER),encode:it(t,At.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:Zr(Ke.HTML,t),linkTags:Pt($.LINK,[Y.REL,Y.HREF],t),metaTags:Pt($.META,[Y.NAME,Y.CHARSET,Y.HTTPEQUIV,Y.PROPERTY,Y.ITEM_PROP],t),noscriptTags:Pt($.NOSCRIPT,[Y.INNER_HTML],t),onChangeClientState:Gm(t),scriptTags:Pt($.SCRIPT,[Y.SRC,Y.INNER_HTML],t),styleTags:Pt($.STYLE,[Y.CSS_TEXT],t),title:Fm(t),titleAttributes:Zr(Ke.TITLE,t)}},Cn=function(){var e=Date.now();return function(t){var n=Date.now();n-e>16?(e=n,t(n)):setTimeout(function(){Cn(t)},0)}}(),vo=function(t){return clearTimeout(t)},Km=typeof window<"u"?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Cn:global.requestAnimationFrame||Cn,Vm=typeof window<"u"?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||vo:global.cancelAnimationFrame||vo,Ym=function(t){return console&&typeof console.warn=="function"&&console.warn(t)},qt=null,Jm=function(t){qt&&Vm(qt),t.defer?qt=Km(function(){bo(t,function(){qt=null})}):(bo(t),qt=null)},bo=function(t,n){var o=t.baseTag,u=t.bodyAttributes,f=t.htmlAttributes,h=t.linkTags,a=t.metaTags,r=t.noscriptTags,s=t.onChangeClientState,i=t.scriptTags,c=t.styleTags,l=t.title,d=t.titleAttributes;In($.BODY,u),In($.HTML,f),Xm(l,d);var p={baseTag:rt($.BASE,o),linkTags:rt($.LINK,h),metaTags:rt($.META,a),noscriptTags:rt($.NOSCRIPT,r),scriptTags:rt($.SCRIPT,i),styleTags:rt($.STYLE,c)},g={},y={};Object.keys(p).forEach(function(P){var w=p[P],v=w.newTags,m=w.oldTags;v.length&&(g[P]=v),m.length&&(y[P]=p[P].oldTags)}),n&&n(),s(t,g,y)},Gi=function(t){return Array.isArray(t)?t.join(""):t},Xm=function(t,n){typeof t<"u"&&document.title!==t&&(document.title=Gi(t)),In($.TITLE,n)},In=function(t,n){var o=document.getElementsByTagName(t)[0];if(o){for(var u=o.getAttribute(me),f=u?u.split(","):[],h=[].concat(f),a=Object.keys(n),r=0;r<a.length;r++){var s=a[r],i=n[s]||"";o.getAttribute(s)!==i&&o.setAttribute(s,i),f.indexOf(s)===-1&&f.push(s);var c=h.indexOf(s);c!==-1&&h.splice(c,1)}for(var l=h.length-1;l>=0;l--)o.removeAttribute(h[l]);f.length===h.length?o.removeAttribute(me):o.getAttribute(me)!==a.join(",")&&o.setAttribute(me,a.join(","))}},rt=function(t,n){var o=document.head||document.querySelector($.HEAD),u=o.querySelectorAll(t+"["+me+"]"),f=Array.prototype.slice.call(u),h=[],a=void 0;return n&&n.length&&n.forEach(function(r){var s=document.createElement(t);for(var i in r)if(r.hasOwnProperty(i))if(i===Y.INNER_HTML)s.innerHTML=r.innerHTML;else if(i===Y.CSS_TEXT)s.styleSheet?s.styleSheet.cssText=r.cssText:s.appendChild(document.createTextNode(r.cssText));else{var c=typeof r[i]>"u"?"":r[i];s.setAttribute(i,c)}s.setAttribute(me,"true"),f.some(function(l,d){return a=d,s.isEqualNode(l)})?f.splice(a,1):h.push(s)}),f.forEach(function(r){return r.parentNode.removeChild(r)}),h.forEach(function(r){return o.appendChild(r)}),{oldTags:f,newTags:h}},Wi=function(t){return Object.keys(t).reduce(function(n,o){var u=typeof t[o]<"u"?o+'="'+t[o]+'"':""+o;return n?n+" "+u:u},"")},Zm=function(t,n,o,u){var f=Wi(o),h=Gi(n);return f?"<"+t+" "+me+'="true" '+f+">"+xn(h,u)+"</"+t+">":"<"+t+" "+me+'="true">'+xn(h,u)+"</"+t+">"},ey=function(t,n,o){return n.reduce(function(u,f){var h=Object.keys(f).filter(function(s){return!(s===Y.INNER_HTML||s===Y.CSS_TEXT)}).reduce(function(s,i){var c=typeof f[i]>"u"?i:i+'="'+xn(f[i],o)+'"';return s?s+" "+c:c},""),a=f.innerHTML||f.cssText||"",r=Mm.indexOf(t)===-1;return u+"<"+t+" "+me+'="true" '+h+(r?"/>":">"+a+"</"+t+">")},"")},zi=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(o,u){return o[yr[u]||u]=t[u],o},n)},ty=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Object.keys(t).reduce(function(o,u){return o[Um[u]||u]=t[u],o},n)},ry=function(t,n,o){var u,f=(u={key:n},u[me]=!0,u),h=zi(o,f);return[St.createElement($.TITLE,h,n)]},ny=function(t,n){return n.map(function(o,u){var f,h=(f={key:u},f[me]=!0,f);return Object.keys(o).forEach(function(a){var r=yr[a]||a;if(r===Y.INNER_HTML||r===Y.CSS_TEXT){var s=o.innerHTML||o.cssText;h.dangerouslySetInnerHTML={__html:s}}else h[r]=o[a]}),St.createElement(t,h)})},De=function(t,n,o){switch(t){case $.TITLE:return{toComponent:function(){return ry(t,n.title,n.titleAttributes)},toString:function(){return Zm(t,n.title,n.titleAttributes,o)}};case Ke.BODY:case Ke.HTML:return{toComponent:function(){return zi(n)},toString:function(){return Wi(n)}};default:return{toComponent:function(){return ny(t,n)},toString:function(){return ey(t,n,o)}}}},Ki=function(t){var n=t.baseTag,o=t.bodyAttributes,u=t.encode,f=t.htmlAttributes,h=t.linkTags,a=t.metaTags,r=t.noscriptTags,s=t.scriptTags,i=t.styleTags,c=t.title,l=c===void 0?"":c,d=t.titleAttributes;return{base:De($.BASE,n,u),bodyAttributes:De(Ke.BODY,o,u),htmlAttributes:De(Ke.HTML,f,u),link:De($.LINK,h,u),meta:De($.META,a,u),noscript:De($.NOSCRIPT,r,u),script:De($.SCRIPT,s,u),style:De($.STYLE,i,u),title:De($.TITLE,{title:l,titleAttributes:d},u)}},ay=function(t){var n,o;return o=n=function(u){Hm(f,u);function f(){return $m(this,f),Qm(this,u.apply(this,arguments))}return f.prototype.shouldComponentUpdate=function(a){return!Am(this.props,a)},f.prototype.mapNestedChildrenToProps=function(a,r){if(!r)return null;switch(a.type){case $.SCRIPT:case $.NOSCRIPT:return{innerHTML:r};case $.STYLE:return{cssText:r}}throw new Error("<"+a.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},f.prototype.flattenArrayTypeChildren=function(a){var r,s=a.child,i=a.arrayTypeChildren,c=a.newChildProps,l=a.nestedChildren;return oe({},i,(r={},r[s.type]=[].concat(i[s.type]||[],[oe({},c,this.mapNestedChildrenToProps(s,l))]),r))},f.prototype.mapObjectTypeChildren=function(a){var r,s,i=a.child,c=a.newProps,l=a.newChildProps,d=a.nestedChildren;switch(i.type){case $.TITLE:return oe({},c,(r={},r[i.type]=d,r.titleAttributes=oe({},l),r));case $.BODY:return oe({},c,{bodyAttributes:oe({},l)});case $.HTML:return oe({},c,{htmlAttributes:oe({},l)})}return oe({},c,(s={},s[i.type]=oe({},l),s))},f.prototype.mapArrayTypeChildrenToProps=function(a,r){var s=oe({},r);return Object.keys(a).forEach(function(i){var c;s=oe({},s,(c={},c[i]=a[i],c))}),s},f.prototype.warnOnInvalidChildren=function(a,r){return!0},f.prototype.mapChildrenToProps=function(a,r){var s=this,i={};return St.Children.forEach(a,function(c){if(!(!c||!c.props)){var l=c.props,d=l.children,p=qo(l,["children"]),g=ty(p);switch(s.warnOnInvalidChildren(c,d),c.type){case $.LINK:case $.META:case $.NOSCRIPT:case $.SCRIPT:case $.STYLE:i=s.flattenArrayTypeChildren({child:c,arrayTypeChildren:i,newChildProps:g,nestedChildren:d});break;default:r=s.mapObjectTypeChildren({child:c,newProps:r,newChildProps:g,nestedChildren:d});break}}}),r=this.mapArrayTypeChildrenToProps(i,r),r},f.prototype.render=function(){var a=this.props,r=a.children,s=qo(a,["children"]),i=oe({},s);return r&&(i=this.mapChildrenToProps(r,i)),St.createElement(t,i)},Bm(f,null,[{key:"canUseDOM",set:function(a){t.canUseDOM=a}}]),f}(St.Component),n.propTypes={base:M.object,bodyAttributes:M.object,children:M.oneOfType([M.arrayOf(M.node),M.node]),defaultTitle:M.string,defer:M.bool,encodeSpecialCharacters:M.bool,htmlAttributes:M.object,link:M.arrayOf(M.object),meta:M.arrayOf(M.object),noscript:M.arrayOf(M.object),onChangeClientState:M.func,script:M.arrayOf(M.object),style:M.arrayOf(M.object),title:M.string,titleAttributes:M.object,titleTemplate:M.string},n.defaultProps={defer:!0,encodeSpecialCharacters:!0},n.peek=t.peek,n.rewind=function(){var u=t.rewind();return u||(u=Ki({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),u},o},sy=function(){return null},oy=Sm(zm,Jm,Ki)(sy),_n=ay(oy);_n.renderStatic=_n.rewind;var Le=(e=>(e.WEBSITE="website",e.ARTICLE="article",e.PROFILE="profile",e))(Le||{});const{useTranslation:iy}=await R("@dcl/hooks"),cy="https://cms-images.decentraland.org/ea2ybdmmn1kv/7tYISdowuJYIbSIDqij87H/f3524d454d8e29702792a6b674f5550d/GI_Landscape.Small.png",en="Decentraland",uy="en_US",Dt=e=>{const{t}=iy(),n={url:cy,width:1200,height:630,alt:t("seo.default_image_alt"),type:"image/jpeg"},{title:o,description:u,image:f=n,type:h=Le.WEBSITE,url:a,locale:r=uy,author:s,publishedTime:i,modifiedTime:c,section:l,tags:d}=e,p=ee("BLOG_BASE_URL")||"",g=o?`${o} | ${en}`:en,y=a||p,P=typeof f=="string"?{url:f}:f;return q.jsxs(_n,{children:[q.jsx("title",{children:g}),q.jsx("meta",{name:"description",content:u}),q.jsx("link",{rel:"canonical",href:y}),q.jsx("meta",{property:"og:site_name",content:en}),q.jsx("meta",{property:"og:title",content:g}),q.jsx("meta",{property:"og:description",content:u}),q.jsx("meta",{property:"og:type",content:h}),q.jsx("meta",{property:"og:url",content:y}),q.jsx("meta",{property:"og:locale",content:r}),q.jsx("meta",{property:"og:image",content:P.url}),P.width&&q.jsx("meta",{property:"og:image:width",content:String(P.width)}),P.height&&q.jsx("meta",{property:"og:image:height",content:String(P.height)}),P.alt&&q.jsx("meta",{property:"og:image:alt",content:P.alt}),P.type&&q.jsx("meta",{property:"og:image:type",content:P.type}),q.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),q.jsx("meta",{name:"twitter:title",content:g}),q.jsx("meta",{name:"twitter:description",content:u}),q.jsx("meta",{name:"twitter:image",content:P.url}),P.alt&&q.jsx("meta",{name:"twitter:image:alt",content:P.alt}),h===Le.ARTICLE&&s&&q.jsx("meta",{property:"article:author",content:s}),h===Le.ARTICLE&&i&&q.jsx("meta",{property:"article:published_time",content:i}),h===Le.ARTICLE&&c&&q.jsx("meta",{property:"article:modified_time",content:c}),h===Le.ARTICLE&&l&&q.jsx("meta",{property:"article:section",content:l}),h===Le.ARTICLE&&d?.map(w=>q.jsx("meta",{property:"article:tag",content:w},w))]})},{useCallback:ly,useEffect:Eo,useMemo:dy,useRef:hy,useState:So}=await R("react"),{useInfiniteScroll:fy}=await R("@dcl/hooks"),py=7,To=6,gy=(e,t)=>Array.from({length:e},(n,o)=>({id:`placeholder-${t}-${o}`,isPlaceholder:!0}));function qa({category:e,author:t}={}){const[n,o]=So(0),[u,f]=So(!1),h=hy(0),{data:a,isLoading:r,error:s,isFetching:i}=fi({category:e,author:t,limit:n===0?py:To,skip:n}),c=dy(()=>{const g=a?.posts??[];return u&&i?[...g,...gy(To,h.current)]:g},[a?.posts,u,i]),l=a?.hasMore??!0,d=r&&n===0;Eo(()=>{o(0),f(!1),h.current=0},[e,t]),Eo(()=>{i&&n>0?(h.current+=1,f(!0)):i||f(!1)},[i,n]);const p=ly(()=>{i||!l||!a||o(a.nextCmsSkip)},[i,l,a]);return fy({onLoadMore:p,hasMore:l,isLoading:i}),{posts:c,isLoading:r,isLoadingInitial:d,isFetching:i,hasMore:l,error:s}}const{Box:Vi,styled:va}=await R("decentraland-ui2"),my=va(Vi)(({theme:e})=>({marginBottom:e.spacing(6),display:"flex",flexDirection:"column",alignItems:"left",gap:e.spacing(4)})),yy=va("img")(()=>({width:"150px",height:"150px",borderRadius:"50%",objectFit:"cover"})),An=va(Vi)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)})),{useParams:wy}=await R("react-router-dom"),{useTranslation:Yi}=await R("@dcl/hooks"),{CircularProgress:Py,Typography:or}=await R("decentraland-ui2"),qy=({author:e})=>{const{t}=Yi(),{posts:n,isLoadingInitial:o,error:u}=qa({author:e.slug});return u?q.jsx(An,{children:q.jsx(or,{color:"error",children:t("error.load_posts")})}):q.jsxs(q.Fragment,{children:[q.jsxs(my,{children:[e.image&&q.jsx(yy,{src:e.image.url,alt:e.title}),q.jsx(or,{variant:"h5",children:e.title}),q.jsx(or,{variant:"body1",color:"textSecondary",children:e.description})]}),q.jsx(ua,{posts:n,loading:o,hasMainPost:!1})]})},FP=()=>{const{t:e}=Yi(),{authorSlug:t}=wy(),{data:n,isLoading:o,error:u}=Wh({slug:t||""}),f=ee("BLOG_BASE_URL")||"";return u?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(An,{children:q.jsx(or,{color:"error",children:e("error.load_author")})})}):q.jsxs(de,{showBlogNavigation:!0,children:[q.jsx(Dt,{title:n?.title?e("blog.posts_by",{author:n.title}):void 0,description:n?.description||e("blog.default_description"),url:`${f}/author/${t}`,type:Le.PROFILE,image:n?.image?{url:n.image.url,alt:n.title}:void 0}),o?q.jsx(An,{children:q.jsx(Py,{})}):n?q.jsx(qy,{author:n},n.id):null]})},{Box:ba,styled:Ea}=await R("decentraland-ui2");Ea(ba)(({theme:e})=>({marginTop:e.spacing(6),display:"flex",justifyContent:"center"}));Ea(ba)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));const vy=Ea(ba)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(4),paddingBottom:e.spacing(4)})),{useMemo:by}=await R("react"),{useTranslation:Ey}=await R("@dcl/hooks"),{Typography:Sy}=await R("decentraland-ui2"),GP=()=>{const{t:e}=Ey(),t=Uo(),{posts:n,isLoadingInitial:o,error:u}=qa(),f=by(()=>n.find(a=>!("isPlaceholder"in a)),[n]);return q.jsxs(de,{showBlogNavigation:!0,activeCategory:"all_articles",children:[q.jsx(Dt,{title:e("blog.title"),description:f?.description||e("blog.default_description"),image:f?.image?{url:f.image.url,width:f.image.width,height:f.image.height,alt:f.title}:void 0}),u?q.jsx(vy,{children:q.jsx(Sy,{color:"error",children:e("error.load_posts")})}):q.jsx(ua,{posts:n,loading:o,hasMainPost:!t})]})},{Box:Ji,Typography:Ty,styled:Sa}=await R("decentraland-ui2"),xy=Sa(Ji)(({theme:e,imageUrl:t})=>({backgroundImage:`linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)), url("${t}")`,backgroundSize:"cover",backgroundPosition:"center",width:"100%",height:"248px",display:"flex",alignItems:"center",justifyContent:"flex-start",marginBottom:e.spacing(6),[e.breakpoints.down("sm")]:{height:"180px",justifyContent:"center"}})),Cy=Sa(Ji)(({theme:e})=>({textAlign:"left",color:e.palette.common.white,maxWidth:e.spacing(133),width:"100%",margin:"0 auto",padding:e.spacing(3),"& p":{fontSize:"18px",lineHeight:"28px",textShadow:"0 1px 2px rgba(0, 0, 0, 0.5)"},[e.breakpoints.down("sm")]:{textAlign:"center"}})),Iy=Sa(Ty)(({theme:e})=>({marginBottom:e.spacing(2),textShadow:"0 2px 4px rgba(0, 0, 0, 0.5)",[e.breakpoints.down("sm")]:{fontSize:e.typography.h4.fontSize,fontWeight:e.typography.h4.fontWeight,lineHeight:e.typography.h4.lineHeight}})),{memo:_y}=await R("react"),{Typography:Ay}=await R("decentraland-ui2"),Ry=_y(e=>{const{category:t,description:n,image:o}=e;return q.jsx(xy,{imageUrl:o,children:q.jsxs(Cy,{children:[q.jsx(Iy,{variant:"h3",children:t}),q.jsx(Ay,{variant:"body1",children:n})]})})}),{Box:Ta,styled:xa}=await R("decentraland-ui2"),Rn=xa(Ta)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)}));xa(Ta)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));xa(Ta)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(6)}));const{useParams:Oy}=await R("react-router-dom"),{useTranslation:Xi}=await R("@dcl/hooks"),{CircularProgress:ky,Typography:Zi}=await R("decentraland-ui2"),Dy=({category:e})=>{const{t}=Xi(),n=Uo(),{posts:o,isLoadingInitial:u,error:f}=qa({category:e.slug});return f?q.jsx(Rn,{children:q.jsx(Zi,{color:"error",children:t("error.load_posts")})}):q.jsx(ua,{posts:o,loading:u,hasMainPost:!n})},WP=()=>{const{t:e}=Xi(),{categorySlug:t}=Oy(),{data:n,isLoading:o,error:u}=Fh({slug:t||""}),f=ee("BLOG_BASE_URL")||"";return u?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Rn,{children:q.jsx(Zi,{color:"error",children:e("error.load_category")})})}):q.jsxs(de,{showBlogNavigation:!0,activeCategory:t,banner:n?q.jsx(Ry,{category:n.title,description:n.description,image:n.image.url}):void 0,children:[q.jsx(Dt,{title:n?.title,description:n?.description||e("blog.default_description"),url:`${f}/${t}`,image:n?.image?{url:n.image.url,width:n.image.width,height:n.image.height,alt:n.title}:void 0}),o?q.jsx(Rn,{children:q.jsx(ky,{})}):n?q.jsx(Dy,{category:n},n.id):null]})};var Ca={},jy=Tc;Object.defineProperty(Ca,"__esModule",{value:!0});var ec=Ca.default=void 0;My(Mo);var Ly=jy(Sc()),Uy=q;function tc(e){if(typeof WeakMap!="function")return null;var t=new WeakMap,n=new WeakMap;return(tc=function(o){return o?n:t})(e)}function My(e,t){if(e&&e.__esModule)return e;if(e===null||typeof e!="object"&&typeof e!="function")return{default:e};var n=tc(t);if(n&&n.has(e))return n.get(e);var o={__proto__:null},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in e)if(f!=="default"&&Object.prototype.hasOwnProperty.call(e,f)){var h=u?Object.getOwnPropertyDescriptor(e,f):null;h&&(h.get||h.set)?Object.defineProperty(o,f,h):o[f]=e[f]}return o.default=e,n&&n.set(e,o),o}ec=Ca.default=(0,Ly.default)((0,Uy.jsx)("path",{d:"M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m13 2h-2.5A3.5 3.5 0 0 0 12 8.5V11h-2v3h2v7h3v-7h3v-3h-3V9a1 1 0 0 1 1-1h2V5z"}),"Facebook");const{useDispatch:zP,useSelector:Ny}=await R("react-redux"),$y=Ny,{Box:rc,Typography:By,dclColors:Hy,styled:_r}=await R("decentraland-ui2"),Qy=_r("section")(({theme:e})=>({backgroundColor:Hy.neutral.softBlack2,paddingBottom:e.spacing(13),paddingTop:e.spacing(12),width:"100%"})),Fy=_r(rc)(({theme:e})=>({display:"flex",flexDirection:"column",gap:e.spacing(3),paddingLeft:e.spacing(2),paddingRight:e.spacing(2),width:"100%",maxWidth:e.spacing(136.875),margin:"0 auto"})),Gy=_r(By)(({theme:e})=>({...e.typography.h6,color:e.palette.text.primary})),Wy=_r(rc)(({theme:e})=>({display:"flex",flexWrap:"nowrap",justifyContent:"flex-start",gap:e.spacing(4),[e.breakpoints.down("xs")]:{justifyContent:"center",flexWrap:"wrap"}})),{memo:zy}=await R("react"),{useTranslation:Ky}=await R("@dcl/hooks"),Vy=3,Yy=zy(e=>{const{posts:t=[],loading:n=!1,maxItems:o=Vy}=e,u=t.slice(0,o),{t:f}=Ky();return n||u.length===0?null:q.jsx(Qy,{children:q.jsxs(Fy,{children:[q.jsx(Gy,{variant:"h6",children:f("blog.related_post")}),q.jsx(Wy,{children:u.map(h=>q.jsx(ar,{post:h},h.id))})]})})});var tn={exports:{}};/*!
|
|
8
8
|
* $script.js JS loader & dependency manager
|
|
9
9
|
* https://github.com/ded/script.js
|
|
10
10
|
* (c) Dustin Diaz 2014 | License MIT
|
|
11
|
-
*/var xo;function Vy(){return xo||(xo=1,function(e){(function(t,n){e.exports?e.exports=n():this[t]=n()})("$script",function(){var t=document,n=t.getElementsByTagName("head")[0],o=!1,u="push",f="readyState",h="onreadystatechange",a={},r={},s={},i,c;function l(y,P){for(var w=0,v=y.length;w<v;++w)if(!P(y[w]))return o;return 1}function d(y,P){l(y,function(w){return P(w),1})}function p(y,P,w){y=y[u]?y:[y];var v=P&&P.call,m=v?P:w,b=v?y.join(""):P,x=y.length;function _(T){return T.call?T():a[T]}function A(){if(!--x){a[b]=1,m&&m();for(var T in r)l(T.split("|"),_)&&!d(r[T],_)&&(r[T]=[])}}return setTimeout(function(){d(y,function T(E,S){if(E===null)return A();if(!S&&!/^https?:\/\//.test(E)&&i&&(E=E.indexOf(".js")===-1?i+E+".js":i+E),s[E])return s[E]==2?A():setTimeout(function(){T(E,!0)},0);s[E]=1,g(E,A)})},0),p}function g(y,P){var w=t.createElement("script"),v;w.onload=w.onerror=w[h]=function(){w[f]&&!/^c|loade/.test(w[f])||v||(w.onload=w[h]=null,v=1,s[y]=2,P())},w.async=1,w.src=c?y+(y.indexOf("?")===-1?"?":"&")+c:y,n.insertBefore(w,n.lastChild)}return p.get=g,p.order=function(y,P,w){(function v(m){m=y.shift(),y.length?p(m,v):p(m,P,w)})()},p.path=function(y){i=y},p.urlArgs=function(y){c=y},p.ready=function(y,P,w){y=y[u]?y:[y];var v=[];return!d(y,function(m){a[m]||v[u](m)})&&l(y,function(m){return a[m]})?P():function(m){r[m]=r[m]||[],r[m][u](P),w&&w(v)}(y.join("|")),p},p.done=function(y){p([null],y)},p})}(tn)),tn.exports}const $e=await R("react");var Yy="https://platform.twitter.com/widgets.js",rn="createTweet",Jy=function(t){var n=$e.useRef(null),o=$e.useState(!0),u=o[0],f=o[1];return $e.useEffect(function(){var h=!0,a=Vy();return a(Yy,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(h){if(!window.twttr.widgets[rn]){console.error("Method "+rn+" is not present anymore in twttr.widget api");return}window.twttr.widgets[rn](t.tweetId,n?.current,t.options).then(function(r){f(!1),t.onLoad&&t.onLoad(r)})}}),function(){h=!1}},[]),$e.createElement($e.Fragment,null,u&&$e.createElement($e.Fragment,null,t.placeholder),$e.createElement("div",{ref:n}))};const{Link:Xy}=await R("react-router-dom"),{styled:te}=await R("decentraland-ui2"),Zy=te("p")(({theme:e})=>({...e.typography.body1,lineHeight:2,letterSpacing:"-0.2px",marginTop:e.spacing(2.5),marginBottom:0})),ew=te("h1")(({theme:e})=>({...e.typography.h1,fontSize:e.typography.pxToRem(40),fontWeight:700,lineHeight:1.17,marginTop:0,paddingTop:e.spacing(1.375),marginBottom:0})),tw=te("h2")(({theme:e})=>({...e.typography.h2,fontSize:e.typography.pxToRem(32),fontWeight:700,lineHeight:1.17,marginTop:0,paddingTop:e.spacing(1.375),marginBottom:0})),rw=te("h3")(({theme:e})=>({...e.typography.h3,fontSize:e.typography.pxToRem(28),fontWeight:500,lineHeight:1.21,marginTop:e.spacing(8),marginBottom:0})),nw=te("h4")(({theme:e})=>({...e.typography.h4,fontSize:e.typography.pxToRem(24),lineHeight:1.2,letterSpacing:"0.3px",marginTop:e.spacing(4),marginBottom:0})),nc=te("h5")(({theme:e})=>({...e.typography.h5,fontSize:e.typography.pxToRem(20),lineHeight:1.2,letterSpacing:"0.3px",marginTop:e.spacing(2),marginBottom:0})),aw=te(nc)(({theme:e})=>({fontSize:e.typography.pxToRem(18)})),sw=te("blockquote")(({theme:e})=>({borderLeft:"4px solid",borderColor:e.palette.primary.main,paddingLeft:e.spacing(2),marginTop:e.spacing(2),marginBottom:e.spacing(2),fontStyle:"italic"})),Co=te("img")(({theme:e})=>({maxWidth:"100%",marginTop:e.spacing(2),marginBottom:e.spacing(2)})),Io=te("a")(({theme:e})=>({color:e.palette.primary.main,textDecoration:"none","&:hover":{color:e.palette.primary.dark}})),ow=te(Xy)(({theme:e})=>({color:e.palette.primary.main,textDecoration:"none","&:hover":{color:e.palette.primary.dark}})),iw=te("iframe")(({theme:e})=>({height:760,width:560,border:`thin solid ${e.palette.divider}`,padding:e.spacing(.625),marginTop:e.spacing(2),marginBottom:e.spacing(2)})),cw=te("div")(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),uw=te("iframe")(({theme:e})=>({width:560,height:315,border:0,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),lw=te("iframe")(({theme:e})=>({width:400,height:480,border:0,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),dw=te("li")(()=>({})),hw=te("ol")(({theme:e})=>({marginBottom:e.spacing(2)})),fw=te("ul")(({theme:e})=>({marginBottom:e.spacing(2)})),pw=e=>{const t=new URL(e),n=t.searchParams.has("v")?t.searchParams.get("v"):t.pathname.split("/").pop();return q.jsx(uw,{src:`https://www.youtube.com/embed/${n}`,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})},gw=e=>{const t=e.split("/"),n=t[t.length-1].split("?")[0];return q.jsx(cw,{children:q.jsx(Jy,{tweetId:n,options:{theme:"dark"}})})},mw=e=>{let t;try{t=new URL(e)}catch{return null}const o=`https://www.instagram.com${t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`}embed/`,u=e.includes("/reel/")?"Instagram Reel":"Instagram Post";return q.jsx(lw,{src:o,title:u,scrolling:"no",allowFullScreen:!0})},yw=(e,t)=>{const n=e.data?.target?.sys?.id;if(n&&t[n])return q.jsx(Co,{src:t[n].url,alt:""});const o=e.data?.target?.fields?.file?.url;return o?q.jsx(Co,{src:o.startsWith("//")?`https:${o}`:o,alt:""}):null},ww=e=>{const t=e.data.uri,o=e.content[0]?.value;if((t.includes("youtube.com")||t.includes("youtu.be"))&&o===t)return pw(t);if((t.includes("twitter.com")||t.includes("x.com"))&&o===t)return gw(t);if(t.includes("instagram.com")&&o===t)try{if(new URL(t).hostname.endsWith("instagram.com"))return mw(t)}catch{}if(t.includes("linkedin.com")&&o===t)return q.jsx(iw,{src:t,title:"Embedded Linkedin Post"});const u=ee("BLOG_BASE_URL")||"",f=t.startsWith(u),h=t.startsWith("#");if(f){const a=new URL(t,window.location.origin).pathname;return q.jsx(ow,{to:a,children:o})}return h?q.jsx(Io,{href:t,target:"_self",children:o}):q.jsx(Io,{href:t,target:"_blank",rel:"noopener noreferrer",children:o})},{useMemo:Pw}=await R("react"),qw=e=>({renderNode:{[se.BLOCKS.PARAGRAPH]:(t,n)=>q.jsx(Zy,{children:n}),[se.BLOCKS.HEADING_1]:(t,n)=>q.jsx(ew,{children:n}),[se.BLOCKS.HEADING_2]:(t,n)=>q.jsx(tw,{children:n}),[se.BLOCKS.HEADING_3]:(t,n)=>q.jsx(rw,{children:n}),[se.BLOCKS.HEADING_4]:(t,n)=>q.jsx(nw,{children:n}),[se.BLOCKS.HEADING_5]:(t,n)=>q.jsx(nc,{children:n}),[se.BLOCKS.HEADING_6]:(t,n)=>q.jsx(aw,{children:n}),[se.BLOCKS.UL_LIST]:(t,n)=>q.jsx(fw,{children:n}),[se.BLOCKS.OL_LIST]:(t,n)=>q.jsx(hw,{children:n}),[se.BLOCKS.LIST_ITEM]:(t,n)=>q.jsx(dw,{children:n}),[se.BLOCKS.QUOTE]:(t,n)=>q.jsx(sw,{children:n}),[se.BLOCKS.EMBEDDED_ASSET]:t=>yw(t,e),[se.INLINES.HYPERLINK]:t=>ww(t)}}),ac=({document:e,assets:t={}})=>{if(!e||!e.content)return null;const n=Pw(()=>qw(t),[t]);return q.jsx(q.Fragment,{children:Cc(e,n)})},{Link:sc}=await R("react-router-dom"),{Box:He,Typography:jt,styled:X}=await R("decentraland-ui2"),Tt=X(He)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)})),oc=X(He)(({theme:e})=>({maxWidth:e.spacing(96),width:"100%",margin:"0 auto",padding:0,[e.breakpoints.down("xs")]:{padding:`${e.spacing(4)} ${e.spacing(2)}`}})),ic=X(He)(({theme:e})=>({marginBottom:e.spacing(5)})),cc=X(jt)(({theme:e})=>({...e.typography.caption,color:e.palette.text.primary,letterSpacing:e.typography.caption.letterSpacing,textTransform:"uppercase",display:"flex",alignItems:"center",gap:e.spacing(1)})),uc=X("span")(({theme:e})=>({color:e.palette.text.secondary})),vw=X(sc)(({theme:e})=>({color:"#5c5c6e",textDecoration:"none",WebkitTapHighlightColor:"transparent","&:hover":{textDecoration:"underline"},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),lc=X(He)(({theme:e})=>({marginTop:e.spacing(1.5)})),dc=X(jt)(({theme:e})=>({color:e.palette.text.primary})),hc=X(jt)(({theme:e})=>({color:e.palette.text.primary,marginTop:e.spacing(1)})),fc=X("img")(({theme:e})=>({width:"100%",height:"auto",borderRadius:e.spacing(2),marginBottom:e.spacing(5),objectFit:"cover",backgroundColor:e.palette.background.paper})),pc=X(He)(()=>({})),bw=X(He)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(5)})),Ew=X(sc)(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(2),textDecoration:"none",color:e.palette.text.primary,WebkitTapHighlightColor:"transparent","&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),gc=X("img")(({theme:e})=>({width:e.spacing(4),height:e.spacing(4),borderRadius:"50%",objectFit:"cover",backgroundColor:e.palette.background.default})),mc=X(jt)(({theme:e})=>({...e.typography.body1,color:e.palette.text.primary})),yc=X(He)(()=>({})),Sw=X(He)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1.5)})),Tw=X(jt)(({theme:e})=>({...e.typography.caption,color:e.palette.text.secondary,textTransform:"uppercase"})),_o=X("a")(({theme:e})=>({display:"inline-flex",alignItems:"center",color:e.palette.text.secondary,textDecoration:"none","&:hover":{color:e.palette.text.primary},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),{useMemo:nn}=await R("react"),{useParams:xw}=await R("react-router-dom"),{useTranslation:Cw}=await R("@dcl/hooks"),{CircularProgress:Iw,Typography:_w}=await R("decentraland-ui2"),wc=3,Aw=10,Rw=wc*Aw,WP=()=>{const{t:e}=Cw(),{categorySlug:t,postSlug:n}=xw(),o=My(g=>{for(const y of Object.values(g.cmsClient.queries))if(y?.endpointName==="getBlogPosts"&&y.status==="fulfilled"&&y.data){const w=y.data.posts.find(v=>v.category.slug===t&&v.slug===n);if(w)return w}return null}),{data:u,isLoading:f,error:h}=Gh({categorySlug:t||"",postSlug:n||""},{skip:!!o}),a=nn(()=>o||u,[o,u]),{data:r,isLoading:s}=fi({category:a?.category.id,limit:Rw,skip:0},{skip:!a?.category.id}),i=nn(()=>!r?.posts||!a?[]:r.posts.filter(g=>g.id!==a.id),[a,r?.posts]),c=nn(()=>aa(a?.publishedDate),[a?.publishedDate]),l=a?.author,d=!!l&&!!l.title,p=ee("BLOG_BASE_URL")||"";return f&&!o?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Tt,{children:q.jsx(Iw,{})})}):h||!a?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Tt,{children:q.jsx(_w,{color:"error",children:e("error.load_post")})})}):q.jsxs(de,{showBlogNavigation:!0,activeCategory:t,relatedPosts:q.jsx(Ky,{posts:i,loading:s,maxItems:wc}),children:[q.jsx(Dt,{title:a?.title,description:a?.description||e("blog.default_description"),url:a?`${p}/${t}/${n}`:p,type:Le.ARTICLE,image:a?.image?{url:a.image.url,width:a.image.width,height:a.image.height,alt:a.title}:void 0,author:l?.title,publishedTime:a?.publishedDate,section:a?.category.title,tags:a?.category.title?[a.category.title]:void 0}),q.jsxs(oc,{children:[q.jsx(fc,{src:a.image.url,alt:a.title}),q.jsxs(ic,{children:[q.jsxs(cc,{as:"span",children:[c,q.jsx(uc,{children:"•"}),q.jsx(vw,{to:Me.category(a.category.slug),children:a.category.title})]}),q.jsx(lc,{children:q.jsx(dc,{variant:"h4",children:a.title})}),q.jsx(hc,{variant:"h6",children:a.description})]}),d&&q.jsxs(bw,{children:[q.jsx(pc,{children:q.jsxs(Ew,{to:l.url,children:[l.image?.url&&q.jsx(gc,{src:l.image.url,alt:l.title}),q.jsx(mc,{variant:"body2",children:l.title})]})}),q.jsxs(Sw,{children:[q.jsx(Tw,{children:e("blog.share")}),q.jsx(_o,{href:Me.twitter(a),target:"_blank",rel:"noopener noreferrer",children:q.jsx(xc,{fontSize:"small"})}),q.jsx(_o,{href:Me.facebook(a),target:"_blank",rel:"noopener noreferrer",children:q.jsx(ec,{fontSize:"small"})})]})]}),q.jsx(yc,{children:q.jsx(ac,{document:a.body,assets:a.bodyAssets})})]})]})},{Box:Pc,styled:Ia}=await R("decentraland-ui2"),Ow=Ia(Pc)(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(2)})),kw=Ia("span")(()=>({color:"#5c5c6e"})),Dw=Ia(Pc)(({theme:e})=>({backgroundColor:e.palette.warning.main,color:e.palette.warning.contrastText,padding:e.spacing(2),borderRadius:e.spacing(1),maxWidth:e.spacing(96),margin:`0 auto ${e.spacing(4)}`,[e.breakpoints.down("xs")]:{margin:`0 ${e.spacing(2)} ${e.spacing(4)}`}})),{useMemo:Ao}=await R("react"),{useSearchParams:jw}=await R("react-router-dom"),{useTranslation:Lw}=await R("@dcl/hooks"),{CircularProgress:Uw,Typography:Yt}=await R("decentraland-ui2"),Mw="https://preview.contentful.com",Nw="ea2ybdmmn1kv",zP=()=>{const{t:e}=Lw(),[t]=jw(),n=Ao(()=>({id:t.get("contentful_id")??"",env:t.get("contentful_env")??"",token:t.get("token")??"",previewBaseUrl:Mw,spaceId:Nw}),[t]),o=n.id&&n.env&&n.token,{data:u,isLoading:f,error:h}=zh(n,{skip:!o}),a=Ao(()=>aa(u?.publishedDate),[u?.publishedDate]),r=u?.author,s=!!r&&!!r.title;return o?f?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Uw,{})})}):h||!u?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Yt,{color:"error",children:e("error.load_preview")})})}):q.jsxs(de,{showBlogNavigation:!0,children:[q.jsxs(Dw,{children:[q.jsx(Yt,{variant:"h6",children:e("preview.mode")}),q.jsx(Yt,{variant:"body2",children:e("preview.description")})]}),q.jsxs(oc,{children:[q.jsx(fc,{src:u.image.url,alt:u.title}),q.jsxs(ic,{children:[q.jsxs(cc,{as:"span",children:[a,q.jsx(uc,{children:"•"}),q.jsx(kw,{children:u.category.title})]}),q.jsx(lc,{children:q.jsx(dc,{variant:"h4",children:u.title})}),q.jsx(hc,{variant:"h6",children:u.description})]}),s&&q.jsx(pc,{children:q.jsxs(Ow,{children:[r.image?.url&&q.jsx(gc,{src:r.image.url,alt:r.title}),q.jsx(mc,{variant:"body2",children:r.title})]})}),q.jsx(yc,{children:q.jsx(ac,{document:u.body,assets:u.bodyAssets})})]})]}):q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Yt,{color:"error",children:e("preview.missing_params")})})})},{Box:_a,Skeleton:Ar,Typography:qc,styled:Re}=await R("decentraland-ui2"),Ro=Re(_a)(({theme:e})=>({margin:e.spacing(0,0,2),listStyleType:"none",flexGrow:1,borderRadius:e.spacing(1),backgroundColor:e.palette.background.paper,border:"transparent",position:"relative",display:"flex",alignItems:"flex-start",transition:"transform 250ms ease, box-shadow 250ms ease",boxShadow:e.shadows[1],height:"150px","& > a":{display:"flex",width:"100%",height:"100%",textDecoration:"none"},"&:hover":{transform:"translate(0, -4px)",boxShadow:e.shadows[2]},[e.breakpoints.down("sm")]:{height:"100px"}})),Oo=Re(_a)(()=>({display:"flex",width:"100%",height:"100%"})),$w=Re("img")(({theme:e})=>({flexShrink:0,width:"232px",height:"100%",objectFit:"cover",borderRadius:`${e.shape.borderRadius}px 0 0 ${e.shape.borderRadius}px`,[e.breakpoints.down("sm")]:{width:"33%"}})),ko=Re(_a)(({theme:e})=>({padding:e.spacing(2.75,2.5,3,2.5),width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"hidden","& em":{fontStyle:"normal",fontWeight:700,color:e.palette.primary.main},[e.breakpoints.down("sm")]:{padding:e.spacing(1.75)}})),Bw=Re(qc)(({theme:e})=>({margin:`0 0 ${e.spacing(.5)}`,fontSize:e.typography.pxToRem(20),lineHeight:"28px",fontWeight:500,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",[e.breakpoints.down("sm")]:{fontSize:e.typography.pxToRem(15),lineHeight:"18px"}})),Hw=Re(qc)(({theme:e})=>({lineHeight:"24px",padding:0,margin:0,fontSize:e.typography.pxToRem(15),color:e.palette.text.secondary,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",[e.breakpoints.down("sm")]:{display:"none"}})),Qw=Re(Ar)(({theme:e})=>({width:"232px",height:"100%",borderRadius:`${e.shape.borderRadius}px 0 0 ${e.shape.borderRadius}px`,flexShrink:0,[e.breakpoints.down("sm")]:{width:"33%"}})),Fw=Re(Ar)(({theme:e})=>({width:"80%",height:e.spacing(3.5),marginBottom:e.spacing(1)})),Gw=Re(Ar)(({theme:e})=>({width:"100%",height:e.spacing(3),[e.breakpoints.down("sm")]:{display:"none"}})),Ww=Re(Ar)(({theme:e})=>({width:"60%",height:e.spacing(3),[e.breakpoints.down("sm")]:{display:"none"}})),{Link:zw}=await R("react-router-dom"),an=e=>{const{result:t,loading:n}=e;return n?q.jsx(Ro,{children:q.jsxs(Oo,{children:[q.jsx(Qw,{variant:"rectangular"}),q.jsxs(ko,{children:[q.jsx(Fw,{variant:"text"}),q.jsx(Gw,{variant:"text"}),q.jsx(Ww,{variant:"text"})]})]})}):t?q.jsx(Ro,{children:q.jsx(zw,{to:t.url,children:q.jsxs(Oo,{children:[t.image&&q.jsx($w,{src:t.image,alt:""}),q.jsxs(ko,{children:[q.jsx(Bw,{dangerouslySetInnerHTML:{__html:t.title}}),q.jsx(Hw,{dangerouslySetInnerHTML:{__html:t.description}})]})]})})}):null},{Box:Rr,Typography:Kw,styled:Lt}=await R("decentraland-ui2"),Vw=Lt(Kw)(({theme:e})=>({margin:e.spacing(4.5,0,3),...e.typography.h4,fontWeight:400,padding:e.spacing(0,2),"& span":{fontWeight:700}})),Yw=Lt(Rr)(({theme:e})=>({marginBottom:e.spacing(3)})),Jw=Lt(Rr)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(4),paddingBottom:e.spacing(4)})),sn=Lt(Rr)(()=>({display:"flex",flexDirection:"column"})),Xw=Lt(Rr)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(4)})),{useEffect:Do,useMemo:Zw,useState:jo}=await R("react"),{useSearchParams:eP}=await R("react-router-dom"),{useTranslation:tP}=await R("@dcl/hooks"),{Button:rP,Typography:Lo}=await R("decentraland-ui2"),nP=10,KP=()=>{const{t:e}=tP(),[t]=eP(),[n,o]=jo(0),[u,f]=jo([]),h=Zw(()=>t.get("q")||"",[t]),{data:a,isLoading:r,isFetching:s}=Cg({query:h,hitsPerPage:nP,page:n},{skip:h.length<3});Do(()=>{o(0),f([])},[h]),Do(()=>{a?.results&&f(n===0?a.results:P=>[...P,...a.results])},[a,n]);const i=()=>{o(P=>P+1),setTimeout(()=>window.scrollBy({top:500,left:0,behavior:"smooth"}),0)},c=u.length>0,l=!r&&h.length>=3&&u.length===0&&a?.results.length===0,d=r&&u.length===0,p=a?.hasMore??!1,g=h?e("search.description_with_query",{query:h}):e("search.description"),y=ee("BLOG_BASE_URL")||"";return q.jsxs(de,{showBlogNavigation:!0,children:[q.jsx(Dt,{title:h?e("search.title_with_query",{query:h}):e("search.title"),description:g,url:h?`${y}/search?q=${encodeURIComponent(h)}`:`${y}/search`}),h.length>=3&&q.jsx(Yw,{children:q.jsxs(Vw,{children:[e("search.results_for")," ",q.jsxs("span",{children:["“",h,"”"]})]})}),d&&q.jsx(sn,{children:Array.from({length:5},(P,w)=>q.jsx(an,{loading:!0},w))}),c&&q.jsx(sn,{children:u.map((P,w)=>q.jsx(an,{result:P},`${P.url}-${w}`))}),s&&!r&&q.jsx(sn,{children:Array.from({length:3},(P,w)=>q.jsx(an,{loading:!0},`loading-more-${w}`))}),p&&c&&!s&&q.jsx(Xw,{children:q.jsx(rP,{variant:"contained",onClick:i,children:e("blog.load_more")})}),l&&q.jsxs(Jw,{children:[q.jsx(Lo,{variant:"h5",gutterBottom:!0,children:e("blog.nothing_to_show")}),q.jsxs(Lo,{color:"textSecondary",children:[e("search.no_results_for")," “",h,"”"]})]})]})},{useEffect:aP}=await R("react");function VP(){return aP(()=>{Si()},[]),null}export{HP as A,QP as B,FP as C,Cu as P,om as S,EP as W,Et as a,Hh as b,SP as c,zP as d,NP as e,KP as f,VP as g,WP as h,UP as i,ee as j,_u as k,Ru as l,Iu as m,LP as p,gP as s,MP as w};
|
|
11
|
+
*/var xo;function Jy(){return xo||(xo=1,function(e){(function(t,n){e.exports?e.exports=n():this[t]=n()})("$script",function(){var t=document,n=t.getElementsByTagName("head")[0],o=!1,u="push",f="readyState",h="onreadystatechange",a={},r={},s={},i,c;function l(y,P){for(var w=0,v=y.length;w<v;++w)if(!P(y[w]))return o;return 1}function d(y,P){l(y,function(w){return P(w),1})}function p(y,P,w){y=y[u]?y:[y];var v=P&&P.call,m=v?P:w,b=v?y.join(""):P,x=y.length;function _(T){return T.call?T():a[T]}function A(){if(!--x){a[b]=1,m&&m();for(var T in r)l(T.split("|"),_)&&!d(r[T],_)&&(r[T]=[])}}return setTimeout(function(){d(y,function T(E,S){if(E===null)return A();if(!S&&!/^https?:\/\//.test(E)&&i&&(E=E.indexOf(".js")===-1?i+E+".js":i+E),s[E])return s[E]==2?A():setTimeout(function(){T(E,!0)},0);s[E]=1,g(E,A)})},0),p}function g(y,P){var w=t.createElement("script"),v;w.onload=w.onerror=w[h]=function(){w[f]&&!/^c|loade/.test(w[f])||v||(w.onload=w[h]=null,v=1,s[y]=2,P())},w.async=1,w.src=c?y+(y.indexOf("?")===-1?"?":"&")+c:y,n.insertBefore(w,n.lastChild)}return p.get=g,p.order=function(y,P,w){(function v(m){m=y.shift(),y.length?p(m,v):p(m,P,w)})()},p.path=function(y){i=y},p.urlArgs=function(y){c=y},p.ready=function(y,P,w){y=y[u]?y:[y];var v=[];return!d(y,function(m){a[m]||v[u](m)})&&l(y,function(m){return a[m]})?P():function(m){r[m]=r[m]||[],r[m][u](P),w&&w(v)}(y.join("|")),p},p.done=function(y){p([null],y)},p})}(tn)),tn.exports}const $e=await R("react");var Xy="https://platform.twitter.com/widgets.js",rn="createTweet",Zy=function(t){var n=$e.useRef(null),o=$e.useState(!0),u=o[0],f=o[1];return $e.useEffect(function(){var h=!0,a=Jy();return a(Xy,"twitter-embed",function(){if(!window.twttr){console.error("Failure to load window.twttr, aborting load");return}if(h){if(!window.twttr.widgets[rn]){console.error("Method "+rn+" is not present anymore in twttr.widget api");return}window.twttr.widgets[rn](t.tweetId,n?.current,t.options).then(function(r){f(!1),t.onLoad&&t.onLoad(r)})}}),function(){h=!1}},[]),$e.createElement($e.Fragment,null,u&&$e.createElement($e.Fragment,null,t.placeholder),$e.createElement("div",{ref:n}))};const{Link:ew}=await R("react-router-dom"),{styled:te}=await R("decentraland-ui2"),tw=te("p")(({theme:e})=>({...e.typography.body1,lineHeight:2,letterSpacing:"-0.2px",marginTop:e.spacing(2.5),marginBottom:0})),rw=te("h1")(({theme:e})=>({...e.typography.h1,fontSize:e.typography.pxToRem(40),fontWeight:700,lineHeight:1.17,marginTop:0,paddingTop:e.spacing(1.375),marginBottom:0})),nw=te("h2")(({theme:e})=>({...e.typography.h2,fontSize:e.typography.pxToRem(32),fontWeight:700,lineHeight:1.17,marginTop:0,paddingTop:e.spacing(1.375),marginBottom:0})),aw=te("h3")(({theme:e})=>({...e.typography.h3,fontSize:e.typography.pxToRem(28),fontWeight:500,lineHeight:1.21,marginTop:e.spacing(8),marginBottom:0})),sw=te("h4")(({theme:e})=>({...e.typography.h4,fontSize:e.typography.pxToRem(24),lineHeight:1.2,letterSpacing:"0.3px",marginTop:e.spacing(4),marginBottom:0})),nc=te("h5")(({theme:e})=>({...e.typography.h5,fontSize:e.typography.pxToRem(20),lineHeight:1.2,letterSpacing:"0.3px",marginTop:e.spacing(2),marginBottom:0})),ow=te(nc)(({theme:e})=>({fontSize:e.typography.pxToRem(18)})),iw=te("blockquote")(({theme:e})=>({borderLeft:"4px solid",borderColor:e.palette.primary.main,paddingLeft:e.spacing(2),marginTop:e.spacing(2),marginBottom:e.spacing(2),fontStyle:"italic"})),Co=te("img")(({theme:e})=>({maxWidth:"100%",marginTop:e.spacing(2),marginBottom:e.spacing(2)})),Io=te("a")(({theme:e})=>({color:e.palette.primary.main,textDecoration:"none","&:hover":{color:e.palette.primary.dark}})),cw=te(ew)(({theme:e})=>({color:e.palette.primary.main,textDecoration:"none","&:hover":{color:e.palette.primary.dark}})),uw=te("iframe")(({theme:e})=>({height:760,width:560,border:`thin solid ${e.palette.divider}`,padding:e.spacing(.625),marginTop:e.spacing(2),marginBottom:e.spacing(2)})),lw=te("div")(({theme:e})=>({marginTop:e.spacing(2),marginBottom:e.spacing(2)})),dw=te("iframe")(({theme:e})=>({width:560,height:315,border:0,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),hw=te("iframe")(({theme:e})=>({width:400,height:480,border:0,marginTop:e.spacing(2),marginBottom:e.spacing(2)})),fw=te("li")(()=>({})),pw=te("ol")(({theme:e})=>({marginBottom:e.spacing(2)})),gw=te("ul")(({theme:e})=>({marginBottom:e.spacing(2)})),mw=e=>{const t=new URL(e),n=t.searchParams.has("v")?t.searchParams.get("v"):t.pathname.split("/").pop();return q.jsx(dw,{src:`https://www.youtube.com/embed/${n}`,title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})},yw=e=>{const t=e.split("/"),n=t[t.length-1].split("?")[0];return q.jsx(lw,{children:q.jsx(Zy,{tweetId:n,options:{theme:"dark"}})})},ww=e=>{let t;try{t=new URL(e)}catch{return null}const o=`https://www.instagram.com${t.pathname.endsWith("/")?t.pathname:`${t.pathname}/`}embed/`,u=e.includes("/reel/")?"Instagram Reel":"Instagram Post";return q.jsx(hw,{src:o,title:u,scrolling:"no",allowFullScreen:!0})},Pw=(e,t)=>{const n=e.data?.target?.sys?.id;if(n&&t[n])return q.jsx(Co,{src:t[n].url,alt:""});const o=e.data?.target?.fields?.file?.url;return o?q.jsx(Co,{src:o.startsWith("//")?`https:${o}`:o,alt:""}):null},qw=e=>{const t=e.data.uri,o=e.content[0]?.value;if((t.includes("youtube.com")||t.includes("youtu.be"))&&o===t)return mw(t);if((t.includes("twitter.com")||t.includes("x.com"))&&o===t)return yw(t);if(t.includes("instagram.com")&&o===t)try{if(new URL(t).hostname.endsWith("instagram.com"))return ww(t)}catch{}if(t.includes("linkedin.com")&&o===t)return q.jsx(uw,{src:t,title:"Embedded Linkedin Post"});const u=ee("BLOG_BASE_URL")||"",f=t.startsWith(u),h=t.startsWith("#");if(f){const a=new URL(t,window.location.origin).pathname;return q.jsx(cw,{to:a,children:o})}return h?q.jsx(Io,{href:t,target:"_self",children:o}):q.jsx(Io,{href:t,target:"_blank",rel:"noopener noreferrer",children:o})},{useMemo:vw}=await R("react"),bw=e=>({renderNode:{[se.BLOCKS.PARAGRAPH]:(t,n)=>q.jsx(tw,{children:n}),[se.BLOCKS.HEADING_1]:(t,n)=>q.jsx(rw,{children:n}),[se.BLOCKS.HEADING_2]:(t,n)=>q.jsx(nw,{children:n}),[se.BLOCKS.HEADING_3]:(t,n)=>q.jsx(aw,{children:n}),[se.BLOCKS.HEADING_4]:(t,n)=>q.jsx(sw,{children:n}),[se.BLOCKS.HEADING_5]:(t,n)=>q.jsx(nc,{children:n}),[se.BLOCKS.HEADING_6]:(t,n)=>q.jsx(ow,{children:n}),[se.BLOCKS.UL_LIST]:(t,n)=>q.jsx(gw,{children:n}),[se.BLOCKS.OL_LIST]:(t,n)=>q.jsx(pw,{children:n}),[se.BLOCKS.LIST_ITEM]:(t,n)=>q.jsx(fw,{children:n}),[se.BLOCKS.QUOTE]:(t,n)=>q.jsx(iw,{children:n}),[se.BLOCKS.EMBEDDED_ASSET]:t=>Pw(t,e),[se.INLINES.HYPERLINK]:t=>qw(t)}}),ac=({document:e,assets:t={}})=>{if(!e||!e.content)return null;const n=vw(()=>bw(t),[t]);return q.jsx(q.Fragment,{children:Cc(e,n)})},{Link:sc}=await R("react-router-dom"),{Box:He,Typography:jt,styled:X}=await R("decentraland-ui2"),Tt=X(He)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)})),oc=X(He)(({theme:e})=>({maxWidth:e.spacing(96),width:"100%",margin:"0 auto",padding:0,[e.breakpoints.down("xs")]:{padding:`${e.spacing(4)} ${e.spacing(2)}`}})),ic=X(He)(({theme:e})=>({marginBottom:e.spacing(5)})),cc=X(jt)(({theme:e})=>({...e.typography.caption,color:e.palette.text.primary,letterSpacing:e.typography.caption.letterSpacing,textTransform:"uppercase",display:"flex",alignItems:"center",gap:e.spacing(1)})),uc=X("span")(({theme:e})=>({color:e.palette.text.secondary})),Ew=X(sc)(({theme:e})=>({color:"#5c5c6e",textDecoration:"none",WebkitTapHighlightColor:"transparent","&:hover":{textDecoration:"underline"},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),lc=X(He)(({theme:e})=>({marginTop:e.spacing(1.5)})),dc=X(jt)(({theme:e})=>({color:e.palette.text.primary})),hc=X(jt)(({theme:e})=>({color:e.palette.text.primary,marginTop:e.spacing(1)})),fc=X("img")(({theme:e})=>({width:"100%",height:"auto",borderRadius:e.spacing(2),marginBottom:e.spacing(5),objectFit:"cover",backgroundColor:e.palette.background.paper})),pc=X(He)(()=>({})),Sw=X(He)(({theme:e})=>({display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:e.spacing(5)})),Tw=X(sc)(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(2),textDecoration:"none",color:e.palette.text.primary,WebkitTapHighlightColor:"transparent","&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),gc=X("img")(({theme:e})=>({width:e.spacing(4),height:e.spacing(4),borderRadius:"50%",objectFit:"cover",backgroundColor:e.palette.background.default})),mc=X(jt)(({theme:e})=>({...e.typography.body1,color:e.palette.text.primary})),yc=X(He)(()=>({})),xw=X(He)(({theme:e})=>({display:"flex",alignItems:"center",gap:e.spacing(1.5)})),Cw=X(jt)(({theme:e})=>({...e.typography.caption,color:e.palette.text.secondary,textTransform:"uppercase"})),_o=X("a")(({theme:e})=>({display:"inline-flex",alignItems:"center",color:e.palette.text.secondary,textDecoration:"none","&:hover":{color:e.palette.text.primary},"&:focus-visible":{outline:`2px solid ${e.palette.primary.main}`,outlineOffset:2}})),{useMemo:nn}=await R("react"),{useParams:Iw}=await R("react-router-dom"),{useTranslation:_w}=await R("@dcl/hooks"),{CircularProgress:Aw,Typography:Rw}=await R("decentraland-ui2"),wc=3,Ow=10,kw=wc*Ow,KP=()=>{const{t:e}=_w(),{categorySlug:t,postSlug:n}=Iw(),o=$y(g=>{for(const y of Object.values(g.cmsClient.queries))if(y?.endpointName==="getBlogPosts"&&y.status==="fulfilled"&&y.data){const w=y.data.posts.find(v=>v.category.slug===t&&v.slug===n);if(w)return w}return null}),{data:u,isLoading:f,error:h}=Gh({categorySlug:t||"",postSlug:n||""},{skip:!!o}),a=nn(()=>o||u,[o,u]),{data:r,isLoading:s}=fi({category:a?.category.id,limit:kw,skip:0},{skip:!a?.category.id}),i=nn(()=>!r?.posts||!a?[]:r.posts.filter(g=>g.id!==a.id),[a,r?.posts]),c=nn(()=>aa(a?.publishedDate),[a?.publishedDate]),l=a?.author,d=!!l&&!!l.title,p=ee("BLOG_BASE_URL")||"";return f&&!o?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Tt,{children:q.jsx(Aw,{})})}):h||!a?q.jsx(de,{showBlogNavigation:!0,activeCategory:t,children:q.jsx(Tt,{children:q.jsx(Rw,{color:"error",children:e("error.load_post")})})}):q.jsxs(de,{showBlogNavigation:!0,activeCategory:t,relatedPosts:q.jsx(Yy,{posts:i,loading:s,maxItems:wc}),children:[q.jsx(Dt,{title:a?.title,description:a?.description||e("blog.default_description"),url:a?`${p}/${t}/${n}`:p,type:Le.ARTICLE,image:a?.image?{url:a.image.url,width:a.image.width,height:a.image.height,alt:a.title}:void 0,author:l?.title,publishedTime:a?.publishedDate,section:a?.category.title,tags:a?.category.title?[a.category.title]:void 0}),q.jsxs(oc,{children:[q.jsx(fc,{src:a.image.url,alt:a.title}),q.jsxs(ic,{children:[q.jsxs(cc,{as:"span",children:[c,q.jsx(uc,{children:"•"}),q.jsx(Ew,{to:Me.category(a.category.slug),children:a.category.title})]}),q.jsx(lc,{children:q.jsx(dc,{variant:"h4",children:a.title})}),q.jsx(hc,{variant:"h6",children:a.description})]}),d&&q.jsxs(Sw,{children:[q.jsx(pc,{children:q.jsxs(Tw,{to:l.url,children:[l.image?.url&&q.jsx(gc,{src:l.image.url,alt:l.title}),q.jsx(mc,{variant:"body2",children:l.title})]})}),q.jsxs(xw,{children:[q.jsx(Cw,{children:e("blog.share")}),q.jsx(_o,{href:Me.twitter(a),target:"_blank",rel:"noopener noreferrer",children:q.jsx(xc,{fontSize:"small"})}),q.jsx(_o,{href:Me.facebook(a),target:"_blank",rel:"noopener noreferrer",children:q.jsx(ec,{fontSize:"small"})})]})]}),q.jsx(yc,{children:q.jsx(ac,{document:a.body,assets:a.bodyAssets})})]})]})},{Box:Pc,styled:Ia}=await R("decentraland-ui2"),Dw=Ia(Pc)(({theme:e})=>({display:"inline-flex",alignItems:"center",gap:e.spacing(2)})),jw=Ia("span")(()=>({color:"#5c5c6e"})),Lw=Ia(Pc)(({theme:e})=>({backgroundColor:e.palette.warning.main,color:e.palette.warning.contrastText,padding:e.spacing(2),borderRadius:e.spacing(1),maxWidth:e.spacing(96),margin:`0 auto ${e.spacing(4)}`,[e.breakpoints.down("xs")]:{margin:`0 ${e.spacing(2)} ${e.spacing(4)}`}})),{useMemo:Ao}=await R("react"),{useSearchParams:Uw}=await R("react-router-dom"),{useTranslation:Mw}=await R("@dcl/hooks"),{CircularProgress:Nw,Typography:Yt}=await R("decentraland-ui2"),$w="https://preview.contentful.com",Bw="ea2ybdmmn1kv",VP=()=>{const{t:e}=Mw(),[t]=Uw(),n=Ao(()=>({id:t.get("contentful_id")??"",env:t.get("contentful_env")??"",token:t.get("token")??"",previewBaseUrl:$w,spaceId:Bw}),[t]),o=n.id&&n.env&&n.token,{data:u,isLoading:f,error:h}=zh(n,{skip:!o}),a=Ao(()=>aa(u?.publishedDate),[u?.publishedDate]),r=u?.author,s=!!r&&!!r.title;return o?f?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Nw,{})})}):h||!u?q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Yt,{color:"error",children:e("error.load_preview")})})}):q.jsxs(de,{showBlogNavigation:!0,children:[q.jsxs(Lw,{children:[q.jsx(Yt,{variant:"h6",children:e("preview.mode")}),q.jsx(Yt,{variant:"body2",children:e("preview.description")})]}),q.jsxs(oc,{children:[q.jsx(fc,{src:u.image.url,alt:u.title}),q.jsxs(ic,{children:[q.jsxs(cc,{as:"span",children:[a,q.jsx(uc,{children:"•"}),q.jsx(jw,{children:u.category.title})]}),q.jsx(lc,{children:q.jsx(dc,{variant:"h4",children:u.title})}),q.jsx(hc,{variant:"h6",children:u.description})]}),s&&q.jsx(pc,{children:q.jsxs(Dw,{children:[r.image?.url&&q.jsx(gc,{src:r.image.url,alt:r.title}),q.jsx(mc,{variant:"body2",children:r.title})]})}),q.jsx(yc,{children:q.jsx(ac,{document:u.body,assets:u.bodyAssets})})]})]}):q.jsx(de,{showBlogNavigation:!0,children:q.jsx(Tt,{children:q.jsx(Yt,{color:"error",children:e("preview.missing_params")})})})},{Box:_a,Skeleton:Ar,Typography:qc,styled:Re}=await R("decentraland-ui2"),Ro=Re(_a)(({theme:e})=>({margin:e.spacing(0,0,2),listStyleType:"none",flexGrow:1,borderRadius:e.spacing(1),backgroundColor:e.palette.background.paper,border:"transparent",position:"relative",display:"flex",alignItems:"flex-start",transition:"transform 250ms ease, box-shadow 250ms ease",boxShadow:e.shadows[1],height:"150px","& > a":{display:"flex",width:"100%",height:"100%",textDecoration:"none"},"&:hover":{transform:"translate(0, -4px)",boxShadow:e.shadows[2]},[e.breakpoints.down("sm")]:{height:"100px"}})),Oo=Re(_a)(()=>({display:"flex",width:"100%",height:"100%"})),Hw=Re("img")(({theme:e})=>({flexShrink:0,width:"232px",height:"100%",objectFit:"cover",borderRadius:`${e.shape.borderRadius}px 0 0 ${e.shape.borderRadius}px`,[e.breakpoints.down("sm")]:{width:"33%"}})),ko=Re(_a)(({theme:e})=>({padding:e.spacing(2.75,2.5,3,2.5),width:"100%",display:"flex",flexDirection:"column",justifyContent:"flex-start",overflow:"hidden","& em":{fontStyle:"normal",fontWeight:700,color:e.palette.primary.main},[e.breakpoints.down("sm")]:{padding:e.spacing(1.75)}})),Qw=Re(qc)(({theme:e})=>({margin:`0 0 ${e.spacing(.5)}`,fontSize:e.typography.pxToRem(20),lineHeight:"28px",fontWeight:500,color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",[e.breakpoints.down("sm")]:{fontSize:e.typography.pxToRem(15),lineHeight:"18px"}})),Fw=Re(qc)(({theme:e})=>({lineHeight:"24px",padding:0,margin:0,fontSize:e.typography.pxToRem(15),color:e.palette.text.secondary,textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",[e.breakpoints.down("sm")]:{display:"none"}})),Gw=Re(Ar)(({theme:e})=>({width:"232px",height:"100%",borderRadius:`${e.shape.borderRadius}px 0 0 ${e.shape.borderRadius}px`,flexShrink:0,[e.breakpoints.down("sm")]:{width:"33%"}})),Ww=Re(Ar)(({theme:e})=>({width:"80%",height:e.spacing(3.5),marginBottom:e.spacing(1)})),zw=Re(Ar)(({theme:e})=>({width:"100%",height:e.spacing(3),[e.breakpoints.down("sm")]:{display:"none"}})),Kw=Re(Ar)(({theme:e})=>({width:"60%",height:e.spacing(3),[e.breakpoints.down("sm")]:{display:"none"}})),{Link:Vw}=await R("react-router-dom"),an=e=>{const{result:t,loading:n}=e;return n?q.jsx(Ro,{children:q.jsxs(Oo,{children:[q.jsx(Gw,{variant:"rectangular"}),q.jsxs(ko,{children:[q.jsx(Ww,{variant:"text"}),q.jsx(zw,{variant:"text"}),q.jsx(Kw,{variant:"text"})]})]})}):t?q.jsx(Ro,{children:q.jsx(Vw,{to:t.url,children:q.jsxs(Oo,{children:[t.image&&q.jsx(Hw,{src:t.image,alt:""}),q.jsxs(ko,{children:[q.jsx(Qw,{dangerouslySetInnerHTML:{__html:t.title}}),q.jsx(Fw,{dangerouslySetInnerHTML:{__html:t.description}})]})]})})}):null},{Box:Rr,Typography:Yw,styled:Lt}=await R("decentraland-ui2"),Jw=Lt(Yw)(({theme:e})=>({margin:e.spacing(4.5,0,3),...e.typography.h4,fontWeight:400,padding:e.spacing(0,2),"& span":{fontWeight:700}})),Xw=Lt(Rr)(({theme:e})=>({marginBottom:e.spacing(3)})),Zw=Lt(Rr)(({theme:e})=>({textAlign:"center",paddingTop:e.spacing(4),paddingBottom:e.spacing(4)})),sn=Lt(Rr)(()=>({display:"flex",flexDirection:"column"})),eP=Lt(Rr)(({theme:e})=>({display:"flex",justifyContent:"center",marginTop:e.spacing(4)})),{useEffect:Do,useMemo:tP,useState:jo}=await R("react"),{useSearchParams:rP}=await R("react-router-dom"),{useTranslation:nP}=await R("@dcl/hooks"),{Button:aP,Typography:Lo}=await R("decentraland-ui2"),sP=10,YP=()=>{const{t:e}=nP(),[t]=rP(),[n,o]=jo(0),[u,f]=jo([]),h=tP(()=>t.get("q")||"",[t]),{data:a,isLoading:r,isFetching:s}=Cg({query:h,hitsPerPage:sP,page:n},{skip:h.length<3});Do(()=>{o(0),f([])},[h]),Do(()=>{a?.results&&f(n===0?a.results:P=>[...P,...a.results])},[a,n]);const i=()=>{o(P=>P+1),setTimeout(()=>window.scrollBy({top:500,left:0,behavior:"smooth"}),0)},c=u.length>0,l=!r&&h.length>=3&&u.length===0&&a?.results.length===0,d=r&&u.length===0,p=a?.hasMore??!1,g=h?e("search.description_with_query",{query:h}):e("search.description"),y=ee("BLOG_BASE_URL")||"";return q.jsxs(de,{showBlogNavigation:!0,children:[q.jsx(Dt,{title:h?e("search.title_with_query",{query:h}):e("search.title"),description:g,url:h?`${y}/search?q=${encodeURIComponent(h)}`:`${y}/search`}),h.length>=3&&q.jsx(Xw,{children:q.jsxs(Jw,{children:[e("search.results_for")," ",q.jsxs("span",{children:["“",h,"”"]})]})}),d&&q.jsx(sn,{children:Array.from({length:5},(P,w)=>q.jsx(an,{loading:!0},w))}),c&&q.jsx(sn,{children:u.map((P,w)=>q.jsx(an,{result:P},`${P.url}-${w}`))}),s&&!r&&q.jsx(sn,{children:Array.from({length:3},(P,w)=>q.jsx(an,{loading:!0},`loading-more-${w}`))}),p&&c&&!s&&q.jsx(eP,{children:q.jsx(aP,{variant:"contained",onClick:i,children:e("blog.load_more")})}),l&&q.jsxs(Zw,{children:[q.jsx(Lo,{variant:"h5",gutterBottom:!0,children:e("blog.nothing_to_show")}),q.jsxs(Lo,{color:"textSecondary",children:[e("search.no_results_for")," “",h,"”"]})]})]})},{useEffect:oP}=await R("react");function JP(){return oP(()=>{Si()},[]),null}export{FP as A,GP as B,WP as C,Cu as P,im as S,TP as W,Et as a,Hh as b,xP as c,VP as d,BP as e,YP as f,JP as g,KP as h,NP as i,ee as j,_u as k,Ru as l,Iu as m,MP as p,yP as s,$P as w};
|