keyring-chatbot-agent-sdk-test 0.0.14 → 0.0.16

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.
@@ -1,17 +1,17 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet{font-size:14px;font-weight:500;color:#1a1a1d}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}.message:hover .message-reply-button{opacity:1}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header label{margin-bottom:0}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet,.user-wallet a{font-size:14px;font-weight:500;color:#1a1a1d}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}.message:hover .message-reply-button{opacity:1}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header label{margin-bottom:0}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
2
  (function(pt,I){typeof exports=="object"&&typeof module<"u"?I(exports,require("react/jsx-runtime"),require("react")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react"],I):(pt=typeof globalThis<"u"?globalThis:pt||self,I(pt.ChatWidgetSDK={},pt.jsxRuntime,pt.React))})(this,(function(pt,I,re){"use strict";const Ur="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAYAAADG4PRLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAfXSURBVHgB7Z1LbFRVGMe/c4YCAmKrEFiQWIIrNm13RE0olLRuTCq4w4C6Mbopo9GltFsVpmxQN1pJ2MkjcSMESrsgYdd2w8rGkrCA8GjFVintzPH878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cphrgf9Au4Tz4GAcKM6HT1DjCeIEbhPvCq20tgK/SFLNGReFwVkK/QDRWrIWB9YcXuHg5nHE3pjJzHOoT3kzGj61d32thWrETkS77ErdQ9oorU5EN6+QsC8eebSxDiFoNxHtus0lFwPHE1vGxHa1xLjBIh719PbSnbMKt7i6FDm0aAicZKYxIB4o+nXBst9XvUeVT2Zh/2K5M96x1ZiYiOfh+TS8IaV9qvpJmPdmdl2SeqG3rmdmFUHfU4kk6ViXphIf8ubXerqAqvThnLmWgWXGSbaH2OnvDWmVG6QhDhOTFMwwi2THC6sDtVMZAENebea7daJ7AAX/nUzprP98XqEM9QtoI0RUyjRqS2zg/Kxsp2YAFhYfnhMTeo3d5RQOsalLtcrms1//TyUbJOo0HUAAAAASUVORK5CYII=",Dr=re.memo(({onClick:e})=>{const t=n=>{(n.key==="Enter"||n.key===" ")&&(n.preventDefault(),e())};return I.jsx("button",{className:"chat-button",onClick:e,onKeyDown:t,"aria-label":"Open chat",title:"Open chat support",type:"button",children:I.jsx("img",{src:Ur,width:56,height:56,alt:"Ask AI"})})});function at(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function n(s){return r=>{const a=typeof r=="function"?r(s):r,o={...s,...a};return Object.assign(o,{extend:n(o)})}}return Object.assign(t,{extend:n(t)})}const os="2.45.1";let vn={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:n})=>t?`${e??"https://viem.sh"}${t}${n?`#${n}`:""}`:void 0,version:`viem@${os}`};class fe extends Error{constructor(t,n={}){const s=n.cause instanceof fe?n.cause.details:n.cause?.message?n.cause.message:n.details,r=n.cause instanceof fe&&n.cause.docsPath||n.docsPath,a=vn.getDocsUrl?.({...n,docsPath:r}),o=[t||"An error occurred.","",...n.metaMessages?[...n.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...s?[`Details: ${s}`]:[],...vn.version?[`Version: ${vn.version}`]:[]].join(`
3
- `);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=os}walk(t){return as(this,t)}}function as(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?as(e.cause,t):t?null:e}class An extends fe{constructor({max:t,min:n,signed:s,size:r,value:a}){super(`Number "${a}" is not in safe ${r?`${r*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Fr extends fe{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Ct(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ve(e){return Ct(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function tn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,s=0;for(let r=0;r<n.length-1&&n[t==="left"?r:n.length-r-1].toString()==="0";r++)s++;return n=t==="left"?n.slice(s):n.slice(0,n.length-s),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}class is extends fe{constructor({offset:t,position:n,size:s}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${s}).`,{name:"SliceOffsetOutOfBoundsError"})}}class cs extends fe{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Bt(e,{dir:t,size:n=32}={}){return typeof e=="string"?ht(e,{dir:t,size:n}):Mr(e,{dir:t,size:n})}function ht(e,{dir:t,size:n=32}={}){if(n===null)return e;const s=e.replace("0x","");if(s.length>n*2)throw new cs({size:Math.ceil(s.length/2),targetSize:n,type:"hex"});return`0x${s[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Mr(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new cs({size:e.length,targetSize:n,type:"bytes"});const s=new Uint8Array(n);for(let r=0;r<n;r++){const a=t==="right";s[a?r:n-r-1]=e[a?r:e.length-r-1]}return s}const _r=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Pt(e,t={}){return typeof e=="number"||typeof e=="bigint"?le(e,t):typeof e=="string"?ds(e,t):typeof e=="boolean"?ls(e,t):it(e,t)}function ls(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Nt(n,{size:t.size}),Bt(n,{size:t.size})):n}function it(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=_r[e[r]];const s=`0x${n}`;return typeof t.size=="number"?(Nt(s,{size:t.size}),Bt(s,{dir:"right",size:t.size})):s}function le(e,t={}){const{signed:n,size:s}=t,r=BigInt(e);let a;s?n?a=(1n<<BigInt(s)*8n-1n)-1n:a=2n**(BigInt(s)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&r>a||r<o){const T=typeof e=="bigint"?"n":"";throw new An({max:a?`${a}${T}`:void 0,min:`${o}${T}`,signed:n,size:s,value:`${e}${T}`})}const c=`0x${(n&&r<0?(1n<<BigInt(s*8))+BigInt(r):r).toString(16)}`;return s?Bt(c,{size:s}):c}const Lr=new TextEncoder;function ds(e,t={}){const n=Lr.encode(e);return it(n,t)}const Hr=new TextEncoder;function kn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Vr(e,t):typeof e=="boolean"?Rr(e,t):Ct(e)?vt(e,t):fs(e,t)}function Rr(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Nt(n,{size:t.size}),Bt(n,{size:t.size})):n}const ct={zero:48,nine:57,A:65,F:70,a:97,f:102};function us(e){if(e>=ct.zero&&e<=ct.nine)return e-ct.zero;if(e>=ct.A&&e<=ct.F)return e-(ct.A-10);if(e>=ct.a&&e<=ct.f)return e-(ct.a-10)}function vt(e,t={}){let n=e;t.size&&(Nt(n,{size:t.size}),n=Bt(n,{dir:"right",size:t.size}));let s=n.slice(2);s.length%2&&(s=`0${s}`);const r=s.length/2,a=new Uint8Array(r);for(let o=0,c=0;o<r;o++){const T=us(s.charCodeAt(c++)),C=us(s.charCodeAt(c++));if(T===void 0||C===void 0)throw new fe(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);a[o]=T*16+C}return a}function Vr(e,t){const n=le(e,t);return vt(n)}function fs(e,t={}){const n=Hr.encode(e);return typeof t.size=="number"?(Nt(n,{size:t.size}),Bt(n,{dir:"right",size:t.size})):n}function Nt(e,{size:t}){if(Ve(e)>t)throw new Fr({givenSize:Ve(e),maxSize:t})}function Ot(e,t={}){const{signed:n}=t;t.size&&Nt(e,{size:t.size});const s=BigInt(e);if(!n)return s;const r=(e.length-2)/2,a=(1n<<BigInt(r)*8n-1n)-1n;return s<=a?s:s-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function nn(e,t={}){const n=Ot(e,t),s=Number(n);if(!Number.isSafeInteger(s))throw new An({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return s}function xn(e,t){return({exclude:n,format:s})=>({exclude:n,format:(r,a)=>{const o=t(r,a);if(n)for(const c of n)delete o[c];return{...o,...s(r,a)}},type:e})}const ps={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Tn(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?nn(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?nn(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ps[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Gr(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Wr=xn("transaction",Tn);function Gr(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function zr(e,t){const n=(e.transactions??[]).map(s=>typeof s=="string"?s:Tn(s));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Yr=xn("block",zr);function jr(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const qr={"0x0":"reverted","0x1":"success"};function Jr(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(s=>jr(s)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?nn(e.transactionIndex):null,status:e.status?qr[e.status]:null,type:e.type?ps[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Xr=xn("transactionReceipt",Jr),Kr={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Zr(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Qr(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(s=>it(s)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=le(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=le(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=le(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=le(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=le(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=le(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Kr[e.type]),typeof e.value<"u"&&(n.value=le(e.value)),n}function Qr(e){return e.map(t=>({address:t.address,r:t.r?le(BigInt(t.r)):t.r,s:t.s?le(BigInt(t.s)):t.s,chainId:le(t.chainId),nonce:le(t.nonce),...typeof t.yParity<"u"?{yParity:le(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:le(t.v)}:{}}))}const Ut=2n**256n-1n;function Dt(e){return typeof e[0]=="string"?At(e):$r(e)}function $r(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.length;return n}function At(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class hs extends fe{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class eo extends fe{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class to extends fe{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const no={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new to({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new eo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new hs({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new hs({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ms(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(no);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function kt(e,t="hex"){const n=gs(e),s=ms(new Uint8Array(n.length));return n.encode(s),t==="hex"?it(s.bytes):s.bytes}function gs(e){return Array.isArray(e)?so(e.map(t=>gs(t))):ro(e)}function so(e){const t=e.reduce((r,a)=>r+a.length,0),n=bs(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),n===1?r.pushUint8(t):n===2?r.pushUint16(t):n===3?r.pushUint24(t):r.pushUint32(t));for(const{encode:a}of e)a(r)}}}function ro(e){const t=typeof e=="string"?vt(e):e,n=bs(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(r){t.length===1&&t[0]<128?r.pushBytes(t):t.length<=55?(r.pushByte(128+t.length),r.pushBytes(t)):(r.pushByte(183+n),n===1?r.pushUint8(t.length):n===2?r.pushUint16(t.length):n===3?r.pushUint24(t.length):r.pushUint32(t.length),r.pushBytes(t))}}}function bs(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new fe("Length is too large.")}const oo={gwei:9,wei:18},ao={ether:-9,wei:9};function Ue(e,t){let n=e.toString();const s=n.startsWith("-");s&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${s?"-":""}${r||"0"}${a?`.${a}`:""}`}function io(e,t="wei"){return Ue(e,oo[t])}function xt(e,t="wei"){return Ue(e,ao[t])}function ws(e){const t=Object.entries(e).map(([s,r])=>r===void 0||r===!1?null:[s,r]).filter(Boolean),n=t.reduce((s,[r])=>Math.max(s,r.length),0);return t.map(([s,r])=>` ${`${s}:`.padEnd(n+1)} ${r}`).join(`
4
- `)}class co extends fe{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class lo extends fe{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ws(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class uo extends fe{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function fo(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:s,nonce:r,...a}=n,o=n.address;t.push([s?Pt(s):"0x",o,r?Pt(r):"0x",...Wt({},a)])}return t}function ys(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),s=typeof e.blobs[0]=="string"?e.blobs.map(a=>vt(a)):e.blobs,r=[];for(const a of s)r.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?r:r.map(a=>it(a))}function vs(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),s=typeof e.blobs[0]=="string"?e.blobs.map(o=>vt(o)):e.blobs,r=typeof e.commitments[0]=="string"?e.commitments.map(o=>vt(o)):e.commitments,a=[];for(let o=0;o<s.length;o++){const c=s[o],T=r[o];a.push(Uint8Array.from(t.computeBlobKzgProof(c,T)))}return n==="bytes"?a:a.map(o=>it(o))}function po(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function As(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Lt(e,...t){if(!po(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function sn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ks(e,t){Lt(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function ho(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Ht(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function En(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function nt(e,t){return e<<32-t|e>>>t}const mo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function go(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function bo(e){for(let t=0;t<e.length;t++)e[t]=go(e[t]);return e}const xs=mo?e=>e:bo;function wo(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Sn(e){return typeof e=="string"&&(e=wo(e)),Lt(e),e}class Ts{}function Es(e){const t=s=>e().update(Sn(s)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function yo(e,t,n,s){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,s);const r=BigInt(32),a=BigInt(4294967295),o=Number(n>>r&a),c=Number(n&a),T=s?4:0,C=s?0:4;e.setUint32(t+T,o,s),e.setUint32(t+C,c,s)}function vo(e,t,n){return e&t^~e&n}function Ao(e,t,n){return e&t^e&n^t&n}class ko extends Ts{constructor(t,n,s,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=r,this.buffer=new Uint8Array(t),this.view=En(this.buffer)}update(t){sn(this),t=Sn(t),Lt(t);const{view:n,buffer:s,blockLen:r}=this,a=t.length;for(let o=0;o<a;){const c=Math.min(r-this.pos,a-o);if(c===r){const T=En(t);for(;r<=a-o;o+=r)this.process(T,o);continue}s.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){sn(this),ks(t,this),this.finished=!0;const{buffer:n,view:s,blockLen:r,isLE:a}=this;let{pos:o}=this;n[o++]=128,Ht(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(s,0),o=0);for(let L=o;L<r;L++)n[L]=0;yo(s,r-8,BigInt(this.length*8),a),this.process(s,0);const c=En(t),T=this.outputLen;if(T%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const C=T/4,N=this.get();if(C>N.length)throw new Error("_sha2: outputLen bigger than state");for(let L=0;L<C;L++)c.setUint32(4*L,N[L],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:s,length:r,finished:a,destroyed:o,pos:c}=this;return t.destroyed=o,t.finished=a,t.length=r,t.pos=c,r%n&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const mt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rn=BigInt(2**32-1),Ss=BigInt(32);function xo(e,t=!1){return t?{h:Number(e&rn),l:Number(e>>Ss&rn)}:{h:Number(e>>Ss&rn)|0,l:Number(e&rn)|0}}function To(e,t=!1){const n=e.length;let s=new Uint32Array(n),r=new Uint32Array(n);for(let a=0;a<n;a++){const{h:o,l:c}=xo(e[a],t);[s[a],r[a]]=[o,c]}return[s,r]}const Eo=(e,t,n)=>e<<n|t>>>32-n,So=(e,t,n)=>t<<n|e>>>32-n,Io=(e,t,n)=>t<<n-32|e>>>64-n,Co=(e,t,n)=>e<<n-32|t>>>64-n,Bo=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gt=new Uint32Array(64);class Po extends ko{constructor(t=32){super(64,t,8,!1),this.A=mt[0]|0,this.B=mt[1]|0,this.C=mt[2]|0,this.D=mt[3]|0,this.E=mt[4]|0,this.F=mt[5]|0,this.G=mt[6]|0,this.H=mt[7]|0}get(){const{A:t,B:n,C:s,D:r,E:a,F:o,G:c,H:T}=this;return[t,n,s,r,a,o,c,T]}set(t,n,s,r,a,o,c,T){this.A=t|0,this.B=n|0,this.C=s|0,this.D=r|0,this.E=a|0,this.F=o|0,this.G=c|0,this.H=T|0}process(t,n){for(let L=0;L<16;L++,n+=4)gt[L]=t.getUint32(n,!1);for(let L=16;L<64;L++){const m=gt[L-15],k=gt[L-2],x=nt(m,7)^nt(m,18)^m>>>3,g=nt(k,17)^nt(k,19)^k>>>10;gt[L]=g+gt[L-7]+x+gt[L-16]|0}let{A:s,B:r,C:a,D:o,E:c,F:T,G:C,H:N}=this;for(let L=0;L<64;L++){const m=nt(c,6)^nt(c,11)^nt(c,25),k=N+m+vo(c,T,C)+Bo[L]+gt[L]|0,g=(nt(s,2)^nt(s,13)^nt(s,22))+Ao(s,r,a)|0;N=C,C=T,T=c,c=o+k|0,o=a,a=r,r=s,s=k+g|0}s=s+this.A|0,r=r+this.B|0,a=a+this.C|0,o=o+this.D|0,c=c+this.E|0,T=T+this.F|0,C=C+this.G|0,N=N+this.H|0,this.set(s,r,a,o,c,T,C,N)}roundClean(){Ht(gt)}destroy(){this.set(0,0,0,0,0,0,0,0),Ht(this.buffer)}}const No=Es(()=>new Po);function Oo(e,t){return No(Ct(e,{strict:!1})?kn(e):e)}function Uo(e){const{commitment:t,version:n=1}=e,s=e.to??(typeof t=="string"?"hex":"bytes"),r=Oo(t);return r.set([n],0),s==="bytes"?r:it(r)}function Do(e){const{commitments:t,version:n}=e,s=e.to??(typeof t[0]=="string"?"hex":"bytes"),r=[];for(const a of t)r.push(Uo({commitment:a,to:s,version:n}));return r}const Is=6,Cs=32,In=4096,Bs=Cs*In,Ps=Bs*Is-1-1*In*Is,Ns=1;class Fo extends fe{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Os extends fe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Mo extends fe{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class _o extends fe{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Ns}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Lo(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?vt(e.data):e.data,s=Ve(n);if(!s)throw new Os;if(s>Ps)throw new Fo({maxSize:Ps,size:s});const r=[];let a=!0,o=0;for(;a;){const c=ms(new Uint8Array(Bs));let T=0;for(;T<In;){const C=n.slice(o,o+(Cs-1));if(c.pushByte(0),c.pushBytes(C),C.length<31){c.pushByte(128),a=!1;break}T++,o+=31}r.push(c)}return t==="bytes"?r.map(c=>c.bytes):r.map(c=>it(c.bytes))}function Ho(e){const{data:t,kzg:n,to:s}=e,r=e.blobs??Lo({data:t,to:s}),a=e.commitments??ys({blobs:r,kzg:n,to:s}),o=e.proofs??vs({blobs:r,commitments:a,kzg:n,to:s}),c=[];for(let T=0;T<r.length;T++)c.push({blob:r[T],commitment:a[T],proof:o[T]});return c}class st extends fe{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class on extends fe{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class Ft extends fe{constructor({cause:t,message:n}={}){const s=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${s?`with reason: ${s}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Ft,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Ft,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Tt extends fe{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${xt(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Tt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Cn extends fe{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${xt(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Cn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Bn extends fe{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Bn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Pn extends fe{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
3
+ `);super(o,n.cause?{cause:n.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=s,this.docsPath=r,this.metaMessages=n.metaMessages,this.name=n.name??this.name,this.shortMessage=t,this.version=os}walk(t){return as(this,t)}}function as(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?as(e.cause,t):t?null:e}class An extends fe{constructor({max:t,min:n,signed:s,size:r,value:a}){super(`Number "${a}" is not in safe ${r?`${r*8}-bit ${s?"signed":"unsigned"} `:""}integer range ${t?`(${n} to ${t})`:`(above ${n})`}`,{name:"IntegerOutOfRangeError"})}}class Fr extends fe{constructor({givenSize:t,maxSize:n}){super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}function Bt(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Ve(e){return Bt(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function tn(e,{dir:t="left"}={}){let n=typeof e=="string"?e.replace("0x",""):e,s=0;for(let r=0;r<n.length-1&&n[t==="left"?r:n.length-r-1].toString()==="0";r++)s++;return n=t==="left"?n.slice(s):n.slice(0,n.length-s),typeof e=="string"?(n.length===1&&t==="right"&&(n=`${n}0`),`0x${n.length%2===1?`0${n}`:n}`):n}class is extends fe{constructor({offset:t,position:n,size:s}){super(`Slice ${n==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${s}).`,{name:"SliceOffsetOutOfBoundsError"})}}class cs extends fe{constructor({size:t,targetSize:n,type:s}){super(`${s.charAt(0).toUpperCase()}${s.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`,{name:"SizeExceedsPaddingSizeError"})}}function Pt(e,{dir:t,size:n=32}={}){return typeof e=="string"?ht(e,{dir:t,size:n}):Mr(e,{dir:t,size:n})}function ht(e,{dir:t,size:n=32}={}){if(n===null)return e;const s=e.replace("0x","");if(s.length>n*2)throw new cs({size:Math.ceil(s.length/2),targetSize:n,type:"hex"});return`0x${s[t==="right"?"padEnd":"padStart"](n*2,"0")}`}function Mr(e,{dir:t,size:n=32}={}){if(n===null)return e;if(e.length>n)throw new cs({size:e.length,targetSize:n,type:"bytes"});const s=new Uint8Array(n);for(let r=0;r<n;r++){const a=t==="right";s[a?r:n-r-1]=e[a?r:e.length-r-1]}return s}const _r=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Nt(e,t={}){return typeof e=="number"||typeof e=="bigint"?le(e,t):typeof e=="string"?ds(e,t):typeof e=="boolean"?ls(e,t):it(e,t)}function ls(e,t={}){const n=`0x${Number(e)}`;return typeof t.size=="number"?(Ot(n,{size:t.size}),Pt(n,{size:t.size})):n}function it(e,t={}){let n="";for(let r=0;r<e.length;r++)n+=_r[e[r]];const s=`0x${n}`;return typeof t.size=="number"?(Ot(s,{size:t.size}),Pt(s,{dir:"right",size:t.size})):s}function le(e,t={}){const{signed:n,size:s}=t,r=BigInt(e);let a;s?n?a=(1n<<BigInt(s)*8n-1n)-1n:a=2n**(BigInt(s)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));const o=typeof a=="bigint"&&n?-a-1n:0;if(a&&r>a||r<o){const T=typeof e=="bigint"?"n":"";throw new An({max:a?`${a}${T}`:void 0,min:`${o}${T}`,signed:n,size:s,value:`${e}${T}`})}const c=`0x${(n&&r<0?(1n<<BigInt(s*8))+BigInt(r):r).toString(16)}`;return s?Pt(c,{size:s}):c}const Lr=new TextEncoder;function ds(e,t={}){const n=Lr.encode(e);return it(n,t)}const Hr=new TextEncoder;function kn(e,t={}){return typeof e=="number"||typeof e=="bigint"?Vr(e,t):typeof e=="boolean"?Rr(e,t):Bt(e)?At(e,t):fs(e,t)}function Rr(e,t={}){const n=new Uint8Array(1);return n[0]=Number(e),typeof t.size=="number"?(Ot(n,{size:t.size}),Pt(n,{size:t.size})):n}const ct={zero:48,nine:57,A:65,F:70,a:97,f:102};function us(e){if(e>=ct.zero&&e<=ct.nine)return e-ct.zero;if(e>=ct.A&&e<=ct.F)return e-(ct.A-10);if(e>=ct.a&&e<=ct.f)return e-(ct.a-10)}function At(e,t={}){let n=e;t.size&&(Ot(n,{size:t.size}),n=Pt(n,{dir:"right",size:t.size}));let s=n.slice(2);s.length%2&&(s=`0${s}`);const r=s.length/2,a=new Uint8Array(r);for(let o=0,c=0;o<r;o++){const T=us(s.charCodeAt(c++)),C=us(s.charCodeAt(c++));if(T===void 0||C===void 0)throw new fe(`Invalid byte sequence ("${s[c-2]}${s[c-1]}" in "${s}").`);a[o]=T*16+C}return a}function Vr(e,t){const n=le(e,t);return At(n)}function fs(e,t={}){const n=Hr.encode(e);return typeof t.size=="number"?(Ot(n,{size:t.size}),Pt(n,{dir:"right",size:t.size})):n}function Ot(e,{size:t}){if(Ve(e)>t)throw new Fr({givenSize:Ve(e),maxSize:t})}function Ut(e,t={}){const{signed:n}=t;t.size&&Ot(e,{size:t.size});const s=BigInt(e);if(!n)return s;const r=(e.length-2)/2,a=(1n<<BigInt(r)*8n-1n)-1n;return s<=a?s:s-BigInt(`0x${"f".padStart(r*2,"f")}`)-1n}function nn(e,t={}){const n=Ut(e,t),s=Number(n);if(!Number.isSafeInteger(s))throw new An({max:`${Number.MAX_SAFE_INTEGER}`,min:`${Number.MIN_SAFE_INTEGER}`,signed:t.signed,size:t.size,value:`${n}n`});return s}function xn(e,t){return({exclude:n,format:s})=>({exclude:n,format:(r,a)=>{const o=t(r,a);if(n)for(const c of n)delete o[c];return{...o,...s(r,a)}},type:e})}const ps={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function Tn(e,t){const n={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?nn(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?nn(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ps[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return e.authorizationList&&(n.authorizationList=Gr(e.authorizationList)),n.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof n.v=="bigint"){if(n.v===0n||n.v===27n)return 0;if(n.v===1n||n.v===28n)return 1;if(n.v>=35n)return n.v%2n===0n?1:0}})(),n.type==="legacy"&&(delete n.accessList,delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.yParity),n.type==="eip2930"&&(delete n.maxFeePerBlobGas,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas),n.type==="eip1559"&&delete n.maxFeePerBlobGas,n}const Wr=xn("transaction",Tn);function Gr(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function zr(e,t){const n=(e.transactions??[]).map(s=>typeof s=="string"?s:Tn(s));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:n,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}const Yr=xn("block",zr);function jr(e,{args:t,eventName:n}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...n?{args:t,eventName:n}:{}}}const qr={"0x0":"reverted","0x1":"success"};function Jr(e,t){const n={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(s=>jr(s)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?nn(e.transactionIndex):null,status:e.status?qr[e.status]:null,type:e.type?ps[e.type]||e.type:null};return e.blobGasPrice&&(n.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(n.blobGasUsed=BigInt(e.blobGasUsed)),n}const Xr=xn("transactionReceipt",Jr),Kr={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Zr(e,t){const n={};return typeof e.authorizationList<"u"&&(n.authorizationList=Qr(e.authorizationList)),typeof e.accessList<"u"&&(n.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(n.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?n.blobs=e.blobs.map(s=>it(s)):n.blobs=e.blobs),typeof e.data<"u"&&(n.data=e.data),e.account&&(n.from=e.account.address),typeof e.from<"u"&&(n.from=e.from),typeof e.gas<"u"&&(n.gas=le(e.gas)),typeof e.gasPrice<"u"&&(n.gasPrice=le(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(n.maxFeePerBlobGas=le(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(n.maxFeePerGas=le(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(n.maxPriorityFeePerGas=le(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(n.nonce=le(e.nonce)),typeof e.to<"u"&&(n.to=e.to),typeof e.type<"u"&&(n.type=Kr[e.type]),typeof e.value<"u"&&(n.value=le(e.value)),n}function Qr(e){return e.map(t=>({address:t.address,r:t.r?le(BigInt(t.r)):t.r,s:t.s?le(BigInt(t.s)):t.s,chainId:le(t.chainId),nonce:le(t.nonce),...typeof t.yParity<"u"?{yParity:le(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:le(t.v)}:{}}))}const Dt=2n**256n-1n;function Ft(e){return typeof e[0]=="string"?kt(e):$r(e)}function $r(e){let t=0;for(const r of e)t+=r.length;const n=new Uint8Array(t);let s=0;for(const r of e)n.set(r,s),s+=r.length;return n}function kt(e){return`0x${e.reduce((t,n)=>t+n.replace("0x",""),"")}`}class hs extends fe{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}}class eo extends fe{constructor({length:t,position:n}){super(`Position \`${n}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}}class to extends fe{constructor({count:t,limit:n}){super(`Recursive read limit of \`${n}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}}const no={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new to({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new eo({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new hs({offset:e});const t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new hs({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const n=t??this.position;return this.assertPosition(n+e-1),this.bytes.subarray(n,n+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const n=this.inspectBytes(e);return this.position+=t??e,n},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function ms(e,{recursiveReadLimit:t=8192}={}){const n=Object.create(no);return n.bytes=e,n.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),n.positionReadCount=new Map,n.recursiveReadLimit=t,n}function xt(e,t="hex"){const n=gs(e),s=ms(new Uint8Array(n.length));return n.encode(s),t==="hex"?it(s.bytes):s.bytes}function gs(e){return Array.isArray(e)?so(e.map(t=>gs(t))):ro(e)}function so(e){const t=e.reduce((r,a)=>r+a.length,0),n=bs(t);return{length:t<=55?1+t:1+n+t,encode(r){t<=55?r.pushByte(192+t):(r.pushByte(247+n),n===1?r.pushUint8(t):n===2?r.pushUint16(t):n===3?r.pushUint24(t):r.pushUint32(t));for(const{encode:a}of e)a(r)}}}function ro(e){const t=typeof e=="string"?At(e):e,n=bs(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+n+t.length,encode(r){t.length===1&&t[0]<128?r.pushBytes(t):t.length<=55?(r.pushByte(128+t.length),r.pushBytes(t)):(r.pushByte(183+n),n===1?r.pushUint8(t.length):n===2?r.pushUint16(t.length):n===3?r.pushUint24(t.length):r.pushUint32(t.length),r.pushBytes(t))}}}function bs(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new fe("Length is too large.")}const oo={gwei:9,wei:18},ao={ether:-9,wei:9};function Ue(e,t){let n=e.toString();const s=n.startsWith("-");s&&(n=n.slice(1)),n=n.padStart(t,"0");let[r,a]=[n.slice(0,n.length-t),n.slice(n.length-t)];return a=a.replace(/(0+)$/,""),`${s?"-":""}${r||"0"}${a?`.${a}`:""}`}function io(e,t="wei"){return Ue(e,oo[t])}function Tt(e,t="wei"){return Ue(e,ao[t])}function ws(e){const t=Object.entries(e).map(([s,r])=>r===void 0||r===!1?null:[s,r]).filter(Boolean),n=t.reduce((s,[r])=>Math.max(s,r.length),0);return t.map(([s,r])=>` ${`${s}:`.padEnd(n+1)} ${r}`).join(`
4
+ `)}class co extends fe{constructor({v:t}){super(`Invalid \`v\` value "${t}". Expected 27 or 28.`,{name:"InvalidLegacyVError"})}}class lo extends fe{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",ws(t),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class uo extends fe{constructor({storageKey:t}){super(`Size for storage key "${t}" is invalid. Expected 32 bytes. Got ${Math.floor((t.length-2)/2)} bytes.`,{name:"InvalidStorageKeySizeError"})}}function fo(e){if(!e||e.length===0)return[];const t=[];for(const n of e){const{chainId:s,nonce:r,...a}=n,o=n.address;t.push([s?Nt(s):"0x",o,r?Nt(r):"0x",...Gt({},a)])}return t}function ys(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),s=typeof e.blobs[0]=="string"?e.blobs.map(a=>At(a)):e.blobs,r=[];for(const a of s)r.push(Uint8Array.from(t.blobToKzgCommitment(a)));return n==="bytes"?r:r.map(a=>it(a))}function vs(e){const{kzg:t}=e,n=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),s=typeof e.blobs[0]=="string"?e.blobs.map(o=>At(o)):e.blobs,r=typeof e.commitments[0]=="string"?e.commitments.map(o=>At(o)):e.commitments,a=[];for(let o=0;o<s.length;o++){const c=s[o],T=r[o];a.push(Uint8Array.from(t.computeBlobKzgProof(c,T)))}return n==="bytes"?a:a.map(o=>it(o))}function po(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function As(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ht(e,...t){if(!po(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function sn(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function ks(e,t){Ht(e);const n=t.outputLen;if(e.length<n)throw new Error("digestInto() expects output buffer of length at least "+n)}function ho(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Rt(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function En(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function nt(e,t){return e<<32-t|e>>>t}const mo=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function go(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function bo(e){for(let t=0;t<e.length;t++)e[t]=go(e[t]);return e}const xs=mo?e=>e:bo;function wo(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Sn(e){return typeof e=="string"&&(e=wo(e)),Ht(e),e}class Ts{}function Es(e){const t=s=>e().update(Sn(s)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t}function yo(e,t,n,s){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,n,s);const r=BigInt(32),a=BigInt(4294967295),o=Number(n>>r&a),c=Number(n&a),T=s?4:0,C=s?0:4;e.setUint32(t+T,o,s),e.setUint32(t+C,c,s)}function vo(e,t,n){return e&t^~e&n}function Ao(e,t,n){return e&t^e&n^t&n}class ko extends Ts{constructor(t,n,s,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=r,this.buffer=new Uint8Array(t),this.view=En(this.buffer)}update(t){sn(this),t=Sn(t),Ht(t);const{view:n,buffer:s,blockLen:r}=this,a=t.length;for(let o=0;o<a;){const c=Math.min(r-this.pos,a-o);if(c===r){const T=En(t);for(;r<=a-o;o+=r)this.process(T,o);continue}s.set(t.subarray(o,o+c),this.pos),this.pos+=c,o+=c,this.pos===r&&(this.process(n,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){sn(this),ks(t,this),this.finished=!0;const{buffer:n,view:s,blockLen:r,isLE:a}=this;let{pos:o}=this;n[o++]=128,Rt(this.buffer.subarray(o)),this.padOffset>r-o&&(this.process(s,0),o=0);for(let L=o;L<r;L++)n[L]=0;yo(s,r-8,BigInt(this.length*8),a),this.process(s,0);const c=En(t),T=this.outputLen;if(T%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const C=T/4,N=this.get();if(C>N.length)throw new Error("_sha2: outputLen bigger than state");for(let L=0;L<C;L++)c.setUint32(4*L,N[L],a)}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:n,buffer:s,length:r,finished:a,destroyed:o,pos:c}=this;return t.destroyed=o,t.finished=a,t.length=r,t.pos=c,r%n&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const mt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),rn=BigInt(2**32-1),Ss=BigInt(32);function xo(e,t=!1){return t?{h:Number(e&rn),l:Number(e>>Ss&rn)}:{h:Number(e>>Ss&rn)|0,l:Number(e&rn)|0}}function To(e,t=!1){const n=e.length;let s=new Uint32Array(n),r=new Uint32Array(n);for(let a=0;a<n;a++){const{h:o,l:c}=xo(e[a],t);[s[a],r[a]]=[o,c]}return[s,r]}const Eo=(e,t,n)=>e<<n|t>>>32-n,So=(e,t,n)=>t<<n|e>>>32-n,Io=(e,t,n)=>t<<n-32|e>>>64-n,Co=(e,t,n)=>e<<n-32|t>>>64-n,Bo=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gt=new Uint32Array(64);class Po extends ko{constructor(t=32){super(64,t,8,!1),this.A=mt[0]|0,this.B=mt[1]|0,this.C=mt[2]|0,this.D=mt[3]|0,this.E=mt[4]|0,this.F=mt[5]|0,this.G=mt[6]|0,this.H=mt[7]|0}get(){const{A:t,B:n,C:s,D:r,E:a,F:o,G:c,H:T}=this;return[t,n,s,r,a,o,c,T]}set(t,n,s,r,a,o,c,T){this.A=t|0,this.B=n|0,this.C=s|0,this.D=r|0,this.E=a|0,this.F=o|0,this.G=c|0,this.H=T|0}process(t,n){for(let L=0;L<16;L++,n+=4)gt[L]=t.getUint32(n,!1);for(let L=16;L<64;L++){const m=gt[L-15],k=gt[L-2],x=nt(m,7)^nt(m,18)^m>>>3,g=nt(k,17)^nt(k,19)^k>>>10;gt[L]=g+gt[L-7]+x+gt[L-16]|0}let{A:s,B:r,C:a,D:o,E:c,F:T,G:C,H:N}=this;for(let L=0;L<64;L++){const m=nt(c,6)^nt(c,11)^nt(c,25),k=N+m+vo(c,T,C)+Bo[L]+gt[L]|0,g=(nt(s,2)^nt(s,13)^nt(s,22))+Ao(s,r,a)|0;N=C,C=T,T=c,c=o+k|0,o=a,a=r,r=s,s=k+g|0}s=s+this.A|0,r=r+this.B|0,a=a+this.C|0,o=o+this.D|0,c=c+this.E|0,T=T+this.F|0,C=C+this.G|0,N=N+this.H|0,this.set(s,r,a,o,c,T,C,N)}roundClean(){Rt(gt)}destroy(){this.set(0,0,0,0,0,0,0,0),Rt(this.buffer)}}const No=Es(()=>new Po);function Oo(e,t){return No(Bt(e,{strict:!1})?kn(e):e)}function Uo(e){const{commitment:t,version:n=1}=e,s=e.to??(typeof t=="string"?"hex":"bytes"),r=Oo(t);return r.set([n],0),s==="bytes"?r:it(r)}function Do(e){const{commitments:t,version:n}=e,s=e.to??(typeof t[0]=="string"?"hex":"bytes"),r=[];for(const a of t)r.push(Uo({commitment:a,to:s,version:n}));return r}const Is=6,Cs=32,In=4096,Bs=Cs*In,Ps=Bs*Is-1-1*In*Is,Ns=1;class Fo extends fe{constructor({maxSize:t,size:n}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${n} bytes`],name:"BlobSizeTooLargeError"})}}class Os extends fe{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}class Mo extends fe{constructor({hash:t,size:n}){super(`Versioned hash "${t}" size is invalid.`,{metaMessages:["Expected: 32",`Received: ${n}`],name:"InvalidVersionedHashSizeError"})}}class _o extends fe{constructor({hash:t,version:n}){super(`Versioned hash "${t}" version is invalid.`,{metaMessages:[`Expected: ${Ns}`,`Received: ${n}`],name:"InvalidVersionedHashVersionError"})}}function Lo(e){const t=e.to??(typeof e.data=="string"?"hex":"bytes"),n=typeof e.data=="string"?At(e.data):e.data,s=Ve(n);if(!s)throw new Os;if(s>Ps)throw new Fo({maxSize:Ps,size:s});const r=[];let a=!0,o=0;for(;a;){const c=ms(new Uint8Array(Bs));let T=0;for(;T<In;){const C=n.slice(o,o+(Cs-1));if(c.pushByte(0),c.pushBytes(C),C.length<31){c.pushByte(128),a=!1;break}T++,o+=31}r.push(c)}return t==="bytes"?r.map(c=>c.bytes):r.map(c=>it(c.bytes))}function Ho(e){const{data:t,kzg:n,to:s}=e,r=e.blobs??Lo({data:t,to:s}),a=e.commitments??ys({blobs:r,kzg:n,to:s}),o=e.proofs??vs({blobs:r,commitments:a,kzg:n,to:s}),c=[];for(let T=0;T<r.length;T++)c.push({blob:r[T],commitment:a[T],proof:o[T]});return c}class st extends fe{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}class on extends fe{constructor({chainId:t}){super(typeof t=="number"?`Chain ID "${t}" is invalid.`:"Chain ID is invalid.",{name:"InvalidChainIdError"})}}class Mt extends fe{constructor({cause:t,message:n}={}){const s=n?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${s?`with reason: ${s}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(Mt,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(Mt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class Et extends fe{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Tt(n)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(Et,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class Cn extends fe{constructor({cause:t,maxFeePerGas:n}={}){super(`The fee cap (\`maxFeePerGas\`${n?` = ${Tt(n)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(Cn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class Bn extends fe{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(Bn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class Pn extends fe{constructor({cause:t,nonce:n}={}){super([`Nonce provided for the transaction ${n?`(${n}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(`
5
5
  `),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(Pn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class Nn extends fe{constructor({cause:t,nonce:n}={}){super(`Nonce provided for the transaction ${n?`(${n}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(Nn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class On extends fe{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(`
6
- `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Un extends fe{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Un,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Dn extends fe{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Dn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Fn extends fe{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Fn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Rt extends fe{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:s}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${xt(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${s?` = ${xt(s)} gwei`:""}).`].join(`
7
- `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Rt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Us extends fe{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}class Ds extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}const Ro=BigInt(0),Vt=BigInt(1),Vo=BigInt(2),Wo=BigInt(7),Go=BigInt(256),zo=BigInt(113),Fs=[],Ms=[],_s=[];for(let e=0,t=Vt,n=1,s=0;e<24;e++){[n,s]=[s,(2*n+3*s)%5],Fs.push(2*(5*s+n)),Ms.push((e+1)*(e+2)/2%64);let r=Ro;for(let a=0;a<7;a++)t=(t<<Vt^(t>>Wo)*zo)%Go,t&Vo&&(r^=Vt<<(Vt<<BigInt(a))-Vt);_s.push(r)}const Ls=To(_s,!0),Yo=Ls[0],jo=Ls[1],Hs=(e,t,n)=>n>32?Io(e,t,n):Eo(e,t,n),Rs=(e,t,n)=>n>32?Co(e,t,n):So(e,t,n);function qo(e,t=24){const n=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const c=(o+8)%10,T=(o+2)%10,C=n[T],N=n[T+1],L=Hs(C,N,1)^n[c],m=Rs(C,N,1)^n[c+1];for(let k=0;k<50;k+=10)e[o+k]^=L,e[o+k+1]^=m}let r=e[2],a=e[3];for(let o=0;o<24;o++){const c=Ms[o],T=Hs(r,a,c),C=Rs(r,a,c),N=Fs[o];r=e[N],a=e[N+1],e[N]=T,e[N+1]=C}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)n[c]=e[o+c];for(let c=0;c<10;c++)e[o+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=Yo[s],e[1]^=jo[s]}Ht(n)}class Mn extends Ts{constructor(t,n,s,r=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=s,this.enableXOF=r,this.rounds=a,As(s),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=ho(this.state)}clone(){return this._cloneInto()}keccak(){xs(this.state32),qo(this.state32,this.rounds),xs(this.state32),this.posOut=0,this.pos=0}update(t){sn(this),t=Sn(t),Lt(t);const{blockLen:n,state:s}=this,r=t.length;for(let a=0;a<r;){const o=Math.min(n-this.pos,r-a);for(let c=0;c<o;c++)s[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:s,blockLen:r}=this;t[s]^=n,(n&128)!==0&&s===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){sn(this,!1),Lt(t),this.finish();const n=this.state,{blockLen:s}=this;for(let r=0,a=t.length;r<a;){this.posOut>=s&&this.keccak();const o=Math.min(s-this.posOut,a-r);t.set(n.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return As(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ks(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Ht(this.state)}_cloneInto(t){const{blockLen:n,suffix:s,outputLen:r,rounds:a,enableXOF:o}=this;return t||(t=new Mn(n,s,r,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=s,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Jo=(e,t,n)=>Es(()=>new Mn(t,e,n)),Xo=Jo(1,136,256/8);function Vs(e,t){const n=t||"hex",s=Xo(Ct(e,{strict:!1})?kn(e):e);return n==="bytes"?s:Pt(s)}const _n=new Ds(8192);function Ko(e,t){if(_n.has(`${e}.${t}`))return _n.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),s=Vs(fs(n),"bytes"),r=n.split("");for(let o=0;o<40;o+=2)s[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(s[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const a=`0x${r.join("")}`;return _n.set(`${e}.${t}`,a),a}const Zo=/^0x[a-fA-F0-9]{40}$/,Ln=new Ds(8192);function Re(e,t){const{strict:n=!0}=t??{},s=`${e}.${n}`;if(Ln.has(s))return Ln.get(s);const r=Zo.test(e)?e.toLowerCase()===e?!0:n?Ko(e)===e:!0:!1;return Ln.set(s,r),r}function Hn(e,t,n,{strict:s}={}){return Ct(e,{strict:!1})?$o(e,t,n,{strict:s}):Qo(e,t,n,{strict:s})}function Ws(e,t){if(typeof t=="number"&&t>0&&t>Ve(e)-1)throw new is({offset:t,position:"start",size:Ve(e)})}function Gs(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ve(e)!==n-t)throw new is({offset:n,position:"end",size:Ve(e)})}function Qo(e,t,n,{strict:s}={}){Ws(e,t);const r=e.slice(t,n);return s&&Gs(r,t,n),r}function $o(e,t,n,{strict:s}={}){Ws(e,t);const r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&Gs(r,t,n),r}function ea(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:s}=n,r=n.address;if(!Re(r))throw new st({address:r});if(s<0)throw new on({chainId:s})}Rn(e)}function ta(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Os;for(const n of t){const s=Ve(n),r=nn(Hn(n,0,1));if(s!==32)throw new Mo({hash:n,size:s});if(r!==Ns)throw new _o({hash:n,version:r})}}Rn(e)}function Rn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:s,to:r}=e;if(t<=0)throw new on({chainId:t});if(r&&!Re(r))throw new st({address:r});if(s&&s>Ut)throw new Tt({maxFeePerGas:s});if(n&&s&&n>s)throw new Rt({maxFeePerGas:s,maxPriorityFeePerGas:n})}function na(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:s,maxFeePerGas:r,to:a}=e;if(t<=0)throw new on({chainId:t});if(a&&!Re(a))throw new st({address:a});if(n||r)throw new fe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(s&&s>Ut)throw new Tt({maxFeePerGas:s})}function sa(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:s,maxFeePerGas:r,to:a}=e;if(a&&!Re(a))throw new st({address:a});if(typeof t<"u"&&t<=0)throw new on({chainId:t});if(n||r)throw new fe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(s&&s>Ut)throw new Tt({maxFeePerGas:s})}function ra(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new lo({transaction:e})}function an(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:s,storageKeys:r}=e[n];for(let a=0;a<r.length;a++)if(r[a].length-2!==64)throw new uo({storageKey:r[a]});if(!Re(s,{strict:!1}))throw new st({address:s});t.push([s,r])}return t}function oa(e,t){const n=ra(e);return n==="eip1559"?ca(e,t):n==="eip2930"?la(e,t):n==="eip4844"?ia(e,t):n==="eip7702"?aa(e,t):da(e,t)}function aa(e,t){const{authorizationList:n,chainId:s,gas:r,nonce:a,to:o,value:c,maxFeePerGas:T,maxPriorityFeePerGas:C,accessList:N,data:L}=e;ea(e);const m=an(N),k=fo(n);return At(["0x04",kt([le(s),a?le(a):"0x",C?le(C):"0x",T?le(T):"0x",r?le(r):"0x",o??"0x",c?le(c):"0x",L??"0x",m,k,...Wt(e,t)])])}function ia(e,t){const{chainId:n,gas:s,nonce:r,to:a,value:o,maxFeePerBlobGas:c,maxFeePerGas:T,maxPriorityFeePerGas:C,accessList:N,data:L}=e;ta(e);let m=e.blobVersionedHashes,k=e.sidecars;if(e.blobs&&(typeof m>"u"||typeof k>"u")){const Q=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(ge=>it(ge)),oe=e.kzg,ye=ys({blobs:Q,kzg:oe});if(typeof m>"u"&&(m=Do({commitments:ye})),typeof k>"u"){const ge=vs({blobs:Q,commitments:ye,kzg:oe});k=Ho({blobs:Q,commitments:ye,proofs:ge})}}const x=an(N),g=[le(n),r?le(r):"0x",C?le(C):"0x",T?le(T):"0x",s?le(s):"0x",a??"0x",o?le(o):"0x",L??"0x",x,c?le(c):"0x",m??[],...Wt(e,t)],B=[],ue=[],D=[];if(k)for(let Q=0;Q<k.length;Q++){const{blob:oe,commitment:ye,proof:ge}=k[Q];B.push(oe),ue.push(ye),D.push(ge)}return At(["0x03",kt(k?[g,B,ue,D]:g)])}function ca(e,t){const{chainId:n,gas:s,nonce:r,to:a,value:o,maxFeePerGas:c,maxPriorityFeePerGas:T,accessList:C,data:N}=e;Rn(e);const L=an(C),m=[le(n),r?le(r):"0x",T?le(T):"0x",c?le(c):"0x",s?le(s):"0x",a??"0x",o?le(o):"0x",N??"0x",L,...Wt(e,t)];return At(["0x02",kt(m)])}function la(e,t){const{chainId:n,gas:s,data:r,nonce:a,to:o,value:c,accessList:T,gasPrice:C}=e;na(e);const N=an(T),L=[le(n),a?le(a):"0x",C?le(C):"0x",s?le(s):"0x",o??"0x",c?le(c):"0x",r??"0x",N,...Wt(e,t)];return At(["0x01",kt(L)])}function da(e,t){const{chainId:n=0,gas:s,data:r,nonce:a,to:o,value:c,gasPrice:T}=e;sa(e);let C=[a?le(a):"0x",T?le(T):"0x",s?le(s):"0x",o??"0x",c?le(c):"0x",r??"0x"];if(t){const N=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const k=27n+(t.v===27n?0n:1n);if(t.v!==k)throw new co({v:t.v});return k})(),L=tn(t.r),m=tn(t.s);C=[...C,le(N),L==="0x00"?"0x":L,m==="0x00"?"0x":m]}else n>0&&(C=[...C,le(n),"0x","0x"]);return kt(C)}function Wt(e,t){const n=t??e,{v:s,yParity:r}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof r>"u")return[];const a=tn(n.r),o=tn(n.s);return[typeof r=="number"?r?le(1):"0x":s===0n?"0x":s===1n?le(1):s===27n?"0x":le(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}const ua={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},fa={block:Yr({format(e){return{transactions:e.transactions?.map(n=>{if(typeof n=="string")return n;const s=Tn(n);return s.typeHex==="0x7e"&&(s.isSystemTx=n.isSystemTx,s.mint=n.mint?Ot(n.mint):void 0,s.sourceHash=n.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Wr({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Ot(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Xr({format(e){return{l1GasPrice:e.l1GasPrice?Ot(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Ot(e.l1GasUsed):null,l1Fee:e.l1Fee?Ot(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function pa(e,t){return ga(e)?ma(e):oa(e,t)}const ha={transaction:pa};function ma(e){ba(e);const{sourceHash:t,data:n,from:s,gas:r,isSystemTx:a,mint:o,to:c,value:T}=e,C=[t,s,c??"0x",o?Pt(o):"0x",T?Pt(T):"0x",r?Pt(r):"0x",a?"0x1":"0x",n??"0x"];return At(["0x7e",kt(C)])}function ga(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function ba(e){const{from:t,to:n}=e;if(t&&!Re(t))throw new st({address:t});if(n&&!Re(n))throw new st({address:n})}const cn={blockTime:2e3,contracts:ua,formatters:fa,serializers:ha},wa=at({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),ya=at({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),Gt=1,zs=at({...cn,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...cn.contracts,disputeGameFactory:{[Gt]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[Gt]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[Gt]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[Gt]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:Gt});({...zs});const va=at({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}});function Vn(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Aa extends fe{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
6
+ `),{cause:t,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."],name:"InsufficientFundsError"})}}Object.defineProperty(On,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class Un extends fe{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(Un,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class Dn extends fe{constructor({cause:t,gas:n}={}){super(`The amount of gas ${n?`(${n}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(Dn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class Fn extends fe{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(Fn,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class Vt extends fe{constructor({cause:t,maxPriorityFeePerGas:n,maxFeePerGas:s}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${n?` = ${Tt(n)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${s?` = ${Tt(s)} gwei`:""}).`].join(`
7
+ `),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(Vt,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class Us extends fe{constructor({cause:t}){super(`An error occurred while executing: ${t?.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}class Ds extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const n=super.get(t);return super.has(t)&&n!==void 0&&(this.delete(t),super.set(t,n)),n}set(t,n){if(super.set(t,n),this.maxSize&&this.size>this.maxSize){const s=this.keys().next().value;s&&this.delete(s)}return this}}const Ro=BigInt(0),Wt=BigInt(1),Vo=BigInt(2),Wo=BigInt(7),Go=BigInt(256),zo=BigInt(113),Fs=[],Ms=[],_s=[];for(let e=0,t=Wt,n=1,s=0;e<24;e++){[n,s]=[s,(2*n+3*s)%5],Fs.push(2*(5*s+n)),Ms.push((e+1)*(e+2)/2%64);let r=Ro;for(let a=0;a<7;a++)t=(t<<Wt^(t>>Wo)*zo)%Go,t&Vo&&(r^=Wt<<(Wt<<BigInt(a))-Wt);_s.push(r)}const Ls=To(_s,!0),Yo=Ls[0],jo=Ls[1],Hs=(e,t,n)=>n>32?Io(e,t,n):Eo(e,t,n),Rs=(e,t,n)=>n>32?Co(e,t,n):So(e,t,n);function qo(e,t=24){const n=new Uint32Array(10);for(let s=24-t;s<24;s++){for(let o=0;o<10;o++)n[o]=e[o]^e[o+10]^e[o+20]^e[o+30]^e[o+40];for(let o=0;o<10;o+=2){const c=(o+8)%10,T=(o+2)%10,C=n[T],N=n[T+1],L=Hs(C,N,1)^n[c],m=Rs(C,N,1)^n[c+1];for(let k=0;k<50;k+=10)e[o+k]^=L,e[o+k+1]^=m}let r=e[2],a=e[3];for(let o=0;o<24;o++){const c=Ms[o],T=Hs(r,a,c),C=Rs(r,a,c),N=Fs[o];r=e[N],a=e[N+1],e[N]=T,e[N+1]=C}for(let o=0;o<50;o+=10){for(let c=0;c<10;c++)n[c]=e[o+c];for(let c=0;c<10;c++)e[o+c]^=~n[(c+2)%10]&n[(c+4)%10]}e[0]^=Yo[s],e[1]^=jo[s]}Rt(n)}class Mn extends Ts{constructor(t,n,s,r=!1,a=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=n,this.outputLen=s,this.enableXOF=r,this.rounds=a,As(s),!(0<t&&t<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=ho(this.state)}clone(){return this._cloneInto()}keccak(){xs(this.state32),qo(this.state32,this.rounds),xs(this.state32),this.posOut=0,this.pos=0}update(t){sn(this),t=Sn(t),Ht(t);const{blockLen:n,state:s}=this,r=t.length;for(let a=0;a<r;){const o=Math.min(n-this.pos,r-a);for(let c=0;c<o;c++)s[this.pos++]^=t[a++];this.pos===n&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:t,suffix:n,pos:s,blockLen:r}=this;t[s]^=n,(n&128)!==0&&s===r-1&&this.keccak(),t[r-1]^=128,this.keccak()}writeInto(t){sn(this,!1),Ht(t),this.finish();const n=this.state,{blockLen:s}=this;for(let r=0,a=t.length;r<a;){this.posOut>=s&&this.keccak();const o=Math.min(s-this.posOut,a-r);t.set(n.subarray(this.posOut,this.posOut+o),r),this.posOut+=o,r+=o}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return As(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(ks(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,Rt(this.state)}_cloneInto(t){const{blockLen:n,suffix:s,outputLen:r,rounds:a,enableXOF:o}=this;return t||(t=new Mn(n,s,r,o,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=s,t.outputLen=r,t.enableXOF=o,t.destroyed=this.destroyed,t}}const Jo=(e,t,n)=>Es(()=>new Mn(t,e,n)),Xo=Jo(1,136,256/8);function Vs(e,t){const n=t||"hex",s=Xo(Bt(e,{strict:!1})?kn(e):e);return n==="bytes"?s:Nt(s)}const _n=new Ds(8192);function Ko(e,t){if(_n.has(`${e}.${t}`))return _n.get(`${e}.${t}`);const n=e.substring(2).toLowerCase(),s=Vs(fs(n),"bytes"),r=n.split("");for(let o=0;o<40;o+=2)s[o>>1]>>4>=8&&r[o]&&(r[o]=r[o].toUpperCase()),(s[o>>1]&15)>=8&&r[o+1]&&(r[o+1]=r[o+1].toUpperCase());const a=`0x${r.join("")}`;return _n.set(`${e}.${t}`,a),a}const Zo=/^0x[a-fA-F0-9]{40}$/,Ln=new Ds(8192);function Re(e,t){const{strict:n=!0}=t??{},s=`${e}.${n}`;if(Ln.has(s))return Ln.get(s);const r=Zo.test(e)?e.toLowerCase()===e?!0:n?Ko(e)===e:!0:!1;return Ln.set(s,r),r}function Hn(e,t,n,{strict:s}={}){return Bt(e,{strict:!1})?$o(e,t,n,{strict:s}):Qo(e,t,n,{strict:s})}function Ws(e,t){if(typeof t=="number"&&t>0&&t>Ve(e)-1)throw new is({offset:t,position:"start",size:Ve(e)})}function Gs(e,t,n){if(typeof t=="number"&&typeof n=="number"&&Ve(e)!==n-t)throw new is({offset:n,position:"end",size:Ve(e)})}function Qo(e,t,n,{strict:s}={}){Ws(e,t);const r=e.slice(t,n);return s&&Gs(r,t,n),r}function $o(e,t,n,{strict:s}={}){Ws(e,t);const r=`0x${e.replace("0x","").slice((t??0)*2,(n??e.length)*2)}`;return s&&Gs(r,t,n),r}function ea(e){const{authorizationList:t}=e;if(t)for(const n of t){const{chainId:s}=n,r=n.address;if(!Re(r))throw new st({address:r});if(s<0)throw new on({chainId:s})}Rn(e)}function ta(e){const{blobVersionedHashes:t}=e;if(t){if(t.length===0)throw new Os;for(const n of t){const s=Ve(n),r=nn(Hn(n,0,1));if(s!==32)throw new Mo({hash:n,size:s});if(r!==Ns)throw new _o({hash:n,version:r})}}Rn(e)}function Rn(e){const{chainId:t,maxPriorityFeePerGas:n,maxFeePerGas:s,to:r}=e;if(t<=0)throw new on({chainId:t});if(r&&!Re(r))throw new st({address:r});if(s&&s>Dt)throw new Et({maxFeePerGas:s});if(n&&s&&n>s)throw new Vt({maxFeePerGas:s,maxPriorityFeePerGas:n})}function na(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:s,maxFeePerGas:r,to:a}=e;if(t<=0)throw new on({chainId:t});if(a&&!Re(a))throw new st({address:a});if(n||r)throw new fe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");if(s&&s>Dt)throw new Et({maxFeePerGas:s})}function sa(e){const{chainId:t,maxPriorityFeePerGas:n,gasPrice:s,maxFeePerGas:r,to:a}=e;if(a&&!Re(a))throw new st({address:a});if(typeof t<"u"&&t<=0)throw new on({chainId:t});if(n||r)throw new fe("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");if(s&&s>Dt)throw new Et({maxFeePerGas:s})}function ra(e){if(e.type)return e.type;if(typeof e.authorizationList<"u")return"eip7702";if(typeof e.blobs<"u"||typeof e.blobVersionedHashes<"u"||typeof e.maxFeePerBlobGas<"u"||typeof e.sidecars<"u")return"eip4844";if(typeof e.maxFeePerGas<"u"||typeof e.maxPriorityFeePerGas<"u")return"eip1559";if(typeof e.gasPrice<"u")return typeof e.accessList<"u"?"eip2930":"legacy";throw new lo({transaction:e})}function an(e){if(!e||e.length===0)return[];const t=[];for(let n=0;n<e.length;n++){const{address:s,storageKeys:r}=e[n];for(let a=0;a<r.length;a++)if(r[a].length-2!==64)throw new uo({storageKey:r[a]});if(!Re(s,{strict:!1}))throw new st({address:s});t.push([s,r])}return t}function oa(e,t){const n=ra(e);return n==="eip1559"?ca(e,t):n==="eip2930"?la(e,t):n==="eip4844"?ia(e,t):n==="eip7702"?aa(e,t):da(e,t)}function aa(e,t){const{authorizationList:n,chainId:s,gas:r,nonce:a,to:o,value:c,maxFeePerGas:T,maxPriorityFeePerGas:C,accessList:N,data:L}=e;ea(e);const m=an(N),k=fo(n);return kt(["0x04",xt([le(s),a?le(a):"0x",C?le(C):"0x",T?le(T):"0x",r?le(r):"0x",o??"0x",c?le(c):"0x",L??"0x",m,k,...Gt(e,t)])])}function ia(e,t){const{chainId:n,gas:s,nonce:r,to:a,value:o,maxFeePerBlobGas:c,maxFeePerGas:T,maxPriorityFeePerGas:C,accessList:N,data:L}=e;ta(e);let m=e.blobVersionedHashes,k=e.sidecars;if(e.blobs&&(typeof m>"u"||typeof k>"u")){const Q=typeof e.blobs[0]=="string"?e.blobs:e.blobs.map(ge=>it(ge)),oe=e.kzg,ye=ys({blobs:Q,kzg:oe});if(typeof m>"u"&&(m=Do({commitments:ye})),typeof k>"u"){const ge=vs({blobs:Q,commitments:ye,kzg:oe});k=Ho({blobs:Q,commitments:ye,proofs:ge})}}const x=an(N),g=[le(n),r?le(r):"0x",C?le(C):"0x",T?le(T):"0x",s?le(s):"0x",a??"0x",o?le(o):"0x",L??"0x",x,c?le(c):"0x",m??[],...Gt(e,t)],B=[],ue=[],D=[];if(k)for(let Q=0;Q<k.length;Q++){const{blob:oe,commitment:ye,proof:ge}=k[Q];B.push(oe),ue.push(ye),D.push(ge)}return kt(["0x03",xt(k?[g,B,ue,D]:g)])}function ca(e,t){const{chainId:n,gas:s,nonce:r,to:a,value:o,maxFeePerGas:c,maxPriorityFeePerGas:T,accessList:C,data:N}=e;Rn(e);const L=an(C),m=[le(n),r?le(r):"0x",T?le(T):"0x",c?le(c):"0x",s?le(s):"0x",a??"0x",o?le(o):"0x",N??"0x",L,...Gt(e,t)];return kt(["0x02",xt(m)])}function la(e,t){const{chainId:n,gas:s,data:r,nonce:a,to:o,value:c,accessList:T,gasPrice:C}=e;na(e);const N=an(T),L=[le(n),a?le(a):"0x",C?le(C):"0x",s?le(s):"0x",o??"0x",c?le(c):"0x",r??"0x",N,...Gt(e,t)];return kt(["0x01",xt(L)])}function da(e,t){const{chainId:n=0,gas:s,data:r,nonce:a,to:o,value:c,gasPrice:T}=e;sa(e);let C=[a?le(a):"0x",T?le(T):"0x",s?le(s):"0x",o??"0x",c?le(c):"0x",r??"0x"];if(t){const N=(()=>{if(t.v>=35n)return(t.v-35n)/2n>0?t.v:27n+(t.v===35n?0n:1n);if(n>0)return BigInt(n*2)+BigInt(35n+t.v-27n);const k=27n+(t.v===27n?0n:1n);if(t.v!==k)throw new co({v:t.v});return k})(),L=tn(t.r),m=tn(t.s);C=[...C,le(N),L==="0x00"?"0x":L,m==="0x00"?"0x":m]}else n>0&&(C=[...C,le(n),"0x","0x"]);return xt(C)}function Gt(e,t){const n=t??e,{v:s,yParity:r}=n;if(typeof n.r>"u")return[];if(typeof n.s>"u")return[];if(typeof s>"u"&&typeof r>"u")return[];const a=tn(n.r),o=tn(n.s);return[typeof r=="number"?r?le(1):"0x":s===0n?"0x":s===1n?le(1):s===27n?"0x":le(1),a==="0x00"?"0x":a,o==="0x00"?"0x":o]}const ua={gasPriceOracle:{address:"0x420000000000000000000000000000000000000F"},l1Block:{address:"0x4200000000000000000000000000000000000015"},l2CrossDomainMessenger:{address:"0x4200000000000000000000000000000000000007"},l2Erc721Bridge:{address:"0x4200000000000000000000000000000000000014"},l2StandardBridge:{address:"0x4200000000000000000000000000000000000010"},l2ToL1MessagePasser:{address:"0x4200000000000000000000000000000000000016"}},fa={block:Yr({format(e){return{transactions:e.transactions?.map(n=>{if(typeof n=="string")return n;const s=Tn(n);return s.typeHex==="0x7e"&&(s.isSystemTx=n.isSystemTx,s.mint=n.mint?Ut(n.mint):void 0,s.sourceHash=n.sourceHash,s.type="deposit"),s}),stateRoot:e.stateRoot}}}),transaction:Wr({format(e){const t={};return e.type==="0x7e"&&(t.isSystemTx=e.isSystemTx,t.mint=e.mint?Ut(e.mint):void 0,t.sourceHash=e.sourceHash,t.type="deposit"),t}}),transactionReceipt:Xr({format(e){return{l1GasPrice:e.l1GasPrice?Ut(e.l1GasPrice):null,l1GasUsed:e.l1GasUsed?Ut(e.l1GasUsed):null,l1Fee:e.l1Fee?Ut(e.l1Fee):null,l1FeeScalar:e.l1FeeScalar?Number(e.l1FeeScalar):null}}})};function pa(e,t){return ga(e)?ma(e):oa(e,t)}const ha={transaction:pa};function ma(e){ba(e);const{sourceHash:t,data:n,from:s,gas:r,isSystemTx:a,mint:o,to:c,value:T}=e,C=[t,s,c??"0x",o?Nt(o):"0x",T?Nt(T):"0x",r?Nt(r):"0x",a?"0x1":"0x",n??"0x"];return kt(["0x7e",xt(C)])}function ga(e){return e.type==="deposit"||typeof e.sourceHash<"u"}function ba(e){const{from:t,to:n}=e;if(t&&!Re(t))throw new st({address:t});if(n&&!Re(n))throw new st({address:n})}const cn={blockTime:2e3,contracts:ua,formatters:fa,serializers:ha},wa=at({id:42161,name:"Arbitrum One",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},blockTime:250,rpcUrls:{default:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://arbiscan.io",apiUrl:"https://api.arbiscan.io/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:7654707}}}),ya=at({id:43114,name:"Avalanche",blockTime:1700,nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{default:{name:"SnowTrace",url:"https://snowtrace.io",apiUrl:"https://api.snowtrace.io"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:11907934}}}),zt=1,zs=at({...cn,id:8453,name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://basescan.org",apiUrl:"https://api.basescan.org/api"}},contracts:{...cn.contracts,disputeGameFactory:{[zt]:{address:"0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"}},l2OutputOracle:{[zt]:{address:"0x56315b90c40730925ec5485cf004d835058518A0"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:5022},portal:{[zt]:{address:"0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",blockCreated:17482143}},l1StandardBridge:{[zt]:{address:"0x3154Cf16ccdb4C6d922629664174b904d80F2C35",blockCreated:17482143}}},sourceId:zt});({...zs});const va=at({id:56,name:"BNB Smart Chain",blockTime:750,nativeCurrency:{decimals:18,name:"BNB",symbol:"BNB"},rpcUrls:{default:{http:["https://56.rpc.thirdweb.com"]}},blockExplorers:{default:{name:"BscScan",url:"https://bscscan.com",apiUrl:"https://api.bscscan.com/api"}},contracts:{multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:15921452}}});function Vn(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}class Aa extends fe{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(`
8
8
  `),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}function Wn(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new Ba(e.type);return`${e.name}(${Ys(e.inputs,{includeName:t})})`}function Ys(e,{includeName:t=!1}={}){return e?e.map(n=>ka(n,{includeName:t})).join(t?", ":","):""}function ka(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Ys(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}class xa extends fe{constructor({expectedLength:t,givenLength:n,type:s}){super([`ABI encoding array length mismatch for type ${s}.`,`Expected length: ${t}`,`Given length: ${n}`].join(`
9
9
  `),{name:"AbiEncodingArrayLengthMismatchError"})}}class Ta extends fe{constructor({expectedSize:t,value:n}){super(`Size of bytes "${n}" (bytes${Ve(n)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class Ea extends fe{constructor({expectedLength:t,givenLength:n}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${n}`].join(`
10
10
  `),{name:"AbiEncodingLengthMismatchError"})}}class js extends fe{constructor(t,{docsPath:n}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(`
11
11
  `),{docsPath:n,name:"AbiFunctionNotFoundError"})}}class Sa extends fe{constructor(t,n){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Wn(t.abiItem)}\`, and`,`\`${n.type}\` in \`${Wn(n.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}class Ia extends fe{constructor(t,{docsPath:n}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(`
12
12
  `),{docsPath:n,name:"InvalidAbiEncodingType"})}}class Ca extends fe{constructor(t){super([`Value "${t}" is not a valid array.`].join(`
13
13
  `),{name:"InvalidArrayError"})}}class Ba extends fe{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(`
14
- `),{name:"InvalidDefinitionTypeError"})}}const Pa=e=>Vs(kn(e));function Na(e){return Pa(e)}function Oa(e,t){return e.exec(t)?.groups}const qs=/^tuple(?<array>(\[(\d*)\])*)$/;function Gn(e){let t=e.type;if(qs.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){const a=e.components[r];t+=Gn(a),r<n-1&&(t+=", ")}const s=Oa(qs,e.type);return t+=`)${s?.array||""}`,Gn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function zt(e){let t="";const n=e.length;for(let s=0;s<n;s++){const r=e[s];t+=Gn(r),s!==n-1&&(t+=", ")}return t}function Ua(e){return e.type==="function"?`function ${e.name}(${zt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${zt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${zt(e.inputs)})`:e.type==="error"?`error ${e.name}(${zt(e.inputs)})`:e.type==="constructor"?`constructor(${zt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Da(e){let t=!0,n="",s=0,r="",a=!1;for(let o=0;o<e.length;o++){const c=e[o];if(["(",")",","].includes(c)&&(t=!0),c==="("&&s++,c===")"&&s--,!!t){if(s===0){if(c===" "&&["event","function",""].includes(r))r="";else if(r+=c,c===")"){a=!0;break}continue}if(c===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}r+=c,n+=c}}if(!a)throw new fe("Unable to normalize signature.");return r}const Fa=e=>{const t=typeof e=="string"?e:Ua(e);return Da(t)};function Js(e){return Na(Fa(e))}const Xs=e=>Hn(Js(e),0,4),Ma=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function _a(e,t){if(e.length!==t.length)throw new Ea({expectedLength:e.length,givenLength:t.length});const n=La({params:e,values:t}),s=Yn(n);return s.length===0?"0x":s}function La({params:e,values:t}){const n=[];for(let s=0;s<e.length;s++)n.push(zn({param:e[s],value:t[s]}));return n}function zn({param:e,value:t}){const n=ja(e.type);if(n){const[s,r]=n;return Ra(t,{length:s,param:{...e,type:r}})}if(e.type==="tuple")return Ya(t,{param:e});if(e.type==="address")return Ha(t);if(e.type==="bool")return Wa(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const s=e.type.startsWith("int"),[,,r="256"]=Ma.exec(e.type)??[];return Ga(t,{signed:s,size:Number(r)})}if(e.type.startsWith("bytes"))return Va(t,{param:e});if(e.type==="string")return za(t);throw new Ia(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Yn(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:c}=e[a];o?t+=32:t+=Ve(c)}const n=[],s=[];let r=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:c}=e[a];o?(n.push(le(t+r,{size:32})),s.push(c),r+=Ve(c)):n.push(c)}return Dt([...n,...s])}function Ha(e){if(!Re(e))throw new st({address:e});return{dynamic:!1,encoded:ht(e.toLowerCase())}}function Ra(e,{length:t,param:n}){const s=t===null;if(!Array.isArray(e))throw new Ca(e);if(!s&&e.length!==t)throw new xa({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let r=!1;const a=[];for(let o=0;o<e.length;o++){const c=zn({param:n,value:e[o]});c.dynamic&&(r=!0),a.push(c)}if(s||r){const o=Yn(a);if(s){const c=le(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Dt([c,o]):c}}if(r)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Dt(a.map(({encoded:o})=>o))}}function Va(e,{param:t}){const[,n]=t.type.split("bytes"),s=Ve(e);if(!n){let r=e;return s%32!==0&&(r=ht(r,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Dt([ht(le(s,{size:32})),r])}}if(s!==Number.parseInt(n,10))throw new Ta({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:ht(e,{dir:"right"})}}function Wa(e){if(typeof e!="boolean")throw new fe(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ht(ls(e))}}function Ga(e,{signed:t,size:n=256}){if(typeof n=="number"){const s=2n**(BigInt(n)-(t?1n:0n))-1n,r=t?-s-1n:0n;if(e>s||e<r)throw new An({max:s.toString(),min:r.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:le(e,{size:32,signed:t})}}function za(e){const t=ds(e),n=Math.ceil(Ve(t)/32),s=[];for(let r=0;r<n;r++)s.push(ht(Hn(t,r*32,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Dt([ht(le(Ve(t),{size:32})),...s])}}function Ya(e,{param:t}){let n=!1;const s=[];for(let r=0;r<t.components.length;r++){const a=t.components[r],o=Array.isArray(e)?r:a.name,c=zn({param:a,value:e[o]});s.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Yn(s):Dt(s.map(({encoded:r})=>r))}}function ja(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const qa=Js;function Ja(e){const{abi:t,args:n=[],name:s}=e,r=Ct(s,{strict:!1}),a=t.filter(c=>r?c.type==="function"?Xs(c)===s:c.type==="event"?qa(c)===s:!1:"name"in c&&c.name===s);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const c of a){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((C,N)=>{const L="inputs"in c&&c.inputs[N];return L?jn(C,L):!1})){if(o&&"inputs"in o&&o.inputs){const C=Ks(c.inputs,o.inputs,n);if(C)throw new Sa({abiItem:c,type:C[0]},{abiItem:o,type:C[1]})}o=c}}return o||a[0]}function jn(e,t){const n=typeof e,s=t.type;switch(s){case"address":return Re(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return s==="tuple"&&"components"in t?Object.values(t.components).every((r,a)=>n==="object"&&jn(Object.values(e)[a],r)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(s)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(s)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(s)?Array.isArray(e)&&e.every(r=>jn(r,{...t,type:s.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Ks(e,t,n){for(const s in e){const r=e[s],a=t[s];if(r.type==="tuple"&&a.type==="tuple"&&"components"in r&&"components"in a)return Ks(r.components,a.components,n[s]);const o=[r.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Re(n[s],{strict:!1}):o.includes("address")&&o.includes("bytes")?Re(n[s],{strict:!1}):!1)return o}}function Zs(e){return e.reduce((t,{slot:n,value:s})=>`${t} ${n}: ${s}
14
+ `),{name:"InvalidDefinitionTypeError"})}}const Pa=e=>Vs(kn(e));function Na(e){return Pa(e)}function Oa(e,t){return e.exec(t)?.groups}const qs=/^tuple(?<array>(\[(\d*)\])*)$/;function Gn(e){let t=e.type;if(qs.test(e.type)&&"components"in e){t="(";const n=e.components.length;for(let r=0;r<n;r++){const a=e.components[r];t+=Gn(a),r<n-1&&(t+=", ")}const s=Oa(qs,e.type);return t+=`)${s?.array||""}`,Gn({...e,type:t})}return"indexed"in e&&e.indexed&&(t=`${t} indexed`),e.name?`${t} ${e.name}`:t}function Yt(e){let t="";const n=e.length;for(let s=0;s<n;s++){const r=e[s];t+=Gn(r),s!==n-1&&(t+=", ")}return t}function Ua(e){return e.type==="function"?`function ${e.name}(${Yt(e.inputs)})${e.stateMutability&&e.stateMutability!=="nonpayable"?` ${e.stateMutability}`:""}${e.outputs?.length?` returns (${Yt(e.outputs)})`:""}`:e.type==="event"?`event ${e.name}(${Yt(e.inputs)})`:e.type==="error"?`error ${e.name}(${Yt(e.inputs)})`:e.type==="constructor"?`constructor(${Yt(e.inputs)})${e.stateMutability==="payable"?" payable":""}`:e.type==="fallback"?`fallback() external${e.stateMutability==="payable"?" payable":""}`:"receive() external payable"}function Da(e){let t=!0,n="",s=0,r="",a=!1;for(let o=0;o<e.length;o++){const c=e[o];if(["(",")",","].includes(c)&&(t=!0),c==="("&&s++,c===")"&&s--,!!t){if(s===0){if(c===" "&&["event","function",""].includes(r))r="";else if(r+=c,c===")"){a=!0;break}continue}if(c===" "){e[o-1]!==","&&n!==","&&n!==",("&&(n="",t=!1);continue}r+=c,n+=c}}if(!a)throw new fe("Unable to normalize signature.");return r}const Fa=e=>{const t=typeof e=="string"?e:Ua(e);return Da(t)};function Js(e){return Na(Fa(e))}const Xs=e=>Hn(Js(e),0,4),Ma=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function _a(e,t){if(e.length!==t.length)throw new Ea({expectedLength:e.length,givenLength:t.length});const n=La({params:e,values:t}),s=Yn(n);return s.length===0?"0x":s}function La({params:e,values:t}){const n=[];for(let s=0;s<e.length;s++)n.push(zn({param:e[s],value:t[s]}));return n}function zn({param:e,value:t}){const n=ja(e.type);if(n){const[s,r]=n;return Ra(t,{length:s,param:{...e,type:r}})}if(e.type==="tuple")return Ya(t,{param:e});if(e.type==="address")return Ha(t);if(e.type==="bool")return Wa(t);if(e.type.startsWith("uint")||e.type.startsWith("int")){const s=e.type.startsWith("int"),[,,r="256"]=Ma.exec(e.type)??[];return Ga(t,{signed:s,size:Number(r)})}if(e.type.startsWith("bytes"))return Va(t,{param:e});if(e.type==="string")return za(t);throw new Ia(e.type,{docsPath:"/docs/contract/encodeAbiParameters"})}function Yn(e){let t=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:c}=e[a];o?t+=32:t+=Ve(c)}const n=[],s=[];let r=0;for(let a=0;a<e.length;a++){const{dynamic:o,encoded:c}=e[a];o?(n.push(le(t+r,{size:32})),s.push(c),r+=Ve(c)):n.push(c)}return Ft([...n,...s])}function Ha(e){if(!Re(e))throw new st({address:e});return{dynamic:!1,encoded:ht(e.toLowerCase())}}function Ra(e,{length:t,param:n}){const s=t===null;if(!Array.isArray(e))throw new Ca(e);if(!s&&e.length!==t)throw new xa({expectedLength:t,givenLength:e.length,type:`${n.type}[${t}]`});let r=!1;const a=[];for(let o=0;o<e.length;o++){const c=zn({param:n,value:e[o]});c.dynamic&&(r=!0),a.push(c)}if(s||r){const o=Yn(a);if(s){const c=le(a.length,{size:32});return{dynamic:!0,encoded:a.length>0?Ft([c,o]):c}}if(r)return{dynamic:!0,encoded:o}}return{dynamic:!1,encoded:Ft(a.map(({encoded:o})=>o))}}function Va(e,{param:t}){const[,n]=t.type.split("bytes"),s=Ve(e);if(!n){let r=e;return s%32!==0&&(r=ht(r,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Ft([ht(le(s,{size:32})),r])}}if(s!==Number.parseInt(n,10))throw new Ta({expectedSize:Number.parseInt(n,10),value:e});return{dynamic:!1,encoded:ht(e,{dir:"right"})}}function Wa(e){if(typeof e!="boolean")throw new fe(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:ht(ls(e))}}function Ga(e,{signed:t,size:n=256}){if(typeof n=="number"){const s=2n**(BigInt(n)-(t?1n:0n))-1n,r=t?-s-1n:0n;if(e>s||e<r)throw new An({max:s.toString(),min:r.toString(),signed:t,size:n/8,value:e.toString()})}return{dynamic:!1,encoded:le(e,{size:32,signed:t})}}function za(e){const t=ds(e),n=Math.ceil(Ve(t)/32),s=[];for(let r=0;r<n;r++)s.push(ht(Hn(t,r*32,(r+1)*32),{dir:"right"}));return{dynamic:!0,encoded:Ft([ht(le(Ve(t),{size:32})),...s])}}function Ya(e,{param:t}){let n=!1;const s=[];for(let r=0;r<t.components.length;r++){const a=t.components[r],o=Array.isArray(e)?r:a.name,c=zn({param:a,value:e[o]});s.push(c),c.dynamic&&(n=!0)}return{dynamic:n,encoded:n?Yn(s):Ft(s.map(({encoded:r})=>r))}}function ja(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const qa=Js;function Ja(e){const{abi:t,args:n=[],name:s}=e,r=Bt(s,{strict:!1}),a=t.filter(c=>r?c.type==="function"?Xs(c)===s:c.type==="event"?qa(c)===s:!1:"name"in c&&c.name===s);if(a.length===0)return;if(a.length===1)return a[0];let o;for(const c of a){if(!("inputs"in c))continue;if(!n||n.length===0){if(!c.inputs||c.inputs.length===0)return c;continue}if(!c.inputs||c.inputs.length===0||c.inputs.length!==n.length)continue;if(n.every((C,N)=>{const L="inputs"in c&&c.inputs[N];return L?jn(C,L):!1})){if(o&&"inputs"in o&&o.inputs){const C=Ks(c.inputs,o.inputs,n);if(C)throw new Sa({abiItem:c,type:C[0]},{abiItem:o,type:C[1]})}o=c}}return o||a[0]}function jn(e,t){const n=typeof e,s=t.type;switch(s){case"address":return Re(e,{strict:!1});case"bool":return n==="boolean";case"function":return n==="string";case"string":return n==="string";default:return s==="tuple"&&"components"in t?Object.values(t.components).every((r,a)=>n==="object"&&jn(Object.values(e)[a],r)):/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(s)?n==="number"||n==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(s)?n==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(s)?Array.isArray(e)&&e.every(r=>jn(r,{...t,type:s.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function Ks(e,t,n){for(const s in e){const r=e[s],a=t[s];if(r.type==="tuple"&&a.type==="tuple"&&"components"in r&&"components"in a)return Ks(r.components,a.components,n[s]);const o=[r.type,a.type];if(o.includes("address")&&o.includes("bytes20")?!0:o.includes("address")&&o.includes("string")?Re(n[s],{strict:!1}):o.includes("address")&&o.includes("bytes")?Re(n[s],{strict:!1}):!1)return o}}function Zs(e){return e.reduce((t,{slot:n,value:s})=>`${t} ${n}: ${s}
15
15
  `,"")}function Xa(e){return e.reduce((t,{address:n,...s})=>{let r=`${t} ${n}:
16
16
  `;return s.nonce&&(r+=` nonce: ${s.nonce}
17
17
  `),s.balance&&(r+=` balance: ${s.balance}
@@ -19,15 +19,15 @@
19
19
  `),s.state&&(r+=` state:
20
20
  `,r+=Zs(s.state)),s.stateDiff&&(r+=` stateDiff:
21
21
  `,r+=Zs(s.stateDiff)),r},` State Override:
22
- `).slice(0,-1)}class Ka extends fe{constructor(t,{account:n,docsPath:s,chain:r,data:a,gas:o,gasPrice:c,maxFeePerGas:T,maxPriorityFeePerGas:C,nonce:N,to:L,value:m,stateOverride:k}){const x=n?Vn(n):void 0;let g=ws({from:x?.address,to:L,value:typeof m<"u"&&`${io(m)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:o,gasPrice:typeof c<"u"&&`${xt(c)} gwei`,maxFeePerGas:typeof T<"u"&&`${xt(T)} gwei`,maxPriorityFeePerGas:typeof C<"u"&&`${xt(C)} gwei`,nonce:N});k&&(g+=`
23
- ${Xa(k)}`),super(t.shortMessage,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function Za(e,t){const n=(e.details||"").toLowerCase(),s=e instanceof fe?e.walk(r=>r?.code===Ft.code):e;return s instanceof fe?new Ft({cause:e,message:s.details}):Ft.nodeMessage.test(n)?new Ft({cause:e,message:e.details}):Tt.nodeMessage.test(n)?new Tt({cause:e,maxFeePerGas:t?.maxFeePerGas}):Cn.nodeMessage.test(n)?new Cn({cause:e,maxFeePerGas:t?.maxFeePerGas}):Bn.nodeMessage.test(n)?new Bn({cause:e,nonce:t?.nonce}):Pn.nodeMessage.test(n)?new Pn({cause:e,nonce:t?.nonce}):Nn.nodeMessage.test(n)?new Nn({cause:e,nonce:t?.nonce}):On.nodeMessage.test(n)?new On({cause:e}):Un.nodeMessage.test(n)?new Un({cause:e,gas:t?.gas}):Dn.nodeMessage.test(n)?new Dn({cause:e,gas:t?.gas}):Fn.nodeMessage.test(n)?new Fn({cause:e}):Rt.nodeMessage.test(n)?new Rt({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Us({cause:e})}function Qa(e,{docsPath:t,...n}){const s=(()=>{const r=Za(e,n);return r instanceof Us?e:r})();return new Ka(s,{docsPath:t,...n})}function $a(e,{format:t}){if(!t)return{};const n={};function s(a){const o=Object.keys(a);for(const c of o)c in e&&(n[c]=e[c]),a[c]&&typeof a[c]=="object"&&!Array.isArray(a[c])&&s(a[c])}const r=t(e||{});return s(r),n}function ei(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:s,to:r}=e,a=t?Vn(t):void 0;if(a&&!Re(a.address))throw new st({address:a.address});if(r&&!Re(r))throw new st({address:r});if(n&&n>Ut)throw new Tt({maxFeePerGas:n});if(s&&n&&s>n)throw new Rt({maxFeePerGas:n,maxPriorityFeePerGas:s})}async function ti(e,t){const{account:n=e.account}=t;if(!n)throw new Aa;const s=Vn(n);try{const{accessList:r,blockNumber:a,blockTag:o,data:c,gas:T,gasPrice:C,maxFeePerGas:N,maxPriorityFeePerGas:L,nonce:m,to:k,value:x,...g}=t,ue=(typeof a=="bigint"?le(a):void 0)||o;ei(t);const D=e.chain?.formatters?.transactionRequest?.format,oe=(D||Zr)({...$a(g,{format:D}),account:s,accessList:r,data:c,gas:T,gasPrice:C,maxFeePerGas:N,maxPriorityFeePerGas:L,nonce:m,to:k,value:x},"estimateGas"),{baseFeePerGas:ye,gasLimit:ge,priorityFeePerGas:Ce}=await e.request({method:"linea_estimateGas",params:ue?[oe,ue]:[oe]});return{baseFeePerGas:BigInt(ye),gasLimit:BigInt(ge),priorityFeePerGas:BigInt(Ce)}}catch(r){throw Qa(r,{...t,account:s,chain:e.chain})}}const ni={fees:{estimateFeesPerGas:Qs,async maxPriorityFeePerGas({block:e,client:t,request:n}){const s=await Qs({block:e,client:t,multiply:r=>r,request:n,type:"eip1559"});return s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:null}}};async function Qs({client:e,multiply:t,request:n,type:s}){try{const r=await ti(e,{...n,account:n?.account}),{priorityFeePerGas:a}=r,c=t(BigInt(r.baseFeePerGas))+a;return s==="legacy"?{gasPrice:c}:{maxFeePerGas:c,maxPriorityFeePerGas:a}}catch{return null}}const si=at({...ni,id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),ri=at({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}}}),Yt=1,oi=at({...cn,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...cn.contracts,disputeGameFactory:{[Yt]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[Yt]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[Yt]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[Yt]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:Yt}),ai=at({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}}}),$s="/docs/contract/encodeFunctionData";function ii(e){const{abi:t,args:n,functionName:s}=e;let r=t[0];if(s){const a=Ja({abi:t,args:n,name:s});if(!a)throw new js(s,{docsPath:$s});r=a}if(r.type!=="function")throw new js(void 0,{docsPath:$s});return{abi:[r],functionName:Xs(Wn(r))}}function bt(e){const{args:t}=e,{abi:n,functionName:s}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:ii(e),r=n[0],a=s,o="inputs"in r&&r.inputs?_a(r.inputs,t??[]):void 0;return At([a,o??"0x"])}const jt={1:{...ri,logo:"https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024",chainId:1,chainType:"ether",chainTypeMoralis:"eth",tokenTrendingDefault:["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"]},10:{...oi,logo:"https://cryptologos.cc/logos/optimism-ethereum-op-logo.png?v=024",chainId:10,chainType:"optimism",chainTypeMoralis:"optimism",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0x68f180fcce6836688e9084f035309e29bf0a2095","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},56:{...va,logo:"https://cryptologos.cc/logos/bnb-bnb-logo.png?v=024",chainId:56,chainType:"bsc",chainTypeMoralis:"bsc",tokenTrendingDefault:["0x2170ed0880ac9a755fd29b2688956bd959f933f8","0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"]},137:{...ai,logo:"https://cryptologos.cc/logos/polygon-matic-logo.png?v=024",chainId:137,chainType:"matic",chainTypeMoralis:"polygon",tokenTrendingDefault:["0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6"]},8453:{...zs,logo:"https://icons.llamao.fi/icons/chains/rsz_base.jpg",chainId:8453,chainType:"base",chainTypeMoralis:"base",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},42161:{...wa,logo:"https://cryptologos.cc/logos/arbitrum-arb-logo.png?v=024",chainId:42161,chainType:"arbitrum",chainTypeMoralis:"arbitrum",tokenTrendingDefault:["0x82af49447d8a07e3bd95bd0d56f35241523fbab1","0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f"]},43114:{...ya,logo:"https://cryptologos.cc/logos/avalanche-avax-logo.png?v=024",chainId:43114,chainType:"avax",chainTypeMoralis:"avalanche",tokenTrendingDefault:["0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB","0x0555E30da8f98308EdB960aa94C0Db47230d2B9c"]},59144:{...si,logo:"https://icons.llamao.fi/icons/chains/rsz_linea.jpg",chainId:59144,chainType:"linea",chainTypeMoralis:"linea",tokenTrendingDefault:["0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f","0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4"]}},ci=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const s=new Date(e);return s.setHours(0,0,0,0),t.setHours(0,0,0,0),n.setHours(0,0,0,0),s.getTime()===t.getTime()?"Today":s.getTime()===n.getTime()?"Yesterday":s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:s.getFullYear()!==t.getFullYear()?"numeric":void 0})},lt=e=>new Promise(t=>setTimeout(t,e||0)),li=(e,t=5,n=5)=>(e=e||"",e?.length<=t+n?e:`${e.substr(0,t)}...${e.substr(e.length-n,n)}`),di=e=>{if(!e)return"";const t=jt[e];return t?t.chainTypeMoralis:""},ui=e=>{if(!e)return"";const t=jt[e];return t?t.chainType:""},Et={getItem(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},removeItem(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}},get length(){if(typeof window>"u")return 0;try{return window.localStorage.length}catch{return 0}},key(e){if(typeof window>"u")return null;try{return window.localStorage.key(e)}catch{return null}}};class fi extends fe{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function dt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new fi({value:e});let[n,s="0"]=e.split(".");const r=n.startsWith("-");if(r&&(n=n.slice(1)),s=s.replace(/(0+)$/,""),t===0)Math.round(+`.${s}`)===1&&(n=`${BigInt(n)+1n}`),s="";else if(s.length>t){const[a,o,c]=[s.slice(0,t-1),s.slice(t-1,t),s.slice(t)],T=Math.round(+`${o}.${c}`);T>9?s=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):s=`${a}${T}`,s.length>t&&(s=s.slice(1),n=`${BigInt(n)+1n}`),s=s.slice(0,t)}else s=s.padEnd(t,"0");return BigInt(`${r?"-":""}${n}${s}`)}const pi="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",qe="0x0000000000000000000000000000000000000000",hi=({address:e,chainLogo:t})=>{const[n,s]=re.useState(!1),r=re.useCallback(()=>{if(!e)return;const a=e,o=()=>{s(!0),setTimeout(()=>s(!1),2e3)};try{navigator.clipboard.writeText(a).then(o).catch(()=>{const c=document.createElement("input");c.value=a,document.body.appendChild(c),c.select(),document.execCommand("copy"),c.remove(),o()})}catch{const c=document.createElement("input");c.value=a,document.body.appendChild(c),c.select(),document.execCommand("copy"),c.remove(),o()}},[e]);return I.jsx(I.Fragment,{children:Re(e||"")&&I.jsxs("div",{className:"chat-user-info",children:[t&&I.jsx("div",{className:"user-avatar",children:I.jsx("img",{src:t||"",alt:"Chain",width:20,height:20})}),I.jsx("span",{className:"user-wallet",children:li(e)||"Not connected"}),I.jsx("button",{className:"copy-address-btn",onClick:r,"aria-label":"Copy wallet address",type:"button",title:n?"Copied!":"Copy address",children:n?I.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):I.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[I.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),I.jsx("path",{d:"M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})})},He=[];for(let e=0;e<256;++e)He.push((e+256).toString(16).slice(1));function mi(e,t=0){return(He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]).toLowerCase()}let qn;const gi=new Uint8Array(16);function bi(){if(!qn){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");qn=crypto.getRandomValues.bind(crypto)}return qn(gi)}const er={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wi(e,t,n){e=e||{};const s=e.random??e.rng?.()??bi();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,mi(s)}function tr(e,t,n){return er.randomUUID&&!e?er.randomUUID():wi(e)}const yi="chat_widget_messages",nr=re.createContext(void 0),Jn=()=>{const e=re.useContext(nr);if(!e)throw new Error("useConnect must be used within ConnectProvider");return{...e,chainData:jt[e.account?.chainId]||void 0,chainId:e.account?.chainId||void 0,chainType:ui(e.account?.chainId||void 0),chainTypeMoralis:di(e.account?.chainId||void 0)}},vi=({children:e,initialAccount:t})=>I.jsx(nr.Provider,{value:{account:t||null},children:e}),Xn=yi,sr=200,Mt=[{id:tr(),text:`**Welcome! 🚀**
24
- You're connected and ready to explore DeFi! I can help you trade, check prices, and analyze your portfolio when you need it.`,sender:"bot",timestamp:new Date}];function Ai(e,t){return e&&t?`${e}_${t}`:""}function rr(e){return e.map(t=>({...t,timestamp:new Date(t.timestamp)}))}function or(){const e=Et.getItem(Xn);if(!e)return null;try{const t=JSON.parse(e);if(t&&t.owner!==void 0&&Array.isArray(t.messages))return{owner:t.owner,messages:rr(t.messages)};if(Array.isArray(t))return{owner:"",messages:rr(t)}}catch{}return null}function ln(e,t){Et.setItem(Xn,JSON.stringify({owner:e,messages:t}))}function ki(){const{account:e}=Jn(),t=Ai(e?.address,e?.chainId),[n,s]=re.useState(()=>t||"pending"),[r,a]=re.useState(()=>{const N=or();return t?N&&N.owner===t?N.messages:Mt:N?.messages??Mt});if(n==="pending"&&t){const N=or();N&&N.owner===t?a(N.messages):ln(t,r),s(t)}else n!=="pending"&&t&&n!==t&&(a(Mt),ln(t,Mt),s(t));re.useEffect(()=>{n!=="pending"&&ln(n,r)},[r,n]),re.useEffect(()=>{const N=[];for(let L=0;L<Et.length;L++){const m=Et.key(L);m&&m.startsWith(Xn+"_")&&N.push(m)}N.forEach(L=>Et.removeItem(L))},[]);const o=(N,L,m,k,x)=>{const g=m?r.find(ue=>ue.id===m):void 0,B={id:tr(),text:N,sender:L,timestamp:new Date,...g&&{replyTo:{id:g.id,text:g.text,sender:g.sender}},...k&&{buttons:k},...x&&{actionData:x}};return a(ue=>{const D=[...ue,B];return D.length>sr?D.slice(D.length-sr):D}),B},c=(N,L)=>{a(m=>m.map(k=>k.id===N&&k.actionData?{...k,actionData:{...k.actionData,status:L}}:k))},T=(N,L)=>{a(m=>m.map(k=>k.id===N?{...k,text:L}:k))},C=re.useCallback(()=>{a(Mt),ln(t,Mt)},[t]);return{messages:r,setMessages:a,addMessage:o,updateMessageAction:c,updateMessageText:T,clearMessages:C}}const ar=re.createContext(void 0),xi=()=>{const e=re.useContext(ar);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e},Ti=({children:e,initialConfig:t})=>I.jsx(ar.Provider,{value:{config:t||null},children:e}),ir=re.createContext(void 0),Ei=({children:e,initialLanguage:t="en"})=>{const[n,s]=re.useState(t);return re.useEffect(()=>{t&&s(t)},[t]),I.jsx(ir.Provider,{value:{language:n,setLanguage:s},children:e})},Si=()=>{const e=re.useContext(ir);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};var Ii=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Kn=Math.ceil,Je=Math.floor,We="[BigNumber Error] ",cr=We+"Number primitive has more than 15 significant digits: ",tt=1e14,he=14,Zn=9007199254740991,Qn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],wt=1e7,Me=1e9;function lr(e){var t,n,s,r=D.prototype={constructor:D,toString:null,valueOf:null},a=new D(1),o=20,c=4,T=-7,C=21,N=-1e7,L=1e7,m=!1,k=1,x=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz",ue=!0;function D(i,l){var u,w,p,v,S,h,b,E,y=this;if(!(y instanceof D))return new D(i,l);if(l==null){if(i&&i._isBigNumber===!0){y.s=i.s,!i.c||i.e>L?y.c=y.e=null:i.e<N?y.c=[y.e=0]:(y.e=i.e,y.c=i.c.slice());return}if((h=typeof i=="number")&&i*0==0){if(y.s=1/i<0?(i=-i,-1):1,i===~~i){for(v=0,S=i;S>=10;S/=10,v++);v>L?y.c=y.e=null:(y.e=v,y.c=[i]);return}E=String(i)}else{if(!Ii.test(E=String(i)))return s(y,E,h);y.s=E.charCodeAt(0)==45?(E=E.slice(1),-1):1}(v=E.indexOf("."))>-1&&(E=E.replace(".","")),(S=E.search(/e/i))>0?(v<0&&(v=S),v+=+E.slice(S+1),E=E.substring(0,S)):v<0&&(v=E.length)}else{if(Ne(l,2,B.length,"Base"),l==10&&ue)return y=new D(i),ge(y,o+y.e+1,c);if(E=String(i),h=typeof i=="number"){if(i*0!=0)return s(y,E,h,l);if(y.s=1/i<0?(E=E.slice(1),-1):1,D.DEBUG&&E.replace(/^0\.0*|\./,"").length>15)throw Error(cr+i)}else y.s=E.charCodeAt(0)===45?(E=E.slice(1),-1):1;for(u=B.slice(0,l),v=S=0,b=E.length;S<b;S++)if(u.indexOf(w=E.charAt(S))<0){if(w=="."){if(S>v){v=b;continue}}else if(!p&&(E==E.toUpperCase()&&(E=E.toLowerCase())||E==E.toLowerCase()&&(E=E.toUpperCase()))){p=!0,S=-1,v=0;continue}return s(y,String(i),h,l)}h=!1,E=n(E,l,10,y.s),(v=E.indexOf("."))>-1?E=E.replace(".",""):v=E.length}for(S=0;E.charCodeAt(S)===48;S++);for(b=E.length;E.charCodeAt(--b)===48;);if(E=E.slice(S,++b)){if(b-=S,h&&D.DEBUG&&b>15&&(i>Zn||i!==Je(i)))throw Error(cr+y.s*i);if((v=v-S-1)>L)y.c=y.e=null;else if(v<N)y.c=[y.e=0];else{if(y.e=v,y.c=[],S=(v+1)%he,v<0&&(S+=he),S<b){for(S&&y.c.push(+E.slice(0,S)),b-=he;S<b;)y.c.push(+E.slice(S,S+=he));S=he-(E=E.slice(S)).length}else S-=b;for(;S--;E+="0");y.c.push(+E)}}else y.c=[y.e=0]}D.clone=lr,D.ROUND_UP=0,D.ROUND_DOWN=1,D.ROUND_CEIL=2,D.ROUND_FLOOR=3,D.ROUND_HALF_UP=4,D.ROUND_HALF_DOWN=5,D.ROUND_HALF_EVEN=6,D.ROUND_HALF_CEIL=7,D.ROUND_HALF_FLOOR=8,D.EUCLID=9,D.config=D.set=function(i){var l,u;if(i!=null)if(typeof i=="object"){if(i.hasOwnProperty(l="DECIMAL_PLACES")&&(u=i[l],Ne(u,0,Me,l),o=u),i.hasOwnProperty(l="ROUNDING_MODE")&&(u=i[l],Ne(u,0,8,l),c=u),i.hasOwnProperty(l="EXPONENTIAL_AT")&&(u=i[l],u&&u.pop?(Ne(u[0],-Me,0,l),Ne(u[1],0,Me,l),T=u[0],C=u[1]):(Ne(u,-Me,Me,l),T=-(C=u<0?-u:u))),i.hasOwnProperty(l="RANGE"))if(u=i[l],u&&u.pop)Ne(u[0],-Me,-1,l),Ne(u[1],1,Me,l),N=u[0],L=u[1];else if(Ne(u,-Me,Me,l),u)N=-(L=u<0?-u:u);else throw Error(We+l+" cannot be zero: "+u);if(i.hasOwnProperty(l="CRYPTO"))if(u=i[l],u===!!u)if(u)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=u;else throw m=!u,Error(We+"crypto unavailable");else m=u;else throw Error(We+l+" not true or false: "+u);if(i.hasOwnProperty(l="MODULO_MODE")&&(u=i[l],Ne(u,0,9,l),k=u),i.hasOwnProperty(l="POW_PRECISION")&&(u=i[l],Ne(u,0,Me,l),x=u),i.hasOwnProperty(l="FORMAT"))if(u=i[l],typeof u=="object")g=u;else throw Error(We+l+" not an object: "+u);if(i.hasOwnProperty(l="ALPHABET"))if(u=i[l],typeof u=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(u))ue=u.slice(0,10)=="0123456789",B=u;else throw Error(We+l+" invalid: "+u)}else throw Error(We+"Object expected: "+i);return{DECIMAL_PLACES:o,ROUNDING_MODE:c,EXPONENTIAL_AT:[T,C],RANGE:[N,L],CRYPTO:m,MODULO_MODE:k,POW_PRECISION:x,FORMAT:g,ALPHABET:B}},D.isBigNumber=function(i){if(!i||i._isBigNumber!==!0)return!1;if(!D.DEBUG)return!0;var l,u,w=i.c,p=i.e,v=i.s;e:if({}.toString.call(w)=="[object Array]"){if((v===1||v===-1)&&p>=-Me&&p<=Me&&p===Je(p)){if(w[0]===0){if(p===0&&w.length===1)return!0;break e}if(l=(p+1)%he,l<1&&(l+=he),String(w[0]).length==l){for(l=0;l<w.length;l++)if(u=w[l],u<0||u>=tt||u!==Je(u))break e;if(u!==0)return!0}}}else if(w===null&&p===null&&(v===null||v===1||v===-1))return!0;throw Error(We+"Invalid BigNumber: "+i)},D.maximum=D.max=function(){return oe(arguments,-1)},D.minimum=D.min=function(){return oe(arguments,1)},D.random=(function(){var i=9007199254740992,l=Math.random()*i&2097151?function(){return Je(Math.random()*i)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(u){var w,p,v,S,h,b=0,E=[],y=new D(a);if(u==null?u=o:Ne(u,0,Me),S=Kn(u/he),m)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(S*=2));b<S;)h=w[b]*131072+(w[b+1]>>>11),h>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),w[b]=p[0],w[b+1]=p[1]):(E.push(h%1e14),b+=2);b=S/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(S*=7);b<S;)h=(w[b]&31)*281474976710656+w[b+1]*1099511627776+w[b+2]*4294967296+w[b+3]*16777216+(w[b+4]<<16)+(w[b+5]<<8)+w[b+6],h>=9e15?crypto.randomBytes(7).copy(w,b):(E.push(h%1e14),b+=7);b=S/7}else throw m=!1,Error(We+"crypto unavailable");if(!m)for(;b<S;)h=l(),h<9e15&&(E[b++]=h%1e14);for(S=E[--b],u%=he,S&&u&&(h=Qn[he-u],E[b]=Je(S/h)*h);E[b]===0;E.pop(),b--);if(b<0)E=[v=0];else{for(v=-1;E[0]===0;E.splice(0,1),v-=he);for(b=1,h=E[0];h>=10;h/=10,b++);b<he&&(v-=he-b)}return y.e=v,y.c=E,y}})(),D.sum=function(){for(var i=1,l=arguments,u=new D(l[0]);i<l.length;)u=u.plus(l[i++]);return u},n=(function(){var i="0123456789";function l(u,w,p,v){for(var S,h=[0],b,E=0,y=u.length;E<y;){for(b=h.length;b--;h[b]*=w);for(h[0]+=v.indexOf(u.charAt(E++)),S=0;S<h.length;S++)h[S]>p-1&&(h[S+1]==null&&(h[S+1]=0),h[S+1]+=h[S]/p|0,h[S]%=p)}return h.reverse()}return function(u,w,p,v,S){var h,b,E,y,O,q,ne,me,xe=u.indexOf("."),Te=o,W=c;for(xe>=0&&(y=x,x=0,u=u.replace(".",""),me=new D(w),q=me.pow(u.length-xe),x=y,me.c=l(ut(Ke(q.c),q.e,"0"),10,p,i),me.e=me.c.length),ne=l(u,w,p,S?(h=B,i):(h=i,B)),E=y=ne.length;ne[--y]==0;ne.pop());if(!ne[0])return h.charAt(0);if(xe<0?--E:(q.c=ne,q.e=E,q.s=v,q=t(q,me,Te,W,p),ne=q.c,O=q.r,E=q.e),b=E+Te+1,xe=ne[b],y=p/2,O=O||b<0||ne[b+1]!=null,O=W<4?(xe!=null||O)&&(W==0||W==(q.s<0?3:2)):xe>y||xe==y&&(W==4||O||W==6&&ne[b-1]&1||W==(q.s<0?8:7)),b<1||!ne[0])u=O?ut(h.charAt(1),-Te,h.charAt(0)):h.charAt(0);else{if(ne.length=b,O)for(--p;++ne[--b]>p;)ne[b]=0,b||(++E,ne=[1].concat(ne));for(y=ne.length;!ne[--y];);for(xe=0,u="";xe<=y;u+=h.charAt(ne[xe++]));u=ut(u,E,h.charAt(0))}return u}})(),t=(function(){function i(w,p,v){var S,h,b,E,y=0,O=w.length,q=p%wt,ne=p/wt|0;for(w=w.slice();O--;)b=w[O]%wt,E=w[O]/wt|0,S=ne*b+E*q,h=q*b+S%wt*wt+y,y=(h/v|0)+(S/wt|0)+ne*E,w[O]=h%v;return y&&(w=[y].concat(w)),w}function l(w,p,v,S){var h,b;if(v!=S)b=v>S?1:-1;else for(h=b=0;h<v;h++)if(w[h]!=p[h]){b=w[h]>p[h]?1:-1;break}return b}function u(w,p,v,S){for(var h=0;v--;)w[v]-=h,h=w[v]<p[v]?1:0,w[v]=h*S+w[v]-p[v];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,p,v,S,h){var b,E,y,O,q,ne,me,xe,Te,W,be,Ie,_e,Qe,Ye,Le,Ge,Fe=w.s==p.s?1:-1,Oe=w.c,Ee=p.c;if(!Oe||!Oe[0]||!Ee||!Ee[0])return new D(!w.s||!p.s||(Oe?Ee&&Oe[0]==Ee[0]:!Ee)?NaN:Oe&&Oe[0]==0||!Ee?Fe*0:Fe/0);for(xe=new D(Fe),Te=xe.c=[],E=w.e-p.e,Fe=v+E+1,h||(h=tt,E=Xe(w.e/he)-Xe(p.e/he),Fe=Fe/he|0),y=0;Ee[y]==(Oe[y]||0);y++);if(Ee[y]>(Oe[y]||0)&&E--,Fe<0)Te.push(1),O=!0;else{for(Qe=Oe.length,Le=Ee.length,y=0,Fe+=2,q=Je(h/(Ee[0]+1)),q>1&&(Ee=i(Ee,q,h),Oe=i(Oe,q,h),Le=Ee.length,Qe=Oe.length),_e=Le,W=Oe.slice(0,Le),be=W.length;be<Le;W[be++]=0);Ge=Ee.slice(),Ge=[0].concat(Ge),Ye=Ee[0],Ee[1]>=h/2&&Ye++;do{if(q=0,b=l(Ee,W,Le,be),b<0){if(Ie=W[0],Le!=be&&(Ie=Ie*h+(W[1]||0)),q=Je(Ie/Ye),q>1)for(q>=h&&(q=h-1),ne=i(Ee,q,h),me=ne.length,be=W.length;l(ne,W,me,be)==1;)q--,u(ne,Le<me?Ge:Ee,me,h),me=ne.length,b=1;else q==0&&(b=q=1),ne=Ee.slice(),me=ne.length;if(me<be&&(ne=[0].concat(ne)),u(W,ne,be,h),be=W.length,b==-1)for(;l(Ee,W,Le,be)<1;)q++,u(W,Le<be?Ge:Ee,be,h),be=W.length}else b===0&&(q++,W=[0]);Te[y++]=q,W[0]?W[be++]=Oe[_e]||0:(W=[Oe[_e]],be=1)}while((_e++<Qe||W[0]!=null)&&Fe--);O=W[0]!=null,Te[0]||Te.splice(0,1)}if(h==tt){for(y=1,Fe=Te[0];Fe>=10;Fe/=10,y++);ge(xe,v+(xe.e=y+E*he-1)+1,S,O)}else xe.e=E,xe.r=+O;return xe}})();function Q(i,l,u,w){var p,v,S,h,b;if(u==null?u=c:Ne(u,0,8),!i.c)return i.toString();if(p=i.c[0],S=i.e,l==null)b=Ke(i.c),b=w==1||w==2&&(S<=T||S>=C)?un(b,S):ut(b,S,"0");else if(i=ge(new D(i),l,u),v=i.e,b=Ke(i.c),h=b.length,w==1||w==2&&(l<=v||v<=T)){for(;h<l;b+="0",h++);b=un(b,v)}else if(l-=S+(w===2&&v>S),b=ut(b,v,"0"),v+1>h){if(--l>0)for(b+=".";l--;b+="0");}else if(l+=v-h,l>0)for(v+1==h&&(b+=".");l--;b+="0");return i.s<0&&p?"-"+b:b}function oe(i,l){for(var u,w,p=1,v=new D(i[0]);p<i.length;p++)w=new D(i[p]),(!w.s||(u=St(v,w))===l||u===0&&v.s===l)&&(v=w);return v}function ye(i,l,u){for(var w=1,p=l.length;!l[--p];l.pop());for(p=l[0];p>=10;p/=10,w++);return(u=w+u*he-1)>L?i.c=i.e=null:u<N?i.c=[i.e=0]:(i.e=u,i.c=l),i}s=(function(){var i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,u=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,S,h,b){var E,y=h?S:S.replace(p,"");if(w.test(y))v.s=isNaN(y)?null:y<0?-1:1;else{if(!h&&(y=y.replace(i,function(O,q,ne){return E=(ne=ne.toLowerCase())=="x"?16:ne=="b"?2:8,!b||b==E?q:O}),b&&(E=b,y=y.replace(l,"$1").replace(u,"0.$1")),S!=y))return new D(y,E);if(D.DEBUG)throw Error(We+"Not a"+(b?" base "+b:"")+" number: "+S);v.s=null}v.c=v.e=null}})();function ge(i,l,u,w){var p,v,S,h,b,E,y,O=i.c,q=Qn;if(O){e:{for(p=1,h=O[0];h>=10;h/=10,p++);if(v=l-p,v<0)v+=he,S=l,b=O[E=0],y=Je(b/q[p-S-1]%10);else if(E=Kn((v+1)/he),E>=O.length)if(w){for(;O.length<=E;O.push(0));b=y=0,p=1,v%=he,S=v-he+1}else break e;else{for(b=h=O[E],p=1;h>=10;h/=10,p++);v%=he,S=v-he+p,y=S<0?0:Je(b/q[p-S-1]%10)}if(w=w||l<0||O[E+1]!=null||(S<0?b:b%q[p-S-1]),w=u<4?(y||w)&&(u==0||u==(i.s<0?3:2)):y>5||y==5&&(u==4||w||u==6&&(v>0?S>0?b/q[p-S]:0:O[E-1])%10&1||u==(i.s<0?8:7)),l<1||!O[0])return O.length=0,w?(l-=i.e+1,O[0]=q[(he-l%he)%he],i.e=-l||0):O[0]=i.e=0,i;if(v==0?(O.length=E,h=1,E--):(O.length=E+1,h=q[he-v],O[E]=S>0?Je(b/q[p-S]%q[S])*h:0),w)for(;;)if(E==0){for(v=1,S=O[0];S>=10;S/=10,v++);for(S=O[0]+=h,h=1;S>=10;S/=10,h++);v!=h&&(i.e++,O[0]==tt&&(O[0]=1));break}else{if(O[E]+=h,O[E]!=tt)break;O[E--]=0,h=1}for(v=O.length;O[--v]===0;O.pop());}i.e>L?i.c=i.e=null:i.e<N&&(i.c=[i.e=0])}return i}function Ce(i){var l,u=i.e;return u===null?i.toString():(l=Ke(i.c),l=u<=T||u>=C?un(l,u):ut(l,u,"0"),i.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var i=new D(this);return i.s<0&&(i.s=1),i},r.comparedTo=function(i,l){return St(this,new D(i,l))},r.decimalPlaces=r.dp=function(i,l){var u,w,p,v=this;if(i!=null)return Ne(i,0,Me),l==null?l=c:Ne(l,0,8),ge(new D(v),i+v.e+1,l);if(!(u=v.c))return null;if(w=((p=u.length-1)-Xe(this.e/he))*he,p=u[p])for(;p%10==0;p/=10,w--);return w<0&&(w=0),w},r.dividedBy=r.div=function(i,l){return t(this,new D(i,l),o,c)},r.dividedToIntegerBy=r.idiv=function(i,l){return t(this,new D(i,l),0,1)},r.exponentiatedBy=r.pow=function(i,l){var u,w,p,v,S,h,b,E,y,O=this;if(i=new D(i),i.c&&!i.isInteger())throw Error(We+"Exponent not an integer: "+Ce(i));if(l!=null&&(l=new D(l)),h=i.e>14,!O.c||!O.c[0]||O.c[0]==1&&!O.e&&O.c.length==1||!i.c||!i.c[0])return y=new D(Math.pow(+Ce(O),h?i.s*(2-dn(i)):+Ce(i))),l?y.mod(l):y;if(b=i.s<0,l){if(l.c?!l.c[0]:!l.s)return new D(NaN);w=!b&&O.isInteger()&&l.isInteger(),w&&(O=O.mod(l))}else{if(i.e>9&&(O.e>0||O.e<-1||(O.e==0?O.c[0]>1||h&&O.c[1]>=24e7:O.c[0]<8e13||h&&O.c[0]<=9999975e7)))return v=O.s<0&&dn(i)?-0:0,O.e>-1&&(v=1/v),new D(b?1/v:v);x&&(v=Kn(x/he+2))}for(h?(u=new D(.5),b&&(i.s=1),E=dn(i)):(p=Math.abs(+Ce(i)),E=p%2),y=new D(a);;){if(E){if(y=y.times(O),!y.c)break;v?y.c.length>v&&(y.c.length=v):w&&(y=y.mod(l))}if(p){if(p=Je(p/2),p===0)break;E=p%2}else if(i=i.times(u),ge(i,i.e+1,1),i.e>14)E=dn(i);else{if(p=+Ce(i),p===0)break;E=p%2}O=O.times(O),v?O.c&&O.c.length>v&&(O.c.length=v):w&&(O=O.mod(l))}return w?y:(b&&(y=a.div(y)),l?y.mod(l):v?ge(y,x,c,S):y)},r.integerValue=function(i){var l=new D(this);return i==null?i=c:Ne(i,0,8),ge(l,l.e+1,i)},r.isEqualTo=r.eq=function(i,l){return St(this,new D(i,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(i,l){return St(this,new D(i,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(i,l){return(l=St(this,new D(i,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Xe(this.e/he)>this.c.length-2},r.isLessThan=r.lt=function(i,l){return St(this,new D(i,l))<0},r.isLessThanOrEqualTo=r.lte=function(i,l){return(l=St(this,new D(i,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(i,l){var u,w,p,v,S=this,h=S.s;if(i=new D(i,l),l=i.s,!h||!l)return new D(NaN);if(h!=l)return i.s=-l,S.plus(i);var b=S.e/he,E=i.e/he,y=S.c,O=i.c;if(!b||!E){if(!y||!O)return y?(i.s=-l,i):new D(O?S:NaN);if(!y[0]||!O[0])return O[0]?(i.s=-l,i):new D(y[0]?S:c==3?-0:0)}if(b=Xe(b),E=Xe(E),y=y.slice(),h=b-E){for((v=h<0)?(h=-h,p=y):(E=b,p=O),p.reverse(),l=h;l--;p.push(0));p.reverse()}else for(w=(v=(h=y.length)<(l=O.length))?h:l,h=l=0;l<w;l++)if(y[l]!=O[l]){v=y[l]<O[l];break}if(v&&(p=y,y=O,O=p,i.s=-i.s),l=(w=O.length)-(u=y.length),l>0)for(;l--;y[u++]=0);for(l=tt-1;w>h;){if(y[--w]<O[w]){for(u=w;u&&!y[--u];y[u]=l);--y[u],y[w]+=tt}y[w]-=O[w]}for(;y[0]==0;y.splice(0,1),--E);return y[0]?ye(i,y,E):(i.s=c==3?-1:1,i.c=[i.e=0],i)},r.modulo=r.mod=function(i,l){var u,w,p=this;return i=new D(i,l),!p.c||!i.s||i.c&&!i.c[0]?new D(NaN):!i.c||p.c&&!p.c[0]?new D(p):(k==9?(w=i.s,i.s=1,u=t(p,i,0,3),i.s=w,u.s*=w):u=t(p,i,0,k),i=p.minus(u.times(i)),!i.c[0]&&k==1&&(i.s=p.s),i)},r.multipliedBy=r.times=function(i,l){var u,w,p,v,S,h,b,E,y,O,q,ne,me,xe,Te,W=this,be=W.c,Ie=(i=new D(i,l)).c;if(!be||!Ie||!be[0]||!Ie[0])return!W.s||!i.s||be&&!be[0]&&!Ie||Ie&&!Ie[0]&&!be?i.c=i.e=i.s=null:(i.s*=W.s,!be||!Ie?i.c=i.e=null:(i.c=[0],i.e=0)),i;for(w=Xe(W.e/he)+Xe(i.e/he),i.s*=W.s,b=be.length,O=Ie.length,b<O&&(me=be,be=Ie,Ie=me,p=b,b=O,O=p),p=b+O,me=[];p--;me.push(0));for(xe=tt,Te=wt,p=O;--p>=0;){for(u=0,q=Ie[p]%Te,ne=Ie[p]/Te|0,S=b,v=p+S;v>p;)E=be[--S]%Te,y=be[S]/Te|0,h=ne*E+y*q,E=q*E+h%Te*Te+me[v]+u,u=(E/xe|0)+(h/Te|0)+ne*y,me[v--]=E%xe;me[v]=u}return u?++w:me.splice(0,1),ye(i,me,w)},r.negated=function(){var i=new D(this);return i.s=-i.s||null,i},r.plus=function(i,l){var u,w=this,p=w.s;if(i=new D(i,l),l=i.s,!p||!l)return new D(NaN);if(p!=l)return i.s=-l,w.minus(i);var v=w.e/he,S=i.e/he,h=w.c,b=i.c;if(!v||!S){if(!h||!b)return new D(p/0);if(!h[0]||!b[0])return b[0]?i:new D(h[0]?w:p*0)}if(v=Xe(v),S=Xe(S),h=h.slice(),p=v-S){for(p>0?(S=v,u=b):(p=-p,u=h),u.reverse();p--;u.push(0));u.reverse()}for(p=h.length,l=b.length,p-l<0&&(u=b,b=h,h=u,l=p),p=0;l;)p=(h[--l]=h[l]+b[l]+p)/tt|0,h[l]=tt===h[l]?0:h[l]%tt;return p&&(h=[p].concat(h),++S),ye(i,h,S)},r.precision=r.sd=function(i,l){var u,w,p,v=this;if(i!=null&&i!==!!i)return Ne(i,1,Me),l==null?l=c:Ne(l,0,8),ge(new D(v),i,l);if(!(u=v.c))return null;if(p=u.length-1,w=p*he+1,p=u[p]){for(;p%10==0;p/=10,w--);for(p=u[0];p>=10;p/=10,w++);}return i&&v.e+1>w&&(w=v.e+1),w},r.shiftedBy=function(i){return Ne(i,-Zn,Zn),this.times("1e"+i)},r.squareRoot=r.sqrt=function(){var i,l,u,w,p,v=this,S=v.c,h=v.s,b=v.e,E=o+4,y=new D("0.5");if(h!==1||!S||!S[0])return new D(!h||h<0&&(!S||S[0])?NaN:S?v:1/0);if(h=Math.sqrt(+Ce(v)),h==0||h==1/0?(l=Ke(S),(l.length+b)%2==0&&(l+="0"),h=Math.sqrt(+l),b=Xe((b+1)/2)-(b<0||b%2),h==1/0?l="5e"+b:(l=h.toExponential(),l=l.slice(0,l.indexOf("e")+1)+b),u=new D(l)):u=new D(h+""),u.c[0]){for(b=u.e,h=b+E,h<3&&(h=0);;)if(p=u,u=y.times(p.plus(t(v,p,E,1))),Ke(p.c).slice(0,h)===(l=Ke(u.c)).slice(0,h))if(u.e<b&&--h,l=l.slice(h-3,h+1),l=="9999"||!w&&l=="4999"){if(!w&&(ge(p,p.e+o+2,0),p.times(p).eq(v))){u=p;break}E+=4,h+=4,w=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(ge(u,u.e+o+2,1),i=!u.times(u).eq(v));break}}return ge(u,u.e+o+1,c,i)},r.toExponential=function(i,l){return i!=null&&(Ne(i,0,Me),i++),Q(this,i,l,1)},r.toFixed=function(i,l){return i!=null&&(Ne(i,0,Me),i=i+this.e+1),Q(this,i,l)},r.toFormat=function(i,l,u){var w,p=this;if(u==null)i!=null&&l&&typeof l=="object"?(u=l,l=null):i&&typeof i=="object"?(u=i,i=l=null):u=g;else if(typeof u!="object")throw Error(We+"Argument not an object: "+u);if(w=p.toFixed(i,l),p.c){var v,S=w.split("."),h=+u.groupSize,b=+u.secondaryGroupSize,E=u.groupSeparator||"",y=S[0],O=S[1],q=p.s<0,ne=q?y.slice(1):y,me=ne.length;if(b&&(v=h,h=b,b=v,me-=v),h>0&&me>0){for(v=me%h||h,y=ne.substr(0,v);v<me;v+=h)y+=E+ne.substr(v,h);b>0&&(y+=E+ne.slice(v)),q&&(y="-"+y)}w=O?y+(u.decimalSeparator||"")+((b=+u.fractionGroupSize)?O.replace(new RegExp("\\d{"+b+"}\\B","g"),"$&"+(u.fractionGroupSeparator||"")):O):y}return(u.prefix||"")+w+(u.suffix||"")},r.toFraction=function(i){var l,u,w,p,v,S,h,b,E,y,O,q,ne=this,me=ne.c;if(i!=null&&(h=new D(i),!h.isInteger()&&(h.c||h.s!==1)||h.lt(a)))throw Error(We+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+Ce(h));if(!me)return new D(ne);for(l=new D(a),E=u=new D(a),w=b=new D(a),q=Ke(me),v=l.e=q.length-ne.e-1,l.c[0]=Qn[(S=v%he)<0?he+S:S],i=!i||h.comparedTo(l)>0?v>0?l:E:h,S=L,L=1/0,h=new D(q),b.c[0]=0;y=t(h,l,0,1),p=u.plus(y.times(w)),p.comparedTo(i)!=1;)u=w,w=p,E=b.plus(y.times(p=E)),b=p,l=h.minus(y.times(p=l)),h=p;return p=t(i.minus(u),w,0,1),b=b.plus(p.times(E)),u=u.plus(p.times(w)),b.s=E.s=ne.s,v=v*2,O=t(E,w,v,c).minus(ne).abs().comparedTo(t(b,u,v,c).minus(ne).abs())<1?[E,w]:[b,u],L=S,O},r.toNumber=function(){return+Ce(this)},r.toPrecision=function(i,l){return i!=null&&Ne(i,1,Me),Q(this,i,l,2)},r.toString=function(i){var l,u=this,w=u.s,p=u.e;return p===null?w?(l="Infinity",w<0&&(l="-"+l)):l="NaN":(i==null?l=p<=T||p>=C?un(Ke(u.c),p):ut(Ke(u.c),p,"0"):i===10&&ue?(u=ge(new D(u),o+p+1,c),l=ut(Ke(u.c),u.e,"0")):(Ne(i,2,B.length,"Base"),l=n(ut(Ke(u.c),p,"0"),10,i,w,!0)),w<0&&u.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return Ce(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,e!=null&&D.set(e),D}function Xe(e){var t=e|0;return e>0||e===t?t:t-1}function Ke(e){for(var t,n,s=1,r=e.length,a=e[0]+"";s<r;){for(t=e[s++]+"",n=he-t.length;n--;t="0"+t);a+=t}for(r=a.length;a.charCodeAt(--r)===48;);return a.slice(0,r+1||1)}function St(e,t){var n,s,r=e.c,a=t.c,o=e.s,c=t.s,T=e.e,C=t.e;if(!o||!c)return null;if(n=r&&!r[0],s=a&&!a[0],n||s)return n?s?0:-c:o;if(o!=c)return o;if(n=o<0,s=T==C,!r||!a)return s?0:!r^n?1:-1;if(!s)return T>C^n?1:-1;for(c=(T=r.length)<(C=a.length)?T:C,o=0;o<c;o++)if(r[o]!=a[o])return r[o]>a[o]^n?1:-1;return T==C?0:T>C^n?1:-1}function Ne(e,t,n,s){if(e<t||e>n||e!==Je(e))throw Error(We+(s||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function dn(e){var t=e.c.length-1;return Xe(e.e/he)==t&&e.c[t]%2!=0}function un(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ut(e,t,n){var s,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(s=e.length,++t>s){for(r=n,t-=s;--t;r+=n);e+=r}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var de=lr();class fn{baseUrl;constructor(t){this.baseUrl=t}buildUrl(t,n){const s=new URL(t,this.baseUrl);return n&&Object.entries(n).forEach(([r,a])=>{a!=null&&s.searchParams.append(r,String(a))}),s.toString()}async get(t,n={}){const s=this.buildUrl(t,n.query),r=await fetch(s,{method:"GET",headers:n.headers||{}});if(!r.ok){let o=null;try{o=await r.json()}catch{try{const T=await r.text();T&&(o={message:T})}catch{}}const c=new Error(o?.message||o?.errorMessage||`HTTP ${r.status}: ${r.statusText}`);throw c.status=r.status,c.statusText=r.statusText,o&&(c.data=o),c}return{data:await r.json(),status:r.status}}async post(t,n,s={}){const r=this.buildUrl(t,s.query),a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...s.headers},body:JSON.stringify(n)});if(!a.ok){let c=null;try{c=await a.json()}catch{try{const C=await a.text();C&&(c={message:C})}catch{}}const T=new Error(c?.message||c?.errorMessage||`HTTP ${a.status}: ${a.statusText}`);throw T.status=a.status,T.statusText=a.statusText,c&&(T.data=c),T}return{data:await a.json(),status:a.status}}}const Ci="https://deep-index.moralis.io";function qt(){return"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImY4NmY0Yzc2LTA3MDQtNGEwZS04YTA0LWUwODllOGQxMGZjZCIsIm9yZ0lkIjoiMzk0MDAyIiwidXNlcklkIjoiNDA0ODUzIiwidHlwZUlkIjoiYjQyODExOTQtOGQ0Yi00NjkxLTlhZjItNjU4ODE2NzExYmRjIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MTY4NjQyNTYsImV4cCI6NDg3MjYyNDI1Nn0.V8crfBIBardAnZkc05FD0hQIJBeZxMqvzRnYExVtnF8"}function Jt(e){return{"X-API-Key":e,Accept:"application/json"}}const Xt=new fn(Ci);async function rt(e){const{address:t,chain:n="base",token_addresses:s,exclude_spam:r,exclude_unverified_contracts:a}=e;if(!t)throw new Error("Address is required");try{const o=qt(),c={chain:n,exclude_spam:r??!1,exclude_unverified_contracts:a??!1};s&&(c.token_addresses=s);const C=(await Xt.get(`/api/v2.2/wallets/${encodeURIComponent(t)}/tokens`,{query:c,headers:Jt(o)})).data;return C?.result?.length>0&&(C.result=C.result.filter(N=>new de(N?.balance||0).gt(0)),C.result=C.result.map(N=>({...N,token_address:N.token_address===pi?qe:N.token_address}))),{success:!0,data:C}}catch(o){const c=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching token balances:",c),{success:!1,error:c}}}async function Bi(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Token address is required");try{const s=qt(),[r,a]=await Promise.allSettled([Xt.get("/api/v2.2/erc20/metadata",{query:{chain:n,addresses:[t]},headers:Jt(s)}),Xt.get(`/api/v2.2/erc20/${encodeURIComponent(t)}/price`,{query:{chain:n,include:"percent_change"},headers:Jt(s)})]),o=r.status==="fulfilled"?r.value.data:[];if(!o||o.length===0)return{success:!1,error:"Token metadata not found"};const c=o[0],T=a.status==="fulfilled"?a.value.data?.usdPrice??void 0:void 0;return{success:!0,data:{token_address:c.token_address,name:c.name,symbol:c.symbol,decimals:c.decimals,logo:c.logo||c.thumbnail,thumbnail:c.thumbnail,usd_price:T}}}catch(s){const r=s instanceof Error?s.message:"Unknown error";return console.error("❌ Error fetching token metadata:",r),{success:!1,error:r}}}async function Pi(e){const{prompt:t,model:n="gpt-4.1-mini",stream:s=!1,systemPrompt:r}=e;if(!t)throw new Error("Prompt is required");try{const a=qt(),o=new fn("https://cortex-api.moralis.io"),c=r?`${r}
22
+ `).slice(0,-1)}class Ka extends fe{constructor(t,{account:n,docsPath:s,chain:r,data:a,gas:o,gasPrice:c,maxFeePerGas:T,maxPriorityFeePerGas:C,nonce:N,to:L,value:m,stateOverride:k}){const x=n?Vn(n):void 0;let g=ws({from:x?.address,to:L,value:typeof m<"u"&&`${io(m)} ${r?.nativeCurrency?.symbol||"ETH"}`,data:a,gas:o,gasPrice:typeof c<"u"&&`${Tt(c)} gwei`,maxFeePerGas:typeof T<"u"&&`${Tt(T)} gwei`,maxPriorityFeePerGas:typeof C<"u"&&`${Tt(C)} gwei`,nonce:N});k&&(g+=`
23
+ ${Xa(k)}`),super(t.shortMessage,{cause:t,docsPath:s,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",g].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}function Za(e,t){const n=(e.details||"").toLowerCase(),s=e instanceof fe?e.walk(r=>r?.code===Mt.code):e;return s instanceof fe?new Mt({cause:e,message:s.details}):Mt.nodeMessage.test(n)?new Mt({cause:e,message:e.details}):Et.nodeMessage.test(n)?new Et({cause:e,maxFeePerGas:t?.maxFeePerGas}):Cn.nodeMessage.test(n)?new Cn({cause:e,maxFeePerGas:t?.maxFeePerGas}):Bn.nodeMessage.test(n)?new Bn({cause:e,nonce:t?.nonce}):Pn.nodeMessage.test(n)?new Pn({cause:e,nonce:t?.nonce}):Nn.nodeMessage.test(n)?new Nn({cause:e,nonce:t?.nonce}):On.nodeMessage.test(n)?new On({cause:e}):Un.nodeMessage.test(n)?new Un({cause:e,gas:t?.gas}):Dn.nodeMessage.test(n)?new Dn({cause:e,gas:t?.gas}):Fn.nodeMessage.test(n)?new Fn({cause:e}):Vt.nodeMessage.test(n)?new Vt({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new Us({cause:e})}function Qa(e,{docsPath:t,...n}){const s=(()=>{const r=Za(e,n);return r instanceof Us?e:r})();return new Ka(s,{docsPath:t,...n})}function $a(e,{format:t}){if(!t)return{};const n={};function s(a){const o=Object.keys(a);for(const c of o)c in e&&(n[c]=e[c]),a[c]&&typeof a[c]=="object"&&!Array.isArray(a[c])&&s(a[c])}const r=t(e||{});return s(r),n}function ei(e){const{account:t,maxFeePerGas:n,maxPriorityFeePerGas:s,to:r}=e,a=t?Vn(t):void 0;if(a&&!Re(a.address))throw new st({address:a.address});if(r&&!Re(r))throw new st({address:r});if(n&&n>Dt)throw new Et({maxFeePerGas:n});if(s&&n&&s>n)throw new Vt({maxFeePerGas:n,maxPriorityFeePerGas:s})}async function ti(e,t){const{account:n=e.account}=t;if(!n)throw new Aa;const s=Vn(n);try{const{accessList:r,blockNumber:a,blockTag:o,data:c,gas:T,gasPrice:C,maxFeePerGas:N,maxPriorityFeePerGas:L,nonce:m,to:k,value:x,...g}=t,ue=(typeof a=="bigint"?le(a):void 0)||o;ei(t);const D=e.chain?.formatters?.transactionRequest?.format,oe=(D||Zr)({...$a(g,{format:D}),account:s,accessList:r,data:c,gas:T,gasPrice:C,maxFeePerGas:N,maxPriorityFeePerGas:L,nonce:m,to:k,value:x},"estimateGas"),{baseFeePerGas:ye,gasLimit:ge,priorityFeePerGas:Ce}=await e.request({method:"linea_estimateGas",params:ue?[oe,ue]:[oe]});return{baseFeePerGas:BigInt(ye),gasLimit:BigInt(ge),priorityFeePerGas:BigInt(Ce)}}catch(r){throw Qa(r,{...t,account:s,chain:e.chain})}}const ni={fees:{estimateFeesPerGas:Qs,async maxPriorityFeePerGas({block:e,client:t,request:n}){const s=await Qs({block:e,client:t,multiply:r=>r,request:n,type:"eip1559"});return s?.maxPriorityFeePerGas?s.maxPriorityFeePerGas:null}}};async function Qs({client:e,multiply:t,request:n,type:s}){try{const r=await ti(e,{...n,account:n?.account}),{priorityFeePerGas:a}=r,c=t(BigInt(r.baseFeePerGas))+a;return s==="legacy"?{gasPrice:c}:{maxFeePerGas:c,maxPriorityFeePerGas:a}}catch{return null}}const si=at({...ni,id:59144,name:"Linea Mainnet",blockTime:2e3,nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build",apiUrl:"https://api.lineascan.build/api"}},contracts:{multicall3:{address:"0xcA11bde05977b3631167028862bE2a173976CA11",blockCreated:42},ensRegistry:{address:"0x50130b669B28C339991d8676FA73CF122a121267",blockCreated:6682888},ensUniversalResolver:{address:"0x4D41762915F83c76EcaF6776d9b08076aA32b492",blockCreated:22222151}},ensTlds:[".linea.eth"],testnet:!1}),ri=at({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}}}),jt=1,oi=at({...cn,id:10,name:"OP Mainnet",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://mainnet.optimism.io"]}},blockExplorers:{default:{name:"Optimism Explorer",url:"https://optimistic.etherscan.io",apiUrl:"https://api-optimistic.etherscan.io/api"}},contracts:{...cn.contracts,disputeGameFactory:{[jt]:{address:"0xe5965Ab5962eDc7477C8520243A95517CD252fA9"}},l2OutputOracle:{[jt]:{address:"0xdfe97868233d1aa22e815a266982f2cf17685a27"}},multicall3:{address:"0xca11bde05977b3631167028862be2a173976ca11",blockCreated:4286263},portal:{[jt]:{address:"0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"}},l1StandardBridge:{[jt]:{address:"0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"}}},sourceId:jt}),ai=at({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}}}),$s="/docs/contract/encodeFunctionData";function ii(e){const{abi:t,args:n,functionName:s}=e;let r=t[0];if(s){const a=Ja({abi:t,args:n,name:s});if(!a)throw new js(s,{docsPath:$s});r=a}if(r.type!=="function")throw new js(void 0,{docsPath:$s});return{abi:[r],functionName:Xs(Wn(r))}}function bt(e){const{args:t}=e,{abi:n,functionName:s}=e.abi.length===1&&e.functionName?.startsWith("0x")?e:ii(e),r=n[0],a=s,o="inputs"in r&&r.inputs?_a(r.inputs,t??[]):void 0;return kt([a,o??"0x"])}const wt={1:{...ri,logo:"https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024",chainId:1,chainType:"ether",chainTypeMoralis:"eth",tokenTrendingDefault:["0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2","0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"]},10:{...oi,logo:"https://cryptologos.cc/logos/optimism-ethereum-op-logo.png?v=024",chainId:10,chainType:"optimism",chainTypeMoralis:"optimism",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0x68f180fcce6836688e9084f035309e29bf0a2095","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},56:{...va,logo:"https://cryptologos.cc/logos/bnb-bnb-logo.png?v=024",chainId:56,chainType:"bsc",chainTypeMoralis:"bsc",tokenTrendingDefault:["0x2170ed0880ac9a755fd29b2688956bd959f933f8","0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c"]},137:{...ai,logo:"https://cryptologos.cc/logos/polygon-matic-logo.png?v=024",chainId:137,chainType:"matic",chainTypeMoralis:"polygon",tokenTrendingDefault:["0x7ceb23fd6bc0add59e62ac25578270cff1b9f619","0x1bfd67037b42cf73acf2047067bd4f2c47d9bfd6"]},8453:{...zs,logo:"https://icons.llamao.fi/icons/chains/rsz_base.jpg",chainId:8453,chainType:"base",chainTypeMoralis:"base",tokenTrendingDefault:["0x4200000000000000000000000000000000000006","0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf","0xc47da4cb96ce65a96844a01bfae509f9d5454534"]},42161:{...wa,logo:"https://cryptologos.cc/logos/arbitrum-arb-logo.png?v=024",chainId:42161,chainType:"arbitrum",chainTypeMoralis:"arbitrum",tokenTrendingDefault:["0x82af49447d8a07e3bd95bd0d56f35241523fbab1","0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f"]},43114:{...ya,logo:"https://cryptologos.cc/logos/avalanche-avax-logo.png?v=024",chainId:43114,chainType:"avax",chainTypeMoralis:"avalanche",tokenTrendingDefault:["0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB","0x0555E30da8f98308EdB960aa94C0Db47230d2B9c"]},59144:{...si,logo:"https://icons.llamao.fi/icons/chains/rsz_linea.jpg",chainId:59144,chainType:"linea",chainTypeMoralis:"linea",tokenTrendingDefault:["0xe5d7c2a44ffddf6b295a15c148167daaaf5cf34f","0x3aab2285ddcddad8edf438c1bab47e1a9d05a9b4"]}},ci=e=>{const t=new Date,n=new Date(t);n.setDate(n.getDate()-1);const s=new Date(e);return s.setHours(0,0,0,0),t.setHours(0,0,0,0),n.setHours(0,0,0,0),s.getTime()===t.getTime()?"Today":s.getTime()===n.getTime()?"Yesterday":s.toLocaleDateString("en-US",{month:"short",day:"numeric",year:s.getFullYear()!==t.getFullYear()?"numeric":void 0})},lt=e=>new Promise(t=>setTimeout(t,e||0)),li=(e,t=5,n=5)=>(e=e||"",e?.length<=t+n?e:`${e.substr(0,t)}...${e.substr(e.length-n,n)}`),di=e=>{if(!e)return"";const t=wt[e];return t?t.chainTypeMoralis:""},ui=e=>{if(!e)return"";const t=wt[e];return t?t.chainType:""},St={getItem(e){if(typeof window>"u")return null;try{return window.localStorage.getItem(e)}catch{return null}},setItem(e,t){if(!(typeof window>"u"))try{window.localStorage.setItem(e,t)}catch{}},removeItem(e){if(!(typeof window>"u"))try{window.localStorage.removeItem(e)}catch{}},get length(){if(typeof window>"u")return 0;try{return window.localStorage.length}catch{return 0}},key(e){if(typeof window>"u")return null;try{return window.localStorage.key(e)}catch{return null}}};class fi extends fe{constructor({value:t}){super(`Number \`${t}\` is not a valid decimal number.`,{name:"InvalidDecimalNumberError"})}}function dt(e,t){if(!/^(-?)([0-9]*)\.?([0-9]*)$/.test(e))throw new fi({value:e});let[n,s="0"]=e.split(".");const r=n.startsWith("-");if(r&&(n=n.slice(1)),s=s.replace(/(0+)$/,""),t===0)Math.round(+`.${s}`)===1&&(n=`${BigInt(n)+1n}`),s="";else if(s.length>t){const[a,o,c]=[s.slice(0,t-1),s.slice(t-1,t),s.slice(t)],T=Math.round(+`${o}.${c}`);T>9?s=`${BigInt(a)+BigInt(1)}0`.padStart(a.length+1,"0"):s=`${a}${T}`,s.length>t&&(s=s.slice(1),n=`${BigInt(n)+1n}`),s=s.slice(0,t)}else s=s.padEnd(t,"0");return BigInt(`${r?"-":""}${n}${s}`)}const pi="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",qe="0x0000000000000000000000000000000000000000",hi=({address:e,chainId:t})=>{const[n,s]=re.useState(!1),r=re.useCallback(()=>{if(!e)return;const a=e,o=()=>{s(!0),setTimeout(()=>s(!1),2e3)};try{navigator.clipboard.writeText(a).then(o).catch(()=>{const c=document.createElement("input");c.value=a,document.body.appendChild(c),c.select(),document.execCommand("copy"),c.remove(),o()})}catch{const c=document.createElement("input");c.value=a,document.body.appendChild(c),c.select(),document.execCommand("copy"),c.remove(),o()}},[e]);return I.jsx(I.Fragment,{children:Re(e||"")&&I.jsxs("div",{className:"chat-user-info",children:[t&&wt[t]?.logo&&I.jsx("div",{className:"user-avatar",children:I.jsx("img",{src:wt[t].logo||"",alt:"Chain",width:20,height:20})}),I.jsx("span",{className:"user-wallet",children:I.jsx("a",{href:wt[t]?.blockExplorers?.default?.url+"/address/"+e,target:"_blank",rel:"noopener noreferrer",children:li(e)||"Not connected"})}),I.jsx("button",{className:"copy-address-btn",onClick:r,"aria-label":"Copy wallet address",type:"button",title:n?"Copied!":"Copy address",children:n?I.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}):I.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:[I.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),I.jsx("path",{d:"M5 15H4C2.89543 15 2 14.1046 2 13V4C2 2.89543 2.89543 2 4 2H13C14.1046 2 15 2.89543 15 4V5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})})]})})},He=[];for(let e=0;e<256;++e)He.push((e+256).toString(16).slice(1));function mi(e,t=0){return(He[e[t+0]]+He[e[t+1]]+He[e[t+2]]+He[e[t+3]]+"-"+He[e[t+4]]+He[e[t+5]]+"-"+He[e[t+6]]+He[e[t+7]]+"-"+He[e[t+8]]+He[e[t+9]]+"-"+He[e[t+10]]+He[e[t+11]]+He[e[t+12]]+He[e[t+13]]+He[e[t+14]]+He[e[t+15]]).toLowerCase()}let qn;const gi=new Uint8Array(16);function bi(){if(!qn){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");qn=crypto.getRandomValues.bind(crypto)}return qn(gi)}const er={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function wi(e,t,n){e=e||{};const s=e.random??e.rng?.()??bi();if(s.length<16)throw new Error("Random bytes length must be >= 16");return s[6]=s[6]&15|64,s[8]=s[8]&63|128,mi(s)}function tr(e,t,n){return er.randomUUID&&!e?er.randomUUID():wi(e)}const yi="chat_widget_messages",nr=re.createContext(void 0),Jn=()=>{const e=re.useContext(nr);if(!e)throw new Error("useConnect must be used within ConnectProvider");return{...e,chainData:wt[e.account?.chainId]||void 0,chainId:e.account?.chainId||void 0,chainType:ui(e.account?.chainId||void 0),chainTypeMoralis:di(e.account?.chainId||void 0)}},vi=({children:e,initialAccount:t})=>I.jsx(nr.Provider,{value:{account:t||null},children:e}),Xn=yi,sr=200,_t=[{id:tr(),text:`**Welcome! 🚀**
24
+ You're connected and ready to explore DeFi! I can help you trade, check prices, and analyze your portfolio when you need it.`,sender:"bot",timestamp:new Date}];function Ai(e,t){return e&&t?`${e}_${t}`:""}function rr(e){return e.map(t=>({...t,timestamp:new Date(t.timestamp)}))}function or(){const e=St.getItem(Xn);if(!e)return null;try{const t=JSON.parse(e);if(t&&t.owner!==void 0&&Array.isArray(t.messages))return{owner:t.owner,messages:rr(t.messages)};if(Array.isArray(t))return{owner:"",messages:rr(t)}}catch{}return null}function ln(e,t){St.setItem(Xn,JSON.stringify({owner:e,messages:t}))}function ki(){const{account:e}=Jn(),t=Ai(e?.address,e?.chainId),[n,s]=re.useState(()=>t||"pending"),[r,a]=re.useState(()=>{const N=or();return t?N&&N.owner===t?N.messages:_t:N?.messages??_t});if(n==="pending"&&t){const N=or();N&&N.owner===t?a(N.messages):ln(t,r),s(t)}else n!=="pending"&&t&&n!==t&&(a(_t),ln(t,_t),s(t));re.useEffect(()=>{n!=="pending"&&ln(n,r)},[r,n]),re.useEffect(()=>{const N=[];for(let L=0;L<St.length;L++){const m=St.key(L);m&&m.startsWith(Xn+"_")&&N.push(m)}N.forEach(L=>St.removeItem(L))},[]);const o=(N,L,m,k,x)=>{const g=m?r.find(ue=>ue.id===m):void 0,B={id:tr(),text:N,sender:L,timestamp:new Date,...g&&{replyTo:{id:g.id,text:g.text,sender:g.sender}},...k&&{buttons:k},...x&&{actionData:x}};return a(ue=>{const D=[...ue,B];return D.length>sr?D.slice(D.length-sr):D}),B},c=(N,L)=>{a(m=>m.map(k=>k.id===N&&k.actionData?{...k,actionData:{...k.actionData,status:L}}:k))},T=(N,L)=>{a(m=>m.map(k=>k.id===N?{...k,text:L}:k))},C=re.useCallback(()=>{a(_t),ln(t,_t)},[t]);return{messages:r,setMessages:a,addMessage:o,updateMessageAction:c,updateMessageText:T,clearMessages:C}}const ar=re.createContext(void 0),xi=()=>{const e=re.useContext(ar);if(!e)throw new Error("useConfig must be used within ConfigProvider");return e},Ti=({children:e,initialConfig:t})=>I.jsx(ar.Provider,{value:{config:t||null},children:e}),ir=re.createContext(void 0),Ei=({children:e,initialLanguage:t="en"})=>{const[n,s]=re.useState(t);return re.useEffect(()=>{t&&s(t)},[t]),I.jsx(ir.Provider,{value:{language:n,setLanguage:s},children:e})},Si=()=>{const e=re.useContext(ir);if(!e)throw new Error("useLanguage must be used within a LanguageProvider");return e};var Ii=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Kn=Math.ceil,Je=Math.floor,We="[BigNumber Error] ",cr=We+"Number primitive has more than 15 significant digits: ",tt=1e14,he=14,Zn=9007199254740991,Qn=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],yt=1e7,Me=1e9;function lr(e){var t,n,s,r=D.prototype={constructor:D,toString:null,valueOf:null},a=new D(1),o=20,c=4,T=-7,C=21,N=-1e7,L=1e7,m=!1,k=1,x=0,g={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},B="0123456789abcdefghijklmnopqrstuvwxyz",ue=!0;function D(i,l){var u,w,p,v,S,h,b,E,y=this;if(!(y instanceof D))return new D(i,l);if(l==null){if(i&&i._isBigNumber===!0){y.s=i.s,!i.c||i.e>L?y.c=y.e=null:i.e<N?y.c=[y.e=0]:(y.e=i.e,y.c=i.c.slice());return}if((h=typeof i=="number")&&i*0==0){if(y.s=1/i<0?(i=-i,-1):1,i===~~i){for(v=0,S=i;S>=10;S/=10,v++);v>L?y.c=y.e=null:(y.e=v,y.c=[i]);return}E=String(i)}else{if(!Ii.test(E=String(i)))return s(y,E,h);y.s=E.charCodeAt(0)==45?(E=E.slice(1),-1):1}(v=E.indexOf("."))>-1&&(E=E.replace(".","")),(S=E.search(/e/i))>0?(v<0&&(v=S),v+=+E.slice(S+1),E=E.substring(0,S)):v<0&&(v=E.length)}else{if(Ne(l,2,B.length,"Base"),l==10&&ue)return y=new D(i),ge(y,o+y.e+1,c);if(E=String(i),h=typeof i=="number"){if(i*0!=0)return s(y,E,h,l);if(y.s=1/i<0?(E=E.slice(1),-1):1,D.DEBUG&&E.replace(/^0\.0*|\./,"").length>15)throw Error(cr+i)}else y.s=E.charCodeAt(0)===45?(E=E.slice(1),-1):1;for(u=B.slice(0,l),v=S=0,b=E.length;S<b;S++)if(u.indexOf(w=E.charAt(S))<0){if(w=="."){if(S>v){v=b;continue}}else if(!p&&(E==E.toUpperCase()&&(E=E.toLowerCase())||E==E.toLowerCase()&&(E=E.toUpperCase()))){p=!0,S=-1,v=0;continue}return s(y,String(i),h,l)}h=!1,E=n(E,l,10,y.s),(v=E.indexOf("."))>-1?E=E.replace(".",""):v=E.length}for(S=0;E.charCodeAt(S)===48;S++);for(b=E.length;E.charCodeAt(--b)===48;);if(E=E.slice(S,++b)){if(b-=S,h&&D.DEBUG&&b>15&&(i>Zn||i!==Je(i)))throw Error(cr+y.s*i);if((v=v-S-1)>L)y.c=y.e=null;else if(v<N)y.c=[y.e=0];else{if(y.e=v,y.c=[],S=(v+1)%he,v<0&&(S+=he),S<b){for(S&&y.c.push(+E.slice(0,S)),b-=he;S<b;)y.c.push(+E.slice(S,S+=he));S=he-(E=E.slice(S)).length}else S-=b;for(;S--;E+="0");y.c.push(+E)}}else y.c=[y.e=0]}D.clone=lr,D.ROUND_UP=0,D.ROUND_DOWN=1,D.ROUND_CEIL=2,D.ROUND_FLOOR=3,D.ROUND_HALF_UP=4,D.ROUND_HALF_DOWN=5,D.ROUND_HALF_EVEN=6,D.ROUND_HALF_CEIL=7,D.ROUND_HALF_FLOOR=8,D.EUCLID=9,D.config=D.set=function(i){var l,u;if(i!=null)if(typeof i=="object"){if(i.hasOwnProperty(l="DECIMAL_PLACES")&&(u=i[l],Ne(u,0,Me,l),o=u),i.hasOwnProperty(l="ROUNDING_MODE")&&(u=i[l],Ne(u,0,8,l),c=u),i.hasOwnProperty(l="EXPONENTIAL_AT")&&(u=i[l],u&&u.pop?(Ne(u[0],-Me,0,l),Ne(u[1],0,Me,l),T=u[0],C=u[1]):(Ne(u,-Me,Me,l),T=-(C=u<0?-u:u))),i.hasOwnProperty(l="RANGE"))if(u=i[l],u&&u.pop)Ne(u[0],-Me,-1,l),Ne(u[1],1,Me,l),N=u[0],L=u[1];else if(Ne(u,-Me,Me,l),u)N=-(L=u<0?-u:u);else throw Error(We+l+" cannot be zero: "+u);if(i.hasOwnProperty(l="CRYPTO"))if(u=i[l],u===!!u)if(u)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))m=u;else throw m=!u,Error(We+"crypto unavailable");else m=u;else throw Error(We+l+" not true or false: "+u);if(i.hasOwnProperty(l="MODULO_MODE")&&(u=i[l],Ne(u,0,9,l),k=u),i.hasOwnProperty(l="POW_PRECISION")&&(u=i[l],Ne(u,0,Me,l),x=u),i.hasOwnProperty(l="FORMAT"))if(u=i[l],typeof u=="object")g=u;else throw Error(We+l+" not an object: "+u);if(i.hasOwnProperty(l="ALPHABET"))if(u=i[l],typeof u=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(u))ue=u.slice(0,10)=="0123456789",B=u;else throw Error(We+l+" invalid: "+u)}else throw Error(We+"Object expected: "+i);return{DECIMAL_PLACES:o,ROUNDING_MODE:c,EXPONENTIAL_AT:[T,C],RANGE:[N,L],CRYPTO:m,MODULO_MODE:k,POW_PRECISION:x,FORMAT:g,ALPHABET:B}},D.isBigNumber=function(i){if(!i||i._isBigNumber!==!0)return!1;if(!D.DEBUG)return!0;var l,u,w=i.c,p=i.e,v=i.s;e:if({}.toString.call(w)=="[object Array]"){if((v===1||v===-1)&&p>=-Me&&p<=Me&&p===Je(p)){if(w[0]===0){if(p===0&&w.length===1)return!0;break e}if(l=(p+1)%he,l<1&&(l+=he),String(w[0]).length==l){for(l=0;l<w.length;l++)if(u=w[l],u<0||u>=tt||u!==Je(u))break e;if(u!==0)return!0}}}else if(w===null&&p===null&&(v===null||v===1||v===-1))return!0;throw Error(We+"Invalid BigNumber: "+i)},D.maximum=D.max=function(){return oe(arguments,-1)},D.minimum=D.min=function(){return oe(arguments,1)},D.random=(function(){var i=9007199254740992,l=Math.random()*i&2097151?function(){return Je(Math.random()*i)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(u){var w,p,v,S,h,b=0,E=[],y=new D(a);if(u==null?u=o:Ne(u,0,Me),S=Kn(u/he),m)if(crypto.getRandomValues){for(w=crypto.getRandomValues(new Uint32Array(S*=2));b<S;)h=w[b]*131072+(w[b+1]>>>11),h>=9e15?(p=crypto.getRandomValues(new Uint32Array(2)),w[b]=p[0],w[b+1]=p[1]):(E.push(h%1e14),b+=2);b=S/2}else if(crypto.randomBytes){for(w=crypto.randomBytes(S*=7);b<S;)h=(w[b]&31)*281474976710656+w[b+1]*1099511627776+w[b+2]*4294967296+w[b+3]*16777216+(w[b+4]<<16)+(w[b+5]<<8)+w[b+6],h>=9e15?crypto.randomBytes(7).copy(w,b):(E.push(h%1e14),b+=7);b=S/7}else throw m=!1,Error(We+"crypto unavailable");if(!m)for(;b<S;)h=l(),h<9e15&&(E[b++]=h%1e14);for(S=E[--b],u%=he,S&&u&&(h=Qn[he-u],E[b]=Je(S/h)*h);E[b]===0;E.pop(),b--);if(b<0)E=[v=0];else{for(v=-1;E[0]===0;E.splice(0,1),v-=he);for(b=1,h=E[0];h>=10;h/=10,b++);b<he&&(v-=he-b)}return y.e=v,y.c=E,y}})(),D.sum=function(){for(var i=1,l=arguments,u=new D(l[0]);i<l.length;)u=u.plus(l[i++]);return u},n=(function(){var i="0123456789";function l(u,w,p,v){for(var S,h=[0],b,E=0,y=u.length;E<y;){for(b=h.length;b--;h[b]*=w);for(h[0]+=v.indexOf(u.charAt(E++)),S=0;S<h.length;S++)h[S]>p-1&&(h[S+1]==null&&(h[S+1]=0),h[S+1]+=h[S]/p|0,h[S]%=p)}return h.reverse()}return function(u,w,p,v,S){var h,b,E,y,O,q,ne,me,xe=u.indexOf("."),Te=o,W=c;for(xe>=0&&(y=x,x=0,u=u.replace(".",""),me=new D(w),q=me.pow(u.length-xe),x=y,me.c=l(ut(Ke(q.c),q.e,"0"),10,p,i),me.e=me.c.length),ne=l(u,w,p,S?(h=B,i):(h=i,B)),E=y=ne.length;ne[--y]==0;ne.pop());if(!ne[0])return h.charAt(0);if(xe<0?--E:(q.c=ne,q.e=E,q.s=v,q=t(q,me,Te,W,p),ne=q.c,O=q.r,E=q.e),b=E+Te+1,xe=ne[b],y=p/2,O=O||b<0||ne[b+1]!=null,O=W<4?(xe!=null||O)&&(W==0||W==(q.s<0?3:2)):xe>y||xe==y&&(W==4||O||W==6&&ne[b-1]&1||W==(q.s<0?8:7)),b<1||!ne[0])u=O?ut(h.charAt(1),-Te,h.charAt(0)):h.charAt(0);else{if(ne.length=b,O)for(--p;++ne[--b]>p;)ne[b]=0,b||(++E,ne=[1].concat(ne));for(y=ne.length;!ne[--y];);for(xe=0,u="";xe<=y;u+=h.charAt(ne[xe++]));u=ut(u,E,h.charAt(0))}return u}})(),t=(function(){function i(w,p,v){var S,h,b,E,y=0,O=w.length,q=p%yt,ne=p/yt|0;for(w=w.slice();O--;)b=w[O]%yt,E=w[O]/yt|0,S=ne*b+E*q,h=q*b+S%yt*yt+y,y=(h/v|0)+(S/yt|0)+ne*E,w[O]=h%v;return y&&(w=[y].concat(w)),w}function l(w,p,v,S){var h,b;if(v!=S)b=v>S?1:-1;else for(h=b=0;h<v;h++)if(w[h]!=p[h]){b=w[h]>p[h]?1:-1;break}return b}function u(w,p,v,S){for(var h=0;v--;)w[v]-=h,h=w[v]<p[v]?1:0,w[v]=h*S+w[v]-p[v];for(;!w[0]&&w.length>1;w.splice(0,1));}return function(w,p,v,S,h){var b,E,y,O,q,ne,me,xe,Te,W,be,Ie,_e,Qe,Ye,Le,Ge,Fe=w.s==p.s?1:-1,Oe=w.c,Ee=p.c;if(!Oe||!Oe[0]||!Ee||!Ee[0])return new D(!w.s||!p.s||(Oe?Ee&&Oe[0]==Ee[0]:!Ee)?NaN:Oe&&Oe[0]==0||!Ee?Fe*0:Fe/0);for(xe=new D(Fe),Te=xe.c=[],E=w.e-p.e,Fe=v+E+1,h||(h=tt,E=Xe(w.e/he)-Xe(p.e/he),Fe=Fe/he|0),y=0;Ee[y]==(Oe[y]||0);y++);if(Ee[y]>(Oe[y]||0)&&E--,Fe<0)Te.push(1),O=!0;else{for(Qe=Oe.length,Le=Ee.length,y=0,Fe+=2,q=Je(h/(Ee[0]+1)),q>1&&(Ee=i(Ee,q,h),Oe=i(Oe,q,h),Le=Ee.length,Qe=Oe.length),_e=Le,W=Oe.slice(0,Le),be=W.length;be<Le;W[be++]=0);Ge=Ee.slice(),Ge=[0].concat(Ge),Ye=Ee[0],Ee[1]>=h/2&&Ye++;do{if(q=0,b=l(Ee,W,Le,be),b<0){if(Ie=W[0],Le!=be&&(Ie=Ie*h+(W[1]||0)),q=Je(Ie/Ye),q>1)for(q>=h&&(q=h-1),ne=i(Ee,q,h),me=ne.length,be=W.length;l(ne,W,me,be)==1;)q--,u(ne,Le<me?Ge:Ee,me,h),me=ne.length,b=1;else q==0&&(b=q=1),ne=Ee.slice(),me=ne.length;if(me<be&&(ne=[0].concat(ne)),u(W,ne,be,h),be=W.length,b==-1)for(;l(Ee,W,Le,be)<1;)q++,u(W,Le<be?Ge:Ee,be,h),be=W.length}else b===0&&(q++,W=[0]);Te[y++]=q,W[0]?W[be++]=Oe[_e]||0:(W=[Oe[_e]],be=1)}while((_e++<Qe||W[0]!=null)&&Fe--);O=W[0]!=null,Te[0]||Te.splice(0,1)}if(h==tt){for(y=1,Fe=Te[0];Fe>=10;Fe/=10,y++);ge(xe,v+(xe.e=y+E*he-1)+1,S,O)}else xe.e=E,xe.r=+O;return xe}})();function Q(i,l,u,w){var p,v,S,h,b;if(u==null?u=c:Ne(u,0,8),!i.c)return i.toString();if(p=i.c[0],S=i.e,l==null)b=Ke(i.c),b=w==1||w==2&&(S<=T||S>=C)?un(b,S):ut(b,S,"0");else if(i=ge(new D(i),l,u),v=i.e,b=Ke(i.c),h=b.length,w==1||w==2&&(l<=v||v<=T)){for(;h<l;b+="0",h++);b=un(b,v)}else if(l-=S+(w===2&&v>S),b=ut(b,v,"0"),v+1>h){if(--l>0)for(b+=".";l--;b+="0");}else if(l+=v-h,l>0)for(v+1==h&&(b+=".");l--;b+="0");return i.s<0&&p?"-"+b:b}function oe(i,l){for(var u,w,p=1,v=new D(i[0]);p<i.length;p++)w=new D(i[p]),(!w.s||(u=It(v,w))===l||u===0&&v.s===l)&&(v=w);return v}function ye(i,l,u){for(var w=1,p=l.length;!l[--p];l.pop());for(p=l[0];p>=10;p/=10,w++);return(u=w+u*he-1)>L?i.c=i.e=null:u<N?i.c=[i.e=0]:(i.e=u,i.c=l),i}s=(function(){var i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,l=/^([^.]+)\.$/,u=/^\.([^.]+)$/,w=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(v,S,h,b){var E,y=h?S:S.replace(p,"");if(w.test(y))v.s=isNaN(y)?null:y<0?-1:1;else{if(!h&&(y=y.replace(i,function(O,q,ne){return E=(ne=ne.toLowerCase())=="x"?16:ne=="b"?2:8,!b||b==E?q:O}),b&&(E=b,y=y.replace(l,"$1").replace(u,"0.$1")),S!=y))return new D(y,E);if(D.DEBUG)throw Error(We+"Not a"+(b?" base "+b:"")+" number: "+S);v.s=null}v.c=v.e=null}})();function ge(i,l,u,w){var p,v,S,h,b,E,y,O=i.c,q=Qn;if(O){e:{for(p=1,h=O[0];h>=10;h/=10,p++);if(v=l-p,v<0)v+=he,S=l,b=O[E=0],y=Je(b/q[p-S-1]%10);else if(E=Kn((v+1)/he),E>=O.length)if(w){for(;O.length<=E;O.push(0));b=y=0,p=1,v%=he,S=v-he+1}else break e;else{for(b=h=O[E],p=1;h>=10;h/=10,p++);v%=he,S=v-he+p,y=S<0?0:Je(b/q[p-S-1]%10)}if(w=w||l<0||O[E+1]!=null||(S<0?b:b%q[p-S-1]),w=u<4?(y||w)&&(u==0||u==(i.s<0?3:2)):y>5||y==5&&(u==4||w||u==6&&(v>0?S>0?b/q[p-S]:0:O[E-1])%10&1||u==(i.s<0?8:7)),l<1||!O[0])return O.length=0,w?(l-=i.e+1,O[0]=q[(he-l%he)%he],i.e=-l||0):O[0]=i.e=0,i;if(v==0?(O.length=E,h=1,E--):(O.length=E+1,h=q[he-v],O[E]=S>0?Je(b/q[p-S]%q[S])*h:0),w)for(;;)if(E==0){for(v=1,S=O[0];S>=10;S/=10,v++);for(S=O[0]+=h,h=1;S>=10;S/=10,h++);v!=h&&(i.e++,O[0]==tt&&(O[0]=1));break}else{if(O[E]+=h,O[E]!=tt)break;O[E--]=0,h=1}for(v=O.length;O[--v]===0;O.pop());}i.e>L?i.c=i.e=null:i.e<N&&(i.c=[i.e=0])}return i}function Ce(i){var l,u=i.e;return u===null?i.toString():(l=Ke(i.c),l=u<=T||u>=C?un(l,u):ut(l,u,"0"),i.s<0?"-"+l:l)}return r.absoluteValue=r.abs=function(){var i=new D(this);return i.s<0&&(i.s=1),i},r.comparedTo=function(i,l){return It(this,new D(i,l))},r.decimalPlaces=r.dp=function(i,l){var u,w,p,v=this;if(i!=null)return Ne(i,0,Me),l==null?l=c:Ne(l,0,8),ge(new D(v),i+v.e+1,l);if(!(u=v.c))return null;if(w=((p=u.length-1)-Xe(this.e/he))*he,p=u[p])for(;p%10==0;p/=10,w--);return w<0&&(w=0),w},r.dividedBy=r.div=function(i,l){return t(this,new D(i,l),o,c)},r.dividedToIntegerBy=r.idiv=function(i,l){return t(this,new D(i,l),0,1)},r.exponentiatedBy=r.pow=function(i,l){var u,w,p,v,S,h,b,E,y,O=this;if(i=new D(i),i.c&&!i.isInteger())throw Error(We+"Exponent not an integer: "+Ce(i));if(l!=null&&(l=new D(l)),h=i.e>14,!O.c||!O.c[0]||O.c[0]==1&&!O.e&&O.c.length==1||!i.c||!i.c[0])return y=new D(Math.pow(+Ce(O),h?i.s*(2-dn(i)):+Ce(i))),l?y.mod(l):y;if(b=i.s<0,l){if(l.c?!l.c[0]:!l.s)return new D(NaN);w=!b&&O.isInteger()&&l.isInteger(),w&&(O=O.mod(l))}else{if(i.e>9&&(O.e>0||O.e<-1||(O.e==0?O.c[0]>1||h&&O.c[1]>=24e7:O.c[0]<8e13||h&&O.c[0]<=9999975e7)))return v=O.s<0&&dn(i)?-0:0,O.e>-1&&(v=1/v),new D(b?1/v:v);x&&(v=Kn(x/he+2))}for(h?(u=new D(.5),b&&(i.s=1),E=dn(i)):(p=Math.abs(+Ce(i)),E=p%2),y=new D(a);;){if(E){if(y=y.times(O),!y.c)break;v?y.c.length>v&&(y.c.length=v):w&&(y=y.mod(l))}if(p){if(p=Je(p/2),p===0)break;E=p%2}else if(i=i.times(u),ge(i,i.e+1,1),i.e>14)E=dn(i);else{if(p=+Ce(i),p===0)break;E=p%2}O=O.times(O),v?O.c&&O.c.length>v&&(O.c.length=v):w&&(O=O.mod(l))}return w?y:(b&&(y=a.div(y)),l?y.mod(l):v?ge(y,x,c,S):y)},r.integerValue=function(i){var l=new D(this);return i==null?i=c:Ne(i,0,8),ge(l,l.e+1,i)},r.isEqualTo=r.eq=function(i,l){return It(this,new D(i,l))===0},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(i,l){return It(this,new D(i,l))>0},r.isGreaterThanOrEqualTo=r.gte=function(i,l){return(l=It(this,new D(i,l)))===1||l===0},r.isInteger=function(){return!!this.c&&Xe(this.e/he)>this.c.length-2},r.isLessThan=r.lt=function(i,l){return It(this,new D(i,l))<0},r.isLessThanOrEqualTo=r.lte=function(i,l){return(l=It(this,new D(i,l)))===-1||l===0},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return this.s>0},r.isZero=function(){return!!this.c&&this.c[0]==0},r.minus=function(i,l){var u,w,p,v,S=this,h=S.s;if(i=new D(i,l),l=i.s,!h||!l)return new D(NaN);if(h!=l)return i.s=-l,S.plus(i);var b=S.e/he,E=i.e/he,y=S.c,O=i.c;if(!b||!E){if(!y||!O)return y?(i.s=-l,i):new D(O?S:NaN);if(!y[0]||!O[0])return O[0]?(i.s=-l,i):new D(y[0]?S:c==3?-0:0)}if(b=Xe(b),E=Xe(E),y=y.slice(),h=b-E){for((v=h<0)?(h=-h,p=y):(E=b,p=O),p.reverse(),l=h;l--;p.push(0));p.reverse()}else for(w=(v=(h=y.length)<(l=O.length))?h:l,h=l=0;l<w;l++)if(y[l]!=O[l]){v=y[l]<O[l];break}if(v&&(p=y,y=O,O=p,i.s=-i.s),l=(w=O.length)-(u=y.length),l>0)for(;l--;y[u++]=0);for(l=tt-1;w>h;){if(y[--w]<O[w]){for(u=w;u&&!y[--u];y[u]=l);--y[u],y[w]+=tt}y[w]-=O[w]}for(;y[0]==0;y.splice(0,1),--E);return y[0]?ye(i,y,E):(i.s=c==3?-1:1,i.c=[i.e=0],i)},r.modulo=r.mod=function(i,l){var u,w,p=this;return i=new D(i,l),!p.c||!i.s||i.c&&!i.c[0]?new D(NaN):!i.c||p.c&&!p.c[0]?new D(p):(k==9?(w=i.s,i.s=1,u=t(p,i,0,3),i.s=w,u.s*=w):u=t(p,i,0,k),i=p.minus(u.times(i)),!i.c[0]&&k==1&&(i.s=p.s),i)},r.multipliedBy=r.times=function(i,l){var u,w,p,v,S,h,b,E,y,O,q,ne,me,xe,Te,W=this,be=W.c,Ie=(i=new D(i,l)).c;if(!be||!Ie||!be[0]||!Ie[0])return!W.s||!i.s||be&&!be[0]&&!Ie||Ie&&!Ie[0]&&!be?i.c=i.e=i.s=null:(i.s*=W.s,!be||!Ie?i.c=i.e=null:(i.c=[0],i.e=0)),i;for(w=Xe(W.e/he)+Xe(i.e/he),i.s*=W.s,b=be.length,O=Ie.length,b<O&&(me=be,be=Ie,Ie=me,p=b,b=O,O=p),p=b+O,me=[];p--;me.push(0));for(xe=tt,Te=yt,p=O;--p>=0;){for(u=0,q=Ie[p]%Te,ne=Ie[p]/Te|0,S=b,v=p+S;v>p;)E=be[--S]%Te,y=be[S]/Te|0,h=ne*E+y*q,E=q*E+h%Te*Te+me[v]+u,u=(E/xe|0)+(h/Te|0)+ne*y,me[v--]=E%xe;me[v]=u}return u?++w:me.splice(0,1),ye(i,me,w)},r.negated=function(){var i=new D(this);return i.s=-i.s||null,i},r.plus=function(i,l){var u,w=this,p=w.s;if(i=new D(i,l),l=i.s,!p||!l)return new D(NaN);if(p!=l)return i.s=-l,w.minus(i);var v=w.e/he,S=i.e/he,h=w.c,b=i.c;if(!v||!S){if(!h||!b)return new D(p/0);if(!h[0]||!b[0])return b[0]?i:new D(h[0]?w:p*0)}if(v=Xe(v),S=Xe(S),h=h.slice(),p=v-S){for(p>0?(S=v,u=b):(p=-p,u=h),u.reverse();p--;u.push(0));u.reverse()}for(p=h.length,l=b.length,p-l<0&&(u=b,b=h,h=u,l=p),p=0;l;)p=(h[--l]=h[l]+b[l]+p)/tt|0,h[l]=tt===h[l]?0:h[l]%tt;return p&&(h=[p].concat(h),++S),ye(i,h,S)},r.precision=r.sd=function(i,l){var u,w,p,v=this;if(i!=null&&i!==!!i)return Ne(i,1,Me),l==null?l=c:Ne(l,0,8),ge(new D(v),i,l);if(!(u=v.c))return null;if(p=u.length-1,w=p*he+1,p=u[p]){for(;p%10==0;p/=10,w--);for(p=u[0];p>=10;p/=10,w++);}return i&&v.e+1>w&&(w=v.e+1),w},r.shiftedBy=function(i){return Ne(i,-Zn,Zn),this.times("1e"+i)},r.squareRoot=r.sqrt=function(){var i,l,u,w,p,v=this,S=v.c,h=v.s,b=v.e,E=o+4,y=new D("0.5");if(h!==1||!S||!S[0])return new D(!h||h<0&&(!S||S[0])?NaN:S?v:1/0);if(h=Math.sqrt(+Ce(v)),h==0||h==1/0?(l=Ke(S),(l.length+b)%2==0&&(l+="0"),h=Math.sqrt(+l),b=Xe((b+1)/2)-(b<0||b%2),h==1/0?l="5e"+b:(l=h.toExponential(),l=l.slice(0,l.indexOf("e")+1)+b),u=new D(l)):u=new D(h+""),u.c[0]){for(b=u.e,h=b+E,h<3&&(h=0);;)if(p=u,u=y.times(p.plus(t(v,p,E,1))),Ke(p.c).slice(0,h)===(l=Ke(u.c)).slice(0,h))if(u.e<b&&--h,l=l.slice(h-3,h+1),l=="9999"||!w&&l=="4999"){if(!w&&(ge(p,p.e+o+2,0),p.times(p).eq(v))){u=p;break}E+=4,h+=4,w=1}else{(!+l||!+l.slice(1)&&l.charAt(0)=="5")&&(ge(u,u.e+o+2,1),i=!u.times(u).eq(v));break}}return ge(u,u.e+o+1,c,i)},r.toExponential=function(i,l){return i!=null&&(Ne(i,0,Me),i++),Q(this,i,l,1)},r.toFixed=function(i,l){return i!=null&&(Ne(i,0,Me),i=i+this.e+1),Q(this,i,l)},r.toFormat=function(i,l,u){var w,p=this;if(u==null)i!=null&&l&&typeof l=="object"?(u=l,l=null):i&&typeof i=="object"?(u=i,i=l=null):u=g;else if(typeof u!="object")throw Error(We+"Argument not an object: "+u);if(w=p.toFixed(i,l),p.c){var v,S=w.split("."),h=+u.groupSize,b=+u.secondaryGroupSize,E=u.groupSeparator||"",y=S[0],O=S[1],q=p.s<0,ne=q?y.slice(1):y,me=ne.length;if(b&&(v=h,h=b,b=v,me-=v),h>0&&me>0){for(v=me%h||h,y=ne.substr(0,v);v<me;v+=h)y+=E+ne.substr(v,h);b>0&&(y+=E+ne.slice(v)),q&&(y="-"+y)}w=O?y+(u.decimalSeparator||"")+((b=+u.fractionGroupSize)?O.replace(new RegExp("\\d{"+b+"}\\B","g"),"$&"+(u.fractionGroupSeparator||"")):O):y}return(u.prefix||"")+w+(u.suffix||"")},r.toFraction=function(i){var l,u,w,p,v,S,h,b,E,y,O,q,ne=this,me=ne.c;if(i!=null&&(h=new D(i),!h.isInteger()&&(h.c||h.s!==1)||h.lt(a)))throw Error(We+"Argument "+(h.isInteger()?"out of range: ":"not an integer: ")+Ce(h));if(!me)return new D(ne);for(l=new D(a),E=u=new D(a),w=b=new D(a),q=Ke(me),v=l.e=q.length-ne.e-1,l.c[0]=Qn[(S=v%he)<0?he+S:S],i=!i||h.comparedTo(l)>0?v>0?l:E:h,S=L,L=1/0,h=new D(q),b.c[0]=0;y=t(h,l,0,1),p=u.plus(y.times(w)),p.comparedTo(i)!=1;)u=w,w=p,E=b.plus(y.times(p=E)),b=p,l=h.minus(y.times(p=l)),h=p;return p=t(i.minus(u),w,0,1),b=b.plus(p.times(E)),u=u.plus(p.times(w)),b.s=E.s=ne.s,v=v*2,O=t(E,w,v,c).minus(ne).abs().comparedTo(t(b,u,v,c).minus(ne).abs())<1?[E,w]:[b,u],L=S,O},r.toNumber=function(){return+Ce(this)},r.toPrecision=function(i,l){return i!=null&&Ne(i,1,Me),Q(this,i,l,2)},r.toString=function(i){var l,u=this,w=u.s,p=u.e;return p===null?w?(l="Infinity",w<0&&(l="-"+l)):l="NaN":(i==null?l=p<=T||p>=C?un(Ke(u.c),p):ut(Ke(u.c),p,"0"):i===10&&ue?(u=ge(new D(u),o+p+1,c),l=ut(Ke(u.c),u.e,"0")):(Ne(i,2,B.length,"Base"),l=n(ut(Ke(u.c),p,"0"),10,i,w,!0)),w<0&&u.c[0]&&(l="-"+l)),l},r.valueOf=r.toJSON=function(){return Ce(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,e!=null&&D.set(e),D}function Xe(e){var t=e|0;return e>0||e===t?t:t-1}function Ke(e){for(var t,n,s=1,r=e.length,a=e[0]+"";s<r;){for(t=e[s++]+"",n=he-t.length;n--;t="0"+t);a+=t}for(r=a.length;a.charCodeAt(--r)===48;);return a.slice(0,r+1||1)}function It(e,t){var n,s,r=e.c,a=t.c,o=e.s,c=t.s,T=e.e,C=t.e;if(!o||!c)return null;if(n=r&&!r[0],s=a&&!a[0],n||s)return n?s?0:-c:o;if(o!=c)return o;if(n=o<0,s=T==C,!r||!a)return s?0:!r^n?1:-1;if(!s)return T>C^n?1:-1;for(c=(T=r.length)<(C=a.length)?T:C,o=0;o<c;o++)if(r[o]!=a[o])return r[o]>a[o]^n?1:-1;return T==C?0:T>C^n?1:-1}function Ne(e,t,n,s){if(e<t||e>n||e!==Je(e))throw Error(We+(s||"Argument")+(typeof e=="number"?e<t||e>n?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function dn(e){var t=e.c.length-1;return Xe(e.e/he)==t&&e.c[t]%2!=0}function un(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ut(e,t,n){var s,r;if(t<0){for(r=n+".";++t;r+=n);e=r+e}else if(s=e.length,++t>s){for(r=n,t-=s;--t;r+=n);e+=r}else t<s&&(e=e.slice(0,t)+"."+e.slice(t));return e}var de=lr();class fn{baseUrl;constructor(t){this.baseUrl=t}buildUrl(t,n){const s=new URL(t,this.baseUrl);return n&&Object.entries(n).forEach(([r,a])=>{a!=null&&s.searchParams.append(r,String(a))}),s.toString()}async get(t,n={}){const s=this.buildUrl(t,n.query),r=await fetch(s,{method:"GET",headers:n.headers||{}});if(!r.ok){let o=null;try{o=await r.json()}catch{try{const T=await r.text();T&&(o={message:T})}catch{}}const c=new Error(o?.message||o?.errorMessage||`HTTP ${r.status}: ${r.statusText}`);throw c.status=r.status,c.statusText=r.statusText,o&&(c.data=o),c}return{data:await r.json(),status:r.status}}async post(t,n,s={}){const r=this.buildUrl(t,s.query),a=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",...s.headers},body:JSON.stringify(n)});if(!a.ok){let c=null;try{c=await a.json()}catch{try{const C=await a.text();C&&(c={message:C})}catch{}}const T=new Error(c?.message||c?.errorMessage||`HTTP ${a.status}: ${a.statusText}`);throw T.status=a.status,T.statusText=a.statusText,c&&(T.data=c),T}return{data:await a.json(),status:a.status}}}const Ci="https://deep-index.moralis.io";function qt(){return"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImY4NmY0Yzc2LTA3MDQtNGEwZS04YTA0LWUwODllOGQxMGZjZCIsIm9yZ0lkIjoiMzk0MDAyIiwidXNlcklkIjoiNDA0ODUzIiwidHlwZUlkIjoiYjQyODExOTQtOGQ0Yi00NjkxLTlhZjItNjU4ODE2NzExYmRjIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MTY4NjQyNTYsImV4cCI6NDg3MjYyNDI1Nn0.V8crfBIBardAnZkc05FD0hQIJBeZxMqvzRnYExVtnF8"}function Jt(e){return{"X-API-Key":e,Accept:"application/json"}}const Xt=new fn(Ci);async function rt(e){const{address:t,chain:n="base",token_addresses:s,exclude_spam:r,exclude_unverified_contracts:a}=e;if(!t)throw new Error("Address is required");try{const o=qt(),c={chain:n,exclude_spam:r??!1,exclude_unverified_contracts:a??!1};s&&(c.token_addresses=s);const C=(await Xt.get(`/api/v2.2/wallets/${encodeURIComponent(t)}/tokens`,{query:c,headers:Jt(o)})).data;return C?.result?.length>0&&(C.result=C.result.filter(N=>new de(N?.balance||0).gt(0)),C.result=C.result.map(N=>({...N,token_address:N.token_address===pi?qe:N.token_address}))),{success:!0,data:C}}catch(o){const c=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching token balances:",c),{success:!1,error:c}}}async function Bi(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Token address is required");try{const s=qt(),[r,a]=await Promise.allSettled([Xt.get("/api/v2.2/erc20/metadata",{query:{chain:n,addresses:[t]},headers:Jt(s)}),Xt.get(`/api/v2.2/erc20/${encodeURIComponent(t)}/price`,{query:{chain:n,include:"percent_change"},headers:Jt(s)})]),o=r.status==="fulfilled"?r.value.data:[];if(!o||o.length===0)return{success:!1,error:"Token metadata not found"};const c=o[0],T=a.status==="fulfilled"?a.value.data?.usdPrice??void 0:void 0;return{success:!0,data:{token_address:c.token_address,name:c.name,symbol:c.symbol,decimals:c.decimals,logo:c.logo||c.thumbnail,thumbnail:c.thumbnail,usd_price:T}}}catch(s){const r=s instanceof Error?s.message:"Unknown error";return console.error("❌ Error fetching token metadata:",r),{success:!1,error:r}}}async function Pi(e){const{prompt:t,model:n="gpt-4.1-mini",stream:s=!1,systemPrompt:r}=e;if(!t)throw new Error("Prompt is required");try{const a=qt(),o=new fn("https://cortex-api.moralis.io"),c=r?`${r}
25
25
 
26
26
  ---
27
27
 
28
- User: ${t}`:t;return{success:!0,data:(await o.post("/chat",{prompt:c,model:n,stream:s},{headers:{"X-API-Key":a,Accept:"application/json","Content-Type":"application/json"}})).data}}catch(a){const o=a instanceof Error?a.message:"Unknown error";return console.error("❌ Error chatting with Cortex AI:",o),{success:!1,error:o}}}async function Ni(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Contract address is required");try{const s=qt();return{success:!0,data:(await Xt.get(`/api/v2.2/nft/${encodeURIComponent(t)}/metadata`,{query:{chain:n},headers:Jt(s)})).data}}catch(s){const r=s instanceof Error?s.message:"Unknown error";return console.error("❌ Error fetching NFT contract metadata:",r),{success:!1,error:r}}}async function Oi(e){const{address:t,chain:n="base",limit:s=20,exclude_spam:r=!0,cursor:a}=e;if(!t)throw new Error("Address is required");try{const o=qt(),c={chain:n,format:"decimal",limit:s,exclude_spam:r,media_items:!0,normalizeMetadata:!0};return a&&(c.cursor=a),{success:!0,data:(await Xt.get(`/api/v2.2/${encodeURIComponent(t)}/nft`,{query:c,headers:Jt(o)})).data}}catch(o){const c=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching NFTs:",c),{success:!1,error:c}}}const Ui="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAx8SURBVHgB7VprbFzFFT5n9kmoil0JiUqVsuYX/7BRSeL+aOyKivKjxYYEmpbWNlQpUYvsQAtBVPHdoBYFodgWIiAK8ppWysOVbFrRh0qxUyE5BlQ7/VEqVYo3P6qq6iMbpYTEu3dOz7zuY72Jr51NIrU59u597NyZ+ea8zx2A63Sd/qcI4QoQTfW0QC3fDrLWpS4BUxUAeQwfmFyEa0xNB0xHtw9yrx7DbAlH4WGI1FkZBHq47egEXCNqGmCa3NbF3Q0z0K7IXbLD1I+zBCh24/Yjb8JVpssGTIe+WoCUP8TYbufemKvYzkdSghwcTUsKgQfnJfCrRdwxXYarRM0X6XHW3w3Ze1ln+xlTV4MWFMo4mkUBKkK6NoG9Vx74ugHfNjNXyJ/nk/P5ymJvR6VRGzpyfw+AGOFRCoF4o8BA0s0MrBQg6zdccf1eE+CWhYWWDedrg7mqP5StYUtOAuVqgHy+mPFpOi/lxK97O8v1z7Eh6+fDMH8KcdFuOCV+nnqvlEVPDLhlbq6QQpzJ+lhgkMBgQR2zPlBegfYB8vzJkvBguTYxvSMOnA71FECkPcbal0C3FZUgw/rdZDFPDPjG9+eXGGQhr0DWC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SsDkoKQIf6ia18swDubbmlSAhlDVdKb3HQm1j1zh/deAzOVTvWstFlzX5srfTYq3P9WRLDWR826p0/1XCrU66m94lg3uwAIrUXxGyNUruEACO7g8qF1zerCEzt6hvXgFNiCO87cmKN02k+h+vpxZ2dJV8qSy73IdUvMOk6ClC4Syt4z2QbmIPN0o7c38eFugncPtm9HrC6J7iK5I3MFfKcGWVr2J9zXNX7uMDu+TIc15ytBbt+IIOyrXD3/gq/SoP17t5xdFUBO3rhhfmeDTUYYbCFnNmqqEQ5AGu3O2mxzlRp922vbhmFJtE1Aezo9R+qLY1imAEWAo5arud8qqRqtLvjYGcJmkjXFLCjo9677bnl9Nasj60swpSuyWOfgPxix2jHZYnvdbpO/wf0X652D+/dGV80AAAAAElFTkSuQmCC",Di="data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='36'%20height='36'%20rx='18'%20fill='%232358B2'/%3e%3cmask%20id='mask0_1924_16177'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='11'%20y='10'%20width='17'%20height='16'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='url(%23pattern0_1924_16177)'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1924_16177)'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cpattern%20id='pattern0_1924_16177'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1924_16177'%20transform='scale(0.00195312)'/%3e%3c/pattern%3e%3cimage%20id='image0_1924_16177'%20width='512'%20height='512'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOgAAADoABlffMYAA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6EMAy8HHjjib3ku8EPg+8BPMvPqEX8/SZKq6ewAMFNEBPB0ykCwOvDgGT/uz8KWCW8G/gT8fsaP07yiV5I0TXoxACxPRCymnA7MHAoeAFwPXAFcOeN/LwPOycwb66SVJKkbej8ASJKkhevr5/AlSdIQHAAkSZpCDgCSJE0hBwBJkqaQA4AkSVPo/wH9hnZgmG1pVwAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e";class Fi extends fn{constructor(){super("https://wallet-api.pantograph.app")}async getTokensDetails(t,n="base"){try{if(!t||!Array.isArray(t)||t.length===0)throw new Error("Addresses must be a non-empty array");const s=t.join(","),r=await this.get(`/keyrings/tokens/${n}/v2`,{query:{addresses:s}});return Array.isArray(r.data)&&(r.data=r.data.filter((a,o,c)=>o===c.findIndex(T=>T.address.toLowerCase()===a.address.toLowerCase())),Array.isArray(t)&&t.length>0&&(r.data=r.data.filter(a=>t.some(o=>o.toLowerCase()===a.address.toLowerCase())),r.data.sort((a,o)=>t.findIndex(c=>c.toLowerCase()===a.address.toLowerCase())-t.findIndex(c=>c.toLowerCase()===o.address.toLowerCase())))),r}catch(s){throw console.error("❌ Error getting tokens details:",s instanceof Error?s.message:s),s}}async getTokenDetail(t,n="base"){try{if(!t)throw new Error("Address is required");const s=await this.getTokensDetails([t],n);return{data:s.data[0]||null,status:s.status}}catch(s){throw console.error(`❌ Error getting token detail for ${t}:`,s instanceof Error?s.message:s),s}}async getTopGainers(t="base",n="24h",s=3){try{return await this.get(`/token-list/top-gainers/${t}`,{query:{duration:n,limit:s}})}catch(r){throw console.error("❌ Error getting top gainers:",r instanceof Error?r.message:r),r}}}const Ze=new Fi,Mi="https://dln.debridge.finance",_i=new fn(Mi);async function $n(e){const{chainId:t,tokenIn:n,tokenInAmount:s,tokenOut:r,accesstoken:a,slippage:o="auto",tokenOutRecipient:c}=e;if(!t||!n||!s||!r)throw new Error("Missing required parameters: chainId, tokenIn, tokenInAmount, tokenOut");try{const N=(await(await fetch("https://exchange-api.keyring.app/admin/setting?configs=others",{method:"GET"})).json())?.others||{},L=N?.AFFILIATE_FEE_PERENT,m=N?.AFFILIATE_FEE_RECIPIENT,k=await _i.get("/v1.0/chain/transaction",{query:{chainId:String(t),tokenIn:n,tokenInAmount:s,tokenOut:r,slippage:String(o),tokenOutRecipient:c,accesstoken:a,affiliateFeePercent:L,affiliateFeeRecipient:m}});if(k.data?.error)throw new Error(`DeBridge API Error: ${k.data.error}`);return console.log("✅ Quote retrieved successfully"),{success:!0,data:k.data}}catch(T){let C=T instanceof Error?T.message:"Unknown error";const N=T;N.data?.errorMessage?C=N.data.errorMessage:N.response?.data?.errorMessage?C=N.response.data.errorMessage:N.data?.message?C=N.data.message:N.response?.data?.message&&(C=N.response.data.message);const L=N.status||N.response?.status||N.statusCode||N.data?.status;return console.error("📋 Error details:",{errorMessage:C,errorCode:N.data?.errorCode,errorId:N.data?.errorId,status:L,reqId:N.data?.reqId,fullError:{message:N.message,status:N.status,statusCode:N.statusCode}}),{success:!1,error:T instanceof Error?T.message:"Unknown error",status:L,errorMessage:C,errorCode:N.data?.errorCode,errorId:N.data?.errorId}}}function yt(e){const t=[],n=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]*)\]\(([^)]+)\)|(https?:\/\/[^\s<>]+)|\*\*(.+?)\*\*|__(.+?)__|\*(.+?)\*|_(.+?)_|~~(.+?)~~|`([^`]+)`/g;let s=0,r;for(;(r=n.exec(e))!==null;)r.index>s&&t.push(e.slice(s,r.index)),r[1]!==void 0||r[2]!==void 0?t.push(I.jsx("img",{src:r[2],alt:r[1],className:"mc-image"},r.index)):r[3]!==void 0?t.push(I.jsx("a",{href:r[4],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:r[3]},r.index)):r[5]!==void 0?t.push(I.jsx("a",{href:r[5],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:r[5]},r.index)):r[6]!==void 0?t.push(I.jsx("strong",{children:yt(r[6])},r.index)):r[7]!==void 0?t.push(I.jsx("strong",{children:yt(r[7])},r.index)):r[8]!==void 0?t.push(I.jsx("em",{children:yt(r[8])},r.index)):r[9]!==void 0?t.push(I.jsx("em",{children:yt(r[9])},r.index)):r[10]!==void 0?t.push(I.jsx("del",{children:yt(r[10])},r.index)):r[11]!==void 0&&t.push(I.jsx("code",{className:"mc-inline-code",children:r[11]},r.index)),s=r.index+r[0].length;return s<e.length&&t.push(e.slice(s)),t.length>0?t:[e]}const Li=({content:e})=>{const t=e.split(`
28
+ User: ${t}`:t;return{success:!0,data:(await o.post("/chat",{prompt:c,model:n,stream:s},{headers:{"X-API-Key":a,Accept:"application/json","Content-Type":"application/json"}})).data}}catch(a){const o=a instanceof Error?a.message:"Unknown error";return console.error("❌ Error chatting with Cortex AI:",o),{success:!1,error:o}}}async function Ni(e){const{address:t,chain:n="base"}=e;if(!t)throw new Error("Contract address is required");try{const s=qt();return{success:!0,data:(await Xt.get(`/api/v2.2/nft/${encodeURIComponent(t)}/metadata`,{query:{chain:n},headers:Jt(s)})).data}}catch(s){const r=s instanceof Error?s.message:"Unknown error";return console.error("❌ Error fetching NFT contract metadata:",r),{success:!1,error:r}}}async function Oi(e){const{address:t,chain:n="base",limit:s=20,exclude_spam:r=!0,cursor:a}=e;if(!t)throw new Error("Address is required");try{const o=qt(),c={chain:n,format:"decimal",limit:s,exclude_spam:r,media_items:!0,normalizeMetadata:!0};return a&&(c.cursor=a),{success:!0,data:(await Xt.get(`/api/v2.2/${encodeURIComponent(t)}/nft`,{query:c,headers:Jt(o)})).data}}catch(o){const c=o instanceof Error?o.message:"Unknown error";return console.error("❌ Error fetching NFTs:",c),{success:!1,error:c}}}const Ui="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAx8SURBVHgB7VprbFzFFT5n9kmoil0JiUqVsuYX/7BRSeL+aOyKivKjxYYEmpbWNlQpUYvsQ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53iitC7CiPOa4SG5ibDsDF2moebI+QmlnaX7h0fHGYt763EMTHEx0M+Mi9epg/jpLdJZRg5Z+ua6L6EKZ81qtDKvQugEvdnMqV5XdqDabheEd2Hk75rSnpVh64tXj40+9vBJ46/4d5ZtHez2/Ktp4yhM6MHF5A5KLPAihPjEQZpRotsSeM8m743UDVrR4T2dZ8JtDVWO2t3TmEE/dQMlkP78fntn7UmP9/vQr95RveeWuAUrVbj2b47hdP+NKoLaQGZu1jMTRlrtEiTbBXBZgRccZdKZG3axis6YYhOFkbHJoiyQbhQTvudH5pQMHPmio34s35eFcBlrI1nf0UxGbFJCM5uQ2iANRggR02YAVzfZ2lt/+yiYFumhDZ8PnoKQL0UOBfH/8pf3zUz9+NizQTXkLLYipcfX+OBpoUFgKDQmjmZrWgDI+mGx/V1MAO/pl751F8Pn9Eck3LHtMgmXfJwcv1o3A96BIvfOTfcf/fWT4+JKoLZ9mdFstIFcjiufFjgjbQ1HmSM6vfgESUlMBK1L7sw5/rbNfVPEOdl2nzKSsDkoKQIf6ia18swDubbmlSAhlDVdKb3HQm1j1zh/deAzOVTvWstFlzX5srfTYq3P9WRLDWR826p0/1XCrU66m94lg3uwAIrUXxGyNUruEACO7g8qF1zerCEzt6hvXgFNiCO87cmKN02k+h+vpxZ2dJV8qSy73IdUvMOk6ClC4Syt4z2QbmIPN0o7c38eFugncPtm9HrC6J7iK5I3MFfKcGWVr2J9zXNX7uMDu+TIc15ytBbt+IIOyrXD3/gq/SoP17t5xdFUBO3rhhfmeDTUYYbCFnNmqqEQ5AGu3O2mxzlRp922vbhmFJtE1Aezo9R+qLY1imAEWAo5arud8qqRqtLvjYGcJmkjXFLCjo9677bnl9Nasj60swpSuyWOfgPxix2jHZYnvdbpO/wf0X652D+/dGV80AAAAAElFTkSuQmCC",Di="data:image/svg+xml,%3csvg%20width='36'%20height='36'%20viewBox='0%200%2036%2036'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3crect%20width='36'%20height='36'%20rx='18'%20fill='%232358B2'/%3e%3cmask%20id='mask0_1924_16177'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='11'%20y='10'%20width='17'%20height='16'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='url(%23pattern0_1924_16177)'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_1924_16177)'%3e%3crect%20x='11.334'%20y='10'%20width='16'%20height='16'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3cpattern%20id='pattern0_1924_16177'%20patternContentUnits='objectBoundingBox'%20width='1'%20height='1'%3e%3cuse%20xlink:href='%23image0_1924_16177'%20transform='scale(0.00195312)'/%3e%3c/pattern%3e%3cimage%20id='image0_1924_16177'%20width='512'%20height='512'%20preserveAspectRatio='none'%20xlink:href='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAOgAAADoABlffMYAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7d13uGRlme7/79M0ijnrKM6ImHAMmHXGgB7zKJhzAAMgZjFg4DfnzO8ISM4gKIKIEgwImAAjiAQRCSoCCgaCgOQcn/PHu5reNHt37121qt61qr6f6+pLbLr3vi/Seuqtp947MhNJkjRdFtUOIEmSxs8BQJKkKeQAIEnSFHIAkCRpCjkASJI0hRbXDjCoiFgMPBB40Iwf9wZimV96E/AP4PzmxwWZeeMYo0qS1DnRl48BRsSqwFrA85ofa3DHh/18JHAxcCrwmyU/MvPslqJKktR5nR0AImJ1lj7s1wJWH/G3vAw4EjgE+EFmXj7i7ydJUjWdGgAi4uXA2ykP/YdWjHITcBRlGDggMy+umEWSpNZVHwAiYmXgrcAngMdXDTO7G4ADgZ0z88TaYSRJakO1ASAi7glsAHwUWLVKiIU7FtgZ+FZm3lQ7jCRJgxr7ABARDwE+AmwI3Gus37w9fwW2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3i+Bl2Xm0zPzkBzkaEaSpHka6C2A232BiI8DW+MdAYP6MaWS9xe1g0iSpsfQAwBARLwZ+Co2By7E9ygP/uNrB5EkTZ9WBgCAiHgBcDAWBy3PrcC3KZW8p9QOI0maXq0NAAAR8QTgEODhrX3RyXAL8A1gi8w8vXYYSZJaHQAAIuKewJ7Am1r9wv10I+WtkS9k5tm1w0iStETrA8BtXzjiPZSSmruO5Bt023XAl4GtMvPc2mEkSVrWyAYAgIhYA9gPeOrIvkm3XA3sDmybmRfWDiNJ0lxGOgAARMQiYH3g88D9R/rN6rkc2BnYITMvrR1GkqQVGfkAcNs3irgP8P8DGzE5Vwj/E9ge2CUzr6wdRpKk+RrbAHDbNyyfFPgf4FUMcRNhZRdQLj/aw0peSVIfjX0AuO0bRzwK2BhYF7hLlRALdwKwG3CAlbySpD6rNgDcFiDiAcAHgXcCq1UNM7trKZ/h3z0zT6odRpKkNlQfAGaKiH8HXtH8eDawuFKUG4GjgO8C+2XmFZVySJI0Ep0aAGaKiHsBL6EMAy8HHjjib3ku8EPg+8BPMvPqEX8/SZKq6ewAMFNEBPB0ykCwOvDgGT/uz8KWCW8G/gT8fsaP07yiV5I0TXoxACxPRCymnA7MHAoeAFwPXAFcOeN/LwPOycwb66SVJKkbej8ASJKkhevr5/AlSdIQHAAkSZpCDgCSJE0hBwBJkqaQA4AkSVPo/wH9hnZgmG1pVwAAAABJRU5ErkJggg=='/%3e%3c/defs%3e%3c/svg%3e";class Fi extends fn{constructor(){super("https://wallet-api.pantograph.app")}async getTokensDetails(t,n="base"){try{if(!t||!Array.isArray(t)||t.length===0)throw new Error("Addresses must be a non-empty array");const s=t.join(","),r=await this.get(`/keyrings/tokens/${n}/v2`,{query:{addresses:s}});return Array.isArray(r.data)&&(r.data=r.data.filter((a,o,c)=>o===c.findIndex(T=>T.address.toLowerCase()===a.address.toLowerCase())),Array.isArray(t)&&t.length>0&&(r.data=r.data.filter(a=>t.some(o=>o.toLowerCase()===a.address.toLowerCase())),r.data.sort((a,o)=>t.findIndex(c=>c.toLowerCase()===a.address.toLowerCase())-t.findIndex(c=>c.toLowerCase()===o.address.toLowerCase())))),r}catch(s){throw console.error("❌ Error getting tokens details:",s instanceof Error?s.message:s),s}}async getTokenDetail(t,n="base"){try{if(!t)throw new Error("Address is required");const s=await this.getTokensDetails([t],n);return{data:s.data[0]||null,status:s.status}}catch(s){throw console.error(`❌ Error getting token detail for ${t}:`,s instanceof Error?s.message:s),s}}async getTopGainers(t="base",n="24h",s=3){try{return await this.get(`/token-list/top-gainers/${t}`,{query:{duration:n,limit:s}})}catch(r){throw console.error("❌ Error getting top gainers:",r instanceof Error?r.message:r),r}}}const Ze=new Fi,Mi="https://dln.debridge.finance",_i=new fn(Mi);async function $n(e){const{chainId:t,tokenIn:n,tokenInAmount:s,tokenOut:r,accesstoken:a,slippage:o="auto",tokenOutRecipient:c}=e;if(!t||!n||!s||!r)throw new Error("Missing required parameters: chainId, tokenIn, tokenInAmount, tokenOut");try{const N=(await(await fetch("https://exchange-api.keyring.app/admin/setting?configs=others",{method:"GET"})).json())?.others||{},L=N?.AFFILIATE_FEE_PERENT,m=N?.AFFILIATE_FEE_RECIPIENT,k=await _i.get("/v1.0/chain/transaction",{query:{chainId:String(t),tokenIn:n,tokenInAmount:s,tokenOut:r,slippage:String(o),tokenOutRecipient:c,accesstoken:a,affiliateFeePercent:L,affiliateFeeRecipient:m}});if(k.data?.error)throw new Error(`DeBridge API Error: ${k.data.error}`);return console.log("✅ Quote retrieved successfully"),{success:!0,data:k.data}}catch(T){let C=T instanceof Error?T.message:"Unknown error";const N=T;N.data?.errorMessage?C=N.data.errorMessage:N.response?.data?.errorMessage?C=N.response.data.errorMessage:N.data?.message?C=N.data.message:N.response?.data?.message&&(C=N.response.data.message);const L=N.status||N.response?.status||N.statusCode||N.data?.status;return console.error("📋 Error details:",{errorMessage:C,errorCode:N.data?.errorCode,errorId:N.data?.errorId,status:L,reqId:N.data?.reqId,fullError:{message:N.message,status:N.status,statusCode:N.statusCode}}),{success:!1,error:T instanceof Error?T.message:"Unknown error",status:L,errorMessage:C,errorCode:N.data?.errorCode,errorId:N.data?.errorId}}}function vt(e){const t=[],n=/!\[([^\]]*)\]\(([^)]+)\)|\[([^\]]*)\]\(([^)]+)\)|(https?:\/\/[^\s<>]+)|\*\*(.+?)\*\*|__(.+?)__|\*(.+?)\*|_(.+?)_|~~(.+?)~~|`([^`]+)`/g;let s=0,r;for(;(r=n.exec(e))!==null;)r.index>s&&t.push(e.slice(s,r.index)),r[1]!==void 0||r[2]!==void 0?t.push(I.jsx("img",{src:r[2],alt:r[1],className:"mc-image"},r.index)):r[3]!==void 0?t.push(I.jsx("a",{href:r[4],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:r[3]},r.index)):r[5]!==void 0?t.push(I.jsx("a",{href:r[5],target:"_blank",rel:"noopener noreferrer",className:"mc-link",children:r[5]},r.index)):r[6]!==void 0?t.push(I.jsx("strong",{children:vt(r[6])},r.index)):r[7]!==void 0?t.push(I.jsx("strong",{children:vt(r[7])},r.index)):r[8]!==void 0?t.push(I.jsx("em",{children:vt(r[8])},r.index)):r[9]!==void 0?t.push(I.jsx("em",{children:vt(r[9])},r.index)):r[10]!==void 0?t.push(I.jsx("del",{children:vt(r[10])},r.index)):r[11]!==void 0&&t.push(I.jsx("code",{className:"mc-inline-code",children:r[11]},r.index)),s=r.index+r[0].length;return s<e.length&&t.push(e.slice(s)),t.length>0?t:[e]}const Li=({content:e})=>{const t=e.split(`
29
29
  `),n=[];let s=0;for(;s<t.length;){const r=t[s];if(r.trimStart().startsWith("```")){const o=r.trimStart().slice(3)?.trim(),c=[];for(s++;s<t.length&&!t[s].trimStart().startsWith("```");)c.push(t[s]),s++;n.push(I.jsxs("div",{className:"mc-codeblock",children:[o&&I.jsx("div",{className:"mc-codeblock-lang",children:o}),I.jsx("pre",{children:I.jsx("code",{children:c.join(`
30
- `)})})]},`code-${s}`)),s++;continue}if(/^(\s*[-*_]\s*){3,}$/.test(r)){n.push(I.jsx("hr",{className:"mc-hr"},`hr-${s}`)),s++;continue}const a=r.match(/^(#{1,3})\s+(.+)/);if(a){const o=a[1].length,c=a[2];n.push(I.jsx("div",{className:`mc-heading mc-h${o}`,children:yt(c)},`h-${s}`)),s++;continue}if(r.trimStart().startsWith("> ")){const o=[];for(;s<t.length&&t[s].trimStart().startsWith("> ");)o.push(t[s].replace(/^\s*>\s?/,"")),s++;n.push(I.jsx("div",{className:"mc-blockquote",children:o.map((c,T)=>I.jsx("div",{children:yt(c)},T))},`bq-${s}`));continue}if(r?.trim()===""){n.push(I.jsx("div",{className:"mc-empty-line"},`empty-${s}`)),s++;continue}n.push(I.jsx("div",{className:"mc-line",children:yt(r)},`line-${s}`)),s++}return I.jsx("div",{className:"message-content",children:n})},Hi={send_native:{label:"Send Native Token",description:"Send native token (ETH, BNB, MATIC, etc.) to an address",fields:[{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_token:{label:"Send Token (ERC20)",description:"Send an ERC20 token to an address",fields:[{key:"contract_address",label:"Token Contract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"Token Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"},{key:"decimals",label:"Decimals",type:"number",placeholder:"18",required:!1,editable:!1}]},swap_token:{label:"Swap Token",description:"Swap one token for another",fields:[{key:"token_in",label:"From Token",type:"address",placeholder:"0x... or native",required:!0,editable:!1},{key:"token_in_symbol",label:"From Symbol",type:"text",placeholder:"e.g. ETH",required:!1,editable:!1},{key:"token_out",label:"To Token",type:"address",placeholder:"0x...",required:!0,editable:!1},{key:"token_out_symbol",label:"To Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"token_in_decimals",label:"From Decimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"token_out_decimals",label:"To Decimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},approve_token:{label:"Approve Token",description:"Approve a spender to use your tokens",fields:[{key:"contract_address",label:"Token Contract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"Token Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"spender_address",label:"Spender Address",type:"address",placeholder:"0x... spender contract",required:!0,validation:"address",editable:!1},{key:"amount",label:"Amount (empty = unlimited)",type:"amount",placeholder:"0.0 or leave empty for max",required:!1,validation:"amount"},{key:"decimals",label:"Decimals",type:"number",placeholder:"18",required:!1,editable:!1}]},wrap_native:{label:"Wrap Native Token",description:"Wrap native token (ETH → WETH)",fields:[{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},unwrap_native:{label:"Unwrap Native Token",description:"Unwrap native token (WETH → ETH)",fields:[{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_nft:{label:"Send NFT",description:"Transfer an ERC721 or ERC1155 NFT to another address",fields:[{key:"contract_address",label:"NFT Contract",type:"address",placeholder:"0x... NFT contract",required:!0,validation:"address",editable:!1},{key:"token_id",label:"Token ID",type:"text",placeholder:"e.g. 1234",required:!0,editable:!1},{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"token_standard",label:"Token Standard",type:"text",placeholder:"ERC721 or ERC1155",required:!0,editable:!1},{key:"amount",label:"Amount",type:"text",placeholder:"1",required:!1},{key:"nft_name",label:"NFT Name",type:"text",placeholder:"e.g. Bored Ape #1234",required:!1,editable:!1}]}};function Ri(e){return Re(e)}function es(e){if(!e||e?.trim()==="")return!1;const t=parseFloat(e);return!isNaN(t)&&t>0}const Vi={send_native:"💸",send_token:"📤",swap_token:"🔄",approve_token:"✅",wrap_native:"📦",unwrap_native:"📭"},Wi=({action:e,initialValues:t,onSubmit:n,onCancel:s,isSubmitting:r=!1,tokenInfo:a})=>{const o=Hi[e],[c,T]=re.useState(()=>{if(!o)return{};const g={};return o.fields.forEach(B=>{g[B.key]=t[B.key]||""}),g}),[C]=re.useState(()=>["send_native","send_token","swap_token"].includes(e)&&!a&&c.contract_address?"Token not found in your wallet.":null),[N,L]=re.useState(()=>{const g={};if(["send_native","send_token","swap_token"].includes(e)&&a){const ue=parseFloat(a.balanceFormatted||"0");if(ue<=0)g.amount=`You have no ${a.symbol} balance in your wallet.`;else{const D=t.amount?.trim();D&&es(D)&&parseFloat(D)>ue&&(g.amount=`Insufficient balance. Available: ${a.balanceFormatted} ${a.symbol}`)}}return g}),m=re.useCallback((g,B)=>{T(ue=>({...ue,[g]:B})),N[g]&&L(ue=>{const D={...ue};return delete D[g],D})},[N]),k=re.useCallback(()=>{if(!o)return!1;const g={};return o.fields.forEach(B=>{const ue=c[B.key]?.trim()||"";if(B.required&&!ue){g[B.key]=`${B.label} is required`;return}if(ue){if(B.validation==="address"&&!Ri(ue)&&(g[B.key]="Invalid address (0x + 40 hex chars)"),B.validation==="amount"&&!es(ue)&&(g[B.key]="Must be a positive number"),B.key==="amount"&&ue&&es(ue)&&a?.balanceFormatted){const D=parseFloat(ue),Q=parseFloat(a.balanceFormatted);D>Q&&(g[B.key]=`Insufficient balance. Available: ${a.balanceFormatted} ${a.symbol}`)}B.validation==="positive_number"&&(isNaN(Number(ue))||Number(ue)<0)&&(g[B.key]="Must be a valid number")}}),L(g),Object.keys(g).length===0},[o,c,a]),x=re.useCallback(()=>{k()&&n(e,c)},[k,n,e,c]);return o?I.jsxs("div",{className:"action-form",children:[I.jsxs("div",{className:"action-form-title",children:[I.jsx("span",{children:Vi[e]||"⚙️"}),I.jsx("span",{children:o.label})]}),C&&I.jsxs("div",{className:"action-form-general-error",children:["⚠️ ",C]}),a&&I.jsx("div",{className:"action-form-token-info",children:I.jsxs("div",{className:"token-info-row",children:[a.logo&&I.jsx("img",{src:a.logo,alt:a.symbol,className:"token-info-logo",width:20,height:20}),I.jsxs("div",{className:"token-info-details",children:[I.jsxs("span",{className:"token-info-name",children:[a.name," (",a.symbol,")"]}),I.jsxs("span",{className:"token-info-balance",children:["Balance:"," ",de(a.balanceFormatted).decimalPlaces(8,de.ROUND_DOWN).toFormat()," ",a.symbol,a.usdValue!==void 0&&I.jsxs("span",{className:"token-info-usd",children:[" ","≈ $",a.usdValue.toFixed(2)]})]})]})]})}),I.jsx("div",{className:"action-form-fields",children:o.fields.map(g=>g.key==="amount"&&e==="send_nft"&&c.token_standard?.toUpperCase()!=="ERC1155"?null:I.jsxs("div",{className:"action-form-field",children:[I.jsxs("div",{className:"action-form-field-header",children:[I.jsxs("label",{children:[g.label,g.required&&" *"]}),g.key==="amount"&&a&&e!=="send_nft"&&I.jsxs("div",{className:"action-form-pct-btns",children:[[25,50,75].map(B=>I.jsxs("button",{type:"button",className:"action-form-pct-btn",onClick:()=>m("amount",(parseFloat(a.balanceFormatted)*B/100).toString()),disabled:r,children:[B,"%"]},B)),I.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>m("amount",a.balanceFormatted),disabled:r,children:"MAX"})]})]}),(()=>{const B=g.editable===!1&&!!t[g.key],ue=r||B,D=[N[g.key]?"error":"",B?"readonly":""].filter(Boolean).join(" ");return g.type==="address"?I.jsx("textarea",{rows:2,placeholder:g.placeholder,value:c[g.key]||"",onChange:Q=>m(g.key,Q.target.value),className:D,disabled:ue}):I.jsx("input",{type:g.type==="number"?"number":"text",placeholder:g.placeholder,value:c[g.key]||"",onChange:Q=>m(g.key,Q.target.value),className:D,disabled:ue})})(),N[g.key]&&I.jsx("span",{className:"field-error",children:N[g.key]})]},g.key))}),I.jsxs("div",{className:"action-form-actions",children:[I.jsx("button",{className:"action-form-cancel",onClick:s,type:"button",disabled:r,children:"Cancel"}),I.jsx("button",{className:"action-form-submit",onClick:x,type:"button",disabled:r,children:r?"⏳ Processing...":"🚀 Execute"})]})]}):null},Gi=({scrollContainerRef:e,threshold:t=200})=>{const[n,s]=re.useState(!1);re.useEffect(()=>{const a=e.current;if(!a)return;const o=()=>{const{scrollTop:c,scrollHeight:T,clientHeight:C}=a,N=T-c-C;s(N>t)};return a.addEventListener("scroll",o,{passive:!0}),o(),()=>{a.removeEventListener("scroll",o)}},[e,t]);const r=()=>{e.current?.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})};return n?I.jsx("button",{className:"scroll-to-bottom-btn",onClick:r,"aria-label":"Scroll to bottom",type:"button",children:I.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:I.jsx("path",{d:"M9 3V15M9 15L4 10M9 15L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null};function zi(e){const{walletAddress:t,chainName:n,chainId:s,nativeSymbol:r}=e;return t?t&&!jt[s]?`You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
30
+ `)})})]},`code-${s}`)),s++;continue}if(/^(\s*[-*_]\s*){3,}$/.test(r)){n.push(I.jsx("hr",{className:"mc-hr"},`hr-${s}`)),s++;continue}const a=r.match(/^(#{1,3})\s+(.+)/);if(a){const o=a[1].length,c=a[2];n.push(I.jsx("div",{className:`mc-heading mc-h${o}`,children:vt(c)},`h-${s}`)),s++;continue}if(r.trimStart().startsWith("> ")){const o=[];for(;s<t.length&&t[s].trimStart().startsWith("> ");)o.push(t[s].replace(/^\s*>\s?/,"")),s++;n.push(I.jsx("div",{className:"mc-blockquote",children:o.map((c,T)=>I.jsx("div",{children:vt(c)},T))},`bq-${s}`));continue}if(r?.trim()===""){n.push(I.jsx("div",{className:"mc-empty-line"},`empty-${s}`)),s++;continue}n.push(I.jsx("div",{className:"mc-line",children:vt(r)},`line-${s}`)),s++}return I.jsx("div",{className:"message-content",children:n})},Hi={send_native:{label:"Send Native Token",description:"Send native token (ETH, BNB, MATIC, etc.) to an address",fields:[{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_token:{label:"Send Token (ERC20)",description:"Send an ERC20 token to an address",fields:[{key:"contract_address",label:"Token Contract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"Token Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"},{key:"decimals",label:"Decimals",type:"number",placeholder:"18",required:!1,editable:!1}]},swap_token:{label:"Swap Token",description:"Swap one token for another",fields:[{key:"token_in",label:"From Token",type:"address",placeholder:"0x... or native",required:!0,editable:!1},{key:"token_in_symbol",label:"From Symbol",type:"text",placeholder:"e.g. ETH",required:!1,editable:!1},{key:"token_out",label:"To Token",type:"address",placeholder:"0x...",required:!0,editable:!1},{key:"token_out_symbol",label:"To Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"token_in_decimals",label:"From Decimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"token_out_decimals",label:"To Decimals",type:"number",placeholder:"18",required:!1,editable:!1},{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},approve_token:{label:"Approve Token",description:"Approve a spender to use your tokens",fields:[{key:"contract_address",label:"Token Contract",type:"address",placeholder:"0x... token contract",required:!0,validation:"address",editable:!1},{key:"token_symbol",label:"Token Symbol",type:"text",placeholder:"e.g. USDC",required:!1,editable:!1},{key:"spender_address",label:"Spender Address",type:"address",placeholder:"0x... spender contract",required:!0,validation:"address",editable:!1},{key:"amount",label:"Amount (empty = unlimited)",type:"amount",placeholder:"0.0 or leave empty for max",required:!1,validation:"amount"},{key:"decimals",label:"Decimals",type:"number",placeholder:"18",required:!1,editable:!1}]},wrap_native:{label:"Wrap Native Token",description:"Wrap native token (ETH → WETH)",fields:[{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},unwrap_native:{label:"Unwrap Native Token",description:"Unwrap native token (WETH → ETH)",fields:[{key:"amount",label:"Amount",type:"amount",placeholder:"0.0",required:!0,validation:"amount"}]},send_nft:{label:"Send NFT",description:"Transfer an ERC721 or ERC1155 NFT to another address",fields:[{key:"contract_address",label:"NFT Contract",type:"address",placeholder:"0x... NFT contract",required:!0,validation:"address",editable:!1},{key:"token_id",label:"Token ID",type:"text",placeholder:"e.g. 1234",required:!0,editable:!1},{key:"to_address",label:"Recipient Address",type:"address",placeholder:"0x...",required:!0,validation:"address"},{key:"token_standard",label:"Token Standard",type:"text",placeholder:"ERC721 or ERC1155",required:!0,editable:!1},{key:"amount",label:"Amount",type:"text",placeholder:"1",required:!1},{key:"nft_name",label:"NFT Name",type:"text",placeholder:"e.g. Bored Ape #1234",required:!1,editable:!1}]}};function Ri(e){return Re(e)}function es(e){if(!e||e?.trim()==="")return!1;const t=parseFloat(e);return!isNaN(t)&&t>0}const Vi={send_native:"💸",send_token:"📤",swap_token:"🔄",approve_token:"✅",wrap_native:"📦",unwrap_native:"📭"},Wi=({action:e,initialValues:t,onSubmit:n,onCancel:s,isSubmitting:r=!1,tokenInfo:a})=>{const o=Hi[e],[c,T]=re.useState(()=>{if(!o)return{};const g={};return o.fields.forEach(B=>{g[B.key]=t[B.key]||""}),g}),[C]=re.useState(()=>["send_native","send_token","swap_token"].includes(e)&&!a&&c.contract_address?"Token not found in your wallet.":null),[N,L]=re.useState(()=>{const g={};if(["send_native","send_token","swap_token"].includes(e)&&a){const ue=parseFloat(a.balanceFormatted||"0");if(ue<=0)g.amount=`You have no ${a.symbol} balance in your wallet.`;else{const D=t.amount?.trim();D&&es(D)&&parseFloat(D)>ue&&(g.amount=`Insufficient balance. Available: ${a.balanceFormatted} ${a.symbol}`)}}return g}),m=re.useCallback((g,B)=>{T(ue=>({...ue,[g]:B})),N[g]&&L(ue=>{const D={...ue};return delete D[g],D})},[N]),k=re.useCallback(()=>{if(!o)return!1;const g={};return o.fields.forEach(B=>{const ue=c[B.key]?.trim()||"";if(B.required&&!ue){g[B.key]=`${B.label} is required`;return}if(ue){if(B.validation==="address"&&!Ri(ue)&&(g[B.key]="Invalid address (0x + 40 hex chars)"),B.validation==="amount"&&!es(ue)&&(g[B.key]="Must be a positive number"),B.key==="amount"&&ue&&es(ue)&&a?.balanceFormatted){const D=parseFloat(ue),Q=parseFloat(a.balanceFormatted);D>Q&&(g[B.key]=`Insufficient balance. Available: ${a.balanceFormatted} ${a.symbol}`)}B.validation==="positive_number"&&(isNaN(Number(ue))||Number(ue)<0)&&(g[B.key]="Must be a valid number")}}),L(g),Object.keys(g).length===0},[o,c,a]),x=re.useCallback(()=>{k()&&n(e,c)},[k,n,e,c]);return o?I.jsxs("div",{className:"action-form",children:[I.jsxs("div",{className:"action-form-title",children:[I.jsx("span",{children:Vi[e]||"⚙️"}),I.jsx("span",{children:o.label})]}),C&&I.jsxs("div",{className:"action-form-general-error",children:["⚠️ ",C]}),a&&I.jsx("div",{className:"action-form-token-info",children:I.jsxs("div",{className:"token-info-row",children:[a.logo&&I.jsx("img",{src:a.logo,alt:a.symbol,className:"token-info-logo",width:20,height:20}),I.jsxs("div",{className:"token-info-details",children:[I.jsxs("span",{className:"token-info-name",children:[a.name," (",a.symbol,")"]}),I.jsxs("span",{className:"token-info-balance",children:["Balance:"," ",de(a.balanceFormatted).decimalPlaces(8,de.ROUND_DOWN).toFormat()," ",a.symbol,a.usdValue!==void 0&&I.jsxs("span",{className:"token-info-usd",children:[" ","≈ $",a.usdValue.toFixed(2)]})]})]})]})}),I.jsx("div",{className:"action-form-fields",children:o.fields.map(g=>g.key==="amount"&&e==="send_nft"&&c.token_standard?.toUpperCase()!=="ERC1155"?null:I.jsxs("div",{className:"action-form-field",children:[I.jsxs("div",{className:"action-form-field-header",children:[I.jsxs("label",{children:[g.label,g.required&&" *"]}),g.key==="amount"&&a&&e!=="send_nft"&&I.jsxs("div",{className:"action-form-pct-btns",children:[[25,50,75].map(B=>I.jsxs("button",{type:"button",className:"action-form-pct-btn",onClick:()=>m("amount",(parseFloat(a.balanceFormatted)*B/100).toString()),disabled:r,children:[B,"%"]},B)),I.jsx("button",{type:"button",className:"action-form-pct-btn action-form-max-btn",onClick:()=>m("amount",a.balanceFormatted),disabled:r,children:"MAX"})]})]}),(()=>{const B=g.editable===!1&&!!t[g.key],ue=r||B,D=[N[g.key]?"error":"",B?"readonly":""].filter(Boolean).join(" ");return g.type==="address"?I.jsx("textarea",{rows:2,placeholder:g.placeholder,value:c[g.key]||"",onChange:Q=>m(g.key,Q.target.value),className:D,disabled:ue}):I.jsx("input",{type:g.type==="number"?"number":"text",placeholder:g.placeholder,value:c[g.key]||"",onChange:Q=>m(g.key,Q.target.value),className:D,disabled:ue})})(),N[g.key]&&I.jsx("span",{className:"field-error",children:N[g.key]})]},g.key))}),I.jsxs("div",{className:"action-form-actions",children:[I.jsx("button",{className:"action-form-cancel",onClick:s,type:"button",disabled:r,children:"Cancel"}),I.jsx("button",{className:"action-form-submit",onClick:x,type:"button",disabled:r,children:r?"⏳ Processing...":"🚀 Execute"})]})]}):null},Gi=({scrollContainerRef:e,threshold:t=200})=>{const[n,s]=re.useState(!1);re.useEffect(()=>{const a=e.current;if(!a)return;const o=()=>{const{scrollTop:c,scrollHeight:T,clientHeight:C}=a,N=T-c-C;s(N>t)};return a.addEventListener("scroll",o,{passive:!0}),o(),()=>{a.removeEventListener("scroll",o)}},[e,t]);const r=()=>{e.current?.scrollTo({top:e.current.scrollHeight,behavior:"smooth"})};return n?I.jsx("button",{className:"scroll-to-bottom-btn",onClick:r,"aria-label":"Scroll to bottom",type:"button",children:I.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",children:I.jsx("path",{d:"M9 3V15M9 15L4 10M9 15L14 10",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}):null};function zi(e){const{walletAddress:t,chainName:n,chainId:s,nativeSymbol:r}=e;return t?t&&!wt[s]?`You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
31
31
  The user's wallet address is: ${t}
32
32
  The user is selected on (chainId: ${s}) an UNSUPPORTED chain.
33
33
 
@@ -295,8 +295,8 @@ Always respond with a valid JSON object:
295
295
  - suggested_actions: include when your message offers the user interactive choices or asks a follow-up question. NEVER include suggested_actions that ask the user to connect their wallet (e.g., "Connect wallet", "Connect now", etc.) — the app handles wallet connection separately
296
296
  - For wallet-required actions, politely explain the user needs to connect their wallet first, and put this in the "message" field
297
297
  - ALWAYS respond with raw JSON only, never wrap in \`\`\`json code blocks
298
- - **CRITICAL - LANGUAGE**: Always respond in the SAME language the user writes in. English → English. Vietnamese → Vietnamese. NEVER use Chinese or any other language unless the user wrote in that language.`}const dr={1:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",10:"0x4200000000000000000000000000000000000006",56:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",137:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",8453:"0x4200000000000000000000000000000000000006",42161:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},pn=[{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],ur=[{name:"deposit",type:"function",stateMutability:"payable",inputs:[],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}],Yi=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],ji=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"amount",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]}];function Kt(e,t){return t||jt[e]?.rpcUrls?.default?.http?.[0]}function qi(e){const{action:t,parameters:n,fromAddress:s,chainId:r}=e;switch(t){case"send_native":return Ji(n,s,r);case"send_token":return Xi(n,s,r);case"approve_token":return Ki(n,s,r);case"wrap_native":return Zi(n,s,r);case"unwrap_native":return Qi(n,s,r);case"send_nft":return ec(n,s,r);default:throw new Error(`Action "${t}" does not produce a transaction`)}}function Ji(e,t,n){const{to_address:s,amount:r}=e;if(!s)throw new Error("Recipient address is required");if(!r)throw new Error("Amount is required");const a=dt(r,18).toString();return{from:t,to:s,data:"0x",value:a,chainId:n,description:`Send ${r} native token to ${s}`}}function Xi(e,t,n){const{contract_address:s,to_address:r,amount:a,decimals:o,token_symbol:c}=e;if(!s)throw new Error("Token contract address is required");if(!r)throw new Error("Recipient address is required");if(!a)throw new Error("Amount is required");const T=parseInt(o)||18,C=dt(a,T),N=bt({abi:pn,functionName:"transfer",args:[r,C]});return{from:t,to:s,data:N,value:"0",chainId:n,description:`Send ${a} ${c||"tokens"} to ${r}`}}function Ki(e,t,n){const{contract_address:s,spender_address:r,amount:a,token_symbol:o}=e;if(!s)throw new Error("Token contract address is required");if(!r)throw new Error("Spender address is required");const c=a&&a?.trim()!==""?dt(a,18):Ut,T=bt({abi:pn,functionName:"approve",args:[r,c]});return{from:t,to:s,data:T,value:"0",chainId:n,description:`Approve ${a||"unlimited"} ${o||"tokens"} for ${r}`}}function Zi(e,t,n){const{amount:s}=e;if(!s)throw new Error("Amount is required");const r=dr[n];if(!r)throw new Error(`WETH not supported on chain ${n}`);const a=dt(s,18).toString(),o=bt({abi:ur,functionName:"deposit"});return{from:t,to:r,data:o,value:a,chainId:n,description:`Wrap ${s} native token`}}function Qi(e,t,n){const{amount:s}=e;if(!s)throw new Error("Amount is required");const r=dr[n];if(!r)throw new Error(`WETH not supported on chain ${n}`);const a=dt(s,18),o=bt({abi:ur,functionName:"withdraw",args:[a]});return{from:t,to:r,data:o,value:"0",chainId:n,description:`Unwrap ${s} WETH`}}function $i(e){return["send_native","send_token","approve_token","wrap_native","unwrap_native","send_nft"].includes(e)}async function ts(e){const{transactionHash:t,chainId:n,pollingInterval:s=3e3,timeout:r=12e4,rpcUrl:a}=e,o=Kt(n,a);if(!o)throw new Error(`No RPC endpoint for chain ${n}`);const c=Date.now();for(;Date.now()-c<r;){try{const C=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[t]})})).json();if(C.result){const N=C.result;return{status:N.status==="0x1"?"success":"fail",blockNumber:N.blockNumber,gasUsed:N.gasUsed,effectiveGasPrice:N.effectiveGasPrice}}}catch(T){console.warn("eth_getTransactionReceipt poll error:",T)}await new Promise(T=>setTimeout(T,s))}throw new Error(`Transaction ${t} was not mined within ${r/1e3}s`)}async function ns(e){const{tokenAddress:t,ownerAddress:n,spenderAddress:s,chainId:r,rpcUrl:a}=e,o=Kt(r,a);if(!o)return console.warn(`No RPC endpoint for chain ${r}, assuming no allowance`),BigInt(0);try{const c=bt({abi:pn,functionName:"allowance",args:[n,s]}),C=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:t,data:c},"latest"]})})).json();return C.result&&C.result!=="0x"?BigInt(C.result):BigInt(0)}catch(c){return console.warn("checkAllowance failed:",c),BigInt(0)}}function hn(e){const{tokenAddress:t,spenderAddress:n,fromAddress:s,chainId:r,tokenSymbol:a}=e,o=bt({abi:pn,functionName:"approve",args:[n,Ut]});return{from:s,to:t,data:o,value:"0",chainId:r,description:`Approve ${a||"token"} for swap`}}function ec(e,t,n){const{contract_address:s,token_id:r,to_address:a,token_standard:o,amount:c,nft_name:T}=e;if(!s)throw new Error("NFT contract address is required");if(!r)throw new Error("Token ID is required");if(!a)throw new Error("Recipient address is required");const C=(o||"ERC721").toUpperCase(),N=BigInt(r);let L,m;if(C==="ERC1155"){const k=BigInt(c||"1");L=bt({abi:ji,functionName:"safeTransferFrom",args:[t,a,N,k,"0x"]}),m=`Send ${k>1n?k.toString()+"x ":""}${T||"NFT"} (ERC1155 #${r}) to ${a}`}else L=bt({abi:Yi,functionName:"safeTransferFrom",args:[t,a,N]}),m=`Send ${T||"NFT"} (ERC721 #${r}) to ${a}`;return{from:t,to:s,data:L,value:"0",chainId:n,description:m}}async function mn(e){const{address:t,chainId:n,rpcUrl:s}=e,r=Kt(n,s);if(!r)return console.warn(`No RPC endpoint for chain ${n}`),new de(0);try{const o=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getBalance",params:[t,"latest"]})})).json();return o.result&&o.result!=="0x"?new de(BigInt(o.result).toString()):new de(0)}catch(a){return console.warn("getNativeBalance failed:",a),new de(0)}}async function Zt(e){const{from:t,to:n,data:s,value:r,chainId:a,rpcUrl:o}=e,c=Kt(a,o);if(!c)return console.warn(`No RPC endpoint for chain ${a}`),new de(0);try{const[T,C]=await Promise.all([fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_estimateGas",params:[{from:t,to:n,data:s,...r&&r!=="0"?{value:r}:{}}]})}),fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:2,method:"eth_gasPrice",params:[]})})]),[N,L]=await Promise.all([T.json(),C.json()]),m=N.result?new de(BigInt(N.result).toString()):new de(0),k=L.result?new de(BigInt(L.result).toString()):new de(0);return m.times(k).times(1.1)}catch(T){return console.warn("estimateTransactionFee failed:",T),new de(0)}}async function ss(e){const{chainId:t,rpcUrl:n}=e,s=Kt(t,n);if(!s)return console.warn(`No RPC endpoint for chain ${t}`),new de(0);try{const a=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_gasPrice",params:[]})})).json();return a.result&&a.result!=="0x"?new de(BigInt(a.result).toString()):new de(0)}catch(r){return console.warn("getGasPrice failed:",r),new de(0)}}var te={},Qt={exports:{}},tc=Qt.exports,fr;function nc(){return fr||(fr=1,(function(e,t){(function(n,s){var r="1.0.41",a="",o="?",c="function",T="undefined",C="object",N="string",L="major",m="model",k="name",x="type",g="vendor",B="version",ue="architecture",D="console",Q="mobile",oe="tablet",ye="smarttv",ge="wearable",Ce="embedded",i=500,l="Amazon",u="Apple",w="ASUS",p="BlackBerry",v="Browser",S="Chrome",h="Edge",b="Firefox",E="Google",y="Honor",O="Huawei",q="Lenovo",ne="LG",me="Microsoft",xe="Motorola",Te="Nvidia",W="OnePlus",be="Opera",Ie="OPPO",_e="Samsung",Qe="Sharp",Ye="Sony",Le="Xiaomi",Ge="Zebra",Fe="Facebook",Oe="Chromium OS",Ee="Mac OS",M=" Browser",se=function(F,V){var _={};for(var j in F)V[j]&&V[j].length%2===0?_[j]=V[j].concat(F[j]):_[j]=F[j];return _},R=function(F){for(var V={},_=0;_<F.length;_++)V[F[_].toUpperCase()]=F[_];return V},$=function(F,V){return typeof F===N?ee(V).indexOf(ee(F))!==-1:!1},ee=function(F){return F.toLowerCase()},Y=function(F){return typeof F===N?F.replace(/[^\d\.]/g,a).split(".")[0]:s},z=function(F,V){if(typeof F===N)return F=F.replace(/^\s\s*/,a),typeof V===T?F:F.substring(0,i)},K=function(F,V){for(var _=0,j,ae,ce,G,J,ve;_<V.length&&!J;){var Se=V[_],Be=V[_+1];for(j=ae=0;j<Se.length&&!J&&Se[j];)if(J=Se[j++].exec(F),J)for(ce=0;ce<Be.length;ce++)ve=J[++ae],G=Be[ce],typeof G===C&&G.length>0?G.length===2?typeof G[1]==c?this[G[0]]=G[1].call(this,ve):this[G[0]]=G[1]:G.length===3?typeof G[1]===c&&!(G[1].exec&&G[1].test)?this[G[0]]=ve?G[1].call(this,ve,G[2]):s:this[G[0]]=ve?ve.replace(G[1],G[2]):s:G.length===4&&(this[G[0]]=ve?G[3].call(this,ve.replace(G[1],G[2])):s):this[G]=ve||s;_+=2}},X=function(F,V){for(var _ in V)if(typeof V[_]===C&&V[_].length>0){for(var j=0;j<V[_].length;j++)if($(V[_][j],F))return _===o?s:_}else if($(V[_],F))return _===o?s:_;return V.hasOwnProperty("*")?V["*"]:F},U={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},pe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[B,[k,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[B,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,B],[/opios[\/ ]+([\w\.]+)/i],[B,[k,be+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[B,[k,be+" GX"]],[/\bopr\/([\w\.]+)/i],[B,[k,be]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[B,[k,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[B,[k,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[k,B],[/quark(?:pc)?\/([-\w\.]+)/i],[B,[k,"Quark"]],[/\bddg\/([\w\.]+)/i],[B,[k,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[B,[k,"UC"+v]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[B,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[B,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[B,[k,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[B,[k,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[B,[k,"Smart Lenovo "+v]],[/(avast|avg)\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure "+v],B],[/\bfocus\/([\w\.]+)/i],[B,[k,b+" Focus"]],[/\bopt\/([\w\.]+)/i],[B,[k,be+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[B,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[B,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[B,[k,be+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[B,[k,"MIUI"+M]],[/fxios\/([\w\.-]+)/i],[B,[k,b]],[/\bqihoobrowser\/?([\w\.]*)/i],[B,[k,"360"]],[/\b(qq)\/([\w\.]+)/i],[[k,/(.+)/,"$1Browser"],B],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1"+M],B],[/samsungbrowser\/([\w\.]+)/i],[B,[k,_e+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[B,[k,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[k,"Sogou Mobile"],B],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[k,B],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[k],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[B,k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,Fe],B],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[k,B],[/\bgsa\/([\w\.]+) .*safari\//i],[B,[k,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[B,[k,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[B,[k,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[k,S+" WebView"],B],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[B,[k,"Android "+v]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,B],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[B,[k,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[B,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[B,X,U]],[/(webkit|khtml)\/([\w\.]+)/i],[k,B],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],B],[/(wolvic|librewolf)\/([\w\.]+)/i],[k,B],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[B,[k,b+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[k,[B,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[k,[B,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ue,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ue,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ue,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ue,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ue,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ue,/ower/,a,ee]],[/ sun4\w[;\)]/i],[[ue,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ue,ee]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[m,[g,_e],[x,oe]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[m,[g,_e],[x,Q]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[m,[g,u],[x,Q]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[m,[g,u],[x,oe]],[/(macintosh);/i],[m,[g,u]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[g,Qe],[x,Q]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[m,[g,y],[x,oe]],[/honor([-\w ]+)[;\)]/i],[m,[g,y],[x,Q]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[m,[g,O],[x,oe]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[m,[g,O],[x,Q]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[m,/_/g," "],[g,Le],[x,oe]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[m,/_/g," "],[g,Le],[x,Q]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[g,Ie],[x,Q]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[m,[g,X,{OnePlus:["304","403","203"],"*":Ie}],[x,oe]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[g,"Vivo"],[x,Q]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[g,"Realme"],[x,Q]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[m,[g,xe],[x,Q]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[g,xe],[x,oe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[g,ne],[x,oe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[g,ne],[x,Q]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[m,[g,q],[x,oe]],[/(nokia) (t[12][01])/i],[g,m,[x,oe]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[m,/_/g," "],[x,Q],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[m,[g,E],[x,oe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[m,[g,E],[x,Q]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[m,[g,Ye],[x,Q]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[g,Ye],[x,oe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[g,W],[x,Q]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[g,l],[x,oe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[g,l],[x,Q]],[/(playbook);[-\w\),; ]+(rim)/i],[m,g,[x,oe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[m,[g,p],[x,Q]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[g,w],[x,oe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[g,w],[x,Q]],[/(nexus 9)/i],[m,[g,"HTC"],[x,oe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[m,/_/g," "],[x,Q]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[m,[g,"TCL"],[x,oe]],[/(itel) ((\w+))/i],[[g,ee],m,[x,X,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[g,"Acer"],[x,oe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[g,"Meizu"],[x,Q]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[g,"Ulefone"],[x,Q]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[g,"Energizer"],[x,Q]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[g,"Cat"],[x,Q]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[g,"Smartfren"],[x,Q]],[/droid.+; (a(?:015|06[35]|142p?))/i],[m,[g,"Nothing"],[x,Q]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[m,[g,"Archos"],[x,oe]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[m,[g,"Archos"],[x,Q]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,m,[x,oe]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,m,[x,Q]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,m,[x,oe]],[/(surface duo)/i],[m,[g,me],[x,oe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[g,"Fairphone"],[x,Q]],[/(u304aa)/i],[m,[g,"AT&T"],[x,Q]],[/\bsie-(\w*)/i],[m,[g,"Siemens"],[x,Q]],[/\b(rct\w+) b/i],[m,[g,"RCA"],[x,oe]],[/\b(venue[\d ]{2,7}) b/i],[m,[g,"Dell"],[x,oe]],[/\b(q(?:mv|ta)\w+) b/i],[m,[g,"Verizon"],[x,oe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[m,[g,"Barnes & Noble"],[x,oe]],[/\b(tm\d{3}\w+) b/i],[m,[g,"NuVision"],[x,oe]],[/\b(k88) b/i],[m,[g,"ZTE"],[x,oe]],[/\b(nx\d{3}j) b/i],[m,[g,"ZTE"],[x,Q]],[/\b(gen\d{3}) b.+49h/i],[m,[g,"Swiss"],[x,Q]],[/\b(zur\d{3}) b/i],[m,[g,"Swiss"],[x,oe]],[/\b((zeki)?tb.*\b) b/i],[m,[g,"Zeki"],[x,oe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],m,[x,oe]],[/\b(ns-?\w{0,9}) b/i],[m,[g,"Insignia"],[x,oe]],[/\b((nxa|next)-?\w{0,9}) b/i],[m,[g,"NextBook"],[x,oe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],m,[x,Q]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],m,[x,Q]],[/\b(ph-1) /i],[m,[g,"Essential"],[x,Q]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[m,[g,"Envizen"],[x,oe]],[/\b(trio[-\w\. ]+) b/i],[m,[g,"MachSpeed"],[x,oe]],[/\btu_(1491) b/i],[m,[g,"Rotor"],[x,oe]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[m,[g,Te],[x,oe]],[/(sprint) (\w+)/i],[g,m,[x,Q]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[g,me],[x,Q]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[g,Ge],[x,oe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[g,Ge],[x,Q]],[/smart-tv.+(samsung)/i],[g,[x,ye]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[g,_e],[x,ye]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,ne],[x,ye]],[/(apple) ?tv/i],[g,[m,u+" TV"],[x,ye]],[/crkey/i],[[m,S+"cast"],[g,E],[x,ye]],[/droid.+aft(\w+)( bui|\))/i],[m,[g,l],[x,ye]],[/(shield \w+ tv)/i],[m,[g,Te],[x,ye]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[g,Qe],[x,ye]],[/(bravia[\w ]+)( bui|\))/i],[m,[g,Ye],[x,ye]],[/(mi(tv|box)-?\w+) bui/i],[m,[g,Le],[x,ye]],[/Hbbtv.*(technisat) (.*);/i],[g,m,[x,ye]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,z],[m,z],[x,ye]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[m,[x,ye]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[x,ye]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,m,[x,D]],[/droid.+; (shield)( bui|\))/i],[m,[g,Te],[x,D]],[/(playstation \w+)/i],[m,[g,Ye],[x,D]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[g,me],[x,D]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[m,[g,_e],[x,ge]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,m,[x,ge]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[m,[g,Ie],[x,ge]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[g,u],[x,ge]],[/(opwwe\d{3})/i],[m,[g,W],[x,ge]],[/(moto 360)/i],[m,[g,xe],[x,ge]],[/(smartwatch 3)/i],[m,[g,Ye],[x,ge]],[/(g watch r)/i],[m,[g,ne],[x,ge]],[/droid.+; (wt63?0{2,3})\)/i],[m,[g,Ge],[x,ge]],[/droid.+; (glass) \d/i],[m,[g,E],[x,ge]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,m,[x,ge]],[/; (quest( \d| pro)?)/i],[m,[g,Fe],[x,ge]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[x,Ce]],[/(aeobc)\b/i],[m,[g,l],[x,Ce]],[/(homepod).+mac os/i],[m,[g,u],[x,Ce]],[/windows iot/i],[[x,Ce]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[m,[x,Q]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[m,[x,oe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[x,oe]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[x,Q]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[m,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[B,[k,h+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[k,B],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[B,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[k,B],[/ladybird\//i],[[k,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[B,k]],os:[[/microsoft (windows) (vista|xp)/i],[k,B],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[k,[B,X,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[B,X,Z],[k,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[B,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[k,Ee],[B,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[B,k],[/(ubuntu) ([\w\.]+) like android/i],[[k,/(.+)/,"$1 Touch"],B],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[k,B],[/\(bb(10);/i],[B,[k,p]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[B,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[B,[k,b+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[B,[k,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[B,[k,"watchOS"]],[/crkey\/([\d\.]+)/i],[B,[k,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[k,Oe],B],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[k,B],[/(sunos) ?([\w\.\d]*)/i],[[k,"Solaris"],B],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[k,B]]},ie=function(F,V){if(typeof F===C&&(V=F,F=s),!(this instanceof ie))return new ie(F,V).getResult();var _=typeof n!==T&&n.navigator?n.navigator:s,j=F||(_&&_.userAgent?_.userAgent:a),ae=_&&_.userAgentData?_.userAgentData:s,ce=V?se(pe,V):pe,G=_&&_.userAgent==j;return this.getBrowser=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.browser),J[L]=Y(J[B]),G&&_&&_.brave&&typeof _.brave.isBrave==c&&(J[k]="Brave"),J},this.getCPU=function(){var J={};return J[ue]=s,K.call(J,j,ce.cpu),J},this.getDevice=function(){var J={};return J[g]=s,J[m]=s,J[x]=s,K.call(J,j,ce.device),G&&!J[x]&&ae&&ae.mobile&&(J[x]=Q),G&&J[m]=="Macintosh"&&_&&typeof _.standalone!==T&&_.maxTouchPoints&&_.maxTouchPoints>2&&(J[m]="iPad",J[x]=oe),J},this.getEngine=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.engine),J},this.getOS=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.os),G&&!J[k]&&ae&&ae.platform&&ae.platform!="Unknown"&&(J[k]=ae.platform.replace(/chrome os/i,Oe).replace(/macos/i,Ee)),J},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return j},this.setUA=function(J){return j=typeof J===N&&J.length>i?z(J,i):J,this},this.setUA(j),this};ie.VERSION=r,ie.BROWSER=R([k,B,L]),ie.CPU=R([ue]),ie.DEVICE=R([m,g,x,D,Q,ye,oe,ge,Ce]),ie.ENGINE=ie.OS=R([k,B]),e.exports&&(t=e.exports=ie),t.UAParser=ie;var Ae=typeof n!==T&&(n.jQuery||n.Zepto);if(Ae&&!Ae.ua){var ke=new ie;Ae.ua=ke.getResult(),Ae.ua.get=function(){return ke.getUA()},Ae.ua.set=function(F){ke.setUA(F);var V=ke.getResult();for(var _ in V)Ae.ua[_]=V[_]}}})(typeof window=="object"?window:tc)})(Qt,Qt.exports)),Qt.exports}var pr;function sc(){if(pr)return te;pr=1,Object.defineProperty(te,"__esModule",{value:!0});function e(A){return A&&typeof A=="object"&&"default"in A?A.default:A}var t=re,n=e(t),s=nc(),r=new s,a=r.getBrowser(),o=r.getCPU(),c=r.getDevice(),T=r.getEngine(),C=r.getOS(),N=r.getUA(),L=function(d){return r.setUA(d)},m=function(d){if(!d){console.error("No userAgent string was provided");return}var f=new s(d);return{UA:f,browser:f.getBrowser(),cpu:f.getCPU(),device:f.getDevice(),engine:f.getEngine(),os:f.getOS(),ua:f.getUA(),setUserAgent:function(H){return f.setUA(H)}}},k=Object.freeze({ClientUAInstance:r,browser:a,cpu:o,device:c,engine:T,os:C,ua:N,setUa:L,parseUserAgent:m});function x(A,d){var f=Object.keys(A);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(A);d&&(P=P.filter(function(H){return Object.getOwnPropertyDescriptor(A,H).enumerable})),f.push.apply(f,P)}return f}function g(A){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?x(Object(f),!0).forEach(function(P){oe(A,P,f[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(f)):x(Object(f)).forEach(function(P){Object.defineProperty(A,P,Object.getOwnPropertyDescriptor(f,P))})}return A}function B(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(d){return typeof d}:B=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},B(A)}function ue(A,d){if(!(A instanceof d))throw new TypeError("Cannot call a class as a function")}function D(A,d){for(var f=0;f<d.length;f++){var P=d[f];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(A,P.key,P)}}function Q(A,d,f){return d&&D(A.prototype,d),A}function oe(A,d,f){return d in A?Object.defineProperty(A,d,{value:f,enumerable:!0,configurable:!0,writable:!0}):A[d]=f,A}function ye(){return ye=Object.assign||function(A){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var P in f)Object.prototype.hasOwnProperty.call(f,P)&&(A[P]=f[P])}return A},ye.apply(this,arguments)}function ge(A,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(d&&d.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),d&&i(A,d)}function Ce(A){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},Ce(A)}function i(A,d){return i=Object.setPrototypeOf||function(P,H){return P.__proto__=H,P},i(A,d)}function l(A,d){if(A==null)return{};var f={},P=Object.keys(A),H,we;for(we=0;we<P.length;we++)H=P[we],!(d.indexOf(H)>=0)&&(f[H]=A[H]);return f}function u(A,d){if(A==null)return{};var f=l(A,d),P,H;if(Object.getOwnPropertySymbols){var we=Object.getOwnPropertySymbols(A);for(H=0;H<we.length;H++)P=we[H],!(d.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(A,P)&&(f[P]=A[P])}return f}function w(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function p(A,d){if(d&&(typeof d=="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(A)}function v(A,d){return S(A)||h(A,d)||b(A,d)||y()}function S(A){if(Array.isArray(A))return A}function h(A,d){var f=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(f!=null){var P=[],H=!0,we=!1,De,ze;try{for(f=f.call(A);!(H=(De=f.next()).done)&&(P.push(De.value),!(d&&P.length===d));H=!0);}catch(yn){we=!0,ze=yn}finally{try{!H&&f.return!=null&&f.return()}finally{if(we)throw ze}}return P}}function b(A,d){if(A){if(typeof A=="string")return E(A,d);var f=Object.prototype.toString.call(A).slice(8,-1);if(f==="Object"&&A.constructor&&(f=A.constructor.name),f==="Map"||f==="Set")return Array.from(A);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return E(A,d)}}function E(A,d){(d==null||d>A.length)&&(d=A.length);for(var f=0,P=new Array(d);f<d;f++)P[f]=A[f];return P}function y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
299
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var O={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},q={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},ne={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},me={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},xe=function(d){switch(d){case O.Mobile:return{isMobile:!0};case O.Tablet:return{isTablet:!0};case O.SmartTv:return{isSmartTV:!0};case O.Console:return{isConsole:!0};case O.Wearable:return{isWearable:!0};case O.Browser:return{isBrowser:!0};case O.Embedded:return{isEmbedded:!0};default:return me}},Te=function(d){return L(d)},W=function(d){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return d||f},be=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Ie=function(d){var f=be();return f&&f.platform&&(f.platform.indexOf(d)!==-1||f.platform==="MacIntel"&&f.maxTouchPoints>1&&!window.MSStream)},_e=function(d,f,P,H,we){return{isBrowser:d,browserMajorVersion:W(f.major),browserFullVersion:W(f.version),browserName:W(f.name),engineName:W(P.name),engineVersion:W(P.version),osName:W(H.name),osVersion:W(H.version),userAgent:W(we)}},Qe=function(d,f,P,H){return g({},d,{vendor:W(f.vendor),model:W(f.model),os:W(P.name),osVersion:W(P.version),ua:W(H)})},Ye=function(d,f,P,H){return{isSmartTV:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Le=function(d,f,P,H){return{isConsole:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Ge=function(d,f,P,H){return{isWearable:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Fe=function(d,f,P,H,we){return{isEmbedded:d,vendor:W(f.vendor),model:W(f.model),engineName:W(P.name),engineVersion:W(P.version),osName:W(H.name),osVersion:W(H.version),userAgent:W(we)}};function Oe(A){var d=A?m(A):k,f=d.device,P=d.browser,H=d.engine,we=d.os,De=d.ua,ze=xe(f.type),yn=ze.isBrowser,tl=ze.isMobile,nl=ze.isTablet,Br=ze.isSmartTV,Pr=ze.isConsole,Nr=ze.isWearable,Or=ze.isEmbedded;if(yn)return _e(yn,P,H,we,De);if(Br)return Ye(Br,H,we,De);if(Pr)return Le(Pr,H,we,De);if(tl||nl)return Qe(ze,f,we,De);if(Nr)return Ge(Nr,H,we,De);if(Or)return Fe(Or,f,H,we,De)}var Ee=function(d){var f=d.type;return f===O.Mobile},M=function(d){var f=d.type;return f===O.Tablet},se=function(d){var f=d.type;return f===O.Mobile||f===O.Tablet},R=function(d){var f=d.type;return f===O.SmartTv},$=function(d){var f=d.type;return f===O.Browser},ee=function(d){var f=d.type;return f===O.Wearable},Y=function(d){var f=d.type;return f===O.Console},z=function(d){var f=d.type;return f===O.Embedded},K=function(d){var f=d.vendor;return W(f)},X=function(d){var f=d.model;return W(f)},U=function(d){var f=d.type;return W(f,"browser")},Z=function(d){var f=d.name;return f===ne.Android},pe=function(d){var f=d.name;return f===ne.Windows},ie=function(d){var f=d.name;return f===ne.MAC_OS},Ae=function(d){var f=d.name;return f===ne.WindowsPhone},ke=function(d){var f=d.name;return f===ne.IOS},F=function(d){var f=d.version;return W(f)},V=function(d){var f=d.name;return W(f)},_=function(d){var f=d.name;return f===q.Chrome},j=function(d){var f=d.name;return f===q.Firefox},ae=function(d){var f=d.name;return f===q.Chromium},ce=function(d){var f=d.name;return f===q.Edge},G=function(d){var f=d.name;return f===q.Yandex},J=function(d){var f=d.name;return f===q.Safari||f===q.MobileSafari},ve=function(d){var f=d.name;return f===q.MobileSafari},Se=function(d){var f=d.name;return f===q.Opera},Be=function(d){var f=d.name;return f===q.InternetExplorer||f===q.Ie},je=function(d){var f=d.name;return f===q.MIUI},$e=function(d){var f=d.name;return f===q.SamsungBrowser},ot=function(d){var f=d.version;return W(f)},It=function(d){var f=d.major;return W(f)},ft=function(d){var f=d.name;return W(f)},$t=function(d){var f=d.name;return W(f)},en=function(d){var f=d.version;return W(f)},_t=function(){var d=be(),f=d&&d.userAgent&&d.userAgent.toLowerCase();return typeof f=="string"?/electron/.test(f):!1},Pe=function(d){return typeof d=="string"&&d.indexOf("Edg/")!==-1},bn=function(){var d=be();return d&&(/iPad|iPhone|iPod/.test(d.platform)||d.platform==="MacIntel"&&d.maxTouchPoints>1)&&!window.MSStream},et=function(){return Ie("iPad")},hr=function(){return Ie("iPhone")},mr=function(){return Ie("iPod")},gr=function(d){return W(d)};function br(A){var d=A||k,f=d.device,P=d.browser,H=d.os,we=d.engine,De=d.ua;return{isSmartTV:R(f),isConsole:Y(f),isWearable:ee(f),isEmbedded:z(f),isMobileSafari:ve(P)||et(),isChromium:ae(P),isMobile:se(f)||et(),isMobileOnly:Ee(f),isTablet:M(f)||et(),isBrowser:$(f),isDesktop:$(f),isAndroid:Z(H),isWinPhone:Ae(H),isIOS:ke(H)||et(),isChrome:_(P),isFirefox:j(P),isSafari:J(P),isOpera:Se(P),isIE:Be(P),osVersion:F(H),osName:V(H),fullBrowserVersion:ot(P),browserVersion:It(P),browserName:ft(P),mobileVendor:K(f),mobileModel:X(f),engineName:$t(we),engineVersion:en(we),getUA:gr(De),isEdge:ce(P)||Pe(De),isYandex:G(P),deviceType:U(f),isIOS13:bn(),isIPad13:et(),isIPhone13:hr(),isIPod13:mr(),isElectron:_t(),isEdgeChromium:Pe(De),isLegacyEdge:ce(P)&&!Pe(De),isWindows:pe(H),isMacOs:ie(H),isMIUI:je(P),isSamsungBrowser:$e(P)}}var wr=R(c),yr=Y(c),vr=ee(c),ic=z(c),cc=ve(a)||et(),lc=ae(a),wn=se(c)||et(),Ar=Ee(c),kr=M(c)||et(),xr=$(c),dc=$(c),Tr=Z(C),Er=Ae(C),Sr=ke(C)||et(),uc=_(a),fc=j(a),pc=J(a),hc=Se(a),Ir=Be(a),mc=F(C),gc=V(C),bc=ot(a),wc=It(a),yc=ft(a),vc=K(c),Ac=X(c),kc=$t(T),xc=en(T),Tc=gr(N),Ec=ce(a)||Pe(N),Sc=G(a),Ic=U(c),Cc=bn(),Bc=et(),Pc=hr(),Nc=mr(),Oc=_t(),Uc=Pe(N),Dc=ce(a)&&!Pe(N),Fc=pe(C),Mc=ie(C),_c=je(a),Lc=$e(a),Hc=function(d){if(!d||typeof d!="string"){console.error("No valid user agent string was provided");return}var f=m(d),P=f.device,H=f.browser,we=f.os,De=f.engine,ze=f.ua;return br({device:P,browser:H,os:we,engine:De,ua:ze})},Rc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Tr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Vc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return xr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Wc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Ir?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Gc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Sr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},zc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return wn?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Yc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return kr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},jc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Er?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},qc=function(d){var f=d.renderWithFragment,P=d.children;d.viewClassName,d.style;var H=u(d,["renderWithFragment","children","viewClassName","style"]);return Ar?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Jc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return wr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Xc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return yr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Kc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return vr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Zc=function(d){var f=d.renderWithFragment,P=d.children;d.viewClassName,d.style;var H=d.condition,we=u(d,["renderWithFragment","children","viewClassName","style","condition"]);return H?f?n.createElement(t.Fragment,null,P):n.createElement("div",we,P):null};function Qc(A){return(function(d){ge(f,d);function f(P){var H;return ue(this,f),H=p(this,Ce(f).call(this,P)),H.isEventListenerAdded=!1,H.handleOrientationChange=H.handleOrientationChange.bind(w(H)),H.onOrientationChange=H.onOrientationChange.bind(w(H)),H.onPageLoad=H.onPageLoad.bind(w(H)),H.state={isLandscape:!1,isPortrait:!1},H}return Q(f,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var H=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:H===0,isLandscape:H===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":B(window))!==void 0&&wn&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(A,ye({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),f})(n.Component)}function $c(){var A=t.useState(function(){var we=window.innerWidth>window.innerHeight?90:0;return{isPortrait:we===0,isLandscape:we===90,orientation:we===0?"portrait":"landscape"}}),d=v(A,2),f=d[0],P=d[1],H=t.useCallback(function(){var we=window.innerWidth>window.innerHeight?90:0,De={isPortrait:we===0,isLandscape:we===90,orientation:we===0?"portrait":"landscape"};f.orientation!==De.orientation&&P(De)},[f.orientation]);return t.useEffect(function(){return(typeof window>"u"?"undefined":B(window))!==void 0&&wn&&(H(),window.addEventListener("load",H,!1),window.addEventListener("resize",H,!1)),function(){window.removeEventListener("resize",H,!1),window.removeEventListener("load",H,!1)}},[H]),f}function Cr(A){var d=A||window.navigator.userAgent;return m(d)}function el(A){var d=A||window.navigator.userAgent,f=Cr(d),P=br(f);return[P,f]}return te.AndroidView=Rc,te.BrowserTypes=q,te.BrowserView=Vc,te.ConsoleView=Xc,te.CustomView=Zc,te.IEView=Wc,te.IOSView=Gc,te.MobileOnlyView=qc,te.MobileView=zc,te.OsTypes=ne,te.SmartTVView=Jc,te.TabletView=Yc,te.WearableView=Kc,te.WinPhoneView=jc,te.browserName=yc,te.browserVersion=wc,te.deviceDetect=Oe,te.deviceType=Ic,te.engineName=kc,te.engineVersion=xc,te.fullBrowserVersion=bc,te.getSelectorsByUserAgent=Hc,te.getUA=Tc,te.isAndroid=Tr,te.isBrowser=xr,te.isChrome=uc,te.isChromium=lc,te.isConsole=yr,te.isDesktop=dc,te.isEdge=Ec,te.isEdgeChromium=Uc,te.isElectron=Oc,te.isEmbedded=ic,te.isFirefox=fc,te.isIE=Ir,te.isIOS=Sr,te.isIOS13=Cc,te.isIPad13=Bc,te.isIPhone13=Pc,te.isIPod13=Nc,te.isLegacyEdge=Dc,te.isMIUI=_c,te.isMacOs=Mc,te.isMobile=wn,te.isMobileOnly=Ar,te.isMobileSafari=cc,te.isOpera=hc,te.isSafari=pc,te.isSamsungBrowser=Lc,te.isSmartTV=wr,te.isTablet=kr,te.isWearable=vr,te.isWinPhone=Er,te.isWindows=Fc,te.isYandex=Sc,te.mobileModel=Ac,te.mobileVendor=vc,te.osName=gc,te.osVersion=mc,te.parseUserAgent=m,te.setUserAgent=Te,te.useDeviceData=Cr,te.useDeviceSelectors=el,te.useMobileOrientation=$c,te.withOrientationChange=Qc,te}var gn=sc();function rs(e,t){if(!e)return e;const n=e.toLowerCase().trim();if(n==="max"||n==="all")return t||e;const s=n.match(/^(\d+(?:\.\d+)?)%$/);if(s){const r=parseFloat(s[1])/100;return((parseFloat(t)||0)*r).toFixed(8).replace(/\.?0+$/,"")||"0"}return e}const rc=({isOpen:e,onClose:t,onTransaction:n,position:s="bottom-right"})=>{const{language:r}=Si();console.log("🚀 ~ ChatModal ~ language:",r);const{messages:a,addMessage:o,updateMessageAction:c,updateMessageText:T}=ki(),[C,N]=re.useState(""),[L,m]=re.useState(!1),[k,x]=re.useState(!0),[g,B]=re.useState(null),ue=re.useRef(null),D=re.useRef(null),Q=re.useRef(null),oe=re.useRef(null),ye=re.useRef(null),ge=re.useRef(!1),Ce=re.useRef(k);re.useEffect(()=>{Ce.current=k},[k]);const{account:i,chainData:l,chainType:u,chainTypeMoralis:w,chainId:p}=Jn(),v=Jn();console.log("🚀 ~ ChatModal ~ connect:",v);const{config:S}=xi(),h=p&&S?.rpcUrls?.[p]||void 0,b=re.useCallback(()=>{const M=Et.getItem("dataBuyToken");if(M)try{return JSON.parse(M)}catch{return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}}return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}},[]),E=re.useCallback(M=>{Et.setItem("dataBuyToken",JSON.stringify(M))},[]),y=re.useCallback(M=>{const R={...b(),...M};E(R)},[b,E]),O=re.useCallback(M=>{B(M),gn.isDesktop&&Q.current?.focus()},[]),q=re.useCallback(async(M,se)=>{y({descTokenAddress:M,descTokenDecimals:se||18});try{m(!0);const R=await rt({address:i?.address||"",chain:w});if(R?.success&&R?.data?.result){const $=R.data.result;if($?.length>0){const ee=$.map(Y=>({id:Y.token_address,text:`${Y.name}: ${Y.balance_formatted} ${Y.symbol} ($${de(Y.usd_value||0)?.decimalPlaces(2).toFormat()||"0"})`,value:`Buy with ${Y.symbol}`,action:"click_balance_item_user_to_buy_button",fullWidth:!0,extraData:{tokenAddress:Y.token_address,symbol:Y.symbol,balance:Y.balance_formatted,usdValue:Y.usd_value,decimals:Y.decimals}}));o(`This is the spendable balance of your wallet on ${l?.name||"unknown"} chain. Please choose the coins you want to use for this trade.`,"bot",void 0,ee)}else o(`Sorry, I couldn't find any tokens in your wallet on ${l?.name||"unknown"} chain. Please make sure you have some tokens to trade.`,"bot")}else o("Sorry, I could not fetch your wallet balance. Please try again.","bot")}catch(R){console.error("Error fetching wallet balance:",R),o("Sorry, I encountered an error fetching your wallet balance.","bot")}finally{m(!1)}},[y,i?.address,w,o,l?.name]),ne=re.useCallback(async(M,se,R,$)=>{const ee=[25,50,75,100];y({srcTokenAddress:M,srcTokenDecimals:$||18});let Y=R||"0";if(M===qe)try{const K=await ss({chainId:p,rpcUrl:h});if(K.isGreaterThan(0)){const X=K.times(1e6),Z=new de(dt(R,$||18).toString()).minus(X);Z.isGreaterThan(0)?Y=de(Ue(BigInt(Z.toFixed(0)),18)).toFixed():Y="0"}}catch(K){console.warn("getGasPrice for swap native fee deduction failed:",K)}const z=ee.map(K=>({id:`percent-${K}`,text:`${K}%`,value:`Use ${K}% of ${se}`,action:"select_percent",extraData:{percent:K,tokenAddress:M,tokenSymbol:se,tokenBalance:Y}}));if(de(Y).isZero()){o(`Insufficient fee. Please ensure you have enough ${se} to cover the transaction fees, or select a different token.`,"bot");return}o(`📊 Select the amount of ${se} to use:
298
+ - **CRITICAL - LANGUAGE**: Always respond in the SAME language the user writes in. English → English. Vietnamese → Vietnamese. NEVER use Chinese or any other language unless the user wrote in that language.`}const dr={1:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",10:"0x4200000000000000000000000000000000000006",56:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",137:"0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",8453:"0x4200000000000000000000000000000000000006",42161:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},pn=[{name:"transfer",type:"function",stateMutability:"nonpayable",inputs:[{name:"to",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"approve",type:"function",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{name:"",type:"bool"}]},{name:"allowance",type:"function",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{name:"",type:"uint256"}]}],ur=[{name:"deposit",type:"function",stateMutability:"payable",inputs:[],outputs:[]},{name:"withdraw",type:"function",stateMutability:"nonpayable",inputs:[{name:"wad",type:"uint256"}],outputs:[]}],Yi=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"tokenId",type:"uint256"}],outputs:[]}],ji=[{name:"safeTransferFrom",type:"function",stateMutability:"nonpayable",inputs:[{name:"from",type:"address"},{name:"to",type:"address"},{name:"id",type:"uint256"},{name:"amount",type:"uint256"},{name:"data",type:"bytes"}],outputs:[]}];function Kt(e,t){return t||wt[e]?.rpcUrls?.default?.http?.[0]}function qi(e){const{action:t,parameters:n,fromAddress:s,chainId:r}=e;switch(t){case"send_native":return Ji(n,s,r);case"send_token":return Xi(n,s,r);case"approve_token":return Ki(n,s,r);case"wrap_native":return Zi(n,s,r);case"unwrap_native":return Qi(n,s,r);case"send_nft":return ec(n,s,r);default:throw new Error(`Action "${t}" does not produce a transaction`)}}function Ji(e,t,n){const{to_address:s,amount:r}=e;if(!s)throw new Error("Recipient address is required");if(!r)throw new Error("Amount is required");const a=dt(r,18).toString();return{from:t,to:s,data:"0x",value:a,chainId:n,description:`Send ${r} native token to ${s}`}}function Xi(e,t,n){const{contract_address:s,to_address:r,amount:a,decimals:o,token_symbol:c}=e;if(!s)throw new Error("Token contract address is required");if(!r)throw new Error("Recipient address is required");if(!a)throw new Error("Amount is required");const T=parseInt(o)||18,C=dt(a,T),N=bt({abi:pn,functionName:"transfer",args:[r,C]});return{from:t,to:s,data:N,value:"0",chainId:n,description:`Send ${a} ${c||"tokens"} to ${r}`}}function Ki(e,t,n){const{contract_address:s,spender_address:r,amount:a,token_symbol:o}=e;if(!s)throw new Error("Token contract address is required");if(!r)throw new Error("Spender address is required");const c=a&&a?.trim()!==""?dt(a,18):Dt,T=bt({abi:pn,functionName:"approve",args:[r,c]});return{from:t,to:s,data:T,value:"0",chainId:n,description:`Approve ${a||"unlimited"} ${o||"tokens"} for ${r}`}}function Zi(e,t,n){const{amount:s}=e;if(!s)throw new Error("Amount is required");const r=dr[n];if(!r)throw new Error(`WETH not supported on chain ${n}`);const a=dt(s,18).toString(),o=bt({abi:ur,functionName:"deposit"});return{from:t,to:r,data:o,value:a,chainId:n,description:`Wrap ${s} native token`}}function Qi(e,t,n){const{amount:s}=e;if(!s)throw new Error("Amount is required");const r=dr[n];if(!r)throw new Error(`WETH not supported on chain ${n}`);const a=dt(s,18),o=bt({abi:ur,functionName:"withdraw",args:[a]});return{from:t,to:r,data:o,value:"0",chainId:n,description:`Unwrap ${s} WETH`}}function $i(e){return["send_native","send_token","approve_token","wrap_native","unwrap_native","send_nft"].includes(e)}async function ts(e){const{transactionHash:t,chainId:n,pollingInterval:s=3e3,timeout:r=12e4,rpcUrl:a}=e,o=Kt(n,a);if(!o)throw new Error(`No RPC endpoint for chain ${n}`);const c=Date.now();for(;Date.now()-c<r;){try{const C=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getTransactionReceipt",params:[t]})})).json();if(C.result){const N=C.result;return{status:N.status==="0x1"?"success":"fail",blockNumber:N.blockNumber,gasUsed:N.gasUsed,effectiveGasPrice:N.effectiveGasPrice}}}catch(T){console.warn("eth_getTransactionReceipt poll error:",T)}await new Promise(T=>setTimeout(T,s))}throw new Error(`Transaction ${t} was not mined within ${r/1e3}s`)}async function ns(e){const{tokenAddress:t,ownerAddress:n,spenderAddress:s,chainId:r,rpcUrl:a}=e,o=Kt(r,a);if(!o)return console.warn(`No RPC endpoint for chain ${r}, assuming no allowance`),BigInt(0);try{const c=bt({abi:pn,functionName:"allowance",args:[n,s]}),C=await(await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_call",params:[{to:t,data:c},"latest"]})})).json();return C.result&&C.result!=="0x"?BigInt(C.result):BigInt(0)}catch(c){return console.warn("checkAllowance failed:",c),BigInt(0)}}function hn(e){const{tokenAddress:t,spenderAddress:n,fromAddress:s,chainId:r,tokenSymbol:a}=e,o=bt({abi:pn,functionName:"approve",args:[n,Dt]});return{from:s,to:t,data:o,value:"0",chainId:r,description:`Approve ${a||"token"} for swap`}}function ec(e,t,n){const{contract_address:s,token_id:r,to_address:a,token_standard:o,amount:c,nft_name:T}=e;if(!s)throw new Error("NFT contract address is required");if(!r)throw new Error("Token ID is required");if(!a)throw new Error("Recipient address is required");const C=(o||"ERC721").toUpperCase(),N=BigInt(r);let L,m;if(C==="ERC1155"){const k=BigInt(c||"1");L=bt({abi:ji,functionName:"safeTransferFrom",args:[t,a,N,k,"0x"]}),m=`Send ${k>1n?k.toString()+"x ":""}${T||"NFT"} (ERC1155 #${r}) to ${a}`}else L=bt({abi:Yi,functionName:"safeTransferFrom",args:[t,a,N]}),m=`Send ${T||"NFT"} (ERC721 #${r}) to ${a}`;return{from:t,to:s,data:L,value:"0",chainId:n,description:m}}async function mn(e){const{address:t,chainId:n,rpcUrl:s}=e,r=Kt(n,s);if(!r)return console.warn(`No RPC endpoint for chain ${n}`),new de(0);try{const o=await(await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_getBalance",params:[t,"latest"]})})).json();return o.result&&o.result!=="0x"?new de(BigInt(o.result).toString()):new de(0)}catch(a){return console.warn("getNativeBalance failed:",a),new de(0)}}async function Zt(e){const{from:t,to:n,data:s,value:r,chainId:a,rpcUrl:o}=e,c=Kt(a,o);if(!c)return console.warn(`No RPC endpoint for chain ${a}`),new de(0);try{const[T,C]=await Promise.all([fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_estimateGas",params:[{from:t,to:n,data:s,...r&&r!=="0"?{value:r}:{}}]})}),fetch(c,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:2,method:"eth_gasPrice",params:[]})})]),[N,L]=await Promise.all([T.json(),C.json()]),m=N.result?new de(BigInt(N.result).toString()):new de(0),k=L.result?new de(BigInt(L.result).toString()):new de(0);return m.times(k).times(1.1)}catch(T){return console.warn("estimateTransactionFee failed:",T),new de(0)}}async function ss(e){const{chainId:t,rpcUrl:n}=e,s=Kt(t,n);if(!s)return console.warn(`No RPC endpoint for chain ${t}`),new de(0);try{const a=await(await fetch(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"eth_gasPrice",params:[]})})).json();return a.result&&a.result!=="0x"?new de(BigInt(a.result).toString()):new de(0)}catch(r){return console.warn("getGasPrice failed:",r),new de(0)}}var te={},Qt={exports:{}},tc=Qt.exports,fr;function nc(){return fr||(fr=1,(function(e,t){(function(n,s){var r="1.0.41",a="",o="?",c="function",T="undefined",C="object",N="string",L="major",m="model",k="name",x="type",g="vendor",B="version",ue="architecture",D="console",Q="mobile",oe="tablet",ye="smarttv",ge="wearable",Ce="embedded",i=500,l="Amazon",u="Apple",w="ASUS",p="BlackBerry",v="Browser",S="Chrome",h="Edge",b="Firefox",E="Google",y="Honor",O="Huawei",q="Lenovo",ne="LG",me="Microsoft",xe="Motorola",Te="Nvidia",W="OnePlus",be="Opera",Ie="OPPO",_e="Samsung",Qe="Sharp",Ye="Sony",Le="Xiaomi",Ge="Zebra",Fe="Facebook",Oe="Chromium OS",Ee="Mac OS",M=" Browser",se=function(F,V){var _={};for(var j in F)V[j]&&V[j].length%2===0?_[j]=V[j].concat(F[j]):_[j]=F[j];return _},R=function(F){for(var V={},_=0;_<F.length;_++)V[F[_].toUpperCase()]=F[_];return V},$=function(F,V){return typeof F===N?ee(V).indexOf(ee(F))!==-1:!1},ee=function(F){return F.toLowerCase()},Y=function(F){return typeof F===N?F.replace(/[^\d\.]/g,a).split(".")[0]:s},z=function(F,V){if(typeof F===N)return F=F.replace(/^\s\s*/,a),typeof V===T?F:F.substring(0,i)},K=function(F,V){for(var _=0,j,ae,ce,G,J,ve;_<V.length&&!J;){var Se=V[_],Be=V[_+1];for(j=ae=0;j<Se.length&&!J&&Se[j];)if(J=Se[j++].exec(F),J)for(ce=0;ce<Be.length;ce++)ve=J[++ae],G=Be[ce],typeof G===C&&G.length>0?G.length===2?typeof G[1]==c?this[G[0]]=G[1].call(this,ve):this[G[0]]=G[1]:G.length===3?typeof G[1]===c&&!(G[1].exec&&G[1].test)?this[G[0]]=ve?G[1].call(this,ve,G[2]):s:this[G[0]]=ve?ve.replace(G[1],G[2]):s:G.length===4&&(this[G[0]]=ve?G[3].call(this,ve.replace(G[1],G[2])):s):this[G]=ve||s;_+=2}},X=function(F,V){for(var _ in V)if(typeof V[_]===C&&V[_].length>0){for(var j=0;j<V[_].length;j++)if($(V[_][j],F))return _===o?s:_}else if($(V[_],F))return _===o?s:_;return V.hasOwnProperty("*")?V["*"]:F},U={"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},pe={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[B,[k,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[B,[k,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[k,B],[/opios[\/ ]+([\w\.]+)/i],[B,[k,be+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[B,[k,be+" GX"]],[/\bopr\/([\w\.]+)/i],[B,[k,be]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[B,[k,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[B,[k,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[k,B],[/quark(?:pc)?\/([-\w\.]+)/i],[B,[k,"Quark"]],[/\bddg\/([\w\.]+)/i],[B,[k,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[B,[k,"UC"+v]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[B,[k,"WeChat"]],[/konqueror\/([\w\.]+)/i],[B,[k,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[B,[k,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[B,[k,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[B,[k,"Smart Lenovo "+v]],[/(avast|avg)\/([\w\.]+)/i],[[k,/(.+)/,"$1 Secure "+v],B],[/\bfocus\/([\w\.]+)/i],[B,[k,b+" Focus"]],[/\bopt\/([\w\.]+)/i],[B,[k,be+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[B,[k,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[B,[k,"Dolphin"]],[/coast\/([\w\.]+)/i],[B,[k,be+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[B,[k,"MIUI"+M]],[/fxios\/([\w\.-]+)/i],[B,[k,b]],[/\bqihoobrowser\/?([\w\.]*)/i],[B,[k,"360"]],[/\b(qq)\/([\w\.]+)/i],[[k,/(.+)/,"$1Browser"],B],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[k,/(.+)/,"$1"+M],B],[/samsungbrowser\/([\w\.]+)/i],[B,[k,_e+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[B,[k,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[k,"Sogou Mobile"],B],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[k,B],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[k],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[B,k],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[k,Fe],B],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[k,B],[/\bgsa\/([\w\.]+) .*safari\//i],[B,[k,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[B,[k,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[B,[k,S+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[k,S+" WebView"],B],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[B,[k,"Android "+v]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[k,B],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[B,[k,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[B,k],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[k,[B,X,U]],[/(webkit|khtml)\/([\w\.]+)/i],[k,B],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[k,"Netscape"],B],[/(wolvic|librewolf)\/([\w\.]+)/i],[k,B],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[B,[k,b+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[k,[B,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[k,[B,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[ue,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[ue,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[ue,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[ue,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[ue,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[ue,/ower/,a,ee]],[/ sun4\w[;\)]/i],[[ue,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[ue,ee]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[m,[g,_e],[x,oe]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[m,[g,_e],[x,Q]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[m,[g,u],[x,Q]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[m,[g,u],[x,oe]],[/(macintosh);/i],[m,[g,u]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[g,Qe],[x,Q]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[m,[g,y],[x,oe]],[/honor([-\w ]+)[;\)]/i],[m,[g,y],[x,Q]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[m,[g,O],[x,oe]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[m,[g,O],[x,Q]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[m,/_/g," "],[g,Le],[x,oe]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[m,/_/g," "],[g,Le],[x,Q]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[g,Ie],[x,Q]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[m,[g,X,{OnePlus:["304","403","203"],"*":Ie}],[x,oe]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[g,"Vivo"],[x,Q]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[g,"Realme"],[x,Q]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[m,[g,xe],[x,Q]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[g,xe],[x,oe]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[g,ne],[x,oe]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[g,ne],[x,Q]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[m,[g,q],[x,oe]],[/(nokia) (t[12][01])/i],[g,m,[x,oe]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[m,/_/g," "],[x,Q],[g,"Nokia"]],[/(pixel (c|tablet))\b/i],[m,[g,E],[x,oe]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[m,[g,E],[x,Q]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[m,[g,Ye],[x,Q]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[g,Ye],[x,oe]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[g,W],[x,Q]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[g,l],[x,oe]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[g,l],[x,Q]],[/(playbook);[-\w\),; ]+(rim)/i],[m,g,[x,oe]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[m,[g,p],[x,Q]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[g,w],[x,oe]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[g,w],[x,Q]],[/(nexus 9)/i],[m,[g,"HTC"],[x,oe]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[m,/_/g," "],[x,Q]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[m,[g,"TCL"],[x,oe]],[/(itel) ((\w+))/i],[[g,ee],m,[x,X,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[g,"Acer"],[x,oe]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[g,"Meizu"],[x,Q]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[g,"Ulefone"],[x,Q]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[g,"Energizer"],[x,Q]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[g,"Cat"],[x,Q]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[g,"Smartfren"],[x,Q]],[/droid.+; (a(?:015|06[35]|142p?))/i],[m,[g,"Nothing"],[x,Q]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[m,[g,"Archos"],[x,oe]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[m,[g,"Archos"],[x,Q]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[g,m,[x,oe]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[g,m,[x,Q]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,m,[x,oe]],[/(surface duo)/i],[m,[g,me],[x,oe]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[g,"Fairphone"],[x,Q]],[/(u304aa)/i],[m,[g,"AT&T"],[x,Q]],[/\bsie-(\w*)/i],[m,[g,"Siemens"],[x,Q]],[/\b(rct\w+) b/i],[m,[g,"RCA"],[x,oe]],[/\b(venue[\d ]{2,7}) b/i],[m,[g,"Dell"],[x,oe]],[/\b(q(?:mv|ta)\w+) b/i],[m,[g,"Verizon"],[x,oe]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[m,[g,"Barnes & Noble"],[x,oe]],[/\b(tm\d{3}\w+) b/i],[m,[g,"NuVision"],[x,oe]],[/\b(k88) b/i],[m,[g,"ZTE"],[x,oe]],[/\b(nx\d{3}j) b/i],[m,[g,"ZTE"],[x,Q]],[/\b(gen\d{3}) b.+49h/i],[m,[g,"Swiss"],[x,Q]],[/\b(zur\d{3}) b/i],[m,[g,"Swiss"],[x,oe]],[/\b((zeki)?tb.*\b) b/i],[m,[g,"Zeki"],[x,oe]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],m,[x,oe]],[/\b(ns-?\w{0,9}) b/i],[m,[g,"Insignia"],[x,oe]],[/\b((nxa|next)-?\w{0,9}) b/i],[m,[g,"NextBook"],[x,oe]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],m,[x,Q]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],m,[x,Q]],[/\b(ph-1) /i],[m,[g,"Essential"],[x,Q]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[m,[g,"Envizen"],[x,oe]],[/\b(trio[-\w\. ]+) b/i],[m,[g,"MachSpeed"],[x,oe]],[/\btu_(1491) b/i],[m,[g,"Rotor"],[x,oe]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[m,[g,Te],[x,oe]],[/(sprint) (\w+)/i],[g,m,[x,Q]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[g,me],[x,Q]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[g,Ge],[x,oe]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[g,Ge],[x,Q]],[/smart-tv.+(samsung)/i],[g,[x,ye]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[g,_e],[x,ye]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,ne],[x,ye]],[/(apple) ?tv/i],[g,[m,u+" TV"],[x,ye]],[/crkey/i],[[m,S+"cast"],[g,E],[x,ye]],[/droid.+aft(\w+)( bui|\))/i],[m,[g,l],[x,ye]],[/(shield \w+ tv)/i],[m,[g,Te],[x,ye]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[g,Qe],[x,ye]],[/(bravia[\w ]+)( bui|\))/i],[m,[g,Ye],[x,ye]],[/(mi(tv|box)-?\w+) bui/i],[m,[g,Le],[x,ye]],[/Hbbtv.*(technisat) (.*);/i],[g,m,[x,ye]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,z],[m,z],[x,ye]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[m,[x,ye]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[x,ye]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,m,[x,D]],[/droid.+; (shield)( bui|\))/i],[m,[g,Te],[x,D]],[/(playstation \w+)/i],[m,[g,Ye],[x,D]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[g,me],[x,D]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[m,[g,_e],[x,ge]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[g,m,[x,ge]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[m,[g,Ie],[x,ge]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[g,u],[x,ge]],[/(opwwe\d{3})/i],[m,[g,W],[x,ge]],[/(moto 360)/i],[m,[g,xe],[x,ge]],[/(smartwatch 3)/i],[m,[g,Ye],[x,ge]],[/(g watch r)/i],[m,[g,ne],[x,ge]],[/droid.+; (wt63?0{2,3})\)/i],[m,[g,Ge],[x,ge]],[/droid.+; (glass) \d/i],[m,[g,E],[x,ge]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,m,[x,ge]],[/; (quest( \d| pro)?)/i],[m,[g,Fe],[x,ge]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[x,Ce]],[/(aeobc)\b/i],[m,[g,l],[x,Ce]],[/(homepod).+mac os/i],[m,[g,u],[x,Ce]],[/windows iot/i],[[x,Ce]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[m,[x,Q]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[m,[x,oe]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[x,oe]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[x,Q]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[m,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[B,[k,h+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[k,B],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[B,[k,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[k,B],[/ladybird\//i],[[k,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[B,k]],os:[[/microsoft (windows) (vista|xp)/i],[k,B],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[k,[B,X,Z]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[B,X,Z],[k,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[B,/_/g,"."],[k,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[k,Ee],[B,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[B,k],[/(ubuntu) ([\w\.]+) like android/i],[[k,/(.+)/,"$1 Touch"],B],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[k,B],[/\(bb(10);/i],[B,[k,p]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[B,[k,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[B,[k,b+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[B,[k,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[B,[k,"watchOS"]],[/crkey\/([\d\.]+)/i],[B,[k,S+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[k,Oe],B],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[k,B],[/(sunos) ?([\w\.\d]*)/i],[[k,"Solaris"],B],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[k,B]]},ie=function(F,V){if(typeof F===C&&(V=F,F=s),!(this instanceof ie))return new ie(F,V).getResult();var _=typeof n!==T&&n.navigator?n.navigator:s,j=F||(_&&_.userAgent?_.userAgent:a),ae=_&&_.userAgentData?_.userAgentData:s,ce=V?se(pe,V):pe,G=_&&_.userAgent==j;return this.getBrowser=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.browser),J[L]=Y(J[B]),G&&_&&_.brave&&typeof _.brave.isBrave==c&&(J[k]="Brave"),J},this.getCPU=function(){var J={};return J[ue]=s,K.call(J,j,ce.cpu),J},this.getDevice=function(){var J={};return J[g]=s,J[m]=s,J[x]=s,K.call(J,j,ce.device),G&&!J[x]&&ae&&ae.mobile&&(J[x]=Q),G&&J[m]=="Macintosh"&&_&&typeof _.standalone!==T&&_.maxTouchPoints&&_.maxTouchPoints>2&&(J[m]="iPad",J[x]=oe),J},this.getEngine=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.engine),J},this.getOS=function(){var J={};return J[k]=s,J[B]=s,K.call(J,j,ce.os),G&&!J[k]&&ae&&ae.platform&&ae.platform!="Unknown"&&(J[k]=ae.platform.replace(/chrome os/i,Oe).replace(/macos/i,Ee)),J},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return j},this.setUA=function(J){return j=typeof J===N&&J.length>i?z(J,i):J,this},this.setUA(j),this};ie.VERSION=r,ie.BROWSER=R([k,B,L]),ie.CPU=R([ue]),ie.DEVICE=R([m,g,x,D,Q,ye,oe,ge,Ce]),ie.ENGINE=ie.OS=R([k,B]),e.exports&&(t=e.exports=ie),t.UAParser=ie;var Ae=typeof n!==T&&(n.jQuery||n.Zepto);if(Ae&&!Ae.ua){var ke=new ie;Ae.ua=ke.getResult(),Ae.ua.get=function(){return ke.getUA()},Ae.ua.set=function(F){ke.setUA(F);var V=ke.getResult();for(var _ in V)Ae.ua[_]=V[_]}}})(typeof window=="object"?window:tc)})(Qt,Qt.exports)),Qt.exports}var pr;function sc(){if(pr)return te;pr=1,Object.defineProperty(te,"__esModule",{value:!0});function e(A){return A&&typeof A=="object"&&"default"in A?A.default:A}var t=re,n=e(t),s=nc(),r=new s,a=r.getBrowser(),o=r.getCPU(),c=r.getDevice(),T=r.getEngine(),C=r.getOS(),N=r.getUA(),L=function(d){return r.setUA(d)},m=function(d){if(!d){console.error("No userAgent string was provided");return}var f=new s(d);return{UA:f,browser:f.getBrowser(),cpu:f.getCPU(),device:f.getDevice(),engine:f.getEngine(),os:f.getOS(),ua:f.getUA(),setUserAgent:function(H){return f.setUA(H)}}},k=Object.freeze({ClientUAInstance:r,browser:a,cpu:o,device:c,engine:T,os:C,ua:N,setUa:L,parseUserAgent:m});function x(A,d){var f=Object.keys(A);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(A);d&&(P=P.filter(function(H){return Object.getOwnPropertyDescriptor(A,H).enumerable})),f.push.apply(f,P)}return f}function g(A){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?x(Object(f),!0).forEach(function(P){oe(A,P,f[P])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(f)):x(Object(f)).forEach(function(P){Object.defineProperty(A,P,Object.getOwnPropertyDescriptor(f,P))})}return A}function B(A){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?B=function(d){return typeof d}:B=function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},B(A)}function ue(A,d){if(!(A instanceof d))throw new TypeError("Cannot call a class as a function")}function D(A,d){for(var f=0;f<d.length;f++){var P=d[f];P.enumerable=P.enumerable||!1,P.configurable=!0,"value"in P&&(P.writable=!0),Object.defineProperty(A,P.key,P)}}function Q(A,d,f){return d&&D(A.prototype,d),A}function oe(A,d,f){return d in A?Object.defineProperty(A,d,{value:f,enumerable:!0,configurable:!0,writable:!0}):A[d]=f,A}function ye(){return ye=Object.assign||function(A){for(var d=1;d<arguments.length;d++){var f=arguments[d];for(var P in f)Object.prototype.hasOwnProperty.call(f,P)&&(A[P]=f[P])}return A},ye.apply(this,arguments)}function ge(A,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(d&&d.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),d&&i(A,d)}function Ce(A){return Ce=Object.setPrototypeOf?Object.getPrototypeOf:function(f){return f.__proto__||Object.getPrototypeOf(f)},Ce(A)}function i(A,d){return i=Object.setPrototypeOf||function(P,H){return P.__proto__=H,P},i(A,d)}function l(A,d){if(A==null)return{};var f={},P=Object.keys(A),H,we;for(we=0;we<P.length;we++)H=P[we],!(d.indexOf(H)>=0)&&(f[H]=A[H]);return f}function u(A,d){if(A==null)return{};var f=l(A,d),P,H;if(Object.getOwnPropertySymbols){var we=Object.getOwnPropertySymbols(A);for(H=0;H<we.length;H++)P=we[H],!(d.indexOf(P)>=0)&&Object.prototype.propertyIsEnumerable.call(A,P)&&(f[P]=A[P])}return f}function w(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function p(A,d){if(d&&(typeof d=="object"||typeof d=="function"))return d;if(d!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(A)}function v(A,d){return S(A)||h(A,d)||b(A,d)||y()}function S(A){if(Array.isArray(A))return A}function h(A,d){var f=A==null?null:typeof Symbol<"u"&&A[Symbol.iterator]||A["@@iterator"];if(f!=null){var P=[],H=!0,we=!1,De,ze;try{for(f=f.call(A);!(H=(De=f.next()).done)&&(P.push(De.value),!(d&&P.length===d));H=!0);}catch(yn){we=!0,ze=yn}finally{try{!H&&f.return!=null&&f.return()}finally{if(we)throw ze}}return P}}function b(A,d){if(A){if(typeof A=="string")return E(A,d);var f=Object.prototype.toString.call(A).slice(8,-1);if(f==="Object"&&A.constructor&&(f=A.constructor.name),f==="Map"||f==="Set")return Array.from(A);if(f==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(f))return E(A,d)}}function E(A,d){(d==null||d>A.length)&&(d=A.length);for(var f=0,P=new Array(d);f<d;f++)P[f]=A[f];return P}function y(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
299
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var O={Mobile:"mobile",Tablet:"tablet",SmartTv:"smarttv",Console:"console",Wearable:"wearable",Embedded:"embedded",Browser:void 0},q={Chrome:"Chrome",Firefox:"Firefox",Opera:"Opera",Yandex:"Yandex",Safari:"Safari",InternetExplorer:"Internet Explorer",Edge:"Edge",Chromium:"Chromium",Ie:"IE",MobileSafari:"Mobile Safari",EdgeChromium:"Edge Chromium",MIUI:"MIUI Browser",SamsungBrowser:"Samsung Browser"},ne={IOS:"iOS",Android:"Android",WindowsPhone:"Windows Phone",Windows:"Windows",MAC_OS:"Mac OS"},me={isMobile:!1,isTablet:!1,isBrowser:!1,isSmartTV:!1,isConsole:!1,isWearable:!1},xe=function(d){switch(d){case O.Mobile:return{isMobile:!0};case O.Tablet:return{isTablet:!0};case O.SmartTv:return{isSmartTV:!0};case O.Console:return{isConsole:!0};case O.Wearable:return{isWearable:!0};case O.Browser:return{isBrowser:!0};case O.Embedded:return{isEmbedded:!0};default:return me}},Te=function(d){return L(d)},W=function(d){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none";return d||f},be=function(){return typeof window<"u"&&(window.navigator||navigator)?window.navigator||navigator:!1},Ie=function(d){var f=be();return f&&f.platform&&(f.platform.indexOf(d)!==-1||f.platform==="MacIntel"&&f.maxTouchPoints>1&&!window.MSStream)},_e=function(d,f,P,H,we){return{isBrowser:d,browserMajorVersion:W(f.major),browserFullVersion:W(f.version),browserName:W(f.name),engineName:W(P.name),engineVersion:W(P.version),osName:W(H.name),osVersion:W(H.version),userAgent:W(we)}},Qe=function(d,f,P,H){return g({},d,{vendor:W(f.vendor),model:W(f.model),os:W(P.name),osVersion:W(P.version),ua:W(H)})},Ye=function(d,f,P,H){return{isSmartTV:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Le=function(d,f,P,H){return{isConsole:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Ge=function(d,f,P,H){return{isWearable:d,engineName:W(f.name),engineVersion:W(f.version),osName:W(P.name),osVersion:W(P.version),userAgent:W(H)}},Fe=function(d,f,P,H,we){return{isEmbedded:d,vendor:W(f.vendor),model:W(f.model),engineName:W(P.name),engineVersion:W(P.version),osName:W(H.name),osVersion:W(H.version),userAgent:W(we)}};function Oe(A){var d=A?m(A):k,f=d.device,P=d.browser,H=d.engine,we=d.os,De=d.ua,ze=xe(f.type),yn=ze.isBrowser,tl=ze.isMobile,nl=ze.isTablet,Br=ze.isSmartTV,Pr=ze.isConsole,Nr=ze.isWearable,Or=ze.isEmbedded;if(yn)return _e(yn,P,H,we,De);if(Br)return Ye(Br,H,we,De);if(Pr)return Le(Pr,H,we,De);if(tl||nl)return Qe(ze,f,we,De);if(Nr)return Ge(Nr,H,we,De);if(Or)return Fe(Or,f,H,we,De)}var Ee=function(d){var f=d.type;return f===O.Mobile},M=function(d){var f=d.type;return f===O.Tablet},se=function(d){var f=d.type;return f===O.Mobile||f===O.Tablet},R=function(d){var f=d.type;return f===O.SmartTv},$=function(d){var f=d.type;return f===O.Browser},ee=function(d){var f=d.type;return f===O.Wearable},Y=function(d){var f=d.type;return f===O.Console},z=function(d){var f=d.type;return f===O.Embedded},K=function(d){var f=d.vendor;return W(f)},X=function(d){var f=d.model;return W(f)},U=function(d){var f=d.type;return W(f,"browser")},Z=function(d){var f=d.name;return f===ne.Android},pe=function(d){var f=d.name;return f===ne.Windows},ie=function(d){var f=d.name;return f===ne.MAC_OS},Ae=function(d){var f=d.name;return f===ne.WindowsPhone},ke=function(d){var f=d.name;return f===ne.IOS},F=function(d){var f=d.version;return W(f)},V=function(d){var f=d.name;return W(f)},_=function(d){var f=d.name;return f===q.Chrome},j=function(d){var f=d.name;return f===q.Firefox},ae=function(d){var f=d.name;return f===q.Chromium},ce=function(d){var f=d.name;return f===q.Edge},G=function(d){var f=d.name;return f===q.Yandex},J=function(d){var f=d.name;return f===q.Safari||f===q.MobileSafari},ve=function(d){var f=d.name;return f===q.MobileSafari},Se=function(d){var f=d.name;return f===q.Opera},Be=function(d){var f=d.name;return f===q.InternetExplorer||f===q.Ie},je=function(d){var f=d.name;return f===q.MIUI},$e=function(d){var f=d.name;return f===q.SamsungBrowser},ot=function(d){var f=d.version;return W(f)},Ct=function(d){var f=d.major;return W(f)},ft=function(d){var f=d.name;return W(f)},$t=function(d){var f=d.name;return W(f)},en=function(d){var f=d.version;return W(f)},Lt=function(){var d=be(),f=d&&d.userAgent&&d.userAgent.toLowerCase();return typeof f=="string"?/electron/.test(f):!1},Pe=function(d){return typeof d=="string"&&d.indexOf("Edg/")!==-1},bn=function(){var d=be();return d&&(/iPad|iPhone|iPod/.test(d.platform)||d.platform==="MacIntel"&&d.maxTouchPoints>1)&&!window.MSStream},et=function(){return Ie("iPad")},hr=function(){return Ie("iPhone")},mr=function(){return Ie("iPod")},gr=function(d){return W(d)};function br(A){var d=A||k,f=d.device,P=d.browser,H=d.os,we=d.engine,De=d.ua;return{isSmartTV:R(f),isConsole:Y(f),isWearable:ee(f),isEmbedded:z(f),isMobileSafari:ve(P)||et(),isChromium:ae(P),isMobile:se(f)||et(),isMobileOnly:Ee(f),isTablet:M(f)||et(),isBrowser:$(f),isDesktop:$(f),isAndroid:Z(H),isWinPhone:Ae(H),isIOS:ke(H)||et(),isChrome:_(P),isFirefox:j(P),isSafari:J(P),isOpera:Se(P),isIE:Be(P),osVersion:F(H),osName:V(H),fullBrowserVersion:ot(P),browserVersion:Ct(P),browserName:ft(P),mobileVendor:K(f),mobileModel:X(f),engineName:$t(we),engineVersion:en(we),getUA:gr(De),isEdge:ce(P)||Pe(De),isYandex:G(P),deviceType:U(f),isIOS13:bn(),isIPad13:et(),isIPhone13:hr(),isIPod13:mr(),isElectron:Lt(),isEdgeChromium:Pe(De),isLegacyEdge:ce(P)&&!Pe(De),isWindows:pe(H),isMacOs:ie(H),isMIUI:je(P),isSamsungBrowser:$e(P)}}var wr=R(c),yr=Y(c),vr=ee(c),ic=z(c),cc=ve(a)||et(),lc=ae(a),wn=se(c)||et(),Ar=Ee(c),kr=M(c)||et(),xr=$(c),dc=$(c),Tr=Z(C),Er=Ae(C),Sr=ke(C)||et(),uc=_(a),fc=j(a),pc=J(a),hc=Se(a),Ir=Be(a),mc=F(C),gc=V(C),bc=ot(a),wc=Ct(a),yc=ft(a),vc=K(c),Ac=X(c),kc=$t(T),xc=en(T),Tc=gr(N),Ec=ce(a)||Pe(N),Sc=G(a),Ic=U(c),Cc=bn(),Bc=et(),Pc=hr(),Nc=mr(),Oc=Lt(),Uc=Pe(N),Dc=ce(a)&&!Pe(N),Fc=pe(C),Mc=ie(C),_c=je(a),Lc=$e(a),Hc=function(d){if(!d||typeof d!="string"){console.error("No valid user agent string was provided");return}var f=m(d),P=f.device,H=f.browser,we=f.os,De=f.engine,ze=f.ua;return br({device:P,browser:H,os:we,engine:De,ua:ze})},Rc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Tr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Vc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return xr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Wc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Ir?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Gc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Sr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},zc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return wn?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Yc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return kr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},jc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return Er?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},qc=function(d){var f=d.renderWithFragment,P=d.children;d.viewClassName,d.style;var H=u(d,["renderWithFragment","children","viewClassName","style"]);return Ar?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Jc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return wr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Xc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return yr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Kc=function(d){var f=d.renderWithFragment,P=d.children,H=u(d,["renderWithFragment","children"]);return vr?f?n.createElement(t.Fragment,null,P):n.createElement("div",H,P):null},Zc=function(d){var f=d.renderWithFragment,P=d.children;d.viewClassName,d.style;var H=d.condition,we=u(d,["renderWithFragment","children","viewClassName","style","condition"]);return H?f?n.createElement(t.Fragment,null,P):n.createElement("div",we,P):null};function Qc(A){return(function(d){ge(f,d);function f(P){var H;return ue(this,f),H=p(this,Ce(f).call(this,P)),H.isEventListenerAdded=!1,H.handleOrientationChange=H.handleOrientationChange.bind(w(H)),H.onOrientationChange=H.onOrientationChange.bind(w(H)),H.onPageLoad=H.onPageLoad.bind(w(H)),H.state={isLandscape:!1,isPortrait:!1},H}return Q(f,[{key:"handleOrientationChange",value:function(){this.isEventListenerAdded||(this.isEventListenerAdded=!0);var H=window.innerWidth>window.innerHeight?90:0;this.setState({isPortrait:H===0,isLandscape:H===90})}},{key:"onOrientationChange",value:function(){this.handleOrientationChange()}},{key:"onPageLoad",value:function(){this.handleOrientationChange()}},{key:"componentDidMount",value:function(){(typeof window>"u"?"undefined":B(window))!==void 0&&wn&&(this.isEventListenerAdded?window.removeEventListener("load",this.onPageLoad,!1):(this.handleOrientationChange(),window.addEventListener("load",this.onPageLoad,!1)),window.addEventListener("resize",this.onOrientationChange,!1))}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.onOrientationChange,!1)}},{key:"render",value:function(){return n.createElement(A,ye({},this.props,{isLandscape:this.state.isLandscape,isPortrait:this.state.isPortrait}))}}]),f})(n.Component)}function $c(){var A=t.useState(function(){var we=window.innerWidth>window.innerHeight?90:0;return{isPortrait:we===0,isLandscape:we===90,orientation:we===0?"portrait":"landscape"}}),d=v(A,2),f=d[0],P=d[1],H=t.useCallback(function(){var we=window.innerWidth>window.innerHeight?90:0,De={isPortrait:we===0,isLandscape:we===90,orientation:we===0?"portrait":"landscape"};f.orientation!==De.orientation&&P(De)},[f.orientation]);return t.useEffect(function(){return(typeof window>"u"?"undefined":B(window))!==void 0&&wn&&(H(),window.addEventListener("load",H,!1),window.addEventListener("resize",H,!1)),function(){window.removeEventListener("resize",H,!1),window.removeEventListener("load",H,!1)}},[H]),f}function Cr(A){var d=A||window.navigator.userAgent;return m(d)}function el(A){var d=A||window.navigator.userAgent,f=Cr(d),P=br(f);return[P,f]}return te.AndroidView=Rc,te.BrowserTypes=q,te.BrowserView=Vc,te.ConsoleView=Xc,te.CustomView=Zc,te.IEView=Wc,te.IOSView=Gc,te.MobileOnlyView=qc,te.MobileView=zc,te.OsTypes=ne,te.SmartTVView=Jc,te.TabletView=Yc,te.WearableView=Kc,te.WinPhoneView=jc,te.browserName=yc,te.browserVersion=wc,te.deviceDetect=Oe,te.deviceType=Ic,te.engineName=kc,te.engineVersion=xc,te.fullBrowserVersion=bc,te.getSelectorsByUserAgent=Hc,te.getUA=Tc,te.isAndroid=Tr,te.isBrowser=xr,te.isChrome=uc,te.isChromium=lc,te.isConsole=yr,te.isDesktop=dc,te.isEdge=Ec,te.isEdgeChromium=Uc,te.isElectron=Oc,te.isEmbedded=ic,te.isFirefox=fc,te.isIE=Ir,te.isIOS=Sr,te.isIOS13=Cc,te.isIPad13=Bc,te.isIPhone13=Pc,te.isIPod13=Nc,te.isLegacyEdge=Dc,te.isMIUI=_c,te.isMacOs=Mc,te.isMobile=wn,te.isMobileOnly=Ar,te.isMobileSafari=cc,te.isOpera=hc,te.isSafari=pc,te.isSamsungBrowser=Lc,te.isSmartTV=wr,te.isTablet=kr,te.isWearable=vr,te.isWinPhone=Er,te.isWindows=Fc,te.isYandex=Sc,te.mobileModel=Ac,te.mobileVendor=vc,te.osName=gc,te.osVersion=mc,te.parseUserAgent=m,te.setUserAgent=Te,te.useDeviceData=Cr,te.useDeviceSelectors=el,te.useMobileOrientation=$c,te.withOrientationChange=Qc,te}var gn=sc();function rs(e,t){if(!e)return e;const n=e.toLowerCase().trim();if(n==="max"||n==="all")return t||e;const s=n.match(/^(\d+(?:\.\d+)?)%$/);if(s){const r=parseFloat(s[1])/100;return((parseFloat(t)||0)*r).toFixed(8).replace(/\.?0+$/,"")||"0"}return e}const rc=({isOpen:e,onClose:t,onTransaction:n,position:s="bottom-right"})=>{const{language:r}=Si();console.log("🚀 ~ ChatModal ~ language:",r);const{messages:a,addMessage:o,updateMessageAction:c,updateMessageText:T}=ki(),[C,N]=re.useState(""),[L,m]=re.useState(!1),[k,x]=re.useState(!0),[g,B]=re.useState(null),ue=re.useRef(null),D=re.useRef(null),Q=re.useRef(null),oe=re.useRef(null),ye=re.useRef(null),ge=re.useRef(!1),Ce=re.useRef(k);re.useEffect(()=>{Ce.current=k},[k]);const{account:i,chainData:l,chainType:u,chainTypeMoralis:w,chainId:p}=Jn(),v=Jn();console.log("🚀 ~ ChatModal ~ connect:",v);const{config:S}=xi(),h=p&&S?.rpcUrls?.[p]||void 0,b=re.useCallback(()=>{const M=St.getItem("dataBuyToken");if(M)try{return JSON.parse(M)}catch{return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}}return{srcTokenAddress:"",descTokenAddress:"",amount:"",srcTokenDecimals:18,descTokenDecimals:18}},[]),E=re.useCallback(M=>{St.setItem("dataBuyToken",JSON.stringify(M))},[]),y=re.useCallback(M=>{const R={...b(),...M};E(R)},[b,E]),O=re.useCallback(M=>{B(M),gn.isDesktop&&Q.current?.focus()},[]),q=re.useCallback(async(M,se)=>{y({descTokenAddress:M,descTokenDecimals:se||18});try{m(!0);const R=await rt({address:i?.address||"",chain:w});if(R?.success&&R?.data?.result){const $=R.data.result;if($?.length>0){const ee=$.map(Y=>({id:Y.token_address,text:`${Y.name}: ${Y.balance_formatted} ${Y.symbol} ($${de(Y.usd_value||0)?.decimalPlaces(2).toFormat()||"0"})`,value:`Buy with ${Y.symbol}`,action:"click_balance_item_user_to_buy_button",fullWidth:!0,extraData:{tokenAddress:Y.token_address,symbol:Y.symbol,balance:Y.balance_formatted,usdValue:Y.usd_value,decimals:Y.decimals}}));o(`This is the spendable balance of your wallet on ${l?.name||"unknown"} chain. Please choose the coins you want to use for this trade.`,"bot",void 0,ee)}else o(`Sorry, I couldn't find any tokens in your wallet on ${l?.name||"unknown"} chain. Please make sure you have some tokens to trade.`,"bot")}else o("Sorry, I could not fetch your wallet balance. Please try again.","bot")}catch(R){console.error("Error fetching wallet balance:",R),o("Sorry, I encountered an error fetching your wallet balance.","bot")}finally{m(!1)}},[y,i?.address,w,o,l?.name]),ne=re.useCallback(async(M,se,R,$)=>{const ee=[25,50,75,100];y({srcTokenAddress:M,srcTokenDecimals:$||18});let Y=R||"0";if(M===qe)try{const K=await ss({chainId:p,rpcUrl:h});if(K.isGreaterThan(0)){const X=K.times(1e6),Z=new de(dt(R,$||18).toString()).minus(X);Z.isGreaterThan(0)?Y=de(Ue(BigInt(Z.toFixed(0)),18)).toFixed():Y="0"}}catch(K){console.warn("getGasPrice for swap native fee deduction failed:",K)}const z=ee.map(K=>({id:`percent-${K}`,text:`${K}%`,value:`Use ${K}% of ${se}`,action:"select_percent",extraData:{percent:K,tokenAddress:M,tokenSymbol:se,tokenBalance:Y}}));if(de(Y).isZero()){o(`Insufficient fee. Please ensure you have enough ${se} to cover the transaction fees, or select a different token.`,"bot");return}o(`📊 Select the amount of ${se} to use:
300
300
 
301
301
  Available: ${Y} ${se}`,"bot",void 0,z)},[o,p,h,y]),me=re.useCallback(async(M,se)=>{y({amount:(parseFloat(se)*(M/100)).toFixed(6)});const R=b(),$=dt(R.amount,R.srcTokenDecimals||18).toString(),ee=await $n({chainId:p,tokenIn:R.srcTokenAddress,tokenInAmount:$,tokenOut:R.descTokenAddress,tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(ee.success&&ee.data){const Y=ee.data,z=Y.tokenIn,K=Y.tokenOut,X=de(Ue(BigInt(z.amount||0),z.decimals)).decimalPlaces(6).toFormat(),U=de(Ue(BigInt(K.amount||0),K.decimals)).decimalPlaces(6).toFormat(),Z=R.srcTokenAddress===qe||R.srcTokenAddress==="";let pe=!1;if(!Z&&i?.address&&Y.tx?.to)try{const ae=await ns({tokenAddress:R.srcTokenAddress,ownerAddress:i.address,spenderAddress:Y.tx.to,chainId:p,rpcUrl:h});pe=de(ae.toString()).isLessThan($)}catch(ae){console.warn("Allowance check failed:",ae),pe=!0}const ie=Y.estimatedTransactionFee?.total?de(Y.estimatedTransactionFee.total):de(0);let Ae=de(0);if(pe&&i?.address)try{const ae=hn({tokenAddress:R.srcTokenAddress,spenderAddress:Y.tx?.to||"",fromAddress:i.address,chainId:p});Ae=await Zt({from:i.address,to:ae.to,data:ae.data,chainId:p,rpcUrl:h})}catch(ae){console.warn("Approve fee estimation failed:",ae)}const ke=ie.plus(Ae),F=l?.nativeCurrency?.symbol||"native";let V="",_=!1;if(i?.address&&ke.isGreaterThan(0))try{const ae=await mn({address:i.address,chainId:p,rpcUrl:h});if(ae.isLessThan(ke)){_=!0;const ce=de(Ue(BigInt(ae.toFixed(0)),18)).decimalPlaces(6).toFormat(),G=de(Ue(BigInt(ke.toFixed(0)),18)).decimalPlaces(6).toFormat();V=`
302
302
  ⚠️ **Insufficient ${F} for fees!**
@@ -310,9 +310,9 @@ To: ${U} ${K.symbol}
310
310
  [View on Explorer](${K}/tx/${z.transactionHash})`:`
311
311
  Tx: ${z.transactionHash}`;T(Y.id,`⏳ Transaction submitted. Waiting for confirmation...${X}`);try{await lt(2e3),(await ts({transactionHash:z.transactionHash,chainId:p||1,rpcUrl:h})).status==="success"?T(Y.id,`✅ Transaction confirmed! Your swap has been completed.${X}`):T(Y.id,`❌ Transaction reverted on-chain. Please try again.${X}`)}catch(U){console.warn("Transaction tracking timeout:",U),T(Y.id,`⚠️ Transaction submitted but confirmation timed out. Please check manually.${X}`)}}else if(z.status==="success")T(Y.id,"✅ Transaction successful! Your swap has been completed.");else{const K=z.error?`
312
312
  Error: ${z.error}`:"";T(Y.id,`Transaction failed. Please try again.${K}`)}}catch(z){console.error("Transaction error:",z),T(Y.id,"Transaction failed. Please try again.")}}else o("⚠️ Transaction data not available.","bot");break;case"approve_for_swap":{const $=R?.tokenAddress||"",ee=R?.spenderAddress||"",Y=R?.tokenSymbol||"token",z=R?.tx;if(!$||!ee||!n){o("⚠️ Approval data not available.","bot");break}const K=hn({tokenAddress:$,spenderAddress:ee,fromAddress:i?.address||"",chainId:p,tokenSymbol:Y}),X={from:K.from,to:K.to,data:K.data,value:K.value,chainId:K.chainId};o(`Approving ${Y}... Please confirm in your wallet.`,"bot");try{const U=await n(X);let Z=U.status==="success";if(U.status==="success"&&U.transactionHash)try{Z=(await ts({transactionHash:U.transactionHash,chainId:p||1,rpcUrl:h})).status==="success"}catch(pe){console.warn("Approval tracking timeout:",pe),Z=!0}if(Z)o(`✅ ${Y} approved successfully!`,"bot"),o("Now you can execute the swap.","bot",void 0,[{id:"confirm-swap-after-approve",text:"Confirm Swap",value:"Confirm swap",action:"confirm_swap",fullWidth:!0,extraData:{tx:z}}]);else{const pe=U.error?`
313
- Error: ${U.error}`:"";o(`❌ Approval failed. Please try again.${pe}`,"bot")}}catch(U){console.error("Approval error:",U),o("❌ Approval failed. Please try again.","bot")}break}case"click_swap_dest_token":{const $=R?.tokenAddress||"",ee=R?.symbol||"",Y=R?.decimals||18;y({descTokenAddress:$,descTokenDecimals:Y});const K=b().srcTokenAddress||"",X=K===qe;try{const U=await rt({address:i?.address||"",chain:w});if(U?.success&&U?.data?.result){const Z=U.data.result;let pe="",ie="0";if(X){const Ae=Z.find(ke=>ke.native_token);pe=l?.nativeCurrency?.symbol||"ETH",ie=Ae?.balance_formatted||"0"}else{const Ae=Z.find(ke=>ke.token_address.toLowerCase()===K.toLowerCase());Ae&&(pe=Ae.symbol,ie=Ae.balance_formatted)}if(pe&&parseFloat(ie)>0){const ke=[25,50,75,100].map(F=>({id:`percent-${F}`,text:`${F}%`,value:`Use ${F}% of ${pe}`,action:"select_percent",extraData:{percent:F,tokenAddress:K,tokenSymbol:pe,tokenBalance:ie}}));o(`✅ Swap ${pe} → ${ee}
313
+ Error: ${U.error}`:"";o(`❌ Approval failed. Please try again.${pe}`,"bot")}}catch(U){console.error("Approval error:",U),o("❌ Approval failed. Please try again.","bot")}break}case"click_swap_dest_token":{const $=R?.tokenAddress||"",ee=R?.symbol||"",Y=R?.decimals||18;y({descTokenAddress:$,descTokenDecimals:Y});const K=b().srcTokenAddress||"",X=K===qe;try{const U=await rt({address:i?.address||"",chain:w});if(U?.success&&U?.data?.result){const Z=U.data.result;let pe="",ie="0";if(X){const Ae=Z.find(ke=>ke.native_token);pe=l?.nativeCurrency?.symbol||"ETH",ie=Ae?.balance_formatted||"0"}else{const Ae=Z.find(ke=>ke.token_address.toLowerCase()===K.toLowerCase());Ae&&(pe=Ae.symbol,ie=Ae.balance_formatted)}if(pe&&parseFloat(ie)>0){const ke=[25,50,75,100].map(F=>({id:`percent-${F}`,text:`${F}%`,value:`Use ${F}% of ${pe}`,action:"select_percent",extraData:{percent:F,tokenAddress:K,tokenSymbol:pe,tokenBalance:ie}}));o(`Swap ${pe} → ${ee}
314
314
 
315
- 📊 Select the amount of ${pe} to swap:
315
+ Select the amount of ${pe} to swap:
316
316
 
317
317
  Available: ${ie} ${pe}`,"bot",void 0,ke)}else o("⚠️ You don't have the source token in your wallet or balance is 0.","bot")}else o("⚠️ Could not fetch your wallet balance.","bot")}catch(U){console.error("Error in click_swap_dest_token:",U),o("⚠️ Could not load balance. Please try again.","bot")}break}case"select_nft_to_send":{const $=R?.name||"NFT",ee=R?.contractAddress||"",Y=R?.tokenId||"",z=R?.tokenStandard||"ERC721",K=R?.amount||"1",X={contract_address:ee,token_id:Y,to_address:"",token_standard:z,amount:z==="ERC1155"?K:"1",nft_name:$};o(`📤 Send **${$}** (${z} #${Y})
318
318
 
@@ -339,15 +339,15 @@ Select an NFT to send:`,"bot",void 0,R)}else m(!1),o("🖼️ You don't have any
339
339
  ---
340
340
  `}let Y=C?.trim();M&&(Y=`[Replying to ${M.sender==="user"?"my previous":"your"} message: "${M.text}"]
341
341
 
342
- ${Y}`);const z=await Pi({prompt:Y,model:"gpt-4.1-mini",stream:!1,systemPrompt:R+ee});if(z.success&&z.data){const K=z.data.text||"";let X=null;try{let U=K?.trim();U.startsWith("```json")?U=U.replace(/^```json\s*/,"").replace(/\s*```$/,""):U.startsWith("```")&&(U=U.replace(/^```\s*/,"").replace(/\s*```$/,"")),X=JSON.parse(U)}catch{X=null}if(X&&X.action&&X.action!=="chat")if(X.action==="buy_token"){const U=X.parameters?.token_symbol||"";let Z=X.parameters?.contract_address||"",pe=18;if(Z)try{const ie=await Ze.getTokensDetails([Z],u);ie?.data?.[0]&&(pe=ie.data[0].decimals||18)}catch(ie){console.warn("getTokensDetails for buy_token failed:",ie)}if(!Z&&U&&i?.address)try{const ie=await rt({address:i.address,chain:w});if(ie?.success&&ie?.data?.result){const Ae=ie.data.result,ke=Ae.find(F=>F.token_address.toLowerCase()===Z.toLowerCase())||Ae.find(F=>F.symbol.toUpperCase()===U.toUpperCase());ke&&(Z=ke.token_address,pe=ke.decimals)}if(!Z){const Ae=l.tokenTrendingDefault||[],[ke,F]=await Promise.allSettled([Ze.getTopGainers(u,"24h",10),Ze.getTokensDetails(Ae,u)]),V=[];ke.status==="fulfilled"&&ke.value?.data&&V.push(...ke.value.data),F.status==="fulfilled"&&F.value?.data&&V.push(...F.value.data);const _=V.find(j=>j.address?.toLowerCase()===Z.toLowerCase())||V.find(j=>j.symbol?.toUpperCase()===U.toUpperCase());_&&(Z=_.address,pe=_.decimals||18)}}catch(ie){console.warn("Token lookup for buy failed:",ie)}Z?(o(X.message||`🛒 I'll help you buy ${U}. Let me show your available tokens to trade with.`,"bot",se.id),await q(Z,pe)):(o(X.message||`I couldn't find the token "${U}" on this chain. Here are the trending tokens you can buy:`,"bot",se.id),await Te())}else if(X.action==="swap_token"){const U={...X.parameters||{}},Z=U.token_in==="native"||U.token_in_symbol?.toUpperCase()===l?.nativeCurrency?.symbol?.toUpperCase(),pe=U.token_out==="native"||U.token_out_symbol?.toUpperCase()===l?.nativeCurrency?.symbol?.toUpperCase();if(pe&&(U.token_out=qe),!Z&&(U.token_in||U.token_in_symbol)&&i?.address)try{const F=await rt({address:i.address,chain:w});if(F?.success&&F?.data?.result){const V=F.data.result,_=U.token_in?V.find(j=>j.token_address.toLowerCase()===U.token_in.toLowerCase()):V.find(j=>j.symbol.toUpperCase()===U.token_in_symbol.toUpperCase());_&&(U.token_in=_.token_address,U.token_in_decimals=String(_.decimals))}}catch(F){console.warn("Resolve token_in failed:",F)}if(!pe&&(U.token_out||U.token_out_symbol)&&i?.address)try{const F=await rt({address:i.address,chain:w});if(F?.success&&F?.data?.result){const V=F.data.result,_=U.token_out?V.find(j=>j.token_address.toLowerCase()===U.token_out.toLowerCase()):V.find(j=>j.symbol.toUpperCase()===U.token_out_symbol.toUpperCase());_&&(U.token_out=_.token_address,U.token_out_decimals=String(_.decimals))}}catch(F){console.warn("Resolve token_out failed:",F)}const ie=!!(U.token_in||Z),Ae=!!U.token_out,ke=!!U.amount;if(ie&&Ae&&ke){o(X.message||"🔄 Preparing your swap...","bot",se.id);try{const F=[];U.token_out&&F.push(U.token_out),U.token_in&&!Z&&F.push(U.token_in);let V=18,_=18;if(F.length>0)try{const G=await Ze.getTokensDetails(F,u);if(G?.data)for(const J of G.data)!Z&&J.address.toLowerCase()===U.token_in?.toLowerCase()&&(V=J.decimals||18),J.address.toLowerCase()===U.token_out?.toLowerCase()&&(_=J.decimals||18)}catch(G){console.warn("getTokensDetails failed, using default decimals:",G)}if(i?.address)try{const G=await rt({address:i.address,chain:w});if(G?.success&&G?.data?.result){const J=G.data.result;if(Z){const ve=J.find($e=>$e.native_token);let Se=ve?.balance_formatted||"0";try{const $e=await ss({chainId:p,rpcUrl:h});if($e.isGreaterThan(0)){const ot=$e.times(1e6),ft=new de(ve?.balance||"0").minus(ot);ft.isGreaterThan(0)?Se=de(Ue(BigInt(ft.toFixed(0)),ve?.decimals||18)).toFixed():Se="0"}}catch($e){console.warn("getGasPrice for swap native fee deduction failed:",$e)}U.amount=rs(U.amount,Se);const Be=parseFloat(Se),je=parseFloat(U.amount);if(Be<je){o(`⚠️ Insufficient balance! You have ${Be.toFixed(6)} ${l?.nativeCurrency?.symbol||"native"} but need ${U.amount}. Please top up your wallet or reduce the amount.`,"bot"),m(!1);return}}else{const ve=J.find(je=>je.token_address.toLowerCase()===U.token_in?.toLowerCase());if(!ve){o(`⚠️ You don't have ${U.token_in_symbol||U.token_in} in your wallet. Please acquire some first before swapping.`,"bot"),m(!1);return}U.amount=rs(U.amount,ve.balance_formatted||"0");const Se=parseFloat(ve.balance_formatted||"0"),Be=parseFloat(U.amount);if(Se<Be){o(`⚠️ Insufficient balance! You have ${Se.toFixed(6)} ${ve.symbol} (~$${ve.usd_value?.toFixed(2)||"0"}) but need ${U.amount}. Please reduce the amount or add more tokens.`,"bot"),m(!1);return}}}}catch(G){console.warn("Balance check failed:",G)}const j=Z?qe:U.token_in;y({srcTokenAddress:j,descTokenAddress:U.token_out,amount:U.amount,srcTokenDecimals:V,descTokenDecimals:_});const ae=dt(U.amount,V).toString(),ce=await $n({chainId:p,tokenIn:j,tokenInAmount:ae,tokenOut:U.token_out,tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(ce.success&&ce.data){const G=ce.data,J=G.tokenIn,ve=G.tokenOut,Se=de(Ue(BigInt(J.amount||0),J.decimals)).decimalPlaces(6).toFormat(),Be=de(Ue(BigInt(ve.amount||0),ve.decimals)).decimalPlaces(6).toFormat();let je=!1;if(!Z&&i?.address&&G.tx?.to)try{const Pe=await ns({tokenAddress:j,ownerAddress:i.address,spenderAddress:G.tx.to,chainId:p,rpcUrl:h});je=de(Pe.toString()).isLessThan(ae)}catch(Pe){console.warn("Allowance check failed (CASE 1):",Pe),je=!0}const $e=G.estimatedTransactionFee?.total?de(G.estimatedTransactionFee.total):de(0);let ot=de(0);if(je&&i?.address)try{const Pe=hn({tokenAddress:j,spenderAddress:G.tx?.to||"",fromAddress:i.address,chainId:p});ot=await Zt({from:i.address,to:Pe.to,data:Pe.data,chainId:p,rpcUrl:h})}catch(Pe){console.warn("Approve fee estimation failed:",Pe)}const It=$e.plus(ot),ft=l?.nativeCurrency?.symbol||"native";let $t="",en=!1;if(i?.address&&It.isGreaterThan(0))try{const Pe=await mn({address:i.address,chainId:p,rpcUrl:h});if(Pe.isLessThan(It)){en=!0;const bn=de(Ue(BigInt(Pe.toFixed(0)),18)).decimalPlaces(6).toFormat(),et=de(Ue(BigInt(It.toFixed(0)),18)).decimalPlaces(6).toFormat();$t=`
342
+ ${Y}`);const z=await Pi({prompt:Y,model:"gpt-4.1-mini",stream:!1,systemPrompt:R+ee});if(z.success&&z.data){const K=z.data.text||"";let X=null;try{let U=K?.trim();U.startsWith("```json")?U=U.replace(/^```json\s*/,"").replace(/\s*```$/,""):U.startsWith("```")&&(U=U.replace(/^```\s*/,"").replace(/\s*```$/,"")),X=JSON.parse(U)}catch{X=null}if(X&&X.action&&X.action!=="chat")if(X.action==="buy_token"){const U=X.parameters?.token_symbol||"";let Z=X.parameters?.contract_address||"",pe=18;if(Z)try{const ie=await Ze.getTokensDetails([Z],u);ie?.data?.[0]&&(pe=ie.data[0].decimals||18)}catch(ie){console.warn("getTokensDetails for buy_token failed:",ie)}if(!Z&&U&&i?.address)try{const ie=await rt({address:i.address,chain:w});if(ie?.success&&ie?.data?.result){const Ae=ie.data.result,ke=Ae.find(F=>F.token_address.toLowerCase()===Z.toLowerCase())||Ae.find(F=>F.symbol.toUpperCase()===U.toUpperCase());ke&&(Z=ke.token_address,pe=ke.decimals)}if(!Z){const Ae=l.tokenTrendingDefault||[],[ke,F]=await Promise.allSettled([Ze.getTopGainers(u,"24h",10),Ze.getTokensDetails(Ae,u)]),V=[];ke.status==="fulfilled"&&ke.value?.data&&V.push(...ke.value.data),F.status==="fulfilled"&&F.value?.data&&V.push(...F.value.data);const _=V.find(j=>j.address?.toLowerCase()===Z.toLowerCase())||V.find(j=>j.symbol?.toUpperCase()===U.toUpperCase());_&&(Z=_.address,pe=_.decimals||18)}}catch(ie){console.warn("Token lookup for buy failed:",ie)}Z?(o(X.message||`🛒 I'll help you buy ${U}. Let me show your available tokens to trade with.`,"bot",se.id),await q(Z,pe)):(o(X.message||`I couldn't find the token "${U}" on this chain. Here are the trending tokens you can buy:`,"bot",se.id),await Te())}else if(X.action==="swap_token"){const U={...X.parameters||{}},Z=U.token_in==="native"||U.token_in_symbol?.toUpperCase()===l?.nativeCurrency?.symbol?.toUpperCase(),pe=U.token_out==="native"||U.token_out_symbol?.toUpperCase()===l?.nativeCurrency?.symbol?.toUpperCase();if(pe&&(U.token_out=qe),!Z&&(U.token_in||U.token_in_symbol)&&i?.address)try{const F=await rt({address:i.address,chain:w});if(F?.success&&F?.data?.result){const V=F.data.result,_=U.token_in?V.find(j=>j.token_address.toLowerCase()===U.token_in.toLowerCase()):V.find(j=>j.symbol.toUpperCase()===U.token_in_symbol.toUpperCase());_&&(U.token_in=_.token_address,U.token_in_decimals=String(_.decimals))}}catch(F){console.warn("Resolve token_in failed:",F)}if(!pe&&(U.token_out||U.token_out_symbol)&&i?.address)try{const F=await rt({address:i.address,chain:w});if(F?.success&&F?.data?.result){const V=F.data.result,_=U.token_out?V.find(j=>j.token_address.toLowerCase()===U.token_out.toLowerCase()):V.find(j=>j.symbol.toUpperCase()===U.token_out_symbol.toUpperCase());_&&(U.token_out=_.token_address,U.token_out_decimals=String(_.decimals))}}catch(F){console.warn("Resolve token_out failed:",F)}const ie=!!(U.token_in||Z),Ae=!!U.token_out,ke=!!U.amount;if(ie&&Ae&&ke){o(X.message||"🔄 Preparing your swap...","bot",se.id);try{const F=[];U.token_out&&F.push(U.token_out),U.token_in&&!Z&&F.push(U.token_in);let V=18,_=18;if(F.length>0)try{const G=await Ze.getTokensDetails(F,u);if(G?.data)for(const J of G.data)!Z&&J.address.toLowerCase()===U.token_in?.toLowerCase()&&(V=J.decimals||18),J.address.toLowerCase()===U.token_out?.toLowerCase()&&(_=J.decimals||18)}catch(G){console.warn("getTokensDetails failed, using default decimals:",G)}if(i?.address)try{const G=await rt({address:i.address,chain:w});if(G?.success&&G?.data?.result){const J=G.data.result;if(Z){const ve=J.find($e=>$e.native_token);let Se=ve?.balance_formatted||"0";try{const $e=await ss({chainId:p,rpcUrl:h});if($e.isGreaterThan(0)){const ot=$e.times(1e6),ft=new de(ve?.balance||"0").minus(ot);ft.isGreaterThan(0)?Se=de(Ue(BigInt(ft.toFixed(0)),ve?.decimals||18)).toFixed():Se="0"}}catch($e){console.warn("getGasPrice for swap native fee deduction failed:",$e)}U.amount=rs(U.amount,Se);const Be=parseFloat(Se),je=parseFloat(U.amount);if(Be<je){o(`⚠️ Insufficient balance! You have ${Be.toFixed(6)} ${l?.nativeCurrency?.symbol||"native"} but need ${U.amount}. Please top up your wallet or reduce the amount.`,"bot"),m(!1);return}}else{const ve=J.find(je=>je.token_address.toLowerCase()===U.token_in?.toLowerCase());if(!ve){o(`⚠️ You don't have ${U.token_in_symbol||U.token_in} in your wallet. Please acquire some first before swapping.`,"bot"),m(!1);return}U.amount=rs(U.amount,ve.balance_formatted||"0");const Se=parseFloat(ve.balance_formatted||"0"),Be=parseFloat(U.amount);if(Se<Be){o(`⚠️ Insufficient balance! You have ${Se.toFixed(6)} ${ve.symbol} (~$${ve.usd_value?.toFixed(2)||"0"}) but need ${U.amount}. Please reduce the amount or add more tokens.`,"bot"),m(!1);return}}}}catch(G){console.warn("Balance check failed:",G)}const j=Z?qe:U.token_in;y({srcTokenAddress:j,descTokenAddress:U.token_out,amount:U.amount,srcTokenDecimals:V,descTokenDecimals:_});const ae=dt(U.amount,V).toString(),ce=await $n({chainId:p,tokenIn:j,tokenInAmount:ae,tokenOut:U.token_out,tokenOutRecipient:i?.address||"",slippage:"auto",accesstoken:"d6c45897b8f6"});if(ce.success&&ce.data){const G=ce.data,J=G.tokenIn,ve=G.tokenOut,Se=de(Ue(BigInt(J.amount||0),J.decimals)).decimalPlaces(6).toFormat(),Be=de(Ue(BigInt(ve.amount||0),ve.decimals)).decimalPlaces(6).toFormat();let je=!1;if(!Z&&i?.address&&G.tx?.to)try{const Pe=await ns({tokenAddress:j,ownerAddress:i.address,spenderAddress:G.tx.to,chainId:p,rpcUrl:h});je=de(Pe.toString()).isLessThan(ae)}catch(Pe){console.warn("Allowance check failed (CASE 1):",Pe),je=!0}const $e=G.estimatedTransactionFee?.total?de(G.estimatedTransactionFee.total):de(0);let ot=de(0);if(je&&i?.address)try{const Pe=hn({tokenAddress:j,spenderAddress:G.tx?.to||"",fromAddress:i.address,chainId:p});ot=await Zt({from:i.address,to:Pe.to,data:Pe.data,chainId:p,rpcUrl:h})}catch(Pe){console.warn("Approve fee estimation failed:",Pe)}const Ct=$e.plus(ot),ft=l?.nativeCurrency?.symbol||"native";let $t="",en=!1;if(i?.address&&Ct.isGreaterThan(0))try{const Pe=await mn({address:i.address,chainId:p,rpcUrl:h});if(Pe.isLessThan(Ct)){en=!0;const bn=de(Ue(BigInt(Pe.toFixed(0)),18)).decimalPlaces(6).toFormat(),et=de(Ue(BigInt(Ct.toFixed(0)),18)).decimalPlaces(6).toFormat();$t=`
343
343
  ⚠️ **Insufficient ${ft} for fees!**
344
344
  You have ${bn} ${ft} but need ~${et} ${ft}.
345
- `}}catch(Pe){console.warn("Fee balance check failed:",Pe)}const _t=`From: ${Se} ${J.symbol}
345
+ `}}catch(Pe){console.warn("Fee balance check failed:",Pe)}const Lt=`From: ${Se} ${J.symbol}
346
346
  ⬇️
347
347
  To: ${Be} ${ve.symbol}
348
348
 
349
349
  `+$t+`
350
- `;if(en)o(_t,"bot");else if(je){const Pe=[{id:"approve-for-swap",text:`Approve ${J.symbol}`,value:`Approve ${J.symbol} for swap`,action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:j,spenderAddress:G.tx.to,tokenSymbol:J.symbol,tx:G.tx}}];o(_t+`You need to approve ${J.symbol} first before swapping.`,"bot",void 0,Pe)}else{const Pe=[{id:"confirm-swap",text:"Yes",value:"Confirm swap",action:"confirm_swap",extraData:{tx:G.tx}}];o(_t+"Ready to proceed with the swap?","bot",void 0,Pe)}}else o(`⚠️ Unable to get swap estimation. Error: ${ce.errorMessage||ce.error||"Unknown error"}`,"bot")}catch(F){console.error("Swap estimation error:",F),o("⚠️ Failed to get swap estimation. Please try again.","bot")}}else if(ie&&Ae&&!ke){let F=Z?18:parseInt(U.token_in_decimals||"18",10),V=parseInt(U.token_out_decimals||"18",10);const _=[];if(U.token_out&&_.push(U.token_out),U.token_in&&!Z&&_.push(U.token_in),_.length>0)try{const j=await Ze.getTokensDetails(_,u);if(j?.data)for(const ae of j.data)!Z&&ae.address.toLowerCase()===U.token_in?.toLowerCase()&&(F=ae.decimals||F),ae.address.toLowerCase()===U.token_out?.toLowerCase()&&(V=ae.decimals||V)}catch(j){console.warn("getTokensDetails failed in CASE 2, using fallback decimals:",j)}if(y({descTokenAddress:U.token_out,descTokenDecimals:V}),Z)try{const j=await rt({address:i?.address||"",chain:w});if(j?.success&&j?.data?.result){const ce=j.data.result.find(Be=>Be.native_token),G=l?.nativeCurrency?.symbol||"ETH";let J=ce?.balance_formatted||"0";try{const Be=await ss({chainId:p,rpcUrl:h});if(Be.isGreaterThan(0)){const je=Be.times(1e6),ot=new de(ce?.balance||"0").minus(je);ot.isGreaterThan(0)?J=de(Ue(BigInt(ot.toFixed(0)),ce?.decimals||18)).toFixed():J="0"}}catch(Be){console.warn("getGasPrice for swap native fee deduction (CASE 2) failed:",Be)}y({srcTokenAddress:qe,srcTokenDecimals:F});const Se=[25,50,75,100].map(Be=>({id:`percent-${Be}`,text:`${Be}%`,value:`Use ${Be}% of ${G}`,action:"select_percent",extraData:{percent:Be,tokenAddress:qe,tokenSymbol:G,tokenBalance:J}}));o(`📊 Select the amount of ${G} to swap:
350
+ `;if(en)o(Lt,"bot");else if(je){const Pe=[{id:"approve-for-swap",text:`Approve ${J.symbol}`,value:`Approve ${J.symbol} for swap`,action:"approve_for_swap",fullWidth:!0,extraData:{tokenAddress:j,spenderAddress:G.tx.to,tokenSymbol:J.symbol,tx:G.tx}}];o(Lt+`You need to approve ${J.symbol} first before swapping.`,"bot",void 0,Pe)}else{const Pe=[{id:"confirm-swap",text:"Yes",value:"Confirm swap",action:"confirm_swap",extraData:{tx:G.tx}}];o(Lt+"Ready to proceed with the swap?","bot",void 0,Pe)}}else o(`⚠️ Unable to get swap estimation. Error: ${ce.errorMessage||ce.error||"Unknown error"}`,"bot")}catch(F){console.error("Swap estimation error:",F),o("⚠️ Failed to get swap estimation. Please try again.","bot")}}else if(ie&&Ae&&!ke){let F=Z?18:parseInt(U.token_in_decimals||"18",10),V=parseInt(U.token_out_decimals||"18",10);const _=[];if(U.token_out&&_.push(U.token_out),U.token_in&&!Z&&_.push(U.token_in),_.length>0)try{const j=await Ze.getTokensDetails(_,u);if(j?.data)for(const ae of j.data)!Z&&ae.address.toLowerCase()===U.token_in?.toLowerCase()&&(F=ae.decimals||F),ae.address.toLowerCase()===U.token_out?.toLowerCase()&&(V=ae.decimals||V)}catch(j){console.warn("getTokensDetails failed in CASE 2, using fallback decimals:",j)}if(y({descTokenAddress:U.token_out,descTokenDecimals:V}),Z)try{const j=await rt({address:i?.address||"",chain:w});if(j?.success&&j?.data?.result){const ce=j.data.result.find(Be=>Be.native_token),G=l?.nativeCurrency?.symbol||"ETH";let J=ce?.balance_formatted||"0";try{const Be=await ss({chainId:p,rpcUrl:h});if(Be.isGreaterThan(0)){const je=Be.times(1e6),ot=new de(ce?.balance||"0").minus(je);ot.isGreaterThan(0)?J=de(Ue(BigInt(ot.toFixed(0)),ce?.decimals||18)).toFixed():J="0"}}catch(Be){console.warn("getGasPrice for swap native fee deduction (CASE 2) failed:",Be)}y({srcTokenAddress:qe,srcTokenDecimals:F});const Se=[25,50,75,100].map(Be=>({id:`percent-${Be}`,text:`${Be}%`,value:`Use ${Be}% of ${G}`,action:"select_percent",extraData:{percent:Be,tokenAddress:qe,tokenSymbol:G,tokenBalance:J}}));o(`📊 Select the amount of ${G} to swap:
351
351
 
352
352
  Available: ${J} ${G}`,"bot",se.id,Se)}else o("⚠️ Could not fetch your wallet balance. Please try again.","bot")}catch(j){console.warn("Native balance fetch failed:",j),o("⚠️ Could not fetch your balance. Please try again.","bot")}else{const j=U.token_in_symbol||"Token";y({srcTokenAddress:U.token_in,srcTokenDecimals:F});try{const ae=await rt({address:i?.address||"",chain:w});if(ae?.success&&ae?.data?.result){const G=ae.data.result.find(Se=>Se.token_address.toLowerCase()===U.token_in?.toLowerCase());if(!G){o(`⚠️ You don't have ${j} in your wallet. Please acquire some first before swapping.`,"bot"),m(!1);return}const ve=[25,50,75,100].map(Se=>({id:`percent-${Se}`,text:`${Se}%`,value:`Use ${Se}% of ${G.symbol}`,action:"select_percent",extraData:{percent:Se,tokenAddress:G.token_address,tokenSymbol:G.symbol,tokenBalance:G.balance_formatted}}));o(`📊 Select the amount of ${G.symbol} to swap:
353
353
 
@@ -365,4 +365,4 @@ Step 1: Approve ${K.symbol}
365
365
  Step 2: Confirm Swap`,"bot",void 0,ce)}else{const ce=[{id:"confirm-swap-actionform",text:"Yes",value:"Confirm swap",action:"confirm_swap",extraData:{tx:z.tx}}];c(R,"success"),o(ae+"Ready to proceed with the swap?","bot",void 0,ce)}}else c(R,"fail"),o(`⚠️ Unable to get swap estimation. Error: ${Y.errorMessage||Y.error||"Unknown error"}`,"bot")}else{const $=qi({action:M,parameters:se,fromAddress:i?.address||"",chainId:p||1}),ee={from:$.from,to:$.to,data:$.data,value:$.value,chainId:$.chainId};if((M==="send_token"||M==="send_native"||M==="send_nft")&&i?.address)try{const Y=l?.nativeCurrency?.symbol||"native",z=await Zt({from:$.from,to:$.to,data:$.data,value:$.value&&$.value!=="0"?`0x${BigInt($.value).toString(16)}`:void 0,chainId:p,rpcUrl:h});if(z.isGreaterThan(0)){const K=await mn({address:i.address,chainId:p,rpcUrl:h});if(K.isLessThan(z)){const X=de(Ue(BigInt(K.toFixed(0)),18)).decimalPlaces(6).toFormat(),U=de(Ue(BigInt(z.toFixed(0)),18)).decimalPlaces(6).toFormat();c(R,"fail"),o(`⚠️ **Insufficient ${Y} for gas!** You have ${X} ${Y} but need ~${U} ${Y} for the transaction fee. Please top up your wallet and try again.`,"bot");return}}}catch(Y){console.warn("Pre-execution fee check failed:",Y)}if(n){const Y=await n(ee);if(Y.status==="success"&&Y.transactionHash){const z=l?.blockExplorers?.default?.url,K=z?`
366
366
  [View on Explorer](${z}/tx/${Y.transactionHash})`:`
367
367
  Tx: ${Y.transactionHash}`,X=o(`⏳ Transaction submitted. Waiting for confirmation...${K}`,"bot");try{await lt(2e3),(await ts({transactionHash:Y.transactionHash,chainId:p||1,rpcUrl:h})).status==="success"?(c(R,"success"),T(X.id,`✅ Transaction confirmed!${K}`)):(c(R,"fail"),T(X.id,`❌ Transaction reverted on-chain.${K}`))}catch(U){console.warn("Transaction tracking timeout:",U),c(R,"success"),o(`⚠️ Transaction submitted but confirmation timed out. Please check manually.${K}`,"bot")}}else if(Y.status==="success")c(R,"success"),o("✅ Transaction successful!","bot");else{c(R,"fail");const z=Y.error?`
368
- Error: ${Y.error}`:"";o(`Transaction failed. Please try again.${z}`,"bot")}}else c(R,"fail"),o("⚠️ No transaction handler configured.","bot")}}catch($){console.error("Action form submit error:",$),c(R,"fail"),o(`❌ Error: ${$ instanceof Error?$.message:"Unknown error"}`,"bot")}},[c,p,i?.address,u,o,n,l?.blockExplorers?.default?.url,l?.nativeCurrency?.symbol,T,h]),Ye=re.useCallback(M=>{c(M,"fail")},[c]),[Le,Ge]=re.useState({}),Fe=re.useCallback(async(M,se,R)=>{Ge($=>({...$,[R]:!0}));try{await Qe(M,se,R)}finally{Ge($=>({...$,[R]:!1}))}},[Qe]),Oe=re.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),_e())},[_e]),Ee=re.useCallback(()=>{const M=window.getSelection();M&&M.toString().length>0||t()},[t]);return e?I.jsx("div",{className:`chat-modal-overlay${s==="bottom-left"?" chat-modal-overlay--left":""}`,onClick:Ee,role:"dialog","aria-modal":"true","aria-labelledby":"chat-modal-title",children:I.jsxs("div",{className:"chat-modal",onClick:M=>M.stopPropagation(),children:[I.jsxs("div",{className:"chat-modal-header",children:[I.jsxs("div",{className:"chat-modal-header-left",children:[I.jsx("div",{className:"keyring-logo",children:I.jsx("img",{src:Ui,alt:"Keyring Logo",width:40,height:40})}),I.jsx("h3",{id:"chat-modal-title",children:"Keyring Agent"})]}),I.jsx("button",{className:"close-button",onClick:t,"aria-label":"Close chat",type:"button",children:I.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:I.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),I.jsx(hi,{address:i?.address,chainLogo:l?.logo}),I.jsxs("div",{className:"chat-modal-messages-wrapper",children:[I.jsxs("div",{className:"chat-modal-messages",ref:D,role:"log","aria-live":"polite",children:[a.map((M,se)=>I.jsxs("div",{children:[Ie(se)&&I.jsx("div",{className:"date-separator",children:ci(M.timestamp)}),I.jsxs("div",{className:`message ${M.sender==="user"?"message-user":"message-bot"}`,role:"article",children:[I.jsx("button",{className:"message-reply-button",onClick:()=>O(M),"aria-label":"Reply to message",type:"button",children:I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M3.5 8.5L1 6L3.5 3.5M1.5 6H10C12.2091 6 14 7.79086 14 10V13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),I.jsxs("div",{className:"message-bubble",children:[M.replyTo&&I.jsxs("div",{className:"message-reply-to",children:[I.jsxs("div",{className:"message-reply-to-label",children:["Replying to"," ",M.replyTo.sender==="user"?"You":"Keyring Agent"]}),I.jsx("div",{className:"message-reply-to-text",children:M.replyTo.text})]}),I.jsx("div",{className:"message-text",children:I.jsx(Li,{content:M.text})}),M.buttons&&M.buttons.length>0&&I.jsx("div",{className:"message-buttons",children:M.buttons.map(R=>I.jsx("button",{className:`message-button ${R.fullWidth?"full-width":""} ${R.action==="suggested_action"?"suggested-action":""}`,onClick:()=>xe(R.value,R.action,R?.extraData),type:"button",children:R.text},R.id))}),M.actionData&&M.actionData.status==="pending"&&I.jsx(Wi,{action:M.actionData.action,initialValues:M.actionData.parameters,onSubmit:(R,$)=>Fe(R,$,M.id),onCancel:()=>Ye(M.id),isSubmitting:Le[M.id]||!1,tokenInfo:M.actionData.tokenInfo}),M.actionData&&M.actionData.status==="submitted"&&I.jsx("div",{className:"action-status action-status-submitted",children:"⏳ Processing transaction..."}),M.actionData&&M.actionData.status==="success"&&I.jsx("div",{className:"action-status action-status-success",children:"✅ Transaction completed"}),M.actionData&&M.actionData.status==="fail"&&I.jsx("div",{className:"action-status action-status-fail",children:"❌ Action cancelled or failed"}),I.jsxs("div",{className:"message-timestamp",children:[M.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),M.sender==="user"&&I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"check-icon",children:I.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]},M.id)),L&&I.jsx("div",{className:"message message-bot typing-indicator",role:"status","aria-label":"Bot is typing",children:I.jsxs("div",{className:"message-bubble",children:[I.jsx("span",{className:"typing-dot"}),I.jsx("span",{className:"typing-dot"}),I.jsx("span",{className:"typing-dot"})]})}),(k||a.length===1)&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"message message-bot",role:"article",children:I.jsx("div",{className:"message-bubble",children:I.jsx("div",{className:"message-text",children:"Can I help you with anything?"})})}),I.jsx("div",{className:"suggestions-container",children:be.map(M=>I.jsxs("button",{className:"suggestion-button",onClick:M.action,type:"button",children:[I.jsx("span",{className:"suggestion-icon",children:M.icon}),I.jsx("span",{className:"suggestion-text",children:M.text})]},M.id))})]}),I.jsx("div",{ref:ue})]}),I.jsx(Gi,{scrollContainerRef:D})]}),I.jsxs("div",{className:"chat-modal-input",children:[g&&I.jsxs("div",{className:"reply-preview",children:[I.jsxs("div",{className:"reply-preview-content",children:[I.jsxs("div",{className:"reply-preview-label",children:["Replying to"," ",g.sender==="user"?"You":"Keyring Agent"]}),I.jsx("div",{className:"reply-preview-text",children:g.text})]}),I.jsx("button",{className:"reply-preview-close",onClick:()=>B(null),"aria-label":"Cancel reply",type:"button",children:I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),I.jsxs("div",{className:"chat-modal-input-row",children:[I.jsx("input",{ref:Q,type:"text",placeholder:"Message ....",value:C,onChange:M=>N(M.target.value),onKeyPress:Oe,disabled:L,"aria-label":"Message input"}),I.jsx("button",{className:"send-button",onClick:_e,"aria-label":"Send message",disabled:L||C?.trim()==="",type:"button",children:I.jsx("img",{src:Di,alt:"Send",width:44,height:44})})]})]})]})}):null},oc=({position:e,theme:t,defaultOpen:n,onOpen:s,onClose:r,onTransaction:a})=>{const[o,c]=re.useState(n);re.useEffect(()=>{n&&s&&s()},[]),re.useEffect(()=>{if(typeof window>"u")return;const m=document.body,k=document.documentElement;return!!o?(m.style.overscrollBehavior="none",k.style.overscrollBehavior="none"):(m.style.overscrollBehavior="auto",k.style.overscrollBehavior="auto"),()=>{m.style.overscrollBehavior="auto",k.style.overscrollBehavior="auto"}},[o]);const T=re.useCallback(()=>{c(!0),s?.()},[s]),C=re.useCallback(()=>{c(!1),r?.()},[r]),N=re.useCallback(()=>{o?C():T()},[o,T,C]),L={position:"fixed",[e==="bottom-right"?"right":"left"]:"20px",bottom:"20px",zIndex:t.zIndex??9999};return I.jsxs("div",{style:L,role:"complementary","aria-label":"Chat widget",children:[I.jsx(Dr,{onClick:N}),I.jsx(rc,{isOpen:o,onClose:C,onTransaction:a,position:e})]})},ac=({position:e="bottom-right",theme:t={},defaultOpen:n=!1,onOpen:s,onClose:r,account:a,onTransaction:o,language:c="en",rpcUrls:T})=>{const C={position:e,theme:t,rpcUrls:T};return console.log("🚀 ~ ChatWidget ~ account:",a),typeof window>"u"?null:I.jsx(Ti,{initialConfig:C,children:I.jsx(vi,{initialAccount:a,children:I.jsx(Ei,{initialLanguage:c,children:I.jsx(oc,{position:e,theme:t,defaultOpen:n,onOpen:s,onClose:r,onTransaction:o})})})})};pt.ChatWidget=ac,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})}));
368
+ Error: ${Y.error}`:"";o(`Transaction failed. Please try again.${z}`,"bot")}}else c(R,"fail"),o("⚠️ No transaction handler configured.","bot")}}catch($){console.error("Action form submit error:",$),c(R,"fail"),o(`❌ Error: ${$ instanceof Error?$.message:"Unknown error"}`,"bot")}},[c,p,i?.address,u,o,n,l?.blockExplorers?.default?.url,l?.nativeCurrency?.symbol,T,h]),Ye=re.useCallback(M=>{c(M,"fail")},[c]),[Le,Ge]=re.useState({}),Fe=re.useCallback(async(M,se,R)=>{Ge($=>({...$,[R]:!0}));try{await Qe(M,se,R)}finally{Ge($=>({...$,[R]:!1}))}},[Qe]),Oe=re.useCallback(M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),_e())},[_e]),Ee=re.useCallback(()=>{const M=window.getSelection();M&&M.toString().length>0||t()},[t]);return e?I.jsx("div",{className:`chat-modal-overlay${s==="bottom-left"?" chat-modal-overlay--left":""}`,onClick:Ee,role:"dialog","aria-modal":"true","aria-labelledby":"chat-modal-title",children:I.jsxs("div",{className:"chat-modal",onClick:M=>M.stopPropagation(),children:[I.jsxs("div",{className:"chat-modal-header",children:[I.jsxs("div",{className:"chat-modal-header-left",children:[I.jsx("div",{className:"keyring-logo",children:I.jsx("img",{src:Ui,alt:"Keyring Logo",width:40,height:40})}),I.jsx("h3",{id:"chat-modal-title",children:"Keyring Agent"})]}),I.jsx("button",{className:"close-button",onClick:t,"aria-label":"Close chat",type:"button",children:I.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:I.jsx("path",{d:"M15 5L5 15M5 5L15 15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]}),I.jsx(hi,{address:i?.address,chainId:l?.chainId}),I.jsxs("div",{className:"chat-modal-messages-wrapper",children:[I.jsxs("div",{className:"chat-modal-messages",ref:D,role:"log","aria-live":"polite",children:[a.map((M,se)=>I.jsxs("div",{children:[Ie(se)&&I.jsx("div",{className:"date-separator",children:ci(M.timestamp)}),I.jsxs("div",{className:`message ${M.sender==="user"?"message-user":"message-bot"}`,role:"article",children:[I.jsx("button",{className:"message-reply-button",onClick:()=>O(M),"aria-label":"Reply to message",type:"button",children:I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M3.5 8.5L1 6L3.5 3.5M1.5 6H10C12.2091 6 14 7.79086 14 10V13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),I.jsxs("div",{className:"message-bubble",children:[M.replyTo&&I.jsxs("div",{className:"message-reply-to",children:[I.jsxs("div",{className:"message-reply-to-label",children:["Replying to"," ",M.replyTo.sender==="user"?"You":"Keyring Agent"]}),I.jsx("div",{className:"message-reply-to-text",children:M.replyTo.text})]}),I.jsx("div",{className:"message-text",children:I.jsx(Li,{content:M.text})}),M.buttons&&M.buttons.length>0&&I.jsx("div",{className:"message-buttons",children:M.buttons.map(R=>I.jsx("button",{className:`message-button ${R.fullWidth?"full-width":""} ${R.action==="suggested_action"?"suggested-action":""}`,onClick:()=>xe(R.value,R.action,R?.extraData),type:"button",children:R.text},R.id))}),M.actionData&&M.actionData.status==="pending"&&I.jsx(Wi,{action:M.actionData.action,initialValues:M.actionData.parameters,onSubmit:(R,$)=>Fe(R,$,M.id),onCancel:()=>Ye(M.id),isSubmitting:Le[M.id]||!1,tokenInfo:M.actionData.tokenInfo}),M.actionData&&M.actionData.status==="submitted"&&I.jsx("div",{className:"action-status action-status-submitted",children:"⏳ Processing transaction..."}),M.actionData&&M.actionData.status==="success"&&I.jsx("div",{className:"action-status action-status-success",children:"✅ Transaction completed"}),M.actionData&&M.actionData.status==="fail"&&I.jsx("div",{className:"action-status action-status-fail",children:"❌ Action cancelled or failed"}),I.jsxs("div",{className:"message-timestamp",children:[M.timestamp.toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}),M.sender==="user"&&I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:"check-icon",children:I.jsx("path",{d:"M13.3333 4L6 11.3333L2.66667 8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})]})]})]})]},M.id)),L&&I.jsx("div",{className:"message message-bot typing-indicator",role:"status","aria-label":"Bot is typing",children:I.jsxs("div",{className:"message-bubble",children:[I.jsx("span",{className:"typing-dot"}),I.jsx("span",{className:"typing-dot"}),I.jsx("span",{className:"typing-dot"})]})}),(k||a.length===1)&&I.jsxs(I.Fragment,{children:[I.jsx("div",{className:"message message-bot",role:"article",children:I.jsx("div",{className:"message-bubble",children:I.jsx("div",{className:"message-text",children:"Can I help you with anything?"})})}),I.jsx("div",{className:"suggestions-container",children:be.map(M=>I.jsxs("button",{className:"suggestion-button",onClick:M.action,type:"button",children:[I.jsx("span",{className:"suggestion-icon",children:M.icon}),I.jsx("span",{className:"suggestion-text",children:M.text})]},M.id))})]}),I.jsx("div",{ref:ue})]}),I.jsx(Gi,{scrollContainerRef:D})]}),I.jsxs("div",{className:"chat-modal-input",children:[g&&I.jsxs("div",{className:"reply-preview",children:[I.jsxs("div",{className:"reply-preview-content",children:[I.jsxs("div",{className:"reply-preview-label",children:["Replying to"," ",g.sender==="user"?"You":"Keyring Agent"]}),I.jsx("div",{className:"reply-preview-text",children:g.text})]}),I.jsx("button",{className:"reply-preview-close",onClick:()=>B(null),"aria-label":"Cancel reply",type:"button",children:I.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:I.jsx("path",{d:"M12 4L4 12M4 4L12 12",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]}),I.jsxs("div",{className:"chat-modal-input-row",children:[I.jsx("input",{ref:Q,type:"text",placeholder:"Message ....",value:C,onChange:M=>N(M.target.value),onKeyPress:Oe,disabled:L,"aria-label":"Message input"}),I.jsx("button",{className:"send-button",onClick:_e,"aria-label":"Send message",disabled:L||C?.trim()==="",type:"button",children:I.jsx("img",{src:Di,alt:"Send",width:44,height:44})})]})]})]})}):null},oc=({position:e,theme:t,defaultOpen:n,onOpen:s,onClose:r,onTransaction:a})=>{const[o,c]=re.useState(n);re.useEffect(()=>{n&&s&&s()},[]),re.useEffect(()=>{if(typeof window>"u")return;const m=document.body,k=document.documentElement;return!!o?(m.style.overscrollBehavior="none",k.style.overscrollBehavior="none"):(m.style.overscrollBehavior="auto",k.style.overscrollBehavior="auto"),()=>{m.style.overscrollBehavior="auto",k.style.overscrollBehavior="auto"}},[o]);const T=re.useCallback(()=>{c(!0),s?.()},[s]),C=re.useCallback(()=>{c(!1),r?.()},[r]),N=re.useCallback(()=>{o?C():T()},[o,T,C]),L={position:"fixed",[e==="bottom-right"?"right":"left"]:"20px",bottom:"20px",zIndex:t.zIndex??9999};return I.jsxs("div",{style:L,role:"complementary","aria-label":"Chat widget",children:[I.jsx(Dr,{onClick:N}),I.jsx(rc,{isOpen:o,onClose:C,onTransaction:a,position:e})]})},ac=({position:e="bottom-right",theme:t={},defaultOpen:n=!1,onOpen:s,onClose:r,account:a,onTransaction:o,language:c="en",rpcUrls:T})=>{const C={position:e,theme:t,rpcUrls:T};return console.log("🚀 ~ ChatWidget ~ account:",a),typeof window>"u"?null:I.jsx(Ti,{initialConfig:C,children:I.jsx(vi,{initialAccount:a,children:I.jsx(Ei,{initialLanguage:c,children:I.jsx(oc,{position:e,theme:t,defaultOpen:n,onOpen:s,onClose:r,onTransaction:o})})})})};pt.ChatWidget=ac,Object.defineProperty(pt,Symbol.toStringTag,{value:"Module"})}));