"use strict";var e=require("react/jsx-runtime"),r=require("lucide-react"),t=require("react"),i=require("./privy-context-UTJouJ1x.js"),s=require("./context-rs-ygOK2.js"),u=require("./internal-context-CdsQ3LEl.js"),o=require("./modal-context-BgeioxwT.js"),c=require("./ScreenLayout-DaFW0I3a.js");require("@privy-io/are-addresses-equal"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("./ModalHeader-Cpls13mi.js"),require("styled-components"),require("./useActiveWallet-dTc6deka.js"),require("viem/utils"),require("./wallet-connect-BuohfvHK.js"),require("./errors-CBapWvRs.js"),require("ofetch"),require("./getPublicClient-CFd_sHBk.js"),require("viem"),require("viem/chains"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("./index-Ub4KpwSY.js"),require("zustand"),require("react-device-detect"),require("./get-entropy-details-for-user-D63rM5_a.js"),require("./user-D2oPA-vS.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./Screen-8NusMFtu.js"),require("./index-ByFhjjzH.js");const n=({title:t,description:i,onClose:s})=>/*#__PURE__*/e.jsx(c.ScreenLayout,{title:t,subtitle:i,icon:r.CheckCircle,iconVariant:"success",watermark:!0,onBack:s}),l={component:()=>{let{user:r}=i.usePrivyContext(),{closePrivyModal:c,isNewUserThisSession:l,updateWallets:a}=u.usePrivyInternal(),{data:d,onUserCloseViaDialogOrKeybindRef:q}=o.usePrivyModal(),j=s.useAppConfig(),{onSuccess:m,onFailure:v,callAuthOnSuccessOnClose:y}=d.createWallet,C=()=>{let e=i.getPrivyEthereumWallet(r)??i.getPrivySolanaWallet(r);r&&e?(a(),m({user:r,account:e})):v(Error("Failed to create wallet")),c({shouldCallAuthOnSuccess:y})};t.useEffect((()=>{let e=setTimeout(C,s.DEFAULT_SUCCESS_SCREEN_LONG_DURATION_MS);return()=>clearTimeout(e)}),[]),q.current=C;let S=l&&!((r?.linkedAccounts?.length??0)>1),h=S?"Welcome"+(j?.name?` to ${j?.name}`:""):"All set!";/*#__PURE__*/return e.jsx(n,{title:h,description:S?"You've successfully created an account.":"Your account is secured.",onClose:C})}};exports.EmbeddedWalletCreatedScreen=l,exports.EmbeddedWalletCreatedScreenView=n,exports.default=l;
//# sourceMappingURL=EmbeddedWalletCreatedScreen-CyfztZTg.js.map
