@microcosmmoney/portal-react 3.13.3 → 3.13.5

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.
@@ -55,7 +55,7 @@ const STABLECOIN_VAULTS = {
55
55
  usdt: new web3_js_1.PublicKey("BnHA9jSm88wzQS4c2nCgTXch1Byzc3FWn2G7Wgrvazy3"),
56
56
  };
57
57
  const POOL_PDA_WALLET = new web3_js_1.PublicKey("GSBWtaX9WcBh8jUcmbXtQ1afQPHKSUKvsTxkqpJU3G9S");
58
- const SOLANA_RPC = process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "";
58
+ const SOLANA_RPC = process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com";
59
59
  const COIN_INFO = {
60
60
  usdc: { symbol: 'USDC', name: 'USD Coin', icon: '💵' },
61
61
  usdt: { symbol: 'USDT', name: 'Tether', icon: '💴' },
@@ -298,5 +298,5 @@ function MiningModal({ isOpen, onClose, userDetails, onSuccess }) {
298
298
  const ci = COIN_INFO[stablecoin];
299
299
  const OrderSummary = () => ((0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700 space-y-2 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("mintQuantity") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-bold font-mono", children: [(miningRequest.mcc_amount / 1000000000).toLocaleString(), " MCC"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("payAmount") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400 font-bold font-mono", children: [paymentAmount, " ", ci.symbol] })] })] }));
300
300
  const TxLink = ({ sig, label }) => ((0, jsx_runtime_1.jsxs)("a", { href: `https://solscan.io/tx/${sig}`, target: "_blank", rel: "noopener noreferrer", className: "inline-flex items-center gap-1 text-xs text-cyan-400 hover:underline", children: [label || `${sig.slice(0, 16)}...${sig.slice(-16)}`, " ", (0, jsx_runtime_1.jsx)(lucide_react_1.ExternalLink, { className: "w-3 h-3" })] }));
301
- return ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-end 2xs:items-center justify-center bg-black/50 backdrop-blur-sm font-mono", children: (0, jsx_runtime_1.jsx)("div", { className: "relative w-full max-w-2xl mx-0 2xs:mx-3 xs:mx-4 max-h-[95vh] 2xs:max-h-[90vh] overflow-y-auto rounded-t-2xl 2xs:rounded-xl", children: (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { filename: "mining_request.json", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4 2xs:mb-5 xs:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-white mb-1", children: t("title") }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider", children: t("subtitle") })] }), (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, disabled: loading, className: "text-neutral-400 hover:text-white transition-colors p-1 min-w-[44px] min-h-[44px] flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-5 h-5" }) })] }), step === "input" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [ratioInfo && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("currentPhase") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-white font-bold font-mono", children: ["Phase ", ratioInfo.current_stage] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1 flex items-center gap-1", children: [t("techBonus"), (0, jsx_runtime_1.jsx)("span", { className: "cursor-help text-neutral-500 hover:text-cyan-400", title: t("techBonusTooltip"), children: "?" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold font-mono", children: "0%" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("mintPrice") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-cyan-400 font-bold font-mono", children: ["1 MCC \u2248 ", (ratioInfo.usdc_per_mcc * 4).toFixed(2), " USD"] })] })] }) })), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-5 h-5 text-cyan-400 flex-shrink-0 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold text-sm mb-1", children: t("solanaOnly") }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-xs leading-relaxed", children: t("solanaOnlyDescMining") })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: [t("paymentMethod"), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: ["(", t("paymentMethodHint"), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => setShowStablecoinDropdown(!showStablecoinDropdown), className: "w-full px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white flex items-center justify-between hover:border-neutral-500 transition-colors", children: [(0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { children: ci.icon }), (0, jsx_runtime_1.jsx)("span", { children: ci.symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", ci.name, ")"] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: `w-4 h-4 transition-transform ${showStablecoinDropdown ? 'rotate-180' : ''}` })] }), showStablecoinDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "absolute z-10 w-full mt-1 bg-neutral-900 border border-neutral-700 rounded shadow-lg", children: Object.keys(COIN_INFO).map(type => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => { setStablecoin(type); setShowStablecoinDropdown(false); }, className: `w-full px-4 py-3 text-left flex items-center gap-2 hover:bg-neutral-800 transition-colors ${stablecoin === type ? 'bg-neutral-800 text-cyan-400' : 'text-white'}`, children: [(0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].icon }), (0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", COIN_INFO[type].name, ")"] })] }, type))) }))] }), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center justify-between text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("stablecoinEqual") }), (0, jsx_runtime_1.jsx)("span", { className: `font-medium ${stablecoinBalance === null ? 'text-neutral-400' : stablecoinBalance === 0 ? 'text-red-400' : 'text-white'}`, children: loadingBalance ? t("loading") : stablecoinBalance === null ? t("balanceUnknown") : t("balance", { amount: stablecoinBalance.toFixed(2), symbol: ci.symbol }) })] }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: t("mintAmountLabel", { symbol: "MCC" }) }), (0, jsx_runtime_1.jsx)("input", { type: "number", inputMode: "decimal", value: mccAmount, onChange: e => setMccAmount(e.target.value), placeholder: t("inputPlaceholder", { symbol: "MCC" }), className: "w-full px-3 2xs:px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white placeholder-neutral-400 focus:outline-none focus:border-cyan-400 text-base", min: "0", step: "0.01" })] }), mccAmount && parseFloat(mccAmount) > 0 && ratioInfo && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t("estimatedPayment") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: [(parseFloat(mccAmount) * ratioInfo.usdc_per_mcc * 4).toFixed(2), " ", ci.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-cyan-400/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t("youWillReceive") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: [parseFloat(mccAmount).toFixed(4), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("mccToWallet") })] })] })), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("cancel") }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSubmit, disabled: loading || !mccAmount || parseFloat(mccAmount) <= 0, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), loading ? t("processing") : t("confirmMint")] })] })] })), step === "paymentMethod" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-cyan-500/10 border border-cyan-500/30 text-xs text-cyan-300", children: t("stablecoinReminder", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider uppercase mb-1", children: t("selectPaymentMethod") }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectQrPayment, className: "w-full p-4 rounded border-2 border-cyan-400/50 bg-cyan-400/5 hover:bg-cyan-400/10 hover:border-cyan-400/70 transition-all text-left group", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-cyan-400/20 flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.QrCode, { className: "w-6 h-6 text-cyan-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-white font-bold text-sm", children: t("mobileQrScan") }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 py-0.5 rounded text-[10px] font-bold bg-cyan-400/20 text-cyan-400 tracking-wider", children: t("recommended") })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs mt-1 leading-relaxed", children: t("mobileQrDesc") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Smartphone, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 transition-colors flex-shrink-0" })] }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectBrowserPayment, disabled: !connected, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/50 hover:bg-neutral-800 hover:border-neutral-600 transition-all text-left group disabled:opacity-40 disabled:cursor-not-allowed", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-6 h-6 text-neutral-400" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 font-bold text-sm", children: t("browserExtension") }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mt-1 leading-relaxed", children: connected ? t("browserExtConnected") : t("browserExtNotConnected") })] })] }) }), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-sm transition-colors", children: ["\u2190 ", t("goBack")] })] })), step === "qrPayment" && miningRequest && solanaPayUrl && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingQrPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 rounded bg-amber-500/10 border border-amber-500/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-4 h-4 text-amber-400 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-amber-400 font-bold", children: t("confirmPayWithSymbol", { symbol: ci.symbol }) })] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs mt-1 ml-6", children: [t("insufficientBalance", { symbol: ci.symbol }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { monitorAbortRef.current = true; setStep("input"); setQrMonitoring(false); }, className: "text-cyan-400 hover:underline ml-1", children: t("switchToken") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs 2xs:text-sm text-center", children: t("scanQrToPayDesktop") }), (0, jsx_runtime_1.jsx)("div", { className: "bg-white p-3 2xs:p-4 xs:p-5 rounded-xl", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: solanaPayUrl, size: 200, level: "H", includeMargin: false, className: "w-[160px] h-[160px] 2xs:w-[180px] 2xs:h-[180px] xs:w-[220px] xs:h-[220px] sm:w-[280px] sm:h-[280px]", imageSettings: { src: "/mcc-logo-40.png", x: undefined, y: undefined, height: 40, width: 40, excavate: true } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-[10px] 2xs:text-xs", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-3 h-3 animate-spin" }), t("waitingQrScan")] })] }), qrMonitoring && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2 text-cyan-400 text-xs 2xs:text-sm py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), t("monitoringOnchain")] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { monitorAbortRef.current = true; setStep(isMobile ? "input" : "paymentMethod"); setQrMonitoring(false); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-xs 2xs:text-sm transition-colors min-h-[44px]", children: ["\u2190 ", t("goBack")] })] })), step === "payment" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm", children: t("processingTransfer", { symbol: ci.symbol }) })] })), step === "confirming" && txSignature && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "warning", children: t("verifying") }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm mb-2", children: t("verifyingTransaction") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("txSignature") }), (0, jsx_runtime_1.jsxs)("div", { className: "font-mono text-xs text-cyan-400 break-all", children: [txSignature.slice(0, 16), "...", txSignature.slice(-16)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2", children: (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature, label: t("viewOnExplorer") }) })] })] })), step === "success" && confirmationResult && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-white/10 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-8 h-8 text-white" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-white", children: t("mintSuccess") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-white/10 border border-neutral-700 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("youReceived") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl font-bold text-white font-mono", children: ["+", (confirmationResult.mcc_distributed.user / 1000000000).toLocaleString(), " MCC"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("sentToWallet") })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("paymentTx", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature })] })] }), confirmationResult.onchain_tx_signature && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-neutral-800 border border-neutral-700 space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider", children: t("onchainDistribution") }), (0, jsx_runtime_1.jsx)(TxLink, { sig: confirmationResult.onchain_tx_signature })] })), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-3", children: (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors", children: t("doneAndRefresh") }) })] })), step === "error" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-8 h-8 text-red-500" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-red-500", children: t("mintFailed") }), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-red-500/20 border border-red-500/50", children: (0, jsx_runtime_1.jsx)("p", { className: "text-red-500 text-sm whitespace-pre-line", children: error }) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("back") })] }))] }) }) }));
301
+ return ((0, jsx_runtime_1.jsx)("div", { className: "fixed inset-0 z-50 flex items-end 2xs:items-center justify-center bg-black/50 backdrop-blur-sm font-mono", children: (0, jsx_runtime_1.jsx)("div", { className: "relative w-full max-w-2xl mx-0 2xs:mx-3 xs:mx-4 max-h-[95vh] 2xs:max-h-[90vh] overflow-y-auto rounded-t-2xl 2xs:rounded-xl", children: (0, jsx_runtime_1.jsxs)(terminal_1.TerminalCard, { filename: "mining_request.json", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-4 2xs:mb-5 xs:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h2", { className: "text-base 2xs:text-lg xs:text-xl font-bold text-white mb-1", children: t("title") }), (0, jsx_runtime_1.jsx)("p", { className: "text-[10px] 2xs:text-xs text-neutral-400 tracking-wider", children: t("subtitle") })] }), (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, disabled: loading, className: "text-neutral-400 hover:text-white transition-colors p-1 min-w-[44px] min-h-[44px] flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.X, { className: "w-5 h-5" }) })] }), step === "input" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [ratioInfo && ((0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-3 gap-4 text-sm", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("currentPhase") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-white font-bold font-mono", children: ["Phase ", ratioInfo.current_stage] })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1 flex items-center gap-1", children: [t("techBonus"), (0, jsx_runtime_1.jsx)("span", { className: "cursor-help text-neutral-500 hover:text-cyan-400", title: t("techBonusTooltip"), children: "?" })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold font-mono", children: "0%" })] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("mintPrice") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-cyan-400 font-bold font-mono", children: ["1 MCC \u2248 ", (ratioInfo.usdc_per_mcc * 4).toFixed(2), " USD"] })] })] }) })), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-5 h-5 text-cyan-400 flex-shrink-0 mt-0.5" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-cyan-400 font-bold text-sm mb-1", children: t("solanaOnly") }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-300 text-xs leading-relaxed", children: t("solanaOnlyDescMining") })] })] }) }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: [t("paymentMethod"), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-cyan-400", children: ["(", t("paymentMethodHint"), ")"] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "relative", children: [(0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => setShowStablecoinDropdown(!showStablecoinDropdown), className: "w-full px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white flex items-center justify-between hover:border-neutral-500 transition-colors", children: [(0, jsx_runtime_1.jsxs)("span", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { children: ci.icon }), (0, jsx_runtime_1.jsx)("span", { children: ci.symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", ci.name, ")"] })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: `w-4 h-4 transition-transform ${showStablecoinDropdown ? 'rotate-180' : ''}` })] }), showStablecoinDropdown && ((0, jsx_runtime_1.jsx)("div", { className: "absolute z-10 w-full mt-1 bg-neutral-900 border border-neutral-700 rounded shadow-lg", children: Object.keys(COIN_INFO).map(type => ((0, jsx_runtime_1.jsxs)("button", { type: "button", onClick: () => { setStablecoin(type); setShowStablecoinDropdown(false); }, className: `w-full px-4 py-3 text-left flex items-center gap-2 hover:bg-neutral-800 transition-colors ${stablecoin === type ? 'bg-neutral-800 text-cyan-400' : 'text-white'}`, children: [(0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].icon }), (0, jsx_runtime_1.jsx)("span", { children: COIN_INFO[type].symbol }), (0, jsx_runtime_1.jsxs)("span", { className: "text-neutral-400 text-sm", children: ["(", COIN_INFO[type].name, ")"] })] }, type))) }))] }), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "mt-2 flex items-center justify-between text-xs", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400", children: t("stablecoinEqual") }), (0, jsx_runtime_1.jsx)("span", { className: `font-medium ${stablecoinBalance === null ? 'text-neutral-400' : stablecoinBalance === 0 ? 'text-red-400' : 'text-white'}`, children: loadingBalance ? t("loading") : stablecoinBalance === null ? t("balanceUnknown") : t("balance", { amount: stablecoinBalance.toFixed(2), symbol: ci.symbol }) })] }))] }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("label", { className: "block text-xs text-neutral-400 tracking-wider mb-2", children: t("mintAmountLabel", { symbol: "MCC" }) }), (0, jsx_runtime_1.jsx)("input", { type: "number", inputMode: "decimal", value: mccAmount, onChange: e => setMccAmount(e.target.value), placeholder: t("inputPlaceholder", { symbol: "MCC" }), className: "w-full px-3 2xs:px-4 py-3 bg-neutral-800 border border-neutral-600 rounded text-white placeholder-neutral-400 focus:outline-none focus:border-cyan-400 text-base", min: "0", step: "0.01" })] }), mccAmount && parseFloat(mccAmount) > 0 && ratioInfo && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-cyan-400/20 border border-cyan-400/50 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-2", children: t("estimatedPayment") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-2xl font-bold text-cyan-400 font-mono", children: [(parseFloat(mccAmount) * ratioInfo.usdc_per_mcc * 4).toFixed(2), " ", ci.symbol] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-cyan-400/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex justify-between items-center", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-xs text-neutral-400 tracking-wider", children: t("youWillReceive") }), (0, jsx_runtime_1.jsxs)("span", { className: "text-lg font-bold text-white font-mono", children: [parseFloat(mccAmount).toFixed(4), " MCC"] })] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("mccToWallet") })] })] })), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex gap-3", children: [(0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("cancel") }), (0, jsx_runtime_1.jsxs)("button", { onClick: handleSubmit, disabled: loading || !mccAmount || parseFloat(mccAmount) <= 0, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center justify-center gap-2", children: [loading && (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), loading ? t("processing") : t("confirmMint")] })] })] })), step === "paymentMethod" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "p-3 rounded bg-cyan-500/10 border border-cyan-500/30 text-xs text-cyan-300", children: t("stablecoinReminder", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider uppercase mb-1", children: t("selectPaymentMethod") }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectQrPayment, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/30 hover:bg-cyan-400/10 hover:border-cyan-400/70 focus:bg-cyan-400/10 focus:border-cyan-400 focus:outline-none transition-all text-left group", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 group-hover:bg-cyan-400/20 group-focus:bg-cyan-400/20 transition-colors flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.QrCode, { className: "w-6 h-6 text-neutral-400 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2", children: [(0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 group-hover:text-white group-focus:text-white font-bold text-sm transition-colors", children: t("mobileQrScan") }), (0, jsx_runtime_1.jsx)("span", { className: "px-1.5 py-0.5 rounded text-[10px] font-bold bg-cyan-400/20 text-cyan-400 tracking-wider", children: t("recommended") })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 group-hover:text-neutral-400 group-focus:text-neutral-400 text-xs mt-1 leading-relaxed transition-colors", children: t("mobileQrDesc") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Smartphone, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors flex-shrink-0" })] }) }), (0, jsx_runtime_1.jsx)("button", { onClick: handleSelectBrowserPayment, disabled: !connected, className: "w-full p-4 rounded border border-neutral-700 bg-neutral-800/30 hover:bg-cyan-400/10 hover:border-cyan-400/70 focus:bg-cyan-400/10 focus:border-cyan-400 focus:outline-none transition-all text-left group disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-neutral-800/30 disabled:hover:border-neutral-700", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-12 h-12 rounded-lg bg-neutral-700/50 group-hover:bg-cyan-400/20 group-focus:bg-cyan-400/20 transition-colors flex items-center justify-center flex-shrink-0", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-6 h-6 text-neutral-400 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-300 group-hover:text-white group-focus:text-white font-bold text-sm transition-colors", children: t("browserExtension") }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 group-hover:text-neutral-400 group-focus:text-neutral-400 text-xs mt-1 leading-relaxed transition-colors", children: connected ? t("browserExtConnected") : t("browserExtNotConnected") })] }), (0, jsx_runtime_1.jsx)(lucide_react_1.Monitor, { className: "w-5 h-5 text-neutral-500 group-hover:text-cyan-400 group-focus:text-cyan-400 transition-colors flex-shrink-0" })] }) }), error && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 p-3 rounded bg-red-500/20 border border-red-500/50 text-red-500 text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), error] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-sm transition-colors", children: ["\u2190 ", t("goBack")] })] })), step === "qrPayment" && miningRequest && solanaPayUrl && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingQrPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsxs)("div", { className: "p-2 2xs:p-3 rounded bg-amber-500/10 border border-amber-500/30", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-xs 2xs:text-sm", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-4 h-4 text-amber-400 flex-shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-amber-400 font-bold", children: t("confirmPayWithSymbol", { symbol: ci.symbol }) })] }), (0, jsx_runtime_1.jsxs)("p", { className: "text-neutral-400 text-[10px] 2xs:text-xs mt-1 ml-6", children: [t("insufficientBalance", { symbol: ci.symbol }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { monitorAbortRef.current = true; setStep("input"); setQrMonitoring(false); }, className: "text-cyan-400 hover:underline ml-1", children: t("switchToken") })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col items-center space-y-3 2xs:space-y-4", children: [(0, jsx_runtime_1.jsx)("p", { className: "text-neutral-400 text-xs 2xs:text-sm text-center", children: t("scanQrToPayDesktop") }), (0, jsx_runtime_1.jsx)("div", { className: "bg-white p-3 2xs:p-4 xs:p-5 rounded-xl", children: (0, jsx_runtime_1.jsx)(qrcode_react_1.QRCodeSVG, { value: solanaPayUrl, size: 200, level: "H", includeMargin: false, className: "w-[160px] h-[160px] 2xs:w-[180px] 2xs:h-[180px] xs:w-[220px] xs:h-[220px] sm:w-[280px] sm:h-[280px]", imageSettings: { src: "/mcc-logo-40.png", x: undefined, y: undefined, height: 40, width: 40, excavate: true } }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-neutral-400 text-[10px] 2xs:text-xs", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-3 h-3 animate-spin" }), t("waitingQrScan")] })] }), qrMonitoring && (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center gap-2 text-cyan-400 text-xs 2xs:text-sm py-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-4 h-4 animate-spin" }), t("monitoringOnchain")] }), (0, jsx_runtime_1.jsxs)("button", { onClick: () => { monitorAbortRef.current = true; setStep(isMobile ? "input" : "paymentMethod"); setQrMonitoring(false); setError(""); }, className: "w-full px-4 py-2 text-neutral-400 hover:text-neutral-300 text-xs 2xs:text-sm transition-colors min-h-[44px]", children: ["\u2190 ", t("goBack")] })] })), step === "payment" && miningRequest && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "info", children: t("waitingPayment") }), (0, jsx_runtime_1.jsx)(OrderSummary, {}), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm", children: t("processingTransfer", { symbol: ci.symbol }) })] })), step === "confirming" && txSignature && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)(terminal_1.TerminalBadge, { variant: "warning", children: t("verifying") }), (0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-8 h-8 animate-spin text-cyan-400" }) }), (0, jsx_runtime_1.jsx)("p", { className: "text-center text-neutral-400 text-sm mb-2", children: t("verifyingTransaction") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-3 rounded bg-neutral-800 border border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("txSignature") }), (0, jsx_runtime_1.jsxs)("div", { className: "font-mono text-xs text-cyan-400 break-all", children: [txSignature.slice(0, 16), "...", txSignature.slice(-16)] }), (0, jsx_runtime_1.jsx)("div", { className: "mt-2", children: (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature, label: t("viewOnExplorer") }) })] })] })), step === "success" && confirmationResult && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-white/10 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-8 h-8 text-white" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-white", children: t("mintSuccess") }), (0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-white/10 border border-neutral-700 space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "text-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("youReceived") }), (0, jsx_runtime_1.jsxs)("div", { className: "text-3xl font-bold text-white font-mono", children: ["+", (confirmationResult.mcc_distributed.user / 1000000000).toLocaleString(), " MCC"] }), (0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 mt-1", children: t("sentToWallet") })] }), (0, jsx_runtime_1.jsxs)("div", { className: "pt-3 border-t border-neutral-700", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider mb-1", children: t("paymentTx", { symbol: ci.symbol }) }), (0, jsx_runtime_1.jsx)(TxLink, { sig: txSignature })] })] }), confirmationResult.onchain_tx_signature && ((0, jsx_runtime_1.jsxs)("div", { className: "p-4 rounded bg-neutral-800 border border-neutral-700 space-y-2", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-400 tracking-wider", children: t("onchainDistribution") }), (0, jsx_runtime_1.jsx)(TxLink, { sig: confirmationResult.onchain_tx_signature })] })), (0, jsx_runtime_1.jsx)("div", { className: "flex gap-3", children: (0, jsx_runtime_1.jsx)("button", { onClick: handleClose, className: "flex-1 px-4 py-3 bg-cyan-700 hover:bg-cyan-600 text-white rounded transition-colors", children: t("doneAndRefresh") }) })] })), step === "error" && ((0, jsx_runtime_1.jsxs)("div", { className: "space-y-4", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center justify-center py-8", children: (0, jsx_runtime_1.jsx)("div", { className: "w-16 h-16 rounded-full bg-red-500/20 flex items-center justify-center", children: (0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-8 h-8 text-red-500" }) }) }), (0, jsx_runtime_1.jsx)("h3", { className: "text-xl font-bold text-center text-red-500", children: t("mintFailed") }), (0, jsx_runtime_1.jsx)("div", { className: "p-4 rounded bg-red-500/20 border border-red-500/50", children: (0, jsx_runtime_1.jsx)("p", { className: "text-red-500 text-sm whitespace-pre-line", children: error }) }), (0, jsx_runtime_1.jsx)("button", { onClick: () => { setStep("input"); setError(""); }, className: "w-full px-4 py-3 border border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent rounded transition-colors", children: t("back") })] }))] }) }) }));
302
302
  }
@@ -59,6 +59,9 @@ const time_remaining_1 = require("../ui/time-remaining");
59
59
  const next_intl_1 = require("next-intl");
60
60
  const MCCPriceContext_1 = require("../../contexts/MCCPriceContext");
61
61
  const PriceChart_1 = require("../data/charts/PriceChart");
62
+ const auth_react_1 = require("@microcosmmoney/auth-react");
63
+ const tooltip_1 = require("../ui/tooltip");
64
+ const lucide_react_2 = require("lucide-react");
62
65
  const formatNumber = (num, decimals = 2) => {
63
66
  const parsedNum = parseFloat(String(num));
64
67
  return isNaN(parsedNum) ? "0.00" : parsedNum.toFixed(decimals);
@@ -72,6 +75,8 @@ function MCCMiningPage() {
72
75
  const t = (0, next_intl_1.useTranslations)('miningDash');
73
76
  const router = (0, navigation_1.useRouter)();
74
77
  const ticker = (0, MCCPriceContext_1.useMCCPrice)();
78
+ const techBonusDetail = (0, auth_react_1.useTechBonusDetail)();
79
+ const totalBonus = Number(techBonusDetail.data?.total_bonus ?? 0);
75
80
  const [userDetails, setUserDetails] = (0, react_1.useState)(null);
76
81
  const [showMiningModal, setShowMiningModal] = (0, react_1.useState)(false);
77
82
  const [ratioInfo, setRatioInfo] = (0, react_1.useState)(null);
@@ -216,7 +221,7 @@ function MCCMiningPage() {
216
221
  if (isLoading) {
217
222
  return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-12", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-6 h-6 animate-spin text-neutral-400 mr-3" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingMintData') })] })] }));
218
223
  }
219
- return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: refreshAll, disabled: ratioLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", ratioLoading && "animate-spin") }), t('refresh')] })] }), !connected && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col xs:flex-row items-start xs:items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-5 h-5 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-medium text-white", children: t('connectWalletFirst') }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500", children: t('connectWalletDesc') })] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: '#0e7490' }, className: "!h-9 !rounded-md !text-sm !text-white" })] }) }) })), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2 bg-neutral-800 rounded-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-400", children: [t('connected'), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [publicKey?.toBase58().slice(0, 8), "...", publicKey?.toBase58().slice(-6)] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: 'transparent' }, className: "!h-7 !rounded !text-xs !text-neutral-400 !px-2 !py-0 !border !border-neutral-700 ml-auto" })] })), ratioError && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-red-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: ratioError })] }) }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-3 sm:gap-6 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 flex-wrap", children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent text-[10px] sm:text-xs", children: t('x402Protocol') }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-xs", children: "Solana Mainnet" })] }), (ticker.basePrice || ratioInfo) && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1", children: t('mintPrice') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-xl sm:text-3xl font-bold text-white font-mono", children: ["1 MCC \u2248 ", formatNumber((ticker.basePrice ?? ratioInfo?.usdc_per_mcc ?? 0) * 4, 4), " USD"] }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-sm", children: t('techBonus') })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 sm:gap-4 text-[10px] sm:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc') })] })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowMiningModal(true), size: "lg", className: "px-6 py-3 sm:px-8 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4 sm:w-5 sm:h-5 mr-2" }), t('startMinting')] })] }), ratioInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-3 sm:pt-4 mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider uppercase mb-2 sm:mb-3", children: t('mintStats') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('basePrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", formatNumber(ticker.basePrice ?? ratioInfo.usdc_per_mcc, 4)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('basePriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('marketPrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", ticker.price ? formatNumber(ticker.price, 4) : '...'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('marketPriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('totalMinted') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono truncate", children: formatLargeNumber(ratioInfo.total_minted) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('totalMintedNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('currentPhase') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["Phase ", ratioInfo.current_stage] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('phaseNote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('halvingRemaining', { amount: formatLargeNumber(100000000 - (ratioInfo.total_minted % 100000000), 0) }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full bg-cyan-400 transition-all", style: { width: `${((ratioInfo.total_minted % 100000000) / 100000000) * 100}%` } }) })] })] }))] }) }), (0, jsx_runtime_1.jsx)(PriceChart_1.PriceChart, {}), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs sm:text-sm text-neutral-300 tracking-wider font-medium", children: t('onChainBalance') }), walletBalances.length > 0 && walletBalances.every(w => !w.loading) && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-3 h-3 mr-1 inline" }), walletBalances.length, " ", t('walletsCount')] }))] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: loadWalletBalances, disabled: walletsLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", walletsLoading && "animate-spin") }), t('refresh')] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mb-4", children: t('onChainBalanceDesc') }), walletsLoading && walletBalances.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-neutral-400 mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance') })] })) : walletBalances.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500 text-sm", children: t('noWalletBound') })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 xs:grid-cols-2 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('totalOnChainBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: walletBalances.some(w => w.loading)
224
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "max-w-7xl mx-auto px-3 py-4 space-y-3 xs:px-4 xs:space-y-4 sm:px-6 sm:py-6 sm:space-y-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "min-w-0", children: [(0, jsx_runtime_1.jsx)("h1", { className: "text-lg sm:text-2xl font-bold text-white tracking-wider", children: t('title') }), (0, jsx_runtime_1.jsx)("p", { className: "text-xs sm:text-sm text-neutral-400 mt-1", children: t('subtitle') })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: refreshAll, disabled: ratioLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", ratioLoading && "animate-spin") }), t('refresh')] })] }), !connected && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-3 sm:p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col xs:flex-row items-start xs:items-center justify-between gap-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-5 h-5 text-neutral-400 shrink-0" }), (0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs sm:text-sm font-medium text-white", children: t('connectWalletFirst') }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500", children: t('connectWalletDesc') })] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: '#0e7490' }, className: "!h-9 !rounded-md !text-sm !text-white" })] }) }) })), connected && ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-3 px-4 py-2 bg-neutral-800 rounded-lg", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Link2, { className: "w-4 h-4 text-neutral-400" }), (0, jsx_runtime_1.jsxs)("span", { className: "text-xs text-neutral-400", children: [t('connected'), " ", (0, jsx_runtime_1.jsxs)("span", { className: "text-white font-mono", children: [publicKey?.toBase58().slice(0, 8), "...", publicKey?.toBase58().slice(-6)] })] }), (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletMultiButton, { style: { backgroundColor: 'transparent' }, className: "!h-7 !rounded !text-xs !text-neutral-400 !px-2 !py-0 !border !border-neutral-700 ml-auto" })] })), ratioError && ((0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 dash-card", children: (0, jsx_runtime_1.jsx)(card_1.CardContent, { className: "p-6", children: (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 text-red-400", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.AlertCircle, { className: "w-4 h-4" }), (0, jsx_runtime_1.jsx)("span", { children: ratioError })] }) }) })), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col md:flex-row md:items-center md:justify-between gap-3 sm:gap-6 mb-4 sm:mb-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "space-y-2 sm:space-y-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 flex-wrap", children: [(0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent text-[10px] sm:text-xs", children: t('x402Protocol') }), (0, jsx_runtime_1.jsx)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-xs", children: "Solana Mainnet" })] }), (ticker.basePrice || ratioInfo) && ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1", children: t('mintPrice') }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-baseline gap-2 flex-wrap", children: [(0, jsx_runtime_1.jsxs)("span", { className: "text-xl sm:text-3xl font-bold text-white font-mono", children: ["1 MCC \u2248 ", formatNumber((ticker.basePrice ?? ratioInfo?.usdc_per_mcc ?? 0) * 4, 4), " USD"] }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { delayDuration: 100, children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-cyan-400/20 text-cyan-400 border-transparent text-[10px] sm:text-sm cursor-help inline-flex items-center gap-1", children: ["+", totalBonus, "% ", t('techBonus'), (0, jsx_runtime_1.jsx)(lucide_react_2.HelpCircle, { className: "w-3 h-3" })] }) }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { className: "max-w-xs text-xs leading-relaxed", children: t('techBonusTooltip') })] }) })] })] })), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-start gap-3 sm:gap-4 text-[10px] sm:text-xs text-neutral-500", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Shield, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('stablecoinDirectDesc') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-3 h-3 sm:w-3.5 sm:h-3.5 text-neutral-500 shrink-0" }), (0, jsx_runtime_1.jsx)("span", { children: t('instantMintDesc') })] })] })] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { onClick: () => setShowMiningModal(true), size: "lg", className: "px-6 py-3 sm:px-8 sm:py-4 text-sm sm:text-base font-medium bg-cyan-700 hover:bg-cyan-600 text-white whitespace-nowrap flex-shrink-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Zap, { className: "w-4 h-4 sm:w-5 sm:h-5 mr-2" }), t('startMinting')] })] }), ratioInfo && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "border-t border-neutral-700 pt-3 sm:pt-4 mb-3 sm:mb-4", children: (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider uppercase mb-2 sm:mb-3", children: t('mintStats') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.TrendingUp, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('basePrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", formatNumber(ticker.basePrice ?? ratioInfo.usdc_per_mcc, 4)] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('basePriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Coins, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-white" }), (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('marketPrice') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["$", ticker.price ? formatNumber(ticker.price, 4) : '...'] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('marketPriceNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('totalMinted') }) }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono truncate", children: formatLargeNumber(ratioInfo.total_minted) }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('totalMintedNote') })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex items-center gap-1.5 sm:gap-2 mb-1 sm:mb-2", children: (0, jsx_runtime_1.jsx)("span", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider", children: t('currentPhase') }) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-base sm:text-2xl font-bold text-white font-mono", children: ["Phase ", ratioInfo.current_stage] }), (0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-500 mt-1 hidden xs:block", children: t('phaseNote') })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "space-y-1", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-xs text-neutral-500", children: t('halvingRemaining', { amount: formatLargeNumber(100000000 - (ratioInfo.total_minted % 100000000), 0) }) }), (0, jsx_runtime_1.jsx)("div", { className: "bg-neutral-800 rounded-full h-2 overflow-hidden", children: (0, jsx_runtime_1.jsx)("div", { className: "h-2 rounded-full bg-cyan-400 transition-all", style: { width: `${((ratioInfo.total_minted % 100000000) / 100000000) * 100}%` } }) })] })] }))] }) }), (0, jsx_runtime_1.jsx)(PriceChart_1.PriceChart, {}), (0, jsx_runtime_1.jsx)(card_1.Card, { className: "bg-neutral-900 border-neutral-700 hover:border-cyan-400/50 dash-card", children: (0, jsx_runtime_1.jsxs)(card_1.CardContent, { className: "p-3 sm:p-6", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-between mb-3 gap-2", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex items-center gap-2 sm:gap-3 min-w-0", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Wallet, { className: "w-4 h-4 text-white shrink-0" }), (0, jsx_runtime_1.jsx)("span", { className: "text-xs sm:text-sm text-neutral-300 tracking-wider font-medium", children: t('onChainBalance') }), walletBalances.length > 0 && walletBalances.every(w => !w.loading) && ((0, jsx_runtime_1.jsxs)(badge_1.Badge, { className: "bg-white/20 text-white border-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.CheckCircle2, { className: "w-3 h-3 mr-1 inline" }), walletBalances.length, " ", t('walletsCount')] }))] }), (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "sm", onClick: loadWalletBalances, disabled: walletsLoading, className: "border-neutral-700 text-neutral-400 hover:bg-neutral-800 hover:text-neutral-300 bg-transparent", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { className: (0, utils_1.cn)("w-4 h-4 mr-2", walletsLoading && "animate-spin") }), t('refresh')] })] }), (0, jsx_runtime_1.jsx)("p", { className: "text-neutral-500 text-xs mb-4", children: t('onChainBalanceDesc') }), walletsLoading && walletBalances.length === 0 ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex items-center justify-center py-8", children: [(0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin text-neutral-400 mr-2" }), (0, jsx_runtime_1.jsx)("span", { className: "text-neutral-400 text-sm", children: t('loadingOnChainBalance') })] })) : walletBalances.length === 0 ? ((0, jsx_runtime_1.jsx)("div", { className: "text-center py-8 text-neutral-500 text-sm", children: t('noWalletBound') })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "grid grid-cols-1 xs:grid-cols-2 gap-2 sm:gap-4 mb-3 sm:mb-4", children: [(0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('totalOnChainBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: walletBalances.some(w => w.loading)
220
225
  ? (0, jsx_runtime_1.jsx)(lucide_react_1.Loader2, { className: "w-5 h-5 animate-spin" })
221
226
  : formatLargeNumber(walletBalances.reduce((sum, w) => sum + w.mcc_balance, 0)) }), (0, jsx_runtime_1.jsxs)("div", { className: "text-neutral-500 text-xs mt-1", children: ["MCC \u00B7 ", walletBalances.length, " ", t('walletsTotal')] })] }), (0, jsx_runtime_1.jsxs)("div", { className: "bg-neutral-800 rounded p-2 sm:p-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "text-[10px] sm:text-xs text-neutral-400 tracking-wider mb-1 font-mono", children: t('primaryWalletBalance') }), (0, jsx_runtime_1.jsx)("div", { className: "text-base sm:text-2xl font-bold font-mono text-white", children: (() => {
222
227
  const primary = walletBalances.find(w => w.is_primary);
@@ -10,7 +10,7 @@ const wallet_adapter_react_ui_1 = require("@solana/wallet-adapter-react-ui");
10
10
  require("@solana/wallet-adapter-react-ui/styles.css");
11
11
  function SolanaWalletProvider({ children }) {
12
12
  const endpoint = (0, react_1.useMemo)(() => {
13
- return process.env.NEXT_PUBLIC_SOLANA_RPC_URL || '';
13
+ return process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || 'https://api.mainnet-beta.solana.com';
14
14
  }, []);
15
15
  const wallets = (0, react_1.useMemo)(() => [], []);
16
16
  return ((0, jsx_runtime_1.jsx)(wallet_adapter_react_1.ConnectionProvider, { endpoint: endpoint, children: (0, jsx_runtime_1.jsx)(wallet_adapter_react_1.WalletProvider, { wallets: wallets, autoConnect: true, children: (0, jsx_runtime_1.jsx)(wallet_adapter_react_ui_1.WalletModalProvider, { children: children }) }) }));
@@ -15,7 +15,7 @@ const solana_pay_1 = require("../../lib/solana/solana-pay");
15
15
  const next_intl_1 = require("next-intl");
16
16
  const STABLECOIN_MINTS = { usdc: new web3_js_1.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"), usdt: new web3_js_1.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB") };
17
17
  const STABLECOIN_VAULTS = { usdc: new web3_js_1.PublicKey("5L8vPTvGH14keLq4R6CGGvSFksZFjb7bRPXarCwZbmUA"), usdt: new web3_js_1.PublicKey("BnHA9jSm88wzQS4c2nCgTXch1Byzc3FWn2G7Wgrvazy3") };
18
- const SOLANA_RPC = process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "";
18
+ const SOLANA_RPC = process.env.NEXT_PUBLIC_HELIUS_RPC_URL || process.env.NEXT_PUBLIC_SOLANA_RPC_URL || "https://api.mainnet-beta.solana.com";
19
19
  const COIN_INFO = { usdc: { symbol: 'USDC', name: 'USD Coin', icon: '💵' }, usdt: { symbol: 'USDT', name: 'Tether', icon: '💴' } };
20
20
  function PublicMiningModal({ isOpen, onClose, onSuccess }) {
21
21
  const t = (0, next_intl_1.useTranslations)("miningModal");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microcosmmoney/portal-react",
3
- "version": "3.13.3",
3
+ "version": "3.13.5",
4
4
  "description": "Microcosm Portal UI components for React/Next.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,8 +18,8 @@
18
18
  "next-intl": ">=3.0.0"
19
19
  },
20
20
  "dependencies": {
21
- "@microcosmmoney/auth-core": "^2.3.3",
22
- "@microcosmmoney/auth-react": "^2.6.1",
21
+ "@microcosmmoney/auth-core": "^2.3.4",
22
+ "@microcosmmoney/auth-react": "^2.6.2",
23
23
  "@radix-ui/react-accordion": "^1.2.12",
24
24
  "@radix-ui/react-alert-dialog": "^1.1.15",
25
25
  "@radix-ui/react-aspect-ratio": "^1.1.7",