(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode('@import"https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&display=swap";.mts-default{--border-color: #f4f4f5;--primary-color: #22c55e;--secondary-color: #ebebeb;--background-color: #ffffff;--modal-background-color: #ffffff;--swap-container-background: #f4f4f5;--swap-container-border-color: #ffffff;--input-card-color: #ffffff;--input-card-pay-color: #ffffff;--input-card-receive-color: #d0d5dd;--input-token-color: #f4f4f5;--change-direction-background-color: #22c55e;--change-direction-icon-color: #f4f4f5;--light-shade-color: #f4f4f5;--slippage-box-color: #71717a;--text-black-color: #000000;--text-white-color: #ffffff;--text-fade-color: #9caacb;--skeleton-shine-color: #9c9c9c;--price-impact-color: #e64646}.mts-dark{--border-color: #344054;--primary-color: #16a34a;--secondary-color: #283241;--background-color: #101828;--modal-background-color: #1d2939;--swap-container-background-color: #101828;--swap-container-border-color: #1d293900;--input-card-pay-color: #09090b;--input-card-receive-color: #344054;--input-card-color: #101828;--input-token-color: #101828;--change-direction-background-color: #101828;--change-direction-icon-color: #16a34a;--light-shade-color: #1d2939;--slippage-box-color: #344054;--text-black-color: #ffffff;--text-white-color: #ffffff;--text-fade-color: #687085;--skeleton-shine-color: #585959}.mts-ton-jiggle{--border-color: #004a6533;--primary-color: #177594;--secondary-color: #283241;--background-color: #181f34;--modal-background-color: #101828;--swap-container-background-color: #101828;--swap-container-border-color: #1d293900;--input-card-pay-color: #09090b;--input-card-receive-color: #30475b;--input-card-color: #181f34;--input-token-color: #1d2939;--change-direction-background-color: #101828;--change-direction-icon-color: #177594;--light-shade-color: #193349;--slippage-box-color: #d1d1e0;--text-black-color: #ffffff;--text-white-color: #ffffff;--text-fade-color: #6b7280;--skeleton-shine-color: #585959}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}@keyframes loading{to{background-position-x:-20%}}:where([data-skeleton]){--skeleton-shine: white;background-image:linear-gradient(100deg,transparent 40%,color-mix(in srgb,var(--skeleton-shine),transparent 50%) 50%,transparent 60%)!important;background-size:200% 100%;background-color:var(--skeleton-bg)!important;background-position-x:120%}@media (prefers-reduced-motion: no-preference){:where([data-skeleton]){animation:2s loading ease-in-out infinite;background-position-x:180%}}:where([data-skeleton][style*=--skeleton-lines]){--l-h: 1lh;--l-gap: 1ex;-webkit-mask:linear-gradient(#000 0 var(--l-h),transparent var(--l-h) calc(var(--l-h) + var(--l-gap))) 0 0/100% calc(var(--l-h) + var(--l-gap));mask:linear-gradient(#000 0 var(--l-h),transparent var(--l-h) calc(var(--l-h) + var(--l-gap))) 0 0/100% calc(var(--l-h) + var(--l-gap));min-height:calc(var(--skeleton-lines) * var(--l-h) + (var(--skeleton-lines) - 1) * var(--l-gap))}::-webkit-scrollbar{width:5px}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{border-radius:5px;background:var(--thumb-scrollbar)}._refresher_wadtj_43{position:relative;width:100%;height:100%}.icon_overlay,.refresh_icon{position:absolute;top:0;left:0;transition:color .25s ease-in-out;width:100%;height:auto;color:#6c6c6c}.icon_overlay.overlay{color:#22c55e}.active{cursor:pointer}.icon_overlay.progressing{animation-duration:30s;animation-timing-function:linear;animation-iteration-count:1;animation-name:loading_refresh_icon}.icon_overlay.waiting{animation-duration:30s;animation-timing-function:ease-in-out;animation-iteration-count:infinite;animation-name:waiting_refresh_icon}@keyframes loading_refresh_icon{0%{clip-path:polygon(50% 50%,150% 50%,150% 50%)}25%{clip-path:polygon(50% 50%,150% 50%,50% 150%)}25.000001%{clip-path:polygon(50% 50%,150% 50%,50% 150%,50% 150%)}50%{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%)}50.000001%{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%,-50% 50%)}75%{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%,50% -50%)}75.000001%{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%,50% -50%,50% -50%)}97.5%{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%,50% -50%,150% 50%);color:#f2f2f2}to{clip-path:polygon(50% 50%,150% 50%,50% 150%,-50% 50%,50% -50%,150% 50%);color:#6c6c6c}}@keyframes waiting_refresh_icon{0%{color:#6c6c6c}50%{color:#f2f2f2}to{color:#6c6c6c}}.mytonswap-app .slippage-setting-container{display:flex;flex-direction:column;gap:.25rem}.mytonswap-app .slippage-setting-container .button-container{display:flex;justify-content:space-between;width:100%;color:var(--text-black-color)}.mytonswap-app .slippage-setting-container .slippage-indicator{display:flex;justify-content:center;align-items:center}.mytonswap-app .slippage-setting-container .slippage-indicator .icon{transition:transform .3s ease}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown{display:grid;grid-template-columns:repeat(4,1fr);justify-content:space-around;gap:0 .5rem;width:100%;font-size:var(--font-size-sm)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .controllers{display:flex;justify-content:space-between;align-items:center;gap:.25rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item{display:flex;position:relative;justify-content:center;align-items:center;transition:all .3s ease;cursor:pointer;margin:.125rem;border:1px solid transparent;border-radius:.75rem;background:var(--secondary-color);padding:.25rem;height:2rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item.active{border:1px solid var(--primary-color)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item.percent-input{background-color:var(--light-shade-color);width:50px}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .icon{position:absolute;top:-.25rem;left:-.25rem;transition:color .3s ease;color:var(--primary-color);font-size:1.125rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .icon:hover{color:var(--primary-color)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .icon.disabled{color:var(--text-fade-color)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item input{width:100%;color:var(--text-black-color)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .slippage-input-group{display:flex;justify-content:center;align-items:center}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .slippage-input-group .slippage-input{outline:none;background:transparent;width:100%;color:var(--text-black-color)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .slippage-input-group .slippage-input-percent{padding-right:.25rem;font-size:.75rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .controller{display:flex;justify-content:center;align-items:center;cursor:pointer;border-radius:.75rem;background:var(--primary-color);width:3rem;height:2rem;color:var(--text-white-color);font-weight:700}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .controller:disabled{cursor:not-allowed}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .controller.disabled{background:var(--light-shade-color);color:var(--text-fade-color)}@media screen and (min-width: 768px){.mytonswap-app .slippage-setting-container{gap:.5rem;font-size:.875rem}.mytonswap-app .slippage-setting-container .button-container{font-size:var(--font-size-sm)}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item{margin:.25rem;height:2.5rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .icon{font-size:1.25rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .dropdown-item .slippage-input-group .slippage-input-percent{font-size:.875rem}.mytonswap-app .slippage-setting-container .slippage-setting-dropdown .controller{width:3.5rem;height:2.5rem}}.mytonswap-app .token-setting-container{display:flex;justify-content:space-between;align-items:center;padding:0 .25rem;font-size:.75rem}.mytonswap-app .token-setting-container .token-setting-text{color:var(--text-black-color)}.mytonswap-app .token-setting-container .checkbox{display:flex;position:relative;justify-content:flex-start;align-items:center;transition:all .3s ease;border-radius:9999px;background:var(--light-shade-color);padding:.25rem;width:3rem;height:1.5rem}.mytonswap-app .token-setting-container .checkbox.checkbox-active{background:var(--primary-color)}.mytonswap-app .token-setting-container .checkbox .checkbox-inner{position:absolute;transition:all .3s ease;border-radius:9999px;width:1rem;height:1rem}.mytonswap-app .token-setting-container .checkbox .checkbox-inner.checkbox-inner-active{left:1.75rem;background:var(--background-color)}.mytonswap-app .token-setting-container .checkbox .checkbox-inner.checkbox-inner-inactive{left:.25rem;background:var(--primary-color)}@media screen and (min-width: 768px){.mytonswap-app .token-setting-container{font-size:var(--font-size-sm)}}.mytonswap-app .popover-container{display:flex;position:relative;align-items:center;z-index:2}.mytonswap-app .popover-container button{display:flex;justify-content:center;align-items:center}.mytonswap-app .modal-backdrop{position:fixed;top:0;left:0;background:#0000004d;width:100%;height:100%}.mytonswap-app .modal-backdrop .popover{display:flex;position:fixed;bottom:0;left:0;flex-direction:column;gap:.75rem;box-shadow:0 0 10px #0000001a;border:1px solid var(--border-color);border-top-right-radius:1rem;border-top-left-radius:1rem;background:var(--modal-background-color);padding:1rem;width:100%;min-width:15.625rem;height:-moz-fit-content;height:fit-content;color:var(--text-black-color)}.mytonswap-app .modal-backdrop .popover .popover-header{display:flex;justify-content:space-between;align-items:center}.mytonswap-app .modal-backdrop .popover .popover-header button{color:var(--text-black-color);font-size:var(--font-size-xl)}@media screen and (min-width: 768px){.mytonswap-app .modal-backdrop .popover{border-radius:1rem;max-width:32.5rem}}.wallet-profile-mts .wallet-popover{position:absolute;box-shadow:0 0 20px #0000001a;border-radius:1rem;background:var(--modal-background-color);padding:.25rem;width:100%;min-width:15.625rem;height:100%;height:-moz-fit-content;height:fit-content;color:var(--text-black-color)}.mytonswap-app.rtl .popover{right:auto;left:0}@media screen and (min-width: 768px){.mytonswap-app .popover{min-width:20rem}}.mytonswap-app .wallet-card{border-radius:.5rem;padding:.5rem}.mytonswap-app .wallet-card .title{opacity:.75;font-size:.7rem}.mytonswap-app .wallet-card .wallet-content{display:flex;flex-direction:column}.mytonswap-app .wallet-card .wallet-content .balance-title{margin-top:.5rem;font-size:.8rem}.mytonswap-app .wallet-card .wallet-content .balance-amount{margin:.5rem 0;color:var(--primary-color);font-weight:900;font-size:1.25rem}.mytonswap-app .wallet-card .wallet-content .address{display:flex;opacity:.75;border-radius:.25rem;background:var(--secondary-color);padding:.25rem .5rem;width:-moz-fit-content;width:fit-content;font-size:.8rem}.mytonswap-app .wallet-card .wallet-content .address-section{display:flex;align-items:center;gap:.25rem}.mytonswap-app .wallet-card .wallet-content .address-section .address{display:flex;justify-content:center;align-items:center;opacity:.75;border-radius:.5rem;width:-moz-fit-content;width:fit-content;height:2rem;font-size:.8rem}.mytonswap-app .wallet-card .wallet-content .address-section .wallet-icon{display:flex;justify-content:center;align-items:center;opacity:.75;cursor:pointer;border-radius:.5rem;background:var(--secondary-color);width:2rem;height:2rem;color:var(--text-black-color);font-size:var(--font-size-xs)}.mytonswap-app .wallet-card .wallet-content .address-section .wallet-icon:disabled{opacity:.5;cursor:not-allowed}.mytonswap-app .wallet-card .wallet-content .disconnect-wallet{display:flex;justify-content:center;align-items:center;transition:all .3s ease-in-out;cursor:pointer;margin-top:.5rem;border-radius:.5rem;background:var(--secondary-color);height:2.5rem;color:var(--text-black-color);font-size:.8rem}@media screen and (min-width: 768px){.mytonswap-app .wallet-card .title{font-size:var(--font-size-xs)}.mytonswap-app .wallet-card .wallet-content .balance-title{font-size:var(--font-size-sm)}.mytonswap-app .wallet-card .wallet-content .balance-amount{font-size:var(--font-size-2xl)}.mytonswap-app .wallet-card .wallet-content .address-section .address{height:2.5rem;font-size:var(--font-size-base)}.mytonswap-app .wallet-card .wallet-content .address-section .wallet-icon{width:2.5rem;height:2.5rem;font-size:var(--font-size-xs)}.mytonswap-app .wallet-card .wallet-content .disconnect-wallet{height:3rem;font-size:var(--font-size-sm)}}.mytonswap-app .header-container{display:flex;justify-content:space-between;align-items:center;padding:0 .25rem;color:var(--text-black-color);font-weight:700;font-size:var(--font-size-lg)}.mytonswap-app .header-setting{display:flex;align-items:center;gap:.5rem}.mytonswap-app .header-setting .loading-container{width:1.25rem;height:1.25rem}.mytonswap-app .header-setting .setting-icon{color:var(--text-black-color);font-size:var(--font-size-2xl)}@media screen and (min-width: 768px){.mytonswap-app .header-container{font-size:var(--font-size-lg)}.mytonswap-app .header-setting .loading-container{width:1.25rem;height:1.25rem}.mytonswap-app .header-setting .setting-icon{font-size:var(--font-size-2xl)}}@media screen and (min-width: 1024px){.mytonswap-app .header-container{font-size:var(--font-size-lg)}}.mytonswap-app .token-container{display:flex;align-items:center;cursor:pointer;margin-top:.25rem;border-radius:.75rem;padding-right:.5rem;padding-left:.5rem;width:100%;height:3rem}.mytonswap-app .token-container.selected{opacity:.5;cursor:auto}.mytonswap-app .token-content{display:flex;flex-grow:1;align-items:center;gap:.5rem}.mytonswap-app .token-content .token-image{border-radius:9999px;background-size:contain!important;width:2.75rem;height:2.75rem}.mytonswap-app .token-content .token-details{flex-grow:1}.mytonswap-app .token-content .token-details-symbol-balance{display:flex;flex-grow:1;justify-content:space-between;align-items:center;overflow:hidden;color:var(--text-black-color);font-weight:500;font-size:var(--font-size-base);text-overflow:ellipsis;white-space:nowrap}.mytonswap-app .token-content .token-details-symbol-balance .symbol{display:flex;justify-content:center;align-items:center;gap:.125rem;font-size:var(--font-size-base)}.mytonswap-app .token-content .token-details-symbol-balance .symbol a{display:flex;justify-content:center;align-items:center;opacity:50%;color:inherit;text-decoration:none}.mytonswap-app .token-content .token-details-name-rate{display:flex;flex-grow:1;justify-content:space-between;align-items:center;opacity:.5;color:var(--text-black-color);font-size:var(--font-size-xs)}.mytonswap-app .token-content .token-details-name-rate .name-liq,.mytonswap-app .token-content .token-details-name-rate .name-liq .liq{display:flex;justify-content:center;align-items:center;gap:.125rem}.mytonswap-app .token-content .fav{opacity:.5;transition:transform .2s ease-in-out;color:var(--text-black-color);font-size:var(--font-size-2xl)}.mytonswap-app .token-content .fav:active{transform:scale(.9)}.mytonswap-app .token-content .fav.faved{opacity:1;color:var(--primary-color)}@media screen and (min-width: 1024px){.mytonswap-app .token-container{margin-top:.5rem;height:3rem}.mytonswap-app .token-content .token-image{width:2.5rem;height:2.5rem}.mytonswap-app .token-content .token-details-symbol-balance{font-size:var(--font-size-lg)}.mytonswap-app .token-content .token-details-name-rate{font-size:var(--font-size-sm)}}.mytonswap-app .card-dialog-container{position:fixed;top:0;left:0;z-index:10000000000000000000000000;background:#0003;width:100%;height:100%;overflow:hidden}.mytonswap-app .card-dialog-container .card-dialog{display:flex;position:fixed;bottom:0;left:0;flex-direction:column;box-shadow:0 0 10px #0000000d;border-top-right-radius:1rem;border-top-left-radius:1rem;background:var(--modal-background-color);padding:1rem .75rem .5rem;width:100%;min-height:92.5dvh;max-height:92.5dvh;overflow-y:auto}@media (min-width: 768px){.mytonswap-app .card-dialog-container .card-dialog{box-shadow:0 0 10px #0000000d;border-radius:1rem;width:90%;max-width:34.375rem;height:auto;min-height:21.875rem;max-height:70dvh}}.mytonswap-app .card-dialog-container .card-dialog .no-token-found{display:flex;flex-grow:1;flex-direction:column;justify-content:center;align-items:center;margin-top:1rem;height:100%;color:var(--text-black-color)}.mytonswap-app .card-dialog-container .card-dialog .no-token-found span{opacity:.7;font-size:var(--font-size-xs)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head{display:flex;justify-content:space-between;align-items:center;color:var(--text-black-color);font-weight:700;font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head .card-dialog-close{display:none;opacity:.5;color:var(--text-black-color);font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search{display:flex;align-items:center;transition:all .2s ease-in-out;margin-top:1.5rem;margin-bottom:.5rem;border:1px solid var(--border-color);border-radius:.75rem;background:var(--input-card-color);padding-right:.5rem;padding-left:.5rem;width:100%;height:3.25rem}.mytonswap-app .card-dialog-container .card-dialog .dialog-search:hover{background:var(--input-token-color)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search:focus-within{border-color:var(--primary-color)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search .dialog-search-icon{color:var(--text-black-color);font-size:var(--font-size-lg)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search .dialog-search-input{outline:none;background-color:transparent;padding-right:.25rem;padding-left:.25rem;width:100%;height:100%;color:var(--text-black-color);font-size:1rem}.mytonswap-app .card-dialog-container .card-dialog .dialog-tokens-container{flex-grow:1;height:50vh;overflow-y:scroll}.mytonswap-app .card-dialog-container .card-dialog .infinite-scroll-loading{display:flex;justify-content:center;align-items:center;height:2.5rem;color:var(--text-black-color);font-size:1.25rem}.mytonswap-app .card-dialog-container .card-dialog .dialog-community-modal{display:flex;flex-grow:1;flex-direction:column;height:100%}.mytonswap-app .card-dialog-container .card-dialog .community-modal-container{display:flex;flex-grow:1;flex-direction:column;gap:.5rem .5rem}.mytonswap-app .card-dialog-container .card-dialog .community-modal-warning{display:flex;flex-direction:column;justify-content:center;align-items:center;margin-top:.25rem;margin-bottom:.25rem;border-radius:.75rem;background:var(--input-card-color);padding:.5rem;color:var(--text-black-color)}.mytonswap-app .card-dialog-container .card-dialog .community-modal-warning .icon{color:#f59e00;font-size:1.875rem}.mytonswap-app .card-dialog-container .card-dialog .community-modal-warning .title{font-weight:700;font-size:1rem}.mytonswap-app .card-dialog-container .card-dialog .community-modal-warning .description{padding-right:1.25rem;padding-left:1.25rem;font-size:.875rem;text-align:center}.mytonswap-app .card-dialog-container .card-dialog .accept-button{display:flex;justify-content:center;align-items:center;border-radius:.75rem;background:var(--primary-color);width:100%;height:2.5rem;color:var(--text-black-color);font-size:.875rem}.mytonswap-app .card-dialog-container .card-dialog .pinned-token-container{display:flex;align-items:center;gap:.5rem;padding:.75rem 0}.mytonswap-app .card-dialog-container .card-dialog .pinned-token-container .pinned-token{display:flex;align-items:center;gap:.25rem;opacity:.8;transition:all .3s ease-in-out;cursor:pointer;border-radius:9999rem;background:var(--light-shade-color);padding:.25rem;padding:.25rem .5rem .25rem .25rem;color:var(--text-black-color);font-size:.9rem}.mytonswap-app .card-dialog-container .card-dialog .pinned-token-container .pinned-token:hover{opacity:1}.mytonswap-app .card-dialog-container .card-dialog .pinned-token-container .pinned-token .pinned-token-image{border-radius:9999px;background-size:contain!important;width:1.25rem;height:1.25rem}.mytonswap-app .card-dialog-container .card-dialog .close-footer{display:flex;justify-content:center;align-items:center;cursor:pointer;padding-top:.5rem;font-size:.875rem}@media screen and (min-width: 768px){.mytonswap-app .card-dialog-container .card-dialog .close-footer{display:none}}.mytonswap-app .card-dialog-container .card-dialog .close-footer .close-footer-button{display:flex;justify-content:center;align-items:center;transition:all .3s ease-in-out;border-radius:.75rem;background:var(--secondary-color);width:100%;height:3rem;color:var(--text-black-color);text-align:center}.mytonswap-app .card-dialog-container .card-dialog .close-footer .close-footer-button:active{scale:.95}.mytonswap-app .card-dialog-container .card-dialog .tab-container{display:flex;align-items:center;gap:1.25rem;margin-top:.75rem;margin-bottom:.5rem;border-bottom:1px solid var(--border-color);padding-right:.75rem;padding-bottom:.5rem;padding-left:.75rem;width:100%;color:var(--text-black-color);font-weight:300;font-size:var(--font-size-lg)}.mytonswap-app .card-dialog-container .card-dialog .tab-container .tab-item{position:relative;transition:all .3s ease-in-out;color:var(--text-black-color);font-size:var(--font-size-base)}.mytonswap-app .card-dialog-container .card-dialog .tab-container .tab-item.active{color:var(--primary-color);font-weight:600}.mytonswap-app .card-dialog-container .card-dialog .tab-container .tab-item .tab-item-cursor{position:absolute;bottom:-9px;background:var(--primary-color);width:100%;height:1px}@media screen and (min-width: 768px){.mytonswap-app .card-dialog-container .card-dialog .no-token-found{font-size:var(--font-size-lg)}.mytonswap-app .card-dialog-container .card-dialog .no-token-found span{font-size:var(--font-size-sm)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head{font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head .card-dialog-close{display:block}.mytonswap-app .card-dialog-container .card-dialog .dialog-search{margin-top:.5rem;height:3rem;font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search .dialog-search-icon{opacity:.5;color:var(--text-black-color);font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search .dialog-search-input{font-size:var(--font-size-base)}}@media screen and (min-width: 1024px){.mytonswap-app .card-dialog-container .card-dialog .no-token-found{font-size:var(--font-size-lg)}.mytonswap-app .card-dialog-container .card-dialog .no-token-found span{font-size:var(--font-size-sm)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head{margin-bottom:.5rem;font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-head .card-dialog-close{opacity:.5;color:var(--text-black-color);font-size:var(--font-size-2xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search{height:3.5rem;font-size:var(--font-size-xl)}.mytonswap-app .card-dialog-container .card-dialog .dialog-search .dialog-search-input{font-size:var(--font-size-lg)}}.mytonswap-app .selection-box-container{display:flex;-moz-column-gap:.25rem;column-gap:.25rem;align-items:center;transition:all .2s ease;border-radius:9999px;padding:.25rem .5rem .25rem .25rem;height:2.5rem;font-weight:700;font-size:var(--font-size-2xl);direction:ltr}.mytonswap-app .selection-box-container .dropdown-icon{display:flex;justify-content:center;align-items:center}.mytonswap-app .selection-box-container:active{scale:.95}.mytonswap-app .selection-box-container.loading{width:5rem;height:2.5rem}.mytonswap-app .selection-box-container.pay-loading{pointer-events:none}.mytonswap-app .selection-box-container.receive-loading{justify-content:center;padding-right:.5rem;padding-left:.5rem;width:-moz-fit-content;width:fit-content}@media screen and (min-width: 768px){.mytonswap-app .selection-box-container{padding:.5rem .75rem .5rem .3rem;height:2.75rem;font-size:var(--font-size-xl)}.mytonswap-app .selection-box-container.loading{width:8rem;height:2.75rem}}.mytonswap-app .swapcard-card{display:flex;flex-direction:column;width:100%;font-size:var(--font-size-base)}.mytonswap-app .swapcard-card .card-head{display:flex;justify-content:space-between;align-items:center;padding-right:.25rem;padding-left:.25rem}.mytonswap-app .swapcard-card .card-head .card-title{opacity:.7;color:var(--text-black-color)}.mytonswap-app .swapcard-card .card-head .max-button{cursor:pointer;color:var(--text-black-color)}.mytonswap-app .swapcard-card .card-head .max-button .max-text{color:var(--primary-color)}.mytonswap-app .swapcard-card .card-head .max-button.pay{cursor:auto}.mytonswap-app .swapcard-card .card-content{display:grid;grid-template-columns:1fr auto;gap:.25rem;margin-top:.875rem;border-radius:.75rem;background:var(--input-card-color);padding:1rem;width:100%}.mytonswap-app .swapcard-card .card-content.pay{background:var(--input-card-pay-color)}.mytonswap-app .swapcard-card .card-content.receive{background:var(--input-card-receive-color)}.mytonswap-app .swapcard-card .card-content .card-inputs{display:flex;flex-direction:column;justify-content:center;gap:.25rem;width:100%}.mytonswap-app .swapcard-card .card-content .card-inputs .card-input{outline:none;background:transparent;height:1.875rem;color:var(--text-black-color);font-weight:700;font-size:var(--font-size-2xl);font-family:inherit}.mytonswap-app .swapcard-card .card-content .card-inputs .card-input-loading{border-radius:.75rem;width:6rem;height:1.875rem}.mytonswap-app .swapcard-card .card-content .card-inputs .card-rate{display:flex;align-items:center;opacity:.5;height:1.25rem;color:var(--text-black-color);font-size:var(--font-size-base);font-family:inherit;text-align:left}.mytonswap-app .swapcard-card .card-content .card-inputs .card-rate-loading{border-radius:.75rem;width:3rem;height:1.25rem}.mytonswap-app .swapcard-card .card-content .card-button{display:flex;align-items:center}.mytonswap-app .swapcard-card .card-content .card-button .selection-box{border-radius:9999px;background-size:contain!important;width:2rem;height:2rem}.mytonswap-app.rtl .swapcard-card .card-content .card-inputs .card-rate{font-size:var(--font-size-xs);text-align:right}@media screen and (min-width: 768px){.mytonswap-app .swapcard-card{gap:0px}.mytonswap-app .swapcard-card .card-head{font-size:var(--font-size-base)}.mytonswap-app .swapcard-card .card-content .card-button .selection-box{width:2rem;height:2rem}}@media screen and (min-width: 1024px){.mytonswap-app .swapcard-card .card-content{padding:1rem}.mytonswap-app .swapcard-card .card-content .card-inputs .card-input{font-size:var(--font-size-2xl)}.mytonswap-app .swapcard-card .card-content .card-inputs .card-input-loading{width:10rem}.mytonswap-app .swapcard-card .card-content .card-inputs .card-rate-loading{width:5rem}}.mytonswap-app .swap-card-container{display:flex;position:relative;flex-direction:column;align-items:center;gap:.75rem;margin-top:.875rem;border-radius:1rem;background:var(--light-shade-color);padding:.75rem;font-weight:500}.mytonswap-app .swap-card-container .line{position:absolute;top:50%;background:var(--background-color);width:100%;height:3px}.mytonswap-app .swap-card-container .change-direction-button{display:flex;position:relative;justify-content:center;align-items:center;z-index:1;transition:all .3s ease;border-radius:99999px;background:var(--change-direction-background-color);padding:.75rem 3.5rem;color:var(--change-direction-icon-color);font-size:var(--font-size-2xl)}.mytonswap-app .swap-card-container .change-direction-button:active{scale:.95}.mytonswap-app .swap-card-container .change-direction-button .rotate-90{transform:rotate(90deg)}.mytonswap-app .swap-card-container .change-direction-button:disabled{opacity:.5;cursor:not-allowed}@media screen and (min-width: 768px){.mytonswap-app .swap-card-container .line{height:5px}.mytonswap-app .swap-card-container .change-direction-button{padding:.75rem 3.75rem;font-size:var(--font-size-2xl)}}.mytonswap-app .details-key-value{display:flex;justify-content:space-between;align-items:center;font-weight:500;font-size:var(--font-size-sm);font-family:Inter,sans-serif}.mytonswap-app .details-key-value .details-key-value-value{color:var(--text-black-color)}.mytonswap-app .details-key-value .details-key-value-key{opacity:.6;color:var(--text-black-color)}@media screen and (min-width: 768px){.mytonswap-app .details-key-value{font-size:var(--font-size-sm)}}.mytonswap-app .detail-accordion-container{display:flex;flex-direction:column;align-items:center;margin-top:.75rem;border-radius:.75rem;background:var(--input-token-color);padding-right:.75rem;padding-left:.75rem;width:100%;min-height:3rem;color:var(--text-black-color)}.mytonswap-app .detail-accordion-container .detail-accordion{display:flex;justify-content:space-between;align-items:center;width:100%;min-height:3.25rem;font-weight:500;font-size:var(--font-size-sm)}.mytonswap-app .detail-accordion-container .detail-accordion .finding{display:flex;-moz-column-gap:.25rem;column-gap:.25rem;align-items:center}.mytonswap-app .detail-accordion-container .detail-accordion .icon{transition:all .2s ease-in-out;font-size:1.125rem}.mytonswap-app .detail-accordion-container .detail-accordion .icon.is-open{transform:rotate(180deg)}.mytonswap-app .detail-accordion-container .detail-accordion-content{display:flex;flex-direction:column;gap:.25rem;width:100%;overflow:hidden}.mytonswap-app .detail-accordion-container .detail-accordion-content .details-inner-container{display:flex;flex-direction:column;gap:.25rem;padding:.25rem .25rem 1rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .slippage-box{border-radius:.375rem;background:var(--slippage-box-color);padding:.25rem .5rem;color:var(--text-white-color)}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container{display:flex;justify-content:center;gap:.125rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container .dex{display:flex;justify-content:center;align-items:center;gap:.25rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container .dex .image{background-size:contain!important;width:.75rem;height:.75rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container .route-icon{font-size:var(--font-size-xs)}.mytonswap-app.rtl .detail-accordion-container .one-pay{direction:ltr}@media screen and (min-width: 768px){.mytonswap-app .detail-accordion-container{padding-right:1rem;padding-left:1rem;font-size:var(--font-size-sm)}.mytonswap-app .detail-accordion-container .detail-accordion{min-height:3.5rem;font-size:var(--font-size-sm)}.mytonswap-app .detail-accordion-container .detail-accordion .finding{-moz-column-gap:.5rem;column-gap:.5rem}.mytonswap-app .detail-accordion-container .detail-accordion-content{gap:.5rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .slippage-box{padding:.25rem .5rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container,.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container .dex{gap:.5rem}.mytonswap-app .detail-accordion-container .detail-accordion-content .route-container .dex .image{width:1rem;height:1rem}}.mytonswap-app .error-container{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%;color:var(--text-black-color)}.mytonswap-app .error-container .close-button{position:absolute;top:1rem;right:1rem;opacity:.7;cursor:pointer;font-size:1.25rem}.mytonswap-app .error-container .icon{color:#ffd000;font-size:4rem}.mytonswap-app .error-container .text{margin-top:1rem;padding-right:1.75rem;padding-left:1.75rem;text-align:center}.mytonswap-app .error-container .text .title{font-weight:700;font-size:1.25rem}.mytonswap-app .confirm-modal-container{display:flex;flex-direction:column;align-items:center;gap:.75rem;padding-top:.5rem;padding-bottom:.5rem;width:100%;height:100%}.mytonswap-app .confirm-modal-container .confirm-modal-header{display:flex;justify-content:space-between;align-items:center;padding-right:1rem;padding-left:1rem;width:100%}.mytonswap-app .confirm-modal-container .confirm-modal-header .title{opacity:.5;color:var(--text-black-color);font-weight:700}.mytonswap-app .confirm-modal-container .confirm-modal-header .icon{cursor:pointer;color:var(--text-black-color);font-size:var(--font-size-xl)}.mytonswap-app .confirm-modal-container .confirm-modal-images{display:flex;align-items:center;padding-top:.25rem}.mytonswap-app .confirm-modal-container .confirm-modal-images .pay-image{transform:translate(.75rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .confirm-modal-container .confirm-modal-images .receive-image{transform:translate(-.2rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .confirm-modal-container .confirm-modal-change-rate{display:flex;flex-direction:column;align-items:center;opacity:.7;color:var(--text-black-color);font-weight:700;text-align:center}.mytonswap-app .confirm-modal-container .confirm-modal-change-rate .change-icon{transform:rotate(90deg);opacity:.6;font-size:.75rem}.mytonswap-app .confirm-modal-container .confirm-modal-change-rate .rate{opacity:.6;font-size:.75rem}.mytonswap-app .confirm-modal-container .confirm-modal-detail{display:flex;flex-grow:1;flex-direction:column;justify-content:center;gap:.75rem;margin-top:.125rem;padding-right:1rem;padding-left:1rem;width:100%;height:-moz-fit-content;height:fit-content;font-size:var(--font-size-lg)}.mytonswap-app .confirm-modal-container .confirm-modal-detail .min-receive{display:flex;gap:.25rem}.mytonswap-app .confirm-modal-container .confirm-modal-detail .best-route{display:flex;justify-content:center;align-items:center;gap:.25rem}.mytonswap-app .confirm-modal-container .confirm-modal-button-container{margin-top:.125rem;padding-right:1rem;padding-left:1rem;width:100%}.mytonswap-app .confirm-modal-container .confirm-modal-button-container .confirm-button{cursor:pointer;border-radius:.75rem;background-color:var(--primary-color);width:100%;height:3.25rem;color:var(--text-white-color);font-size:var(--font-size-base)}@media screen and (min-width: 768px){.mytonswap-app .confirm-modal-container .confirm-modal-header .title{font-size:1.25rem}.mytonswap-app .confirm-modal-container .confirm-modal-images .pay-image,.mytonswap-app .confirm-modal-container .confirm-modal-images .receive-image{width:4rem;height:4rem}.mytonswap-app .confirm-modal-container .confirm-modal-change-rate .change-icon,.mytonswap-app .confirm-modal-container .confirm-modal-change-rate .rate,.mytonswap-app .confirm-modal-container .confirm-modal-detail{font-size:1rem}.mytonswap-app .confirm-modal-container .confirm-modal-detail .min-receive,.mytonswap-app .confirm-modal-container .confirm-modal-detail .best-route{gap:.5rem}.mytonswap-app .confirm-modal-container .confirm-modal-button-container .confirm-button{height:3.25rem;font-size:var(--font-size-base)}}.mytonswap-app .waiting-for-wallet-container{display:flex;position:relative;flex-direction:column;justify-content:center;align-items:center;padding-right:1rem;padding-left:1rem;height:100%;color:var(--text-black-color)}.mytonswap-app .waiting-for-wallet-container .close-button{position:absolute;top:1rem;right:1rem;opacity:.7;cursor:pointer;font-size:1.25rem}.mytonswap-app .waiting-for-wallet-container .loading-icon-container{display:flex;justify-content:center;align-items:center;transform:scale(1.5);width:100%;font-size:1.875rem}.mytonswap-app .waiting-for-wallet-container .loading-icon-container .icon{opacity:.7}.mytonswap-app .waiting-for-wallet-container .loading-text{margin-top:1rem;font-weight:700;font-size:1.25rem;text-align:center}@media screen and (min-width: 768px){.mytonswap-app .waiting-for-wallet-container .loading-icon-container{font-size:var(--font-size-3xl)}.mytonswap-app .waiting-for-wallet-container .loading-text{font-size:var(--font-size-xl)}}.mytonswap-app .inprogress-container{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}.mytonswap-app .inprogress-container .close-button{position:absolute;top:1rem;right:1rem;opacity:.7;cursor:pointer;color:var(--text-black-color);font-size:1.25rem}.mytonswap-app .inprogress-container .inprogress-modal-images{display:flex;align-items:center;padding-top:.25rem}.mytonswap-app .inprogress-container .inprogress-modal-images .pay-image{transform:translate(.4rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .inprogress-container .inprogress-modal-images .receive-image{transform:translate(-.4rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .inprogress-container .inprogress-modal-change-rate{display:flex;flex-direction:column;align-items:center;opacity:.7;color:var(--text-black-color);font-weight:700;font-size:var(--font-size-lg);text-align:center}.mytonswap-app .inprogress-container .inprogress-modal-change-rate .change-icon{transform:rotate(90deg);opacity:.6;font-size:var(--font-size-sm)}.mytonswap-app .inprogress-container .inprogress-modal-change-rate .rate{opacity:.6;font-size:var(--font-size-sm)}.mytonswap-app .inprogress-container .description{margin-top:1rem;color:var(--text-black-color);font-weight:700;font-size:var(--font-size-xl);text-align:center}.mytonswap-app .inprogress-container .description-2{color:var(--text-black-color);font-size:var(--font-size-base)}.mytonswap-app .inprogress-container .loading-icon{display:flex;justify-content:center;align-items:center;margin-top:.25rem;width:100%;color:var(--text-black-color);font-size:1.875rem}.mytonswap-app .inprogress-container .loading-icon .icon{opacity:.5}@media screen and (min-width: 768px){.mytonswap-app .inprogress-container .inprogress-modal-images .pay-image,.mytonswap-app .inprogress-container .inprogress-modal-images .receive-image{width:2.5rem;height:2.5rem}.mytonswap-app .inprogress-container .inprogress-modal-change-rate .change-icon,.mytonswap-app .inprogress-container .inprogress-modal-change-rate .rate{font-size:.875rem}.mytonswap-app .inprogress-container .loading-icon{margin-top:1rem;font-size:2.5rem}}.mytonswap-app .done-container{display:flex;flex-direction:column;justify-content:center;align-items:center;height:100%}.mytonswap-app .done-container .close-icon{position:absolute;top:1rem;right:1rem;opacity:.7;cursor:pointer;color:var(--text-black-color);font-size:1.25rem}.mytonswap-app .done-container .done-icon{display:flex;justify-content:center;align-items:center;width:100%;color:var(--primary-color);font-size:5rem}.mytonswap-app .done-container .done-text{margin-bottom:2rem;color:var(--text-black-color);font-weight:700;font-size:1.25rem;text-align:center}.mytonswap-app .done-container .done-modal-images{display:flex;align-items:center;padding-top:.25rem}.mytonswap-app .done-container .done-modal-images .pay-image{transform:translate(.75rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .done-container .done-modal-images .receive-image{transform:translate(-.2rem);border-width:5px;border-style:solid;border-color:var(--modal-background-color);border-radius:9999px;background-size:contain!important;width:4rem;height:4rem}.mytonswap-app .done-container .done-modal-change-rate{display:flex;flex-direction:column;align-items:center;opacity:.7;color:var(--text-black-color);font-weight:700;text-align:center}.mytonswap-app .done-container .done-modal-change-rate .change-icon{transform:rotate(90deg);opacity:.6;font-size:.75rem}.mytonswap-app .done-container .done-modal-change-rate .rate{opacity:.6;font-size:.75rem}.mytonswap-app .loading-button{display:flex;justify-content:center;align-items:center;gap:.5rem}.mytonswap-app .modal-container{position:fixed;top:0;left:0;z-index:10000000000000000000000000;background-color:#0000001a;width:100%;height:100%;overflow:hidden}.mytonswap-app .modal-container .modal-container-inner{display:flex;position:fixed;bottom:0;left:0;flex-direction:column;justify-content:center;align-items:center;box-shadow:0 0 5px #0000000d;border-color:var(--border-color);border-top-right-radius:1rem;border-top-left-radius:1rem;background:var(--modal-background-color);padding:.5rem .25rem;width:100%;height:100%;max-height:26.875rem}@media (min-width: 768px){.mytonswap-app .modal-container .modal-container-inner{box-shadow:0 0 10px #0000000d;border-radius:.75rem;width:90%;max-width:28.125rem;height:100%;max-height:80%;max-height:30rem}}@media (min-width: 1024px){.mytonswap-app .modal-container .modal-container-inner{width:32.5rem;max-width:32.5rem}}.mytonswap-app .swap-button{margin-top:.75rem;border-radius:.75rem;background-color:var(--primary-color);width:100%;height:3.75rem;color:var(--text-white-color);font-size:var(--font-size-base)}.mytonswap-app .swap-button.price-impact{background:var(--price-impact-color)}.mytonswap-app .swap-button:disabled{opacity:.7}@media screen and (min-width: 768px){.mytonswap-app .swap-button{height:3.25rem;font-size:var(--font-size-md)}}@media screen and (min-width: 1024px){.mytonswap-app .swap-button{border-radius:1rem;height:3.5rem;font-size:var(--font-size-md)}}:root{--font-size-xxs: .625rem;--font-size-xs: .75rem;--font-size-sm: .875rem;--font-size-base: 1rem;--font-size-lg: 1.125rem;--font-size-xl: 1.25rem;--font-size-2xl: 1.5rem;--font-size-3xl: 1.875rem;--font-size-4xl: 2.25rem;--font-size-5xl: 3rem;--font-size-6xl: 4rem;--font-size-7xl: 5rem;--font-size-8xl: 6rem;--font-size-9xl: 7rem;--font-size-10xl: 8rem}.mytonswap-app{font-family:Plus Jakarta Sans,sans-serif}.mytonswap-app *{font-family:Plus Jakarta Sans,sans-serif!important;-webkit-tap-highlight-color:transparent}.mytonswap-app button{cursor:pointer;border:none;background-color:transparent;font-family:Inter,sans-serif}.mytonswap-app input{outline:none;border:none;background:none;width:100%}.mytonswap-app *{box-sizing:border-box;margin:0;padding:0}.mytonswap-app .animate-spin{animation:spin 1s linear infinite;color:var(--primary-color)}.mytonswap-app .animate-loading{animation:spin 1s linear infinite}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.mytonswap-app .line-clamp-1{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1;line-clamp:1}.mytonswap-app .container{border-width:1px;border-style:solid;border-color:var(--swap-container-border-color);border-radius:1rem;background:var(--swap-container-background-color);padding:.5rem;max-width:21.875rem;overflow:hidden}@media screen and (min-width: 768px){.mytonswap-app .container{padding:.75rem;width:28.125rem;max-width:28.125rem}}@media screen and (min-width: 1024px){.mytonswap-app .container{width:calc(34.375rem + 24px);max-width:calc(34.375rem + 24px)}}.mytonswap-app .text-provided{margin-top:.5rem;margin-bottom:.25rem;width:100%;color:var(--text-black-color);font-size:var(--font-size-xxs);text-align:center}.mytonswap-app .text-provided a{opacity:.7;color:inherit;text-decoration:none}.mytonswap-app.rtl{direction:rtl}.wallet-profile-mts{position:relative}.wallet-profile-mts .wallet-profile-button{cursor:pointer;border-color:var(--border-color);border-radius:9999999rem;background:var(--primary-color);padding:.5rem .75rem;color:var(--text-white-color);color:#fff;font-weight:500;font-size:.875rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.wallet-profile-mts .wallet-profile-button.connected{background:var(--light-shade-color);color:var(--text-black-color)}')),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})(); (function(Er,K){typeof exports=="object"&&typeof module<"u"?K(exports,require("react/jsx-runtime"),require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react/jsx-runtime","react","react-dom"],K):(Er=typeof globalThis<"u"?globalThis:Er||self,K(Er["MyTonSwap Widget"]={},Er["react/jsx-runtime"],Er.React,Er.ReactDOM))})(this,function(Er,K,xe,yA){"use strict";var wne=Object.defineProperty;var _ne=(Er,K,xe)=>K in Er?wne(Er,K,{enumerable:!0,configurable:!0,writable:!0,value:xe}):Er[K]=xe;var Lo=(Er,K,xe)=>_ne(Er,typeof K!="symbol"?K+"":K,xe);function bA(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const _n=bA(xe);function vA(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $v={exports:{}},rr=$v.exports={},lo,co;function Qg(){throw new Error("setTimeout has not been defined")}function Xg(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?lo=setTimeout:lo=Qg}catch{lo=Qg}try{typeof clearTimeout=="function"?co=clearTimeout:co=Xg}catch{co=Xg}})();function Lv(e){if(lo===setTimeout)return setTimeout(e,0);if((lo===Qg||!lo)&&setTimeout)return lo=setTimeout,setTimeout(e,0);try{return lo(e,0)}catch{try{return lo.call(null,e,0)}catch{return lo.call(this,e,0)}}}function wA(e){if(co===clearTimeout)return clearTimeout(e);if((co===Xg||!co)&&clearTimeout)return co=clearTimeout,clearTimeout(e);try{return co(e)}catch{try{return co.call(null,e)}catch{return co.call(this,e)}}}var Uo=[],Ml=!1,ma,lf=-1;function _A(){!Ml||!ma||(Ml=!1,ma.length?Uo=ma.concat(Uo):lf=-1,Uo.length&&Uv())}function Uv(){if(!Ml){var e=Lv(_A);Ml=!0;for(var t=Uo.length;t;){for(ma=Uo,Uo=[];++lf1)for(var n=1;n"u")return e;const t=new Map,n=(...r)=>(Nn.env.NODE_ENV!=="production"&&cf(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,i)=>i==="create"?e:(t.has(i)||t.set(i,e(i)),t.get(i))})}function Yc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const e0=e=>Array.isArray(e);function jv(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function t0(e,t,n,r){if(typeof t=="function"){const[i,o]=Fv(r);t=t(n!==void 0?n:e.custom,i,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[i,o]=Fv(r);t=t(n!==void 0?n:e.custom,i,o)}return t}function uf(e,t,n){const r=e.getProps();return t0(r,t,n!==void 0?n:r.custom,e)}const n0=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],r0=["initial",...n0],Qc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],_s=new Set(Qc),uo=e=>e*1e3,Do=e=>e/1e3,SA={type:"spring",stiffness:500,damping:25,restSpeed:10},kA=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),AA={type:"keyframes",duration:.8},EA={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},TA=(e,{keyframes:t})=>t.length>2?AA:_s.has(e)?e.startsWith("scale")?kA(t[1]):SA:EA;function i0(e,t){return e[t]||e.default||e}const PA={skipAnimations:!1,useManualTiming:!1},BA=e=>e!==null;function df(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(BA),o=t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const Tr=e=>e;function IA(e){let t=new Set,n=new Set,r=!1,i=!1;const o=new WeakSet;let s={delta:0,timestamp:0,isProcessing:!1};function a(d){o.has(d)&&(c.schedule(d),e()),d(s)}const c={schedule:(d,f=!1,p=!1)=>{const b=p&&r?t:n;return f&&o.add(d),b.has(d)||b.add(d),d},cancel:d=>{n.delete(d),o.delete(d)},process:d=>{if(s=d,r){i=!0;return}r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,i&&(i=!1,c.process(d))}};return c}const ff=["read","resolveKeyframes","update","preRender","render","postRender"],MA=40;function zv(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=ff.reduce((I,B)=>(I[B]=IA(o),I),{}),{read:a,resolveKeyframes:c,update:d,preRender:f,render:p,postRender:g}=s,b=()=>{const I=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(I-i.timestamp,MA),1),i.timestamp=I,i.isProcessing=!0,a.process(i),c.process(i),d.process(i),f.process(i),p.process(i),g.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(b))},_=()=>{n=!0,r=!0,i.isProcessing||e(b)};return{schedule:ff.reduce((I,B)=>{const R=s[B];return I[B]=($,L=!1,U=!1)=>(n||_(),R.schedule($,L,U)),I},{}),cancel:I=>{for(let B=0;B(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,RA=1e-7,OA=12;function $A(e,t,n,r,i){let o,s,a=0;do s=t+(n-t)/2,o=Vv(s,r,i)-e,o>0?n=s:t=s;while(Math.abs(o)>RA&&++a$A(o,0,1,e,n);return o=>o===0||o===1?o:Vv(i(o),t,r)}const Wv=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hv=e=>t=>1-e(1-t),Kv=Xc(.33,1.53,.69,.99),s0=Hv(Kv),qv=Wv(s0),Zv=e=>(e*=2)<1?.5*s0(e):.5*(2-Math.pow(2,-10*(e-1))),a0=e=>1-Math.sin(Math.acos(e)),Gv=Hv(a0),Yv=Wv(a0),Jv=e=>/^0[^.\s]+$/u.test(e);function LA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Jv(e):!0}let Rl=Tr,jo=Tr;Nn.env.NODE_ENV!=="production"&&(Rl=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},jo=(e,t)=>{if(!e)throw new Error(t)});const Qv=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Xv=e=>t=>typeof t=="string"&&t.startsWith(e),ew=Xv("--"),UA=Xv("var(--"),l0=e=>UA(e)?NA.test(e.split("/*")[0].trim()):!1,NA=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,DA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function jA(e){const t=DA.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${n??r}`,i]}const FA=4;function tw(e,t,n=1){jo(n<=FA,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=jA(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const s=o.trim();return Qv(s)?parseFloat(s):s}return l0(i)?tw(i,t,n+1):i}const Cs=(e,t,n)=>n>t?t:ntypeof e=="number",parse:parseFloat,transform:e=>e},eu={...Ol,transform:e=>Cs(0,1,e)},hf={...Ol,default:1},tu=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Ss=tu("deg"),fo=tu("%"),Ot=tu("px"),zA=tu("vh"),VA=tu("vw"),nw={...fo,parse:e=>fo.parse(e)/100,transform:e=>fo.transform(e*100)},WA=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),rw=e=>e===Ol||e===Ot,iw=(e,t)=>parseFloat(e.split(", ")[t]),ow=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return iw(i[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?iw(o[1],e):0}},HA=new Set(["x","y","z"]),KA=Qc.filter(e=>!HA.has(e));function qA(e){const t=[];return KA.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const $l={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ow(4,13),y:ow(5,14)};$l.translateX=$l.x,$l.translateY=$l.y;const sw=e=>t=>t.test(e),aw=[Ol,Ot,fo,Ss,VA,zA,{test:e=>e==="auto",parse:e=>e}],lw=e=>aw.find(sw(e)),ya=new Set;let c0=!1,u0=!1;function cw(){if(u0){const e=Array.from(ya).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const i=qA(r);i.length&&(n.set(r,i),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const i=n.get(r);i&&i.forEach(([o,s])=>{var a;(a=r.getValue(o))===null||a===void 0||a.set(s)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}u0=!1,c0=!1,ya.forEach(e=>e.complete()),ya.clear()}function uw(){ya.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(u0=!0)})}function ZA(){uw(),cw()}class d0{constructor(t,n,r,i,o,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=i,this.element=o,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ya.add(this),c0||(c0=!0,Tn.read(uw),Tn.resolveKeyframes(cw))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:i}=this;for(let o=0;oMath.round(e*1e5)/1e5,f0=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function GA(e){return e==null}const YA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,h0=(e,t)=>n=>!!(typeof n=="string"&&YA.test(n)&&n.startsWith(e)||t&&!GA(n)&&Object.prototype.hasOwnProperty.call(n,t)),dw=(e,t,n)=>r=>{if(typeof r!="string")return r;const[i,o,s,a]=r.match(f0);return{[e]:parseFloat(i),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},JA=e=>Cs(0,255,e),p0={...Ol,transform:e=>Math.round(JA(e))},ba={test:h0("rgb","red"),parse:dw("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+p0.transform(e)+", "+p0.transform(t)+", "+p0.transform(n)+", "+nu(eu.transform(r))+")"};function QA(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}const g0={test:h0("#"),parse:QA,transform:ba.transform},Ll={test:h0("hsl","hue"),parse:dw("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+fo.transform(nu(t))+", "+fo.transform(nu(n))+", "+nu(eu.transform(r))+")"},$r={test:e=>ba.test(e)||g0.test(e)||Ll.test(e),parse:e=>ba.test(e)?ba.parse(e):Ll.test(e)?Ll.parse(e):g0.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ba.transform(e):Ll.transform(e)},XA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function eE(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(f0))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(XA))===null||n===void 0?void 0:n.length)||0)>0}const fw="number",hw="color",tE="var",nE="var(",pw="${}",rE=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ru(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let o=0;const a=t.replace(rE,c=>($r.test(c)?(r.color.push(o),i.push(hw),n.push($r.parse(c))):c.startsWith(nE)?(r.var.push(o),i.push(tE),n.push(c)):(r.number.push(o),i.push(fw),n.push(parseFloat(c))),++o,pw)).split(pw);return{values:n,split:a,indexes:r,types:i}}function gw(e){return ru(e).values}function mw(e){const{split:t,types:n}=ru(e),r=t.length;return i=>{let o="";for(let s=0;stypeof e=="number"?0:e;function oE(e){const t=gw(e);return mw(e)(t.map(iE))}const ks={test:eE,parse:gw,createTransformer:mw,getAnimatableNone:oE},sE=new Set(["brightness","contrast","saturate","opacity"]);function aE(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(f0)||[];if(!r)return e;const i=n.replace(r,"");let o=sE.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+i+")"}const lE=/\b([a-z-]*)\(.*?\)/gu,m0={...ks,getAnimatableNone:e=>{const t=e.match(lE);return t?t.map(aE).join(" "):e}},cE={borderWidth:Ot,borderTopWidth:Ot,borderRightWidth:Ot,borderBottomWidth:Ot,borderLeftWidth:Ot,borderRadius:Ot,radius:Ot,borderTopLeftRadius:Ot,borderTopRightRadius:Ot,borderBottomRightRadius:Ot,borderBottomLeftRadius:Ot,width:Ot,maxWidth:Ot,height:Ot,maxHeight:Ot,top:Ot,right:Ot,bottom:Ot,left:Ot,padding:Ot,paddingTop:Ot,paddingRight:Ot,paddingBottom:Ot,paddingLeft:Ot,margin:Ot,marginTop:Ot,marginRight:Ot,marginBottom:Ot,marginLeft:Ot,backgroundPositionX:Ot,backgroundPositionY:Ot},uE={rotate:Ss,rotateX:Ss,rotateY:Ss,rotateZ:Ss,scale:hf,scaleX:hf,scaleY:hf,scaleZ:hf,skew:Ss,skewX:Ss,skewY:Ss,distance:Ot,translateX:Ot,translateY:Ot,translateZ:Ot,x:Ot,y:Ot,z:Ot,perspective:Ot,transformPerspective:Ot,opacity:eu,originX:nw,originY:nw,originZ:Ot},yw={...Ol,transform:Math.round},y0={...cE,...uE,zIndex:yw,size:Ot,fillOpacity:eu,strokeOpacity:eu,numOctaves:yw},dE={...y0,color:$r,backgroundColor:$r,outlineColor:$r,fill:$r,stroke:$r,borderColor:$r,borderTopColor:$r,borderRightColor:$r,borderBottomColor:$r,borderLeftColor:$r,filter:m0,WebkitFilter:m0},b0=e=>dE[e];function bw(e,t){let n=b0(e);return n!==m0&&(n=ks),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const fE=new Set(["auto","none","0"]);function hE(e,t,n){let r=0,i;for(;r{n.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function v0(e){return typeof e=="function"}let pf;function pE(){pf=void 0}const ho={now:()=>(pf===void 0&&ho.set(Pr.isProcessing||PA.useManualTiming?Pr.timestamp:performance.now()),pf),set:e=>{pf=e,queueMicrotask(pE)}},ww=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ks.test(e)||e==="0")&&!e.startsWith("url("));function gE(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nyE?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&ZA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ho.now(),this.hasAttemptedResolve=!0;const{name:r,type:i,velocity:o,delay:s,onComplete:a,onUpdate:c,isGenerator:d}=this.options;if(!d&&!mE(t,r,i,o))if(s)this.options.duration=0;else{c==null||c(df(t,this.options,n)),a==null||a(),this.resolveFinishedPromise();return}const f=this.initPlayback(t,n);f!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...f},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function xw(e,t){return t?e*(1e3/t):0}const bE=5;function Cw(e,t,n){const r=Math.max(t-bE,0);return xw(n-e(r),t-r)}const w0=.001,vE=.01,Sw=10,wE=.05,_E=1;function xE({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,o;Rl(e<=uo(Sw),"Spring duration must be 10 seconds or less");let s=1-t;s=Cs(wE,_E,s),e=Cs(vE,Sw,Do(e)),s<1?(i=d=>{const f=d*s,p=f*e,g=f-n,b=_0(d,s),_=Math.exp(-p);return w0-g/b*_},o=d=>{const p=d*s*e,g=p*n+n,b=Math.pow(s,2)*Math.pow(d,2)*e,_=Math.exp(-p),S=_0(Math.pow(d,2),s);return(-i(d)+w0>0?-1:1)*((g-b)*_)/S}):(i=d=>{const f=Math.exp(-d*e),p=(d-n)*e+1;return-w0+f*p},o=d=>{const f=Math.exp(-d*e),p=(n-d)*(e*e);return f*p});const a=5/e,c=SE(i,o,a);if(e=uo(e),isNaN(c))return{stiffness:100,damping:10,duration:e};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:s*2*Math.sqrt(r*d),duration:e}}}const CE=12;function SE(e,t,n){let r=n;for(let i=1;ie[n]!==void 0)}function EE(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!kw(e,AE)&&kw(e,kE)){const n=xE(e);t={...t,...n,mass:1},t.isResolvedFromDuration=!0}return t}function Aw({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],o=e[e.length-1],s={done:!1,value:i},{stiffness:a,damping:c,mass:d,duration:f,velocity:p,isResolvedFromDuration:g}=EE({...r,velocity:-Do(r.velocity||0)}),b=p||0,_=c/(2*Math.sqrt(a*d)),S=o-i,k=Do(Math.sqrt(a/d)),I=Math.abs(S)<5;n||(n=I?.01:2),t||(t=I?.005:.5);let B;if(_<1){const R=_0(k,_);B=$=>{const L=Math.exp(-_*k*$);return o-L*((b+_*k*S)/R*Math.sin(R*$)+S*Math.cos(R*$))}}else if(_===1)B=R=>o-Math.exp(-k*R)*(S+(b+k*S)*R);else{const R=k*Math.sqrt(_*_-1);B=$=>{const L=Math.exp(-_*k*$),U=Math.min(R*$,300);return o-L*((b+_*k*S)*Math.sinh(U)+R*S*Math.cosh(U))/R}}return{calculatedDuration:g&&f||null,next:R=>{const $=B(R);if(g)s.done=R>=f;else{let L=0;_<1&&(L=R===0?uo(b):Cw(B,R,$));const U=Math.abs(L)<=n,G=Math.abs(o-$)<=t;s.done=U&&G}return s.value=s.done?o:$,s}}}function Ew({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:c,restDelta:d=.5,restSpeed:f}){const p=e[0],g={done:!1,value:p},b=X=>a!==void 0&&Xc,_=X=>a===void 0?c:c===void 0||Math.abs(a-X)-S*Math.exp(-X/r),R=X=>I+B(X),$=X=>{const J=B(X),me=R(X);g.done=Math.abs(J)<=d,g.value=g.done?I:me};let L,U;const G=X=>{b(g.value)&&(L=X,U=Aw({keyframes:[g.value,_(g.value)],velocity:Cw(R,X,g.value),damping:i,stiffness:o,restDelta:d,restSpeed:f}))};return G(0),{calculatedDuration:null,next:X=>{let J=!1;return!U&&L===void 0&&(J=!0,$(X),G(X)),L!==void 0&&X>=L?U.next(X-L):(!J&&$(X),g)}}}const TE=Xc(.42,0,1,1),PE=Xc(0,0,.58,1),Tw=Xc(.42,0,.58,1),BE=e=>Array.isArray(e)&&typeof e[0]!="number",x0=e=>Array.isArray(e)&&typeof e[0]=="number",Pw={linear:Tr,easeIn:TE,easeInOut:Tw,easeOut:PE,circIn:a0,circInOut:Yv,circOut:Gv,backIn:s0,backInOut:qv,backOut:Kv,anticipate:Zv},Bw=e=>{if(x0(e)){jo(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return Xc(t,n,r,i)}else if(typeof e=="string")return jo(Pw[e]!==void 0,`Invalid easing type '${e}'`),Pw[e];return e},IE=(e,t)=>n=>t(e(n)),Fo=(...e)=>e.reduce(IE),Ul=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},Yn=(e,t,n)=>e+(t-e)*n;function C0(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ME({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,o=0,s=0;if(!t)i=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;i=C0(c,a,e+1/3),o=C0(c,a,e),s=C0(c,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:r}}function gf(e,t){return n=>n>0?t:e}const S0=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},RE=[g0,ba,Ll],OE=e=>RE.find(t=>t.test(e));function Iw(e){const t=OE(e);if(Rl(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===Ll&&(n=ME(n)),n}const Mw=(e,t)=>{const n=Iw(e),r=Iw(t);if(!n||!r)return gf(e,t);const i={...n};return o=>(i.red=S0(n.red,r.red,o),i.green=S0(n.green,r.green,o),i.blue=S0(n.blue,r.blue,o),i.alpha=Yn(n.alpha,r.alpha,o),ba.transform(i))},k0=new Set(["none","hidden"]);function $E(e,t){return k0.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function LE(e,t){return n=>Yn(e,t,n)}function A0(e){return typeof e=="number"?LE:typeof e=="string"?l0(e)?gf:$r.test(e)?Mw:DE:Array.isArray(e)?Rw:typeof e=="object"?$r.test(e)?Mw:UE:gf}function Rw(e,t){const n=[...e],r=n.length,i=e.map((o,s)=>A0(o)(o,t[s]));return o=>{for(let s=0;s{for(const o in r)n[o]=r[o](i);return n}}function NE(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let o=0;o{const n=ks.createTransformer(t),r=ru(e),i=ru(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?k0.has(e)&&!i.values.length||k0.has(t)&&!r.values.length?$E(e,t):Fo(Rw(NE(r,i),i.values),n):(Rl(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),gf(e,t))};function Ow(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Yn(e,t,n):A0(e)(e,t)}function jE(e,t,n){const r=[],i=n||Ow,o=e.length-1;for(let s=0;st[0];if(o===2&&e[0]===e[1])return()=>t[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=jE(t,r,i),a=s.length,c=d=>{let f=0;if(a>1)for(;fc(Cs(e[0],e[o-1],d)):c}function zE(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=Ul(0,t,r);e.push(Yn(n,1,i))}}function VE(e){const t=[0];return zE(t,e.length-1),t}function WE(e,t){return e.map(n=>n*t)}function HE(e,t){return e.map(()=>t||Tw).splice(0,e.length-1)}function mf({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const i=BE(r)?r.map(Bw):Bw(r),o={done:!1,value:t[0]},s=WE(n&&n.length===t.length?n:VE(t),e),a=FE(s,t,{ease:Array.isArray(i)?i:HE(t,i)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const $w=2e4;function KE(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<$w;)t+=n,r=e.next(t);return t>=$w?1/0:t}const qE=e=>{const t=({timestamp:n})=>e(n);return{start:()=>Tn.update(t,!0),stop:()=>xs(t),now:()=>Pr.isProcessing?Pr.timestamp:ho.now()}},ZE={decay:Ew,inertia:Ew,tween:mf,keyframes:mf,spring:Aw},GE=e=>e/100;class E0 extends _w{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:i,keyframes:o}=this.options,s=(i==null?void 0:i.KeyframeResolver)||d0,a=(c,d)=>this.onKeyframesResolved(c,d);this.resolver=new s(o,a,n,r,i),this.resolver.scheduleResolve()}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:o,velocity:s=0}=this.options,a=v0(n)?n:ZE[n]||mf;let c,d;a!==mf&&typeof t[0]!="number"&&(Nn.env.NODE_ENV!=="production"&&jo(t.length===2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),c=Fo(GE,Ow(t[0],t[1])),t=[0,100]);const f=a({...this.options,keyframes:t});o==="mirror"&&(d=a({...this.options,keyframes:[...t].reverse(),velocity:-s})),f.calculatedDuration===null&&(f.calculatedDuration=KE(f));const{calculatedDuration:p}=f,g=p+i,b=g*(r+1)-i;return{generator:f,mirroredGenerator:d,mapPercentToKeyframes:c,calculatedDuration:p,resolvedDuration:g,totalDuration:b}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:X}=this.options;return{done:!0,value:X[X.length-1]}}const{finalKeyframe:i,generator:o,mirroredGenerator:s,mapPercentToKeyframes:a,keyframes:c,calculatedDuration:d,totalDuration:f,resolvedDuration:p}=r;if(this.startTime===null)return o.next(0);const{delay:g,repeat:b,repeatType:_,repeatDelay:S,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-f/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const I=this.currentTime-g*(this.speed>=0?1:-1),B=this.speed>=0?I<0:I>f;this.currentTime=Math.max(I,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=f);let R=this.currentTime,$=o;if(b){const X=Math.min(this.currentTime,f)/p;let J=Math.floor(X),me=X%1;!me&&X>=1&&(me=1),me===1&&J--,J=Math.min(J,b+1),!!(J%2)&&(_==="reverse"?(me=1-me,S&&(me-=S/p)):_==="mirror"&&($=s)),R=Cs(0,1,me)*p}const L=B?{done:!1,value:c[0]}:$.next(R);a&&(L.value=a(L.value));let{done:U}=L;!B&&d!==null&&(U=this.speed>=0?this.currentTime>=f:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&U);return G&&i!==void 0&&(L.value=df(c,this.options,i)),k&&k(L.value),G&&this.finish(),L}get duration(){const{resolved:t}=this;return t?Do(t.calculatedDuration):0}get time(){return Do(this.currentTime)}set time(t){t=uo(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Do(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=qE,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Lw=new Set(["opacity","clipPath","filter","transform"]),YE=10,JE=(e,t)=>{let n="";const r=Math.max(Math.round(t/YE),2);for(let i=0;i(t===void 0&&(t=e()),t)}const QE={linearEasing:void 0};function XE(e,t){const n=T0(e);return()=>{var r;return(r=QE[t])!==null&&r!==void 0?r:n()}}const yf=XE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Uw(e){return!!(typeof e=="function"&&yf()||!e||typeof e=="string"&&(e in P0||yf())||x0(e)||Array.isArray(e)&&e.every(Uw))}const iu=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,P0={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:iu([0,.65,.55,1]),circOut:iu([.55,0,1,.45]),backIn:iu([.31,.01,.66,-.59]),backOut:iu([.33,1.53,.69,.99])};function Nw(e,t){if(e)return typeof e=="function"&&yf()?JE(e,t):x0(e)?iu(e):Array.isArray(e)?e.map(n=>Nw(n,t)||P0.easeOut):P0[e]}function e7(e,t,n,{delay:r=0,duration:i=300,repeat:o=0,repeatType:s="loop",ease:a,times:c}={}){const d={[t]:n};c&&(d.offset=c);const f=Nw(a,i);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:r,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"})}function Dw(e,t){e.timeline=t,e.onfinish=null}const t7=T0(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),bf=10,n7=2e4;function r7(e){return v0(e.type)||e.type==="spring"||!Uw(e.ease)}function i7(e,t){const n=new E0({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let o=0;for(;!r.done&&othis.onKeyframesResolved(s,a),n,r,i),this.resolver.scheduleResolve()}initPlayback(t,n){var r;let{duration:i=300,times:o,ease:s,type:a,motionValue:c,name:d,startTime:f}=this.options;if(!(!((r=c.owner)===null||r===void 0)&&r.current))return!1;if(typeof s=="string"&&yf()&&o7(s)&&(s=jw[s]),r7(this.options)){const{onComplete:g,onUpdate:b,motionValue:_,element:S,...k}=this.options,I=i7(t,k);t=I.keyframes,t.length===1&&(t[1]=t[0]),i=I.duration,o=I.times,s=I.ease,a="keyframes"}const p=e7(c.owner.current,d,t,{...this.options,duration:i,times:o,ease:s});return p.startTime=f??this.calcStartTime(),this.pendingTimeline?(Dw(p,this.pendingTimeline),this.pendingTimeline=void 0):p.onfinish=()=>{const{onComplete:g}=this.options;c.set(df(t,this.options,n)),g&&g(),this.cancel(),this.resolveFinishedPromise()},{animation:p,duration:i,times:o,type:a,ease:s,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Do(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Do(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=uo(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Tr;const{animation:r}=n;Dw(r,t)}return Tr}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:i,type:o,ease:s,times:a}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:d,onUpdate:f,onComplete:p,element:g,...b}=this.options,_=new E0({...b,keyframes:r,duration:i,type:o,ease:s,times:a,isGenerator:!0}),S=uo(this.time);d.setWithVelocity(_.sample(S-bf).value,_.sample(S).value,bf)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:i,repeatType:o,damping:s,type:a}=t;return t7()&&r&&Lw.has(r)&&n&&n.owner&&n.owner.current instanceof HTMLElement&&!n.owner.getProps().onUpdate&&!i&&o!=="mirror"&&s!==0&&a!=="inertia"}}const s7=T0(()=>window.ScrollTimeline!==void 0);class a7{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,n){return Promise.all(this.animations).then(t).catch(n)}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;rs7()&&i.attachTimeline?i.attachTimeline(t):n(i));return()=>{r.forEach((i,o)=>{i&&i(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;nn[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}function l7({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:o,repeatType:s,repeatDelay:a,from:c,elapsed:d,...f}){return!!Object.keys(f).length}const B0=(e,t,n,r={},i,o)=>s=>{const a=i0(r,e)||{},c=a.delay||r.delay||0;let{elapsed:d=0}=r;d=d-uo(c);let f={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-d,onUpdate:g=>{t.set(g),a.onUpdate&&a.onUpdate(g)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:i};l7(a)||(f={...f,...TA(e,f)}),f.duration&&(f.duration=uo(f.duration)),f.repeatDelay&&(f.repeatDelay=uo(f.repeatDelay)),f.from!==void 0&&(f.keyframes[0]=f.from);let p=!1;if((f.type===!1||f.duration===0&&!f.repeatDelay)&&(f.duration=0,f.delay===0&&(p=!0)),p&&!o&&t.get()!==void 0){const g=df(f.keyframes,a);if(g!==void 0)return Tn.update(()=>{f.onUpdate(g),f.onComplete()}),new a7([])}return!o&&Fw.supports(f)?new Fw(f):new E0(f)},c7=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),u7=e=>e0(e)?e[e.length-1]||0:e;function I0(e,t){e.indexOf(t)===-1&&e.push(t)}function M0(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class R0{constructor(){this.subscriptions=[]}add(t){return I0(this.subscriptions,t),()=>M0(this.subscriptions,t)}notify(t,n,r){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,n,r);else for(let o=0;o!isNaN(parseFloat(e));class f7{constructor(t,n={}){this.version="11.11.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,i=!0)=>{const o=ho.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ho.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=d7(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return Nn.env.NODE_ENV!=="production"&&cf(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new R0);const r=this.events[t].add(n);return t==="change"?()=>{r(),Tn.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ho.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>zw)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,zw);return xw(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ou(e,t){return new f7(e,t)}function h7(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ou(n))}function p7(e,t){const n=uf(e,t);let{transitionEnd:r={},transition:i={},...o}=n||{};o={...o,...r};for(const s in o){const a=u7(o[s]);h7(e,s,a)}}const vf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Vw="data-"+vf("framerAppearId");function Ww(e){return e.props[Vw]}const Lr=e=>!!(e&&e.getVelocity);function g7(e){return!!(Lr(e)&&e.add)}function Hw(e){if(_s.has(e))return"transform";if(Lw.has(e))return vf(e)}function O0(e,t){var n;if(!e.applyWillChange)return;const r=e.getValue("willChange");if(g7(r))return r.add(t);!(!((n=e.props.style)===null||n===void 0)&&n.willChange)&&Hw(t)&&e.setStaticValue("willChange","transform")}function m7({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Kw(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var o;let{transition:s=e.getDefaultTransition(),transitionEnd:a,...c}=t;r&&(s=r);const d=[],f=i&&e.animationState&&e.animationState.getState()[i];for(const p in c){const g=e.getValue(p,(o=e.latestValues[p])!==null&&o!==void 0?o:null),b=c[p];if(b===void 0||f&&m7(f,p))continue;const _={delay:n,...i0(s||{},p)};let S=!1;if(window.MotionHandoffAnimation){const I=Ww(e);if(I){const B=window.MotionHandoffAnimation(I,p,Tn);B!==null&&(_.startTime=B,S=!0)}}O0(e,p),g.start(B0(p,g,b,e.shouldReduceMotion&&_s.has(p)?{type:!1}:_,e,S));const k=g.animation;k&&d.push(k)}return a&&Promise.all(d).then(()=>{Tn.update(()=>{a&&p7(e,a)})}),d}function $0(e,t,n={}){var r;const i=uf(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(o=n.transitionOverride);const s=i?()=>Promise.all(Kw(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(d=0)=>{const{delayChildren:f=0,staggerChildren:p,staggerDirection:g}=o;return y7(e,t,f+d,p,g,n)}:()=>Promise.resolve(),{when:c}=o;if(c){const[d,f]=c==="beforeChildren"?[s,a]:[a,s];return d().then(()=>f())}else return Promise.all([s(),a(n.delay)])}function y7(e,t,n=0,r=0,i=1,o){const s=[],a=(e.variantChildren.size-1)*r,c=i===1?(d=0)=>d*r:(d=0)=>a-d*r;return Array.from(e.variantChildren).sort(b7).forEach((d,f)=>{d.notify("AnimationStart",t),s.push($0(d,t,{...o,delay:n+c(f)}).then(()=>d.notify("AnimationComplete",t)))}),Promise.all(s)}function b7(e,t){return e.sortNodePosition(t)}function v7(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const i=t.map(o=>$0(e,o,n));r=Promise.all(i)}else if(typeof t=="string")r=$0(e,t,n);else{const i=typeof t=="function"?uf(e,t,n.custom):t;r=Promise.all(Kw(e,i,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const w7=r0.length;function qw(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?qw(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>v7(e,n,r)))}function S7(e){let t=C7(e),n=Zw(),r=!0;const i=c=>(d,f)=>{var p;const g=uf(e,f,c==="exit"?(p=e.presenceContext)===null||p===void 0?void 0:p.custom:void 0);if(g){const{transition:b,transitionEnd:_,...S}=g;d={...d,...S,..._}}return d};function o(c){t=c(e)}function s(c){const{props:d}=e,f=qw(e.parent)||{},p=[],g=new Set;let b={},_=1/0;for(let k=0;k_&&$,J=!1;const me=Array.isArray(R)?R:[R];let oe=me.reduce(i(I),{});L===!1&&(oe={});const{prevResolvedValues:Q={}}=B,re={...Q,...oe},Z=Se=>{X=!0,g.has(Se)&&(J=!0,g.delete(Se)),B.needsAnimating[Se]=!0;const Te=e.getValue(Se);Te&&(Te.liveStyle=!1)};for(const Se in re){const Te=oe[Se],le=Q[Se];if(b.hasOwnProperty(Se))continue;let tt=!1;e0(Te)&&e0(le)?tt=!jv(Te,le):tt=Te!==le,tt?Te!=null?Z(Se):g.add(Se):Te!==void 0&&g.has(Se)?Z(Se):B.protectedKeys[Se]=!0}B.prevProp=R,B.prevResolvedValues=oe,B.isActive&&(b={...b,...oe}),r&&e.blockInitialAnimation&&(X=!1),X&&(!(U&&G)||J)&&p.push(...me.map(Se=>({animation:Se,options:{type:I}})))}if(g.size){const k={};g.forEach(I=>{const B=e.getBaseTarget(I),R=e.getValue(I);R&&(R.liveStyle=!0),k[I]=B??null}),p.push({animation:k})}let S=!!p.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(S=!1),r=!1,S?t(p):Promise.resolve()}function a(c,d){var f;if(n[c].isActive===d)return Promise.resolve();(f=e.variantChildren)===null||f===void 0||f.forEach(g=>{var b;return(b=g.animationState)===null||b===void 0?void 0:b.setActive(c,d)}),n[c].isActive=d;const p=s(c);for(const g in n)n[g].protectedKeys={};return p}return{animateChanges:s,setActive:a,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Zw(),r=!0}}}function k7(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!jv(t,e):!1}function va(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Zw(){return{animate:va(!0),whileInView:va(),whileHover:va(),whileTap:va(),whileDrag:va(),whileFocus:va(),exit:va()}}class As{constructor(t){this.isMounted=!1,this.node=t}update(){}}class A7 extends As{constructor(t){super(t),t.animationState||(t.animationState=S7(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let E7=0;class T7 extends As{constructor(){super(...arguments),this.id=E7++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const i=this.node.animationState.setActive("exit",!t);n&&!t&&i.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const P7={animation:{Feature:A7},exit:{Feature:T7}},Gw=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function wf(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const B7=e=>t=>Gw(t)&&e(t,wf(t));function zo(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Vo(e,t,n,r){return zo(e,t,B7(n),r)}const Yw=(e,t)=>Math.abs(e-t);function I7(e,t){const n=Yw(e.x,t.x),r=Yw(e.y,t.y);return Math.sqrt(n**2+r**2)}class Jw{constructor(t,n,{transformPagePoint:r,contextWindow:i,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=U0(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,b=I7(p.offset,{x:0,y:0})>=3;if(!g&&!b)return;const{point:_}=p,{timestamp:S}=Pr;this.history.push({..._,timestamp:S});const{onStart:k,onMove:I}=this.handlers;g||(k&&k(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),I&&I(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=L0(g,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:b,onSessionEnd:_,resumeAnimation:S}=this.handlers;if(this.dragSnapToOrigin&&S&&S(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=U0(p.type==="pointercancel"?this.lastMoveEventInfo:L0(g,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,k),_&&_(p,k)},!Gw(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=i||window;const s=wf(t),a=L0(s,this.transformPagePoint),{point:c}=a,{timestamp:d}=Pr;this.history=[{...c,timestamp:d}];const{onSessionStart:f}=n;f&&f(t,U0(a,this.history)),this.removeListeners=Fo(Vo(this.contextWindow,"pointermove",this.handlePointerMove),Vo(this.contextWindow,"pointerup",this.handlePointerUp),Vo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),xs(this.updatePoint)}}function L0(e,t){return t?{point:t(e.point)}:e}function Qw(e,t){return{x:e.x-t.x,y:e.y-t.y}}function U0({point:e},t){return{point:e,delta:Qw(e,Xw(t)),offset:Qw(e,M7(t)),velocity:R7(t,.1)}}function M7(e){return e[0]}function Xw(e){return e[e.length-1]}function R7(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=Xw(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>uo(t)));)n--;if(!r)return{x:0,y:0};const o=Do(i.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const s={x:(i.x-r.x)/o,y:(i.y-r.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function e2(e){let t=null;return()=>{const n=()=>{t=null};return t===null?(t=e,n):!1}}const t2=e2("dragHorizontal"),n2=e2("dragVertical");function r2(e){let t=!1;if(e==="y")t=n2();else if(e==="x")t=t2();else{const n=t2(),r=n2();n&&r?t=()=>{n(),r()}:(n&&n(),r&&r())}return t}function i2(){const e=r2(!0);return e?(e(),!1):!0}function Nl(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}const o2=1e-4,O7=1-o2,$7=1+o2,s2=.01,L7=0-s2,U7=0+s2;function pi(e){return e.max-e.min}function N7(e,t,n){return Math.abs(e-t)<=n}function a2(e,t,n,r=.5){e.origin=r,e.originPoint=Yn(t.min,t.max,e.origin),e.scale=pi(n)/pi(t),e.translate=Yn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=O7&&e.scale<=$7||isNaN(e.scale))&&(e.scale=1),(e.translate>=L7&&e.translate<=U7||isNaN(e.translate))&&(e.translate=0)}function su(e,t,n,r){a2(e.x,t.x,n.x,r?r.originX:void 0),a2(e.y,t.y,n.y,r?r.originY:void 0)}function l2(e,t,n){e.min=n.min+t.min,e.max=e.min+pi(t)}function D7(e,t,n){l2(e.x,t.x,n.x),l2(e.y,t.y,n.y)}function c2(e,t,n){e.min=t.min-n.min,e.max=e.min+pi(t)}function au(e,t,n){c2(e.x,t.x,n.x),c2(e.y,t.y,n.y)}function j7(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?Yn(n,e,r.max):Math.min(e,n)),e}function u2(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function F7(e,{top:t,left:n,bottom:r,right:i}){return{x:u2(e.x,n,i),y:u2(e.y,t,r)}}function d2(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Ul(t.min,t.max-r,e.min):r>i&&(n=Ul(e.min,e.max-i,t.min)),Cs(0,1,n)}function W7(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const N0=.35;function H7(e=N0){return e===!1?e=0:e===!0&&(e=N0),{x:f2(e,"left","right"),y:f2(e,"top","bottom")}}function f2(e,t,n){return{min:h2(e,t),max:h2(e,n)}}function h2(e,t){return typeof e=="number"?e:e[t]||0}const p2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dl=()=>({x:p2(),y:p2()}),g2=()=>({min:0,max:0}),ir=()=>({x:g2(),y:g2()});function Bi(e){return[e("x"),e("y")]}function m2({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function K7({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function q7(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function D0(e){return e===void 0||e===1}function j0({scale:e,scaleX:t,scaleY:n}){return!D0(e)||!D0(t)||!D0(n)}function wa(e){return j0(e)||y2(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function y2(e){return b2(e.x)||b2(e.y)}function b2(e){return e&&e!=="0%"}function _f(e,t,n){const r=e-n,i=t*r;return n+i}function v2(e,t,n,r,i){return i!==void 0&&(e=_f(e,i,r)),_f(e,n,r)+t}function F0(e,t=0,n=1,r,i){e.min=v2(e.min,t,n,r,i),e.max=v2(e.max,t,n,r,i)}function w2(e,{x:t,y:n}){F0(e.x,t.translate,t.scale,t.originPoint),F0(e.y,n.translate,n.scale,n.originPoint)}const _2=.999999999999,x2=1.0000000000001;function Z7(e,t,n,r=!1){const i=n.length;if(!i)return;t.x=t.y=1;let o,s;for(let a=0;a_2&&(t.x=1),t.y_2&&(t.y=1)}function jl(e,t){e.min=e.min+t,e.max=e.max+t}function C2(e,t,n,r,i=.5){const o=Yn(e.min,e.max,i);F0(e,t,n,o,r)}function Fl(e,t){C2(e.x,t.x,t.scaleX,t.scale,t.originX),C2(e.y,t.y,t.scaleY,t.scale,t.originY)}function S2(e,t){return m2(q7(e.getBoundingClientRect(),t))}function G7(e,t,n){const r=S2(e,n),{scroll:i}=t;return i&&(jl(r.x,i.offset.x),jl(r.y,i.offset.y)),r}const k2=({current:e})=>e?e.ownerDocument.defaultView:null,Y7=new WeakMap;class J7{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ir(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const i=f=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(wf(f,"page").point)},o=(f,p)=>{const{drag:g,dragPropagation:b,onDragStart:_}=this.getProps();if(g&&!b&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=r2(g),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Bi(k=>{let I=this.getAxisMotionValue(k).get()||0;if(fo.test(I)){const{projection:B}=this.visualElement;if(B&&B.layout){const R=B.layout.layoutBox[k];R&&(I=pi(R)*(parseFloat(I)/100))}}this.originPoint[k]=I}),_&&Tn.postRender(()=>_(f,p)),O0(this.visualElement,"transform");const{animationState:S}=this.visualElement;S&&S.setActive("whileDrag",!0)},s=(f,p)=>{const{dragPropagation:g,dragDirectionLock:b,onDirectionLock:_,onDrag:S}=this.getProps();if(!g&&!this.openGlobalLock)return;const{offset:k}=p;if(b&&this.currentDirection===null){this.currentDirection=Q7(k),this.currentDirection!==null&&_&&_(this.currentDirection);return}this.updateAxis("x",p.point,k),this.updateAxis("y",p.point,k),this.visualElement.render(),S&&S(f,p)},a=(f,p)=>this.stop(f,p),c=()=>Bi(f=>{var p;return this.getAnimationState(f)==="paused"&&((p=this.getAxisMotionValue(f).animation)===null||p===void 0?void 0:p.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new Jw(t,{onSessionStart:i,onStart:o,onMove:s,onSessionEnd:a,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:k2(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&Tn.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:i}=this.getProps();if(!r||!xf(t,i,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(s=j7(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Nl(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&i?this.constraints=F7(i.layoutBox,n):this.constraints=!1,this.elastic=H7(r),o!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&Bi(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=W7(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Nl(t))return!1;const r=t.current;jo(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=G7(r,i.root,this.visualElement.getTransformPagePoint());let s=z7(i.layout.layoutBox,o);if(n){const a=n(K7(s));this.hasMutatedConstraints=!!a,a&&(s=m2(a))}return s}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:i,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},d=Bi(f=>{if(!xf(f,n,this.currentDirection))return;let p=c&&c[f]||{};s&&(p={min:0,max:0});const g=i?200:1e6,b=i?40:1e7,_={type:"inertia",velocity:r?t[f]:0,bounceStiffness:g,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...p};return this.startAxisValueAnimation(f,_)});return Promise.all(d).then(a)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return O0(this.visualElement,t),r.start(B0(t,r,0,n,this.visualElement,!1))}stopAnimation(){Bi(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Bi(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),i=r[n];return i||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Bi(n=>{const{drag:r}=this.getProps();if(!xf(n,r,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:s,max:a}=i.layout.layoutBox[n];o.set(t[n]-Yn(s,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Nl(n)||!r||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};Bi(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();i[s]=V7({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Bi(s=>{if(!xf(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:d}=this.constraints[s];a.set(Yn(c,d,i[s]))})}addListeners(){if(!this.visualElement.current)return;Y7.set(this.visualElement,this);const t=this.visualElement.current,n=Vo(t,"pointerdown",c=>{const{drag:d,dragListener:f=!0}=this.getProps();d&&f&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();Nl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Tn.read(r);const s=zo(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Bi(f=>{const p=this.getAxisMotionValue(f);p&&(this.originPoint[f]+=c[f].translate,p.set(p.get()+c[f].translate))}),this.visualElement.render())});return()=>{s(),n(),o(),a&&a()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:s=N0,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:i,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function xf(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function Q7(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class X7 extends As{constructor(t){super(t),this.removeGroupControls=Tr,this.removeListeners=Tr,this.controls=new J7(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tr}unmount(){this.removeGroupControls(),this.removeListeners()}}const A2=e=>(t,n)=>{e&&Tn.postRender(()=>e(t,n))};class eT extends As{constructor(){super(...arguments),this.removePointerDownListener=Tr}onPointerDown(t){this.session=new Jw(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:k2(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:i}=this.node.getProps();return{onSessionStart:A2(t),onStart:A2(n),onMove:r,onEnd:(o,s)=>{delete this.session,i&&Tn.postRender(()=>i(o,s))}}}mount(){this.removePointerDownListener=Vo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Cf=xe.createContext(null);function tT(){const e=xe.useContext(Cf);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,i=xe.useId();xe.useEffect(()=>r(i),[]);const o=xe.useCallback(()=>n&&n(i),[i,n]);return!t&&n?[!1,o]:[!0]}const z0=xe.createContext({}),E2=xe.createContext({}),Sf={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function T2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const lu={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Ot.test(e))e=parseFloat(e);else return e;const n=T2(e,t.target.x),r=T2(e,t.target.y);return`${n}% ${r}%`}},nT={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=ks.parse(e);if(i.length>5)return r;const o=ks.createTransformer(e),s=typeof i[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;i[0+s]/=a,i[1+s]/=c;const d=Yn(a,c,.5);return typeof i[2+s]=="number"&&(i[2+s]/=d),typeof i[3+s]=="number"&&(i[3+s]/=d),o(i)}},kf={};function rT(e){Object.assign(kf,e)}const{schedule:V0,cancel:Sne}=zv(queueMicrotask,!1);class iT extends xe.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:i}=this.props,{projection:o}=t;rT(oT),o&&(n.group&&n.group.add(o),r&&r.register&&i&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Sf.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:i,isPresent:o}=this.props,s=r.projection;return s&&(s.isPresent=o,i||t.layoutDependency!==n||n===void 0?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Tn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),V0.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),r&&r.deregister&&r.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function P2(e){const[t,n]=tT(),r=xe.useContext(z0);return K.jsx(iT,{...e,layoutGroup:r,switchLayoutGroup:xe.useContext(E2),isPresent:t,safeToRemove:n})}const oT={borderRadius:{...lu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:lu,borderTopRightRadius:lu,borderBottomLeftRadius:lu,borderBottomRightRadius:lu,boxShadow:nT},B2=["TopLeft","TopRight","BottomLeft","BottomRight"],sT=B2.length,I2=e=>typeof e=="string"?parseFloat(e):e,M2=e=>typeof e=="number"||Ot.test(e);function aT(e,t,n,r,i,o){i?(e.opacity=Yn(0,n.opacity!==void 0?n.opacity:1,lT(r)),e.opacityExit=Yn(t.opacity!==void 0?t.opacity:1,0,cT(r))):o&&(e.opacity=Yn(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let s=0;srt?1:n(Ul(e,t,r))}function $2(e,t){e.min=t.min,e.max=t.max}function Ii(e,t){$2(e.x,t.x),$2(e.y,t.y)}function L2(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function U2(e,t,n,r,i){return e-=t,e=_f(e,1/n,r),i!==void 0&&(e=_f(e,1/i,r)),e}function uT(e,t=0,n=1,r=.5,i,o=e,s=e){if(fo.test(t)&&(t=parseFloat(t),t=Yn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Yn(o.min,o.max,r);e===o&&(a-=t),e.min=U2(e.min,t,n,a,i),e.max=U2(e.max,t,n,a,i)}function N2(e,t,[n,r,i],o,s){uT(e,t[n],t[r],t[i],t.scale,o,s)}const dT=["x","scaleX","originX"],fT=["y","scaleY","originY"];function D2(e,t,n,r){N2(e.x,t,dT,n?n.x:void 0,r?r.x:void 0),N2(e.y,t,fT,n?n.y:void 0,r?r.y:void 0)}function j2(e){return e.translate===0&&e.scale===1}function F2(e){return j2(e.x)&&j2(e.y)}function z2(e,t){return e.min===t.min&&e.max===t.max}function hT(e,t){return z2(e.x,t.x)&&z2(e.y,t.y)}function V2(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function W2(e,t){return V2(e.x,t.x)&&V2(e.y,t.y)}function H2(e){return pi(e.x)/pi(e.y)}function K2(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class pT{constructor(){this.members=[]}add(t){I0(this.members,t),t.scheduleRender()}remove(t){if(M0(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(i=>t===i);if(n===0)return!1;let r;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;i===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function gT(e,t,n){let r="";const i=e.x.translate/t.x,o=e.y.translate/t.y,s=(n==null?void 0:n.z)||0;if((i||o||s)&&(r=`translate3d(${i}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:d,rotate:f,rotateX:p,rotateY:g,skewX:b,skewY:_}=n;d&&(r=`perspective(${d}px) ${r}`),f&&(r+=`rotate(${f}deg) `),p&&(r+=`rotateX(${p}deg) `),g&&(r+=`rotateY(${g}deg) `),b&&(r+=`skewX(${b}deg) `),_&&(r+=`skewY(${_}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(r+=`scale(${a}, ${c})`),r||"none"}const mT=(e,t)=>e.depth-t.depth;class yT{constructor(){this.children=[],this.isDirty=!1}add(t){I0(this.children,t),this.isDirty=!0}remove(t){M0(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mT),this.isDirty=!1,this.children.forEach(t)}}function Af(e){const t=Lr(e)?e.get():e;return c7(t)?t.toValue():t}function bT(e,t){const n=ho.now(),r=({timestamp:i})=>{const o=i-n;o>=t&&(xs(r),e(o-t))};return Tn.read(r,!0),()=>xs(r)}function vT(e){return e instanceof SVGElement&&e.tagName!=="svg"}function wT(e,t,n){const r=Lr(e)?e:ou(e);return r.start(B0("",r,t,n)),r.animation}const _a={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},cu=typeof window<"u"&&window.MotionDebug!==void 0,W0=["","X","Y","Z"],_T={visibility:"hidden"},q2=1e3;let xT=0;function H0(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Z2(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ww(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:i,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Tn,!(i||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Z2(r)}function G2({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(s={},a=t==null?void 0:t()){this.id=xT++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,cu&&(_a.totalNodes=_a.resolvedTargetDeltas=_a.recalculatedProjection=0),this.nodes.forEach(kT),this.nodes.forEach(BT),this.nodes.forEach(IT),this.nodes.forEach(AT),cu&&window.MotionDebug.record(_a)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;cthis.root.updateBlockedByResize=!1;e(s,()=>{this.root.updateBlockedByResize=!0,p&&p(),p=bT(g,250),Sf.hasAnimatedSinceResize&&(Sf.hasAnimatedSinceResize=!1,this.nodes.forEach(J2))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&f&&(c||d)&&this.addEventListener("didUpdate",({delta:p,hasLayoutChanged:g,hasRelativeTargetChanged:b,layout:_})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const S=this.options.transition||f.getDefaultTransition()||LT,{onLayoutAnimationStart:k,onLayoutAnimationComplete:I}=f.getProps(),B=!this.targetLayout||!W2(this.targetLayout,_)||b,R=!g&&b;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||R||g&&(B||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(p,R);const $={...i0(S,"layout"),onPlay:k,onComplete:I};(f.shouldReduceMotion||this.options.layoutRoot)&&($.delay=0,$.type=!1),this.startAnimation($)}else g||J2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=_})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,xs(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(MT),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Z2(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let f=0;f{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c{const L=$/1e3;Q2(p.x,s.x,L),Q2(p.y,s.y,L),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(au(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),OT(this.relativeTarget,this.relativeTargetOrigin,g,L),R&&hT(this.relativeTarget,R)&&(this.isProjectionDirty=!1),R||(R=ir()),Ii(R,this.relativeTarget)),S&&(this.animationValues=f,aT(f,d,this.latestValues,L,B,I)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(xs(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tn.update(()=>{Sf.hasAnimatedSinceResize=!0,this.currentAnimation=wT(0,q2,{...s,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(q2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:c,layout:d,latestValues:f}=s;if(!(!a||!c||!d)){if(this!==s&&this.layout&&d&&r4(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||ir();const p=pi(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+p;const g=pi(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+g}Ii(a,c),Fl(a,f),su(this.projectionDeltaWithTransform,this.layoutCorrected,a,f)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new pT),this.sharedNodes.get(s).add(a);const d=a.options.initialPromotionConfig;a.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){var s;const{layoutId:a}=this.options;return a?((s=this.getStack())===null||s===void 0?void 0:s.lead)||this:this}getPrevLead(){var s;const{layoutId:a}=this.options;return a?(s=this.getStack())===null||s===void 0?void 0:s.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const d={};c.z&&H0("z",s,d,this.animationValues);for(let f=0;f{var a;return(a=s.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(Y2),this.root.sharedNodes.clear()}}}function CT(e){e.updateLayout()}function ST(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:i}=e.layout,{animationType:o}=e.options,s=n.source!==e.layout.source;o==="size"?Bi(p=>{const g=s?n.measuredBox[p]:n.layoutBox[p],b=pi(g);g.min=r[p].min,g.max=g.min+b}):r4(o,n.layoutBox,r)&&Bi(p=>{const g=s?n.measuredBox[p]:n.layoutBox[p],b=pi(r[p]);g.max=g.min+b,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[p].max=e.relativeTarget[p].min+b)});const a=Dl();su(a,r,n.layoutBox);const c=Dl();s?su(c,e.applyTransform(i,!0),n.measuredBox):su(c,r,n.layoutBox);const d=!F2(a);let f=!1;if(!e.resumeFrom){const p=e.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:b}=p;if(g&&b){const _=ir();au(_,n.layoutBox,g.layoutBox);const S=ir();au(S,r,b.layoutBox),W2(_,S)||(f=!0),p.options.layoutRoot&&(e.relativeTarget=S,e.relativeTargetOrigin=_,e.relativeParent=p)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:d,hasRelativeTargetChanged:f})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function kT(e){cu&&_a.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function AT(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ET(e){e.clearSnapshot()}function Y2(e){e.clearMeasurements()}function TT(e){e.isLayoutDirty=!1}function PT(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function J2(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function BT(e){e.resolveTargetDelta()}function IT(e){e.calcProjection()}function MT(e){e.resetSkewAndRotation()}function RT(e){e.removeLeadSnapshot()}function Q2(e,t,n){e.translate=Yn(t.translate,0,n),e.scale=Yn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function X2(e,t,n,r){e.min=Yn(t.min,n.min,r),e.max=Yn(t.max,n.max,r)}function OT(e,t,n,r){X2(e.x,t.x,n.x,r),X2(e.y,t.y,n.y,r)}function $T(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const LT={duration:.45,ease:[.4,0,.1,1]},e4=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),t4=e4("applewebkit/")&&!e4("chrome/")?Math.round:Tr;function n4(e){e.min=t4(e.min),e.max=t4(e.max)}function UT(e){n4(e.x),n4(e.y)}function r4(e,t,n){return e==="position"||e==="preserve-aspect"&&!N7(H2(t),H2(n),.2)}function NT(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const DT=G2({attachResizeListener:(e,t)=>zo(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),K0={current:void 0},i4=G2({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!K0.current){const e=new DT({});e.mount(window),e.setOptions({layoutScroll:!0}),K0.current=e}return K0.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),jT={pan:{Feature:eT},drag:{Feature:X7,ProjectionNode:i4,MeasureLayout:P2}};function o4(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd",i=(o,s)=>{if(o.pointerType==="touch"||i2())return;const a=e.getProps();e.animationState&&a.whileHover&&e.animationState.setActive("whileHover",t);const c=a[r];c&&Tn.postRender(()=>c(o,s))};return Vo(e.current,n,i,{passive:!e.getProps()[r]})}class FT extends As{mount(){this.unmount=Fo(o4(this.node,!0),o4(this.node,!1))}unmount(){}}class zT extends As{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Fo(zo(this.node.current,"focus",()=>this.onFocus()),zo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const s4=(e,t)=>t?e===t?!0:s4(e,t.parentElement):!1;function q0(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,wf(n))}class VT extends As{constructor(){super(...arguments),this.removeStartListeners=Tr,this.removeEndListeners=Tr,this.removeAccessibleListeners=Tr,this.startPointerPress=(t,n)=>{if(this.isPressing)return;this.removeEndListeners();const r=this.node.getProps(),o=Vo(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:d,onTapCancel:f,globalTapTarget:p}=this.node.getProps(),g=!p&&!s4(this.node.current,a.target)?f:d;g&&Tn.update(()=>g(a,c))},{passive:!(r.onTap||r.onPointerUp)}),s=Vo(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=Fo(o,s),this.startPress(t,n)},this.startAccessiblePress=()=>{const t=o=>{if(o.key!=="Enter"||this.isPressing)return;const s=a=>{a.key!=="Enter"||!this.checkPressEnd()||q0("up",(c,d)=>{const{onTap:f}=this.node.getProps();f&&Tn.postRender(()=>f(c,d))})};this.removeEndListeners(),this.removeEndListeners=zo(this.node.current,"keyup",s),q0("down",(a,c)=>{this.startPress(a,c)})},n=zo(this.node.current,"keydown",t),r=()=>{this.isPressing&&q0("cancel",(o,s)=>this.cancelPress(o,s))},i=zo(this.node.current,"blur",r);this.removeAccessibleListeners=Fo(n,i)}}startPress(t,n){this.isPressing=!0;const{onTapStart:r,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&Tn.postRender(()=>r(t,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!i2()}cancelPress(t,n){if(!this.checkPressEnd())return;const{onTapCancel:r}=this.node.getProps();r&&Tn.postRender(()=>r(t,n))}mount(){const t=this.node.getProps(),n=Vo(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),r=zo(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=Fo(n,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const Z0=new WeakMap,G0=new WeakMap,WT=e=>{const t=Z0.get(e.target);t&&t(e)},HT=e=>{e.forEach(WT)};function KT({root:e,...t}){const n=e||document;G0.has(n)||G0.set(n,{});const r=G0.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(HT,{root:e,...t})),r[i]}function qT(e,t,n){const r=KT(t);return Z0.set(e,n),r.observe(e),()=>{Z0.delete(e),r.unobserve(e)}}const ZT={some:0,all:1};class GT extends As{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:i="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:r,threshold:typeof i=="number"?i:ZT[i]},a=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,o&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:f,onViewportLeave:p}=this.node.getProps(),g=d?f:p;g&&g(c)};return qT(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(YT(t,n))&&this.startObserver()}unmount(){}}function YT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const JT={inView:{Feature:GT},tap:{Feature:VT},focus:{Feature:zT},hover:{Feature:FT}},QT={layout:{ProjectionNode:i4,MeasureLayout:P2}},Y0=xe.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),Ef=xe.createContext({}),J0=typeof window<"u",a4=J0?xe.useLayoutEffect:xe.useEffect,l4=xe.createContext({strict:!1});function XT(e,t,n,r,i){var o,s;const{visualElement:a}=xe.useContext(Ef),c=xe.useContext(l4),d=xe.useContext(Cf),f=xe.useContext(Y0).reducedMotion,p=xe.useRef();r=r||c.renderer,!p.current&&r&&(p.current=r(e,{visualState:t,parent:a,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:f}));const g=p.current,b=xe.useContext(E2);g&&!g.projection&&i&&(g.type==="html"||g.type==="svg")&&eP(p.current,n,i,b),xe.useInsertionEffect(()=>{g&&g.update(n,d)});const _=n[Vw],S=xe.useRef(!!_&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,_))&&((s=window.MotionHasOptimisedAnimation)===null||s===void 0?void 0:s.call(window,_)));return a4(()=>{g&&(window.MotionIsMounted=!0,g.updateFeatures(),V0.render(g.render),S.current&&g.animationState&&g.animationState.animateChanges())}),xe.useEffect(()=>{g&&(!S.current&&g.animationState&&g.animationState.animateChanges(),S.current&&(queueMicrotask(()=>{var k;(k=window.MotionHandoffMarkAsComplete)===null||k===void 0||k.call(window,_)}),S.current=!1))}),g}function eP(e,t,n,r){const{layoutId:i,layout:o,drag:s,dragConstraints:a,layoutScroll:c,layoutRoot:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:c4(e.parent)),e.projection.setOptions({layoutId:i,layout:o,alwaysMeasureLayout:!!s||a&&Nl(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:c,layoutRoot:d})}function c4(e){if(e)return e.options.allowProjection!==!1?e.projection:c4(e.parent)}function tP(e,t,n){return xe.useCallback(r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Nl(n)&&(n.current=r))},[t])}function Tf(e){return Yc(e.animate)||r0.some(t=>Jc(e[t]))}function u4(e){return!!(Tf(e)||e.variants)}function nP(e,t){if(Tf(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Jc(n)?n:void 0,animate:Jc(r)?r:void 0}}return e.inherit!==!1?t:{}}function rP(e){const{initial:t,animate:n}=nP(e,xe.useContext(Ef));return xe.useMemo(()=>({initial:t,animate:n}),[d4(t),d4(n)])}function d4(e){return Array.isArray(e)?e.join(" "):e}const f4={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},zl={};for(const e in f4)zl[e]={isEnabled:t=>f4[e].some(n=>!!t[n])};function iP(e){for(const t in e)zl[t]={...zl[t],...e[t]}}const oP=Symbol.for("motionComponentSymbol");function sP({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:i}){e&&iP(e);function o(a,c){let d;const f={...xe.useContext(Y0),...a,layoutId:aP(a)},{isStatic:p}=f,g=rP(a),b=r(a,p);if(!p&&J0){lP(f,e);const _=cP(f);d=_.MeasureLayout,g.visualElement=XT(i,b,f,t,_.ProjectionNode)}return K.jsxs(Ef.Provider,{value:g,children:[d&&g.visualElement?K.jsx(d,{visualElement:g.visualElement,...f}):null,n(i,a,tP(b,g.visualElement,c),b,p,g.visualElement)]})}const s=xe.forwardRef(o);return s[oP]=i,s}function aP({layoutId:e}){const t=xe.useContext(z0).id;return t&&e!==void 0?t+"-"+e:e}function lP(e,t){const n=xe.useContext(l4).strict;if(Nn.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Rl(!1,r):jo(!1,r)}}function cP(e){const{drag:t,layout:n}=zl;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const uP=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Q0(e){return typeof e!="string"||e.includes("-")?!1:!!(uP.indexOf(e)>-1||/[A-Z]/u.test(e))}function h4(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const p4=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function g4(e,t,n,r){h4(e,t,void 0,r);for(const i in t.attrs)e.setAttribute(p4.has(i)?i:vf(i),t.attrs[i])}function m4(e,{layout:t,layoutId:n}){return _s.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!kf[e]||e==="opacity")}function X0(e,t,n){var r;const{style:i}=e,o={};for(const s in i)(Lr(i[s])||t.style&&Lr(t.style[s])||m4(s,e)||((r=n==null?void 0:n.getValue(s))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[s]=i[s]);return n&&i&&typeof i.willChange=="string"&&(n.applyWillChange=!1),o}function y4(e,t,n){const r=X0(e,t,n);for(const i in e)if(Lr(e[i])||Lr(t[i])){const o=Qc.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;r[o]=e[i]}return r}function em(e){const t=xe.useRef(null);return t.current===null&&(t.current=e()),t.current}function dP({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,o,s,a){const c={latestValues:fP(i,o,s,a?!1:e,t),renderState:n()};return r&&(c.mount=d=>r(i,d,c)),c}const b4=e=>(t,n)=>{const r=xe.useContext(Ef),i=xe.useContext(Cf),o=()=>dP(e,t,r,i,n);return n?o():em(o)};function v4(e,t,n){const r=Array.isArray(t)?t:[t];for(let i=0;i{for(const I in S){let B=S[I];if(Array.isArray(B)){const R=b?B.length-1:0;B=B[R]}B!==null&&(s[I]=B)}for(const I in k)s[I]=k[I]}),a&&f&&d!==!1&&!Yc(f)&&v4(e,f,S=>{for(const k in S)if(Hw(k)){s.willChange="transform";return}}),s}const tm=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),w4=()=>({...tm(),attrs:{}}),_4=(e,t)=>t&&typeof e=="number"?t.transform(e):e,hP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pP=Qc.length;function gP(e,t,n){let r="",i=!0;for(let o=0;otypeof e=="string"&&e.toLowerCase()==="svg",wP={useVisualState:b4({scrapeMotionValuesFromProps:y4,createRenderState:w4,onMount:(e,t,{renderState:n,latestValues:r})=>{Tn.read(()=>{try{n.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),Tn.render(()=>{rm(n,r,im(t.tagName),e.transformTemplate),g4(t,n)})}})},_P={useVisualState:b4({applyWillChange:!0,scrapeMotionValuesFromProps:X0,createRenderState:tm})};function C4(e,t,n){for(const r in t)!Lr(t[r])&&!m4(r,n)&&(e[r]=t[r])}function xP({transformTemplate:e},t){return xe.useMemo(()=>{const n=tm();return nm(n,t,e),Object.assign({},n.vars,n.style)},[t])}function CP(e,t){const n=e.style||{},r={};return C4(r,n,e),Object.assign(r,xP(e,t)),r}function SP(e,t){const n={},r=CP(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const kP=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Pf(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||kP.has(e)}let S4=e=>!Pf(e);function AP(e){e&&(S4=t=>t.startsWith("on")?!Pf(t):e(t))}try{AP(require("@emotion/is-prop-valid").default)}catch{}function EP(e,t,n){const r={};for(const i in e)i==="values"&&typeof e.values=="object"||(S4(i)||n===!0&&Pf(i)||!t&&!Pf(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}function TP(e,t,n,r){const i=xe.useMemo(()=>{const o=w4();return rm(o,t,im(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};C4(o,e.style,e),i.style={...o,...i.style}}return i}function PP(e=!1){return(n,r,i,{latestValues:o},s)=>{const c=(Q0(n)?TP:SP)(r,o,s,n),d=EP(r,typeof n=="string",e),f=n!==xe.Fragment?{...d,...c,ref:i}:{},{children:p}=r,g=xe.useMemo(()=>Lr(p)?p.get():p,[p]);return xe.createElement(n,{...f,children:g})}}function BP(e,t){return function(r,{forwardMotionProps:i}={forwardMotionProps:!1}){const s={...Q0(r)?wP:_P,preloadedFeatures:e,useRender:PP(i),createVisualElement:t,Component:r};return sP(s)}}const om={current:null},k4={current:!1};function IP(){if(k4.current=!0,!!J0)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>om.current=e.matches;e.addListener(t),t()}else om.current=!1}function MP(e,t,n){for(const r in t){const i=t[r],o=n[r];if(Lr(i))e.addValue(r,i),Nn.env.NODE_ENV==="development"&&cf(i.version==="11.11.2",`Attempting to mix Framer Motion versions ${i.version} with 11.11.2 may not work as expected.`);else if(Lr(o))e.addValue(r,ou(i,{owner:e}));else if(o!==i)if(e.hasValue(r)){const s=e.getValue(r);s.liveStyle===!0?s.jump(i):s.hasAnimated||s.set(i)}else{const s=e.getStaticValue(r);e.addValue(r,ou(s!==void 0?s:i,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const A4=new WeakMap,RP=[...aw,$r,ks],OP=e=>RP.find(sw(e)),E4=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class $P{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:i,blockInitialAnimation:o,visualState:s},a={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=d0,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const g=ho.now();this.renderScheduledAtthis.bindToMotionValue(r,n)),k4.current||IP(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:om.current,Nn.env.NODE_ENV!=="production"&&cf(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){A4.delete(this.current),this.projection&&this.projection.unmount(),xs(this.notifyUpdate),xs(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=_s.has(t),i=n.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Tn.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{i(),o(),s&&s(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in zl){const n=zl[t];if(!n)continue;const{isEnabled:r,Feature:i}=n;if(!this.features[t]&&i&&r(this.props)&&(this.features[t]=new i(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ir()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ou(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Qv(i)||Jv(i))?i=parseFloat(i):!OP(i)&&ks.test(n)&&(i=bw(t,n)),this.setBaseTarget(t,Lr(i)?i.get():i)),Lr(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let i;if(typeof r=="string"||typeof r=="object"){const s=t0(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);s&&(i=s[t])}if(r&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Lr(o)?o:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new R0),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class T4 extends $P{constructor(){super(...arguments),this.KeyframeResolver=vw}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}}function LP(e){return window.getComputedStyle(e)}class UP extends T4{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=h4}readValueFromInstance(t,n){if(_s.has(n)){const r=b0(n);return r&&r.default||0}else{const r=LP(t),i=(ew(n)?r.getPropertyValue(n):r[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return S2(t,n)}build(t,n,r){nm(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return X0(t,n,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Lr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class NP extends T4{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ir}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(_s.has(n)){const r=b0(n);return r&&r.default||0}return n=p4.has(n)?n:vf(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return y4(t,n,r)}build(t,n,r){rm(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,i){g4(t,n,r,i)}mount(t){this.isSVGTag=im(t.tagName),super.mount(t)}}const DP=(e,t)=>Q0(e)?new NP(t):new UP(t,{allowProjection:e!==xe.Fragment}),jP=BP({...P7,...JT,...jT,...QT},DP),gi=CA(jP);class FP extends _n.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function zP({children:e,isPresent:t}){const n=xe.useId(),r=xe.useRef(null),i=xe.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=xe.useContext(Y0);return xe.useInsertionEffect(()=>{const{width:s,height:a,top:c,left:d}=i.current;if(t||!r.current||!s||!a)return;r.current.dataset.motionPopId=n;const f=document.createElement("style");return o&&(f.nonce=o),document.head.appendChild(f),f.sheet&&f.sheet.insertRule(` [data-motion-pop-id="${n}"] { position: absolute !important; width: ${s}px !important; height: ${a}px !important; top: ${c}px !important; left: ${d}px !important; } `),()=>{document.head.removeChild(f)}},[t]),K.jsx(FP,{isPresent:t,childRef:r,sizeRef:i,children:_n.cloneElement(e,{ref:r})})}const VP=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:o,mode:s})=>{const a=em(WP),c=xe.useId(),d=xe.useMemo(()=>({id:c,initial:t,isPresent:n,custom:i,onExitComplete:f=>{a.set(f,!0);for(const p of a.values())if(!p)return;r&&r()},register:f=>(a.set(f,!1),()=>a.delete(f))}),o?[Math.random()]:[n]);return xe.useMemo(()=>{a.forEach((f,p)=>a.set(p,!1))},[n]),_n.useEffect(()=>{!n&&!a.size&&r&&r()},[n]),s==="popLayout"&&(e=K.jsx(zP,{isPresent:n,children:e})),K.jsx(Cf.Provider,{value:d,children:e})};function WP(){return new Map}const Bf=e=>e.key||"";function P4(e){const t=[];return xe.Children.forEach(e,n=>{xe.isValidElement(n)&&t.push(n)}),t}const Vl=({children:e,exitBeforeEnter:t,custom:n,initial:r=!0,onExitComplete:i,presenceAffectsLayout:o=!0,mode:s="sync"})=>{jo(!t,"Replace exitBeforeEnter with mode='wait'");const a=xe.useMemo(()=>P4(e),[e]),c=a.map(Bf),d=xe.useRef(!0),f=xe.useRef(a),p=em(()=>new Map),[g,b]=xe.useState(a),[_,S]=xe.useState(a);a4(()=>{d.current=!1,f.current=a;for(let B=0;B<_.length;B++){const R=Bf(_[B]);c.includes(R)?p.delete(R):p.get(R)!==!0&&p.set(R,!1)}},[_,c.length,c.join("-")]);const k=[];if(a!==g){let B=[...a];for(let R=0;R<_.length;R++){const $=_[R],L=Bf($);c.includes(L)||(B.splice(R,0,$),k.push($))}s==="wait"&&k.length&&(B=k),S(P4(B)),b(a);return}Nn.env.NODE_ENV!=="production"&&s==="wait"&&_.length>1&&console.warn(`You're attempting to animate multiple children within AnimatePresence, but its mode is set to "wait". This will lead to odd visual behaviour.`);const{forceRender:I}=xe.useContext(z0);return K.jsx(K.Fragment,{children:_.map(B=>{const R=Bf(B),$=a===_||c.includes(R),L=()=>{if(p.has(R))p.set(R,!0);else return;let U=!0;p.forEach(G=>{G||(U=!1)}),U&&(I==null||I(),S(f.current),i&&i())};return K.jsx(VP,{isPresent:$,initial:!d.current||r?void 0:!1,custom:$?void 0:n,presenceAffectsLayout:o,mode:s,onExitComplete:$?void 0:L,children:B},R)})})},B4=e=>{let t;const n=new Set,r=(d,f)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const g=t;t=f??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(b=>b(t,g))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,a);return a},HP=e=>e?B4(e):B4,KP=e=>e;function qP(e,t=KP){const n=xe.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return xe.useDebugValue(n),n}const I4=e=>{const t=HP(e),n=r=>qP(t,r);return Object.assign(n,t),n},uu=e=>e?I4(e):I4;function ZP(e){return e||(e={}),{delay:e.delay===void 0?200:e.delay,initialDelay:e.initialDelay===void 0?0:e.initialDelay,minDelay:e.minDelay===void 0?0:e.minDelay,maxDelay:e.maxDelay===void 0?0:e.maxDelay,factor:e.factor===void 0?0:e.factor,maxAttempts:e.maxAttempts===void 0?3:e.maxAttempts,timeout:e.timeout===void 0?0:e.timeout,jitter:e.jitter===!0,initialJitter:e.initialJitter===!0,handleError:e.handleError===void 0?null:e.handleError,handleTimeout:e.handleTimeout===void 0?null:e.handleTimeout,beforeAttempt:e.beforeAttempt===void 0?null:e.beforeAttempt,calculateDelay:e.calculateDelay===void 0?null:e.calculateDelay}}async function sm(e){return new Promise(t=>setTimeout(t,e))}function GP(e,t){let n=t.delay;if(n===0)return 0;if(t.factor&&(n*=Math.pow(t.factor,e.attemptNum-1),t.maxDelay!==0&&(n=Math.min(n,t.maxDelay))),t.jitter){const r=Math.ceil(t.minDelay),i=Math.floor(n);n=Math.floor(Math.random()*(i-r+1))+r}return Math.round(n)}async function YP(e,t){const n=ZP(t);for(const a of["delay","initialDelay","minDelay","maxDelay","maxAttempts","timeout"]){const c=n[a];if(!Number.isInteger(c)||c<0)throw new Error(`Value for ${a} must be an integer greater than or equal to 0`)}if(n.factor.constructor!==Number||n.factor<0)throw new Error("Value for factor must be a number greater than or equal to 0");if(n.delay{if(n.handleError&&await n.handleError(c,r,n),r.aborted||r.attemptsRemaining===0)throw c;r.attemptNum++;const d=i(r,n);return d&&await sm(d),o()};return r.attemptsRemaining>0&&r.attemptsRemaining--,n.timeout?new Promise((c,d)=>{const f=setTimeout(()=>{if(n.handleTimeout)try{c(n.handleTimeout(r,n))}catch(p){d(p)}else{const p=new Error(`Retry timeout (attemptNum: ${r.attemptNum}, timeout: ${n.timeout})`);p.code="ATTEMPT_TIMEOUT",d(p)}},n.timeout);e(r,n).then(p=>{clearTimeout(f),c(p)}).catch(p=>{clearTimeout(f),a(p).then(c).catch(d)})}):e(r,n).catch(a)}const s=n.calculateDelay?n.calculateDelay(r,n):n.initialDelay;if(s&&await sm(s),r.attemptNum<1&&n.initialJitter){const a=i(r,n);a&&await sm(a)}return o()}const JP=globalThis||void 0||self;function M4(e,t){return function(){return e.apply(t,arguments)}}const{toString:QP}=Object.prototype,{getPrototypeOf:am}=Object,If=(e=>t=>{const n=QP.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Yi=e=>(e=e.toLowerCase(),t=>If(t)===e),Mf=e=>t=>typeof t===e,{isArray:Wl}=Array,du=Mf("undefined");function XP(e){return e!==null&&!du(e)&&e.constructor!==null&&!du(e.constructor)&&mi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const R4=Yi("ArrayBuffer");function eB(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&R4(e.buffer),t}const tB=Mf("string"),mi=Mf("function"),O4=Mf("number"),Rf=e=>e!==null&&typeof e=="object",nB=e=>e===!0||e===!1,Of=e=>{if(If(e)!=="object")return!1;const t=am(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},rB=Yi("Date"),iB=Yi("File"),oB=Yi("Blob"),sB=Yi("FileList"),aB=e=>Rf(e)&&mi(e.pipe),lB=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||mi(e.append)&&((t=If(e))==="formdata"||t==="object"&&mi(e.toString)&&e.toString()==="[object FormData]"))},cB=Yi("URLSearchParams"),[uB,dB,fB,hB]=["ReadableStream","Request","Response","Headers"].map(Yi),pB=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function fu(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Wl(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const xa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:JP,L4=e=>!du(e)&&e!==xa;function lm(){const{caseless:e}=L4(this)&&this||{},t={},n=(r,i)=>{const o=e&&$4(t,i)||i;Of(t[o])&&Of(r)?t[o]=lm(t[o],r):Of(r)?t[o]=lm({},r):Wl(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r(fu(t,(i,o)=>{n&&mi(i)?e[o]=M4(i,n):e[o]=i},{allOwnKeys:r}),e),mB=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),yB=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},bB=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&am(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},vB=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},wB=e=>{if(!e)return null;if(Wl(e))return e;let t=e.length;if(!O4(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},_B=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&am(Uint8Array)),xB=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},CB=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},SB=Yi("HTMLFormElement"),kB=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),U4=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),AB=Yi("RegExp"),N4=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};fu(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},EB=e=>{N4(e,(t,n)=>{if(mi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(mi(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},TB=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Wl(e)?r(e):r(String(e).split(t)),n},PB=()=>{},BB=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,cm="abcdefghijklmnopqrstuvwxyz",D4="0123456789",j4={DIGIT:D4,ALPHA:cm,ALPHA_DIGIT:cm+cm.toUpperCase()+D4},IB=(e=16,t=j4.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function MB(e){return!!(e&&mi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const RB=e=>{const t=new Array(10),n=(r,i)=>{if(Rf(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=Wl(r)?[]:{};return fu(r,(s,a)=>{const c=n(s,i+1);!du(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)},OB=Yi("AsyncFunction"),$B=e=>e&&(Rf(e)||mi(e))&&mi(e.then)&&mi(e.catch),F4=((e,t)=>e?setImmediate:t?((n,r)=>(xa.addEventListener("message",({source:i,data:o})=>{i===xa&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),xa.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",mi(xa.postMessage)),LB=typeof queueMicrotask<"u"?queueMicrotask.bind(xa):typeof Nn<"u"&&Nn.nextTick||F4,Ie={isArray:Wl,isArrayBuffer:R4,isBuffer:XP,isFormData:lB,isArrayBufferView:eB,isString:tB,isNumber:O4,isBoolean:nB,isObject:Rf,isPlainObject:Of,isReadableStream:uB,isRequest:dB,isResponse:fB,isHeaders:hB,isUndefined:du,isDate:rB,isFile:iB,isBlob:oB,isRegExp:AB,isFunction:mi,isStream:aB,isURLSearchParams:cB,isTypedArray:_B,isFileList:sB,forEach:fu,merge:lm,extend:gB,trim:pB,stripBOM:mB,inherits:yB,toFlatObject:bB,kindOf:If,kindOfTest:Yi,endsWith:vB,toArray:wB,forEachEntry:xB,matchAll:CB,isHTMLForm:SB,hasOwnProperty:U4,hasOwnProp:U4,reduceDescriptors:N4,freezeMethods:EB,toObjectSet:TB,toCamelCase:kB,noop:PB,toFiniteNumber:BB,findKey:$4,global:xa,isContextDefined:L4,ALPHABET:j4,generateString:IB,isSpecCompliantForm:MB,toJSONObject:RB,isAsyncFn:OB,isThenable:$B,setImmediate:F4,asap:LB};var z4={},$f={};$f.byteLength=DB,$f.toByteArray=FB,$f.fromByteArray=WB;for(var po=[],Mi=[],UB=typeof Uint8Array<"u"?Uint8Array:Array,um="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Hl=0,NB=um.length;Hl0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function DB(e){var t=V4(e),n=t[0],r=t[1];return(n+r)*3/4-r}function jB(e,t,n){return(t+n)*3/4-n}function FB(e){var t,n=V4(e),r=n[0],i=n[1],o=new UB(jB(e,r,i)),s=0,a=i>0?r-4:r,c;for(c=0;c>16&255,o[s++]=t>>8&255,o[s++]=t&255;return i===2&&(t=Mi[e.charCodeAt(c)]<<2|Mi[e.charCodeAt(c+1)]>>4,o[s++]=t&255),i===1&&(t=Mi[e.charCodeAt(c)]<<10|Mi[e.charCodeAt(c+1)]<<4|Mi[e.charCodeAt(c+2)]>>2,o[s++]=t>>8&255,o[s++]=t&255),o}function zB(e){return po[e>>18&63]+po[e>>12&63]+po[e>>6&63]+po[e&63]}function VB(e,t,n){for(var r,i=[],o=t;oa?a:s+o));return r===1?(t=e[n-1],i.push(po[t>>2]+po[t<<4&63]+"==")):r===2&&(t=(e[n-2]<<8)+e[n-1],i.push(po[t>>10]+po[t>>4&63]+po[t<<2&63]+"=")),i.join("")}var dm={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */dm.read=function(e,t,n,r,i){var o,s,a=i*8-r-1,c=(1<>1,f=-7,p=n?i-1:0,g=n?-1:1,b=e[t+p];for(p+=g,o=b&(1<<-f)-1,b>>=-f,f+=a;f>0;o=o*256+e[t+p],p+=g,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=s*256+e[t+p],p+=g,f-=8);if(o===0)o=1-d;else{if(o===c)return s?NaN:(b?-1:1)*(1/0);s=s+Math.pow(2,r),o=o-d}return(b?-1:1)*s*Math.pow(2,o-r)},dm.write=function(e,t,n,r,i,o){var s,a,c,d=o*8-i-1,f=(1<>1,g=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=r?0:o-1,_=r?1:-1,S=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+p>=1?t+=g/c:t+=g*Math.pow(2,1-p),t*c>=2&&(s++,c/=2),s+p>=f?(a=0,s=f):s+p>=1?(a=(t*c-1)*Math.pow(2,i),s=s+p):(a=t*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;e[n+b]=a&255,b+=_,a/=256,i-=8);for(s=s<0;e[n+b]=s&255,b+=_,s/=256,d-=8);e[n+b-_]|=S*128};/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */(function(e){const t=$f,n=dm,r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=f,e.SlowBuffer=L,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i;const{Uint8Array:o,ArrayBuffer:s,SharedArrayBuffer:a}=globalThis;f.TYPED_ARRAY_SUPPORT=c(),!f.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const x=new o(1),y={foo:function(){return 42}};return Object.setPrototypeOf(y,o.prototype),Object.setPrototypeOf(x,y),x.foo()===42}catch{return!1}}Object.defineProperty(f.prototype,"parent",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.buffer}}),Object.defineProperty(f.prototype,"offset",{enumerable:!0,get:function(){if(f.isBuffer(this))return this.byteOffset}});function d(x){if(x>i)throw new RangeError('The value "'+x+'" is invalid for option "size"');const y=new o(x);return Object.setPrototypeOf(y,f.prototype),y}function f(x,y,v){if(typeof x=="number"){if(typeof y=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(x)}return p(x,y,v)}f.poolSize=8192;function p(x,y,v){if(typeof x=="string")return S(x,y);if(s.isView(x))return I(x);if(x==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x);if(ue(x,s)||x&&ue(x.buffer,s)||typeof a<"u"&&(ue(x,a)||x&&ue(x.buffer,a)))return B(x,y,v);if(typeof x=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const M=x.valueOf&&x.valueOf();if(M!=null&&M!==x)return f.from(M,y,v);const Y=R(x);if(Y)return Y;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof x[Symbol.toPrimitive]=="function")return f.from(x[Symbol.toPrimitive]("string"),y,v);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof x)}f.from=function(x,y,v){return p(x,y,v)},Object.setPrototypeOf(f.prototype,o.prototype),Object.setPrototypeOf(f,o);function g(x){if(typeof x!="number")throw new TypeError('"size" argument must be of type number');if(x<0)throw new RangeError('The value "'+x+'" is invalid for option "size"')}function b(x,y,v){return g(x),x<=0?d(x):y!==void 0?typeof v=="string"?d(x).fill(y,v):d(x).fill(y):d(x)}f.alloc=function(x,y,v){return b(x,y,v)};function _(x){return g(x),d(x<0?0:$(x)|0)}f.allocUnsafe=function(x){return _(x)},f.allocUnsafeSlow=function(x){return _(x)};function S(x,y){if((typeof y!="string"||y==="")&&(y="utf8"),!f.isEncoding(y))throw new TypeError("Unknown encoding: "+y);const v=U(x,y)|0;let M=d(v);const Y=M.write(x,y);return Y!==v&&(M=M.slice(0,Y)),M}function k(x){const y=x.length<0?0:$(x.length)|0,v=d(y);for(let M=0;M=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return x|0}function L(x){return+x!=x&&(x=0),f.alloc(+x)}f.isBuffer=function(y){return y!=null&&y._isBuffer===!0&&y!==f.prototype},f.compare=function(y,v){if(ue(y,o)&&(y=f.from(y,y.offset,y.byteLength)),ue(v,o)&&(v=f.from(v,v.offset,v.byteLength)),!f.isBuffer(y)||!f.isBuffer(v))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(y===v)return 0;let M=y.length,Y=v.length;for(let de=0,fe=Math.min(M,Y);deY.length?(f.isBuffer(fe)||(fe=f.from(fe)),fe.copy(Y,de)):o.prototype.set.call(Y,fe,de);else if(f.isBuffer(fe))fe.copy(Y,de);else throw new TypeError('"list" argument must be an Array of Buffers');de+=fe.length}return Y};function U(x,y){if(f.isBuffer(x))return x.length;if(s.isView(x)||ue(x,s))return x.byteLength;if(typeof x!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof x);const v=x.length,M=arguments.length>2&&arguments[2]===!0;if(!M&&v===0)return 0;let Y=!1;for(;;)switch(y){case"ascii":case"latin1":case"binary":return v;case"utf8":case"utf-8":return Vt(x).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v*2;case"hex":return v>>>1;case"base64":return on(x).length;default:if(Y)return M?-1:Vt(x).length;y=(""+y).toLowerCase(),Y=!0}}f.byteLength=U;function G(x,y,v){let M=!1;if((y===void 0||y<0)&&(y=0),y>this.length||((v===void 0||v>this.length)&&(v=this.length),v<=0)||(v>>>=0,y>>>=0,v<=y))return"";for(x||(x="utf8");;)switch(x){case"hex":return Nt(this,y,v);case"utf8":case"utf-8":return Se(this,y,v);case"ascii":return tt(this,y,v);case"latin1":case"binary":return Ke(this,y,v);case"base64":return Ae(this,y,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return It(this,y,v);default:if(M)throw new TypeError("Unknown encoding: "+x);x=(x+"").toLowerCase(),M=!0}}f.prototype._isBuffer=!0;function X(x,y,v){const M=x[y];x[y]=x[v],x[v]=M}f.prototype.swap16=function(){const y=this.length;if(y%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let v=0;vv&&(y+=" ... "),""},r&&(f.prototype[r]=f.prototype.inspect),f.prototype.compare=function(y,v,M,Y,de){if(ue(y,o)&&(y=f.from(y,y.offset,y.byteLength)),!f.isBuffer(y))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof y);if(v===void 0&&(v=0),M===void 0&&(M=y?y.length:0),Y===void 0&&(Y=0),de===void 0&&(de=this.length),v<0||M>y.length||Y<0||de>this.length)throw new RangeError("out of range index");if(Y>=de&&v>=M)return 0;if(Y>=de)return-1;if(v>=M)return 1;if(v>>>=0,M>>>=0,Y>>>=0,de>>>=0,this===y)return 0;let fe=de-Y,De=M-v;const je=Math.min(fe,De),$e=this.slice(Y,de),gt=y.slice(v,M);for(let nt=0;nt2147483647?v=2147483647:v<-2147483648&&(v=-2147483648),v=+v,D(v)&&(v=Y?0:x.length-1),v<0&&(v=x.length+v),v>=x.length){if(Y)return-1;v=x.length-1}else if(v<0)if(Y)v=0;else return-1;if(typeof y=="string"&&(y=f.from(y,M)),f.isBuffer(y))return y.length===0?-1:me(x,y,v,M,Y);if(typeof y=="number")return y=y&255,typeof o.prototype.indexOf=="function"?Y?o.prototype.indexOf.call(x,y,v):o.prototype.lastIndexOf.call(x,y,v):me(x,[y],v,M,Y);throw new TypeError("val must be string, number or Buffer")}function me(x,y,v,M,Y){let de=1,fe=x.length,De=y.length;if(M!==void 0&&(M=String(M).toLowerCase(),M==="ucs2"||M==="ucs-2"||M==="utf16le"||M==="utf-16le")){if(x.length<2||y.length<2)return-1;de=2,fe/=2,De/=2,v/=2}function je(gt,nt){return de===1?gt[nt]:gt.readUInt16BE(nt*de)}let $e;if(Y){let gt=-1;for($e=v;$efe&&(v=fe-De),$e=v;$e>=0;$e--){let gt=!0;for(let nt=0;ntY&&(M=Y)):M=Y;const de=y.length;M>de/2&&(M=de/2);let fe;for(fe=0;fe>>0,isFinite(M)?(M=M>>>0,Y===void 0&&(Y="utf8")):(Y=M,M=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const de=this.length-v;if((M===void 0||M>de)&&(M=de),y.length>0&&(M<0||v<0)||v>this.length)throw new RangeError("Attempt to write outside buffer bounds");Y||(Y="utf8");let fe=!1;for(;;)switch(Y){case"hex":return oe(this,y,v,M);case"utf8":case"utf-8":return Q(this,y,v,M);case"ascii":case"latin1":case"binary":return re(this,y,v,M);case"base64":return Z(this,y,v,M);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return be(this,y,v,M);default:if(fe)throw new TypeError("Unknown encoding: "+Y);Y=(""+Y).toLowerCase(),fe=!0}},f.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ae(x,y,v){return y===0&&v===x.length?t.fromByteArray(x):t.fromByteArray(x.slice(y,v))}function Se(x,y,v){v=Math.min(x.length,v);const M=[];let Y=y;for(;Y239?4:de>223?3:de>191?2:1;if(Y+De<=v){let je,$e,gt,nt;switch(De){case 1:de<128&&(fe=de);break;case 2:je=x[Y+1],(je&192)===128&&(nt=(de&31)<<6|je&63,nt>127&&(fe=nt));break;case 3:je=x[Y+1],$e=x[Y+2],(je&192)===128&&($e&192)===128&&(nt=(de&15)<<12|(je&63)<<6|$e&63,nt>2047&&(nt<55296||nt>57343)&&(fe=nt));break;case 4:je=x[Y+1],$e=x[Y+2],gt=x[Y+3],(je&192)===128&&($e&192)===128&&(gt&192)===128&&(nt=(de&15)<<18|(je&63)<<12|($e&63)<<6|gt&63,nt>65535&&nt<1114112&&(fe=nt))}}fe===null?(fe=65533,De=1):fe>65535&&(fe-=65536,M.push(fe>>>10&1023|55296),fe=56320|fe&1023),M.push(fe),Y+=De}return le(M)}const Te=4096;function le(x){const y=x.length;if(y<=Te)return String.fromCharCode.apply(String,x);let v="",M=0;for(;MM)&&(v=M);let Y="";for(let de=y;deM&&(y=M),v<0?(v+=M,v<0&&(v=0)):v>M&&(v=M),vv)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUintLE=f.prototype.readUIntLE=function(y,v,M){y=y>>>0,v=v>>>0,M||yt(y,v,this.length);let Y=this[y],de=1,fe=0;for(;++fe>>0,v=v>>>0,M||yt(y,v,this.length);let Y=this[y+--v],de=1;for(;v>0&&(de*=256);)Y+=this[y+--v]*de;return Y},f.prototype.readUint8=f.prototype.readUInt8=function(y,v){return y=y>>>0,v||yt(y,1,this.length),this[y]},f.prototype.readUint16LE=f.prototype.readUInt16LE=function(y,v){return y=y>>>0,v||yt(y,2,this.length),this[y]|this[y+1]<<8},f.prototype.readUint16BE=f.prototype.readUInt16BE=function(y,v){return y=y>>>0,v||yt(y,2,this.length),this[y]<<8|this[y+1]},f.prototype.readUint32LE=f.prototype.readUInt32LE=function(y,v){return y=y>>>0,v||yt(y,4,this.length),(this[y]|this[y+1]<<8|this[y+2]<<16)+this[y+3]*16777216},f.prototype.readUint32BE=f.prototype.readUInt32BE=function(y,v){return y=y>>>0,v||yt(y,4,this.length),this[y]*16777216+(this[y+1]<<16|this[y+2]<<8|this[y+3])},f.prototype.readBigUInt64LE=ee(function(y){y=y>>>0,Mt(y,"offset");const v=this[y],M=this[y+7];(v===void 0||M===void 0)&&Ct(y,this.length-8);const Y=v+this[++y]*2**8+this[++y]*2**16+this[++y]*2**24,de=this[++y]+this[++y]*2**8+this[++y]*2**16+M*2**24;return BigInt(Y)+(BigInt(de)<>>0,Mt(y,"offset");const v=this[y],M=this[y+7];(v===void 0||M===void 0)&&Ct(y,this.length-8);const Y=v*2**24+this[++y]*2**16+this[++y]*2**8+this[++y],de=this[++y]*2**24+this[++y]*2**16+this[++y]*2**8+M;return(BigInt(Y)<>>0,v=v>>>0,M||yt(y,v,this.length);let Y=this[y],de=1,fe=0;for(;++fe=de&&(Y-=Math.pow(2,8*v)),Y},f.prototype.readIntBE=function(y,v,M){y=y>>>0,v=v>>>0,M||yt(y,v,this.length);let Y=v,de=1,fe=this[y+--Y];for(;Y>0&&(de*=256);)fe+=this[y+--Y]*de;return de*=128,fe>=de&&(fe-=Math.pow(2,8*v)),fe},f.prototype.readInt8=function(y,v){return y=y>>>0,v||yt(y,1,this.length),this[y]&128?(255-this[y]+1)*-1:this[y]},f.prototype.readInt16LE=function(y,v){y=y>>>0,v||yt(y,2,this.length);const M=this[y]|this[y+1]<<8;return M&32768?M|4294901760:M},f.prototype.readInt16BE=function(y,v){y=y>>>0,v||yt(y,2,this.length);const M=this[y+1]|this[y]<<8;return M&32768?M|4294901760:M},f.prototype.readInt32LE=function(y,v){return y=y>>>0,v||yt(y,4,this.length),this[y]|this[y+1]<<8|this[y+2]<<16|this[y+3]<<24},f.prototype.readInt32BE=function(y,v){return y=y>>>0,v||yt(y,4,this.length),this[y]<<24|this[y+1]<<16|this[y+2]<<8|this[y+3]},f.prototype.readBigInt64LE=ee(function(y){y=y>>>0,Mt(y,"offset");const v=this[y],M=this[y+7];(v===void 0||M===void 0)&&Ct(y,this.length-8);const Y=this[y+4]+this[y+5]*2**8+this[y+6]*2**16+(M<<24);return(BigInt(Y)<>>0,Mt(y,"offset");const v=this[y],M=this[y+7];(v===void 0||M===void 0)&&Ct(y,this.length-8);const Y=(v<<24)+this[++y]*2**16+this[++y]*2**8+this[++y];return(BigInt(Y)<>>0,v||yt(y,4,this.length),n.read(this,y,!0,23,4)},f.prototype.readFloatBE=function(y,v){return y=y>>>0,v||yt(y,4,this.length),n.read(this,y,!1,23,4)},f.prototype.readDoubleLE=function(y,v){return y=y>>>0,v||yt(y,8,this.length),n.read(this,y,!0,52,8)},f.prototype.readDoubleBE=function(y,v){return y=y>>>0,v||yt(y,8,this.length),n.read(this,y,!1,52,8)};function rt(x,y,v,M,Y,de){if(!f.isBuffer(x))throw new TypeError('"buffer" argument must be a Buffer instance');if(y>Y||yx.length)throw new RangeError("Index out of range")}f.prototype.writeUintLE=f.prototype.writeUIntLE=function(y,v,M,Y){if(y=+y,v=v>>>0,M=M>>>0,!Y){const De=Math.pow(2,8*M)-1;rt(this,y,v,M,De,0)}let de=1,fe=0;for(this[v]=y&255;++fe>>0,M=M>>>0,!Y){const De=Math.pow(2,8*M)-1;rt(this,y,v,M,De,0)}let de=M-1,fe=1;for(this[v+de]=y&255;--de>=0&&(fe*=256);)this[v+de]=y/fe&255;return v+M},f.prototype.writeUint8=f.prototype.writeUInt8=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,1,255,0),this[v]=y&255,v+1},f.prototype.writeUint16LE=f.prototype.writeUInt16LE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,2,65535,0),this[v]=y&255,this[v+1]=y>>>8,v+2},f.prototype.writeUint16BE=f.prototype.writeUInt16BE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,2,65535,0),this[v]=y>>>8,this[v+1]=y&255,v+2},f.prototype.writeUint32LE=f.prototype.writeUInt32LE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,4,4294967295,0),this[v+3]=y>>>24,this[v+2]=y>>>16,this[v+1]=y>>>8,this[v]=y&255,v+4},f.prototype.writeUint32BE=f.prototype.writeUInt32BE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,4,4294967295,0),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4};function Et(x,y,v,M,Y){Xe(y,M,Y,x,v,7);let de=Number(y&BigInt(4294967295));x[v++]=de,de=de>>8,x[v++]=de,de=de>>8,x[v++]=de,de=de>>8,x[v++]=de;let fe=Number(y>>BigInt(32)&BigInt(4294967295));return x[v++]=fe,fe=fe>>8,x[v++]=fe,fe=fe>>8,x[v++]=fe,fe=fe>>8,x[v++]=fe,v}function xn(x,y,v,M,Y){Xe(y,M,Y,x,v,7);let de=Number(y&BigInt(4294967295));x[v+7]=de,de=de>>8,x[v+6]=de,de=de>>8,x[v+5]=de,de=de>>8,x[v+4]=de;let fe=Number(y>>BigInt(32)&BigInt(4294967295));return x[v+3]=fe,fe=fe>>8,x[v+2]=fe,fe=fe>>8,x[v+1]=fe,fe=fe>>8,x[v]=fe,v+8}f.prototype.writeBigUInt64LE=ee(function(y,v=0){return Et(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeBigUInt64BE=ee(function(y,v=0){return xn(this,y,v,BigInt(0),BigInt("0xffffffffffffffff"))}),f.prototype.writeIntLE=function(y,v,M,Y){if(y=+y,v=v>>>0,!Y){const je=Math.pow(2,8*M-1);rt(this,y,v,M,je-1,-je)}let de=0,fe=1,De=0;for(this[v]=y&255;++de>0)-De&255;return v+M},f.prototype.writeIntBE=function(y,v,M,Y){if(y=+y,v=v>>>0,!Y){const je=Math.pow(2,8*M-1);rt(this,y,v,M,je-1,-je)}let de=M-1,fe=1,De=0;for(this[v+de]=y&255;--de>=0&&(fe*=256);)y<0&&De===0&&this[v+de+1]!==0&&(De=1),this[v+de]=(y/fe>>0)-De&255;return v+M},f.prototype.writeInt8=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,1,127,-128),y<0&&(y=255+y+1),this[v]=y&255,v+1},f.prototype.writeInt16LE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,2,32767,-32768),this[v]=y&255,this[v+1]=y>>>8,v+2},f.prototype.writeInt16BE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,2,32767,-32768),this[v]=y>>>8,this[v+1]=y&255,v+2},f.prototype.writeInt32LE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,4,2147483647,-2147483648),this[v]=y&255,this[v+1]=y>>>8,this[v+2]=y>>>16,this[v+3]=y>>>24,v+4},f.prototype.writeInt32BE=function(y,v,M){return y=+y,v=v>>>0,M||rt(this,y,v,4,2147483647,-2147483648),y<0&&(y=4294967295+y+1),this[v]=y>>>24,this[v+1]=y>>>16,this[v+2]=y>>>8,this[v+3]=y&255,v+4},f.prototype.writeBigInt64LE=ee(function(y,v=0){return Et(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),f.prototype.writeBigInt64BE=ee(function(y,v=0){return xn(this,y,v,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Be(x,y,v,M,Y,de){if(v+M>x.length)throw new RangeError("Index out of range");if(v<0)throw new RangeError("Index out of range")}function Ee(x,y,v,M,Y){return y=+y,v=v>>>0,Y||Be(x,y,v,4),n.write(x,y,v,M,23,4),v+4}f.prototype.writeFloatLE=function(y,v,M){return Ee(this,y,v,!0,M)},f.prototype.writeFloatBE=function(y,v,M){return Ee(this,y,v,!1,M)};function Ce(x,y,v,M,Y){return y=+y,v=v>>>0,Y||Be(x,y,v,8),n.write(x,y,v,M,52,8),v+8}f.prototype.writeDoubleLE=function(y,v,M){return Ce(this,y,v,!0,M)},f.prototype.writeDoubleBE=function(y,v,M){return Ce(this,y,v,!1,M)},f.prototype.copy=function(y,v,M,Y){if(!f.isBuffer(y))throw new TypeError("argument should be a Buffer");if(M||(M=0),!Y&&Y!==0&&(Y=this.length),v>=y.length&&(v=y.length),v||(v=0),Y>0&&Y=this.length)throw new RangeError("Index out of range");if(Y<0)throw new RangeError("sourceEnd out of bounds");Y>this.length&&(Y=this.length),y.length-v>>0,M=M===void 0?this.length:M>>>0,y||(y=0);let de;if(typeof y=="number")for(de=v;de2**32?Y=Ze(String(v)):typeof v=="bigint"&&(Y=String(v),(v>BigInt(2)**BigInt(32)||v<-(BigInt(2)**BigInt(32)))&&(Y=Ze(Y)),Y+="n"),M+=` It must be ${y}. Received ${Y}`,M},RangeError);function Ze(x){let y="",v=x.length;const M=x[0]==="-"?1:0;for(;v>=M+4;v-=3)y=`_${x.slice(v-3,v)}${y}`;return`${x.slice(0,v)}${y}`}function it(x,y,v){Mt(y,"offset"),(x[y]===void 0||x[y+v]===void 0)&&Ct(y,x.length-(v+1))}function Xe(x,y,v,M,Y,de){if(x>v||x= 0${fe} and < 2${fe} ** ${(de+1)*8}${fe}`:De=`>= -(2${fe} ** ${(de+1)*8-1}${fe}) and < 2 ** ${(de+1)*8-1}${fe}`,new ke.ERR_OUT_OF_RANGE("value",De,x)}it(M,Y,de)}function Mt(x,y){if(typeof x!="number")throw new ke.ERR_INVALID_ARG_TYPE(y,"number",x)}function Ct(x,y,v){throw Math.floor(x)!==x?(Mt(x,v),new ke.ERR_OUT_OF_RANGE("offset","an integer",x)):y<0?new ke.ERR_BUFFER_OUT_OF_BOUNDS:new ke.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${y}`,x)}const ct=/[^+/0-9A-Za-z-_]/g;function Jt(x){if(x=x.split("=")[0],x=x.trim().replace(ct,""),x.length<2)return"";for(;x.length%4!==0;)x=x+"=";return x}function Vt(x,y){y=y||1/0;let v;const M=x.length;let Y=null;const de=[];for(let fe=0;fe55295&&v<57344){if(!Y){if(v>56319){(y-=3)>-1&&de.push(239,191,189);continue}else if(fe+1===M){(y-=3)>-1&&de.push(239,191,189);continue}Y=v;continue}if(v<56320){(y-=3)>-1&&de.push(239,191,189),Y=v;continue}v=(Y-55296<<10|v-56320)+65536}else Y&&(y-=3)>-1&&de.push(239,191,189);if(Y=null,v<128){if((y-=1)<0)break;de.push(v)}else if(v<2048){if((y-=2)<0)break;de.push(v>>6|192,v&63|128)}else if(v<65536){if((y-=3)<0)break;de.push(v>>12|224,v>>6&63|128,v&63|128)}else if(v<1114112){if((y-=4)<0)break;de.push(v>>18|240,v>>12&63|128,v>>6&63|128,v&63|128)}else throw new Error("Invalid code point")}return de}function pn(x){const y=[];for(let v=0;v>8,Y=v%256,de.push(Y),de.push(M);return de}function on(x){return t.toByteArray(Jt(x))}function kn(x,y,v,M){let Y;for(Y=0;Y=y.length||Y>=x.length);++Y)y[Y+v]=x[Y];return Y}function ue(x,y){return x instanceof y||x!=null&&x.constructor!=null&&x.constructor.name!=null&&x.constructor.name===y.name}function D(x){return x!==x}const ne=function(){const x="0123456789abcdef",y=new Array(256);for(let v=0;v<16;++v){const M=v*16;for(let Y=0;Y<16;++Y)y[M+Y]=x[v]+x[Y]}return y}();function ee(x){return typeof BigInt>"u"?he:x}function he(){throw new Error("BigInt not supported")}})(z4);const Ne=z4.Buffer;function qt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Ie.inherits(qt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ie.toJSONObject(this.config),code:this.code,status:this.status}}});const W4=qt.prototype,H4={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{H4[e]={value:e}}),Object.defineProperties(qt,H4),Object.defineProperty(W4,"isAxiosError",{value:!0}),qt.from=(e,t,n,r,i,o)=>{const s=Object.create(W4);return Ie.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),qt.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};const HB=null;function fm(e){return Ie.isPlainObject(e)||Ie.isArray(e)}function K4(e){return Ie.endsWith(e,"[]")?e.slice(0,-2):e}function q4(e,t,n){return e?e.concat(t).map(function(i,o){return i=K4(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function KB(e){return Ie.isArray(e)&&!e.some(fm)}const qB=Ie.toFlatObject(Ie,{},null,function(t){return/^is[A-Z]/.test(t)});function Lf(e,t,n){if(!Ie.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Ie.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,k){return!Ie.isUndefined(k[S])});const r=n.metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Ie.isSpecCompliantForm(t);if(!Ie.isFunction(i))throw new TypeError("visitor must be a function");function d(_){if(_===null)return"";if(Ie.isDate(_))return _.toISOString();if(!c&&Ie.isBlob(_))throw new qt("Blob is not supported. Use a Buffer instead.");return Ie.isArrayBuffer(_)||Ie.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Ne.from(_):_}function f(_,S,k){let I=_;if(_&&!k&&typeof _=="object"){if(Ie.endsWith(S,"{}"))S=r?S:S.slice(0,-2),_=JSON.stringify(_);else if(Ie.isArray(_)&&KB(_)||(Ie.isFileList(_)||Ie.endsWith(S,"[]"))&&(I=Ie.toArray(_)))return S=K4(S),I.forEach(function(R,$){!(Ie.isUndefined(R)||R===null)&&t.append(s===!0?q4([S],$,o):s===null?S:S+"[]",d(R))}),!1}return fm(_)?!0:(t.append(q4(k,S,o),d(_)),!1)}const p=[],g=Object.assign(qB,{defaultVisitor:f,convertValue:d,isVisitable:fm});function b(_,S){if(!Ie.isUndefined(_)){if(p.indexOf(_)!==-1)throw Error("Circular reference detected in "+S.join("."));p.push(_),Ie.forEach(_,function(I,B){(!(Ie.isUndefined(I)||I===null)&&i.call(t,I,Ie.isString(B)?B.trim():B,S,g))===!0&&b(I,S?S.concat(B):[B])}),p.pop()}}if(!Ie.isObject(e))throw new TypeError("data must be an object");return b(e),t}function Z4(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function hm(e,t){this._pairs=[],e&&Lf(e,this,t)}const G4=hm.prototype;G4.append=function(t,n){this._pairs.push([t,n])},G4.toString=function(t){const n=t?function(r){return t.call(this,r,Z4)}:Z4;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function ZB(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y4(e,t,n){if(!t)return e;const r=n&&n.encode||ZB,i=n&&n.serialize;let o;if(i?o=i(t,n):o=Ie.isURLSearchParams(t)?t.toString():new hm(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}let J4=class{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ie.forEach(this.handlers,function(r){r!==null&&t(r)})}};const Q4={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},GB={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:hm,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},pm=typeof window<"u"&&typeof document<"u",gm=typeof navigator=="object"&&navigator||void 0,YB=pm&&(!gm||["ReactNative","NativeScript","NS"].indexOf(gm.product)<0),JB=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",QB=pm&&window.location.href||"http://localhost",ei={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pm,hasStandardBrowserEnv:YB,hasStandardBrowserWebWorkerEnv:JB,navigator:gm,origin:QB},Symbol.toStringTag,{value:"Module"})),...GB};function XB(e,t){return Lf(e,new ei.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return ei.isNode&&Ie.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function eI(e){return Ie.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function tI(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&Ie.isArray(i)?i.length:s,c?(Ie.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!Ie.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&Ie.isArray(i[s])&&(i[s]=tI(i[s])),!a)}if(Ie.isFormData(e)&&Ie.isFunction(e.entries)){const n={};return Ie.forEachEntry(e,(r,i)=>{t(eI(r),i,n,0)}),n}return null}function nI(e,t,n){if(Ie.isString(e))try{return(t||JSON.parse)(e),Ie.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const hu={transitional:Q4,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=Ie.isObject(t);if(o&&Ie.isHTMLForm(t)&&(t=new FormData(t)),Ie.isFormData(t))return i?JSON.stringify(X4(t)):t;if(Ie.isArrayBuffer(t)||Ie.isBuffer(t)||Ie.isStream(t)||Ie.isFile(t)||Ie.isBlob(t)||Ie.isReadableStream(t))return t;if(Ie.isArrayBufferView(t))return t.buffer;if(Ie.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return XB(t,this.formSerializer).toString();if((a=Ie.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Lf(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),nI(t)):t}],transformResponse:[function(t){const n=this.transitional||hu.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Ie.isResponse(t)||Ie.isReadableStream(t))return t;if(t&&Ie.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?qt.from(a,qt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ei.classes.FormData,Blob:ei.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ie.forEach(["delete","get","head","post","put","patch"],e=>{hu.headers[e]={}});const rI=Ie.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),iI=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&rI[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},e3=Symbol("internals");function pu(e){return e&&String(e).trim().toLowerCase()}function Uf(e){return e===!1||e==null?e:Ie.isArray(e)?e.map(Uf):String(e)}function oI(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const sI=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function mm(e,t,n,r,i){if(Ie.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Ie.isString(t)){if(Ie.isString(r))return t.indexOf(r)!==-1;if(Ie.isRegExp(r))return r.test(t)}}function aI(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function lI(e,t){const n=Ie.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}let ti=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,d){const f=pu(c);if(!f)throw new Error("header name must be a non-empty string");const p=Ie.findKey(i,f);(!p||i[p]===void 0||d===!0||d===void 0&&i[p]!==!1)&&(i[p||c]=Uf(a))}const s=(a,c)=>Ie.forEach(a,(d,f)=>o(d,f,c));if(Ie.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(Ie.isString(t)&&(t=t.trim())&&!sI(t))s(iI(t),n);else if(Ie.isHeaders(t))for(const[a,c]of t.entries())o(c,a,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=pu(t),t){const r=Ie.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return oI(i);if(Ie.isFunction(n))return n.call(this,i,r);if(Ie.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=pu(t),t){const r=Ie.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||mm(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=pu(s),s){const a=Ie.findKey(r,s);a&&(!n||mm(r,r[a],a,n))&&(delete r[a],i=!0)}}return Ie.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||mm(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Ie.forEach(this,(i,o)=>{const s=Ie.findKey(r,o);if(s){n[s]=Uf(i),delete n[o];return}const a=t?aI(o):String(o).trim();a!==o&&delete n[o],n[a]=Uf(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Ie.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Ie.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[e3]=this[e3]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=pu(s);r[a]||(lI(i,s),r[a]=!0)}return Ie.isArray(t)?t.forEach(o):o(t),this}};ti.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ie.reduceDescriptors(ti.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),Ie.freezeMethods(ti);function ym(e,t){const n=this||hu,r=t||n,i=ti.from(r.headers);let o=r.data;return Ie.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function t3(e){return!!(e&&e.__CANCEL__)}function Kl(e,t,n){qt.call(this,e??"canceled",qt.ERR_CANCELED,t,n),this.name="CanceledError"}Ie.inherits(Kl,qt,{__CANCEL__:!0});function n3(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new qt("Request failed with status code "+n.status,[qt.ERR_BAD_REQUEST,qt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function cI(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function uI(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=r[o];s||(s=d),n[i]=c,r[i]=d;let p=o,g=0;for(;p!==i;)g+=n[p++],p=p%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-s{n=f,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const f=Date.now(),p=f-n;p>=r?s(d,f):(i=d,o||(o=setTimeout(()=>{o=null,s(i)},r-p)))},()=>i&&s(i)]}const Nf=(e,t,n=3)=>{let r=0;const i=uI(50,250);return dI(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-r,d=i(c),f=s<=a;r=s;const p={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&f?(a-s)/d:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},r3=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},i3=e=>(...t)=>Ie.asap(()=>e(...t)),fI=ei.hasStandardBrowserEnv?function(){const t=ei.navigator&&/(msie|trident)/i.test(ei.navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=Ie.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),hI=ei.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];Ie.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Ie.isString(r)&&s.push("path="+r),Ie.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function pI(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function gI(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function o3(e,t){return e&&!pI(t)?gI(e,t):t}const s3=e=>e instanceof ti?{...e}:e;function Ca(e,t){t=t||{};const n={};function r(d,f,p){return Ie.isPlainObject(d)&&Ie.isPlainObject(f)?Ie.merge.call({caseless:p},d,f):Ie.isPlainObject(f)?Ie.merge({},f):Ie.isArray(f)?f.slice():f}function i(d,f,p){if(Ie.isUndefined(f)){if(!Ie.isUndefined(d))return r(void 0,d,p)}else return r(d,f,p)}function o(d,f){if(!Ie.isUndefined(f))return r(void 0,f)}function s(d,f){if(Ie.isUndefined(f)){if(!Ie.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function a(d,f,p){if(p in t)return r(d,f);if(p in e)return r(void 0,d)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(d,f)=>i(s3(d),s3(f),!0)};return Ie.forEach(Object.keys(Object.assign({},e,t)),function(f){const p=c[f]||i,g=p(e[f],t[f],f);Ie.isUndefined(g)&&p!==a||(n[f]=g)}),n}const a3=e=>{const t=Ca({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=ti.from(s),t.url=Y4(o3(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(Ie.isFormData(n)){if(ei.hasStandardBrowserEnv||ei.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[d,...f]=c?c.split(";").map(p=>p.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...f].join("; "))}}if(ei.hasStandardBrowserEnv&&(r&&Ie.isFunction(r)&&(r=r(t)),r||r!==!1&&fI(t.url))){const d=i&&o&&hI.read(o);d&&s.set(i,d)}return t},mI=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=a3(e);let o=i.data;const s=ti.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:d}=i,f,p,g,b,_;function S(){b&&b(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function I(){if(!k)return;const R=ti.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:R,config:e,request:k};n3(function(G){n(G),S()},function(G){r(G),S()},L),k=null}"onloadend"in k?k.onloadend=I:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(I)},k.onabort=function(){k&&(r(new qt("Request aborted",qt.ECONNABORTED,e,k)),k=null)},k.onerror=function(){r(new qt("Network Error",qt.ERR_NETWORK,e,k)),k=null},k.ontimeout=function(){let $=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const L=i.transitional||Q4;i.timeoutErrorMessage&&($=i.timeoutErrorMessage),r(new qt($,L.clarifyTimeoutError?qt.ETIMEDOUT:qt.ECONNABORTED,e,k)),k=null},o===void 0&&s.setContentType(null),"setRequestHeader"in k&&Ie.forEach(s.toJSON(),function($,L){k.setRequestHeader(L,$)}),Ie.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),a&&a!=="json"&&(k.responseType=i.responseType),d&&([g,_]=Nf(d,!0),k.addEventListener("progress",g)),c&&k.upload&&([p,b]=Nf(c),k.upload.addEventListener("progress",p),k.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(f=R=>{k&&(r(!R||R.type?new Kl(null,e,k):R),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const B=cI(i.url);if(B&&ei.protocols.indexOf(B)===-1){r(new qt("Unsupported protocol "+B+":",qt.ERR_BAD_REQUEST,e));return}k.send(o||null)})},yI=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,a();const f=d instanceof Error?d:this.reason;r.abort(f instanceof qt?f:new Kl(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,o(new qt(`timeout ${t} of ms exceeded`,qt.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>Ie.asap(a),c}},bI=function*(e,t){let n=e.byteLength;if(n{const i=vI(e,t);let o=0,s,a=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:f}=await i.next();if(d){a(),c.close();return}let p=f.byteLength;if(n){let g=o+=p;n(g)}c.enqueue(new Uint8Array(f))}catch(d){throw a(d),d}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},Df=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",c3=Df&&typeof ReadableStream=="function",_I=Df&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),u3=(e,...t)=>{try{return!!e(...t)}catch{return!1}},xI=c3&&u3(()=>{let e=!1;const t=new Request(ei.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),d3=64*1024,bm=c3&&u3(()=>Ie.isReadableStream(new Response("").body)),jf={stream:bm&&(e=>e.body)};Df&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!jf[t]&&(jf[t]=Ie.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new qt(`Response type '${t}' is not supported`,qt.ERR_NOT_SUPPORT,r)})})})(new Response);const CI=async e=>{if(e==null)return 0;if(Ie.isBlob(e))return e.size;if(Ie.isSpecCompliantForm(e))return(await new Request(ei.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Ie.isArrayBufferView(e)||Ie.isArrayBuffer(e))return e.byteLength;if(Ie.isURLSearchParams(e)&&(e=e+""),Ie.isString(e))return(await _I(e)).byteLength},SI=async(e,t)=>{const n=Ie.toFiniteNumber(e.getContentLength());return n??CI(t)},vm={http:HB,xhr:mI,fetch:Df&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:d,headers:f,withCredentials:p="same-origin",fetchOptions:g}=a3(e);d=d?(d+"").toLowerCase():"text";let b=yI([i,o&&o.toAbortSignal()],s),_;const S=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let k;try{if(c&&xI&&n!=="get"&&n!=="head"&&(k=await SI(f,r))!==0){let L=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(Ie.isFormData(r)&&(U=L.headers.get("content-type"))&&f.setContentType(U),L.body){const[G,X]=r3(k,Nf(i3(c)));r=l3(L.body,d3,G,X)}}Ie.isString(p)||(p=p?"include":"omit");const I="credentials"in Request.prototype;_=new Request(t,{...g,signal:b,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:I?p:void 0});let B=await fetch(_);const R=bm&&(d==="stream"||d==="response");if(bm&&(a||R&&S)){const L={};["status","statusText","headers"].forEach(J=>{L[J]=B[J]});const U=Ie.toFiniteNumber(B.headers.get("content-length")),[G,X]=a&&r3(U,Nf(i3(a),!0))||[];B=new Response(l3(B.body,d3,G,()=>{X&&X(),S&&S()}),L)}d=d||"text";let $=await jf[Ie.findKey(jf,d)||"text"](B,e);return!R&&S&&S(),await new Promise((L,U)=>{n3(L,U,{data:$,headers:ti.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:_})})}catch(I){throw S&&S(),I&&I.name==="TypeError"&&/fetch/i.test(I.message)?Object.assign(new qt("Network Error",qt.ERR_NETWORK,e,_),{cause:I.cause||I}):qt.from(I,I&&I.code,e,_)}})};Ie.forEach(vm,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const f3=e=>`- ${e}`,kI=e=>Ie.isFunction(e)||e===null||e===!1,h3={getAdapter:e=>{e=Ie.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : `+o.map(f3).join(` `):" "+f3(o[0]):"as no adapter specified";throw new qt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:vm};function wm(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Kl(null,e)}function p3(e){return wm(e),e.headers=ti.from(e.headers),e.data=ym.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),h3.getAdapter(e.adapter||hu.adapter)(e).then(function(r){return wm(e),r.data=ym.call(e,e.transformResponse,r),r.headers=ti.from(r.headers),r},function(r){return t3(r)||(wm(e),r&&r.response&&(r.response.data=ym.call(e,e.transformResponse,r.response),r.response.headers=ti.from(r.response.headers))),Promise.reject(r)})}const g3="1.7.7",_m={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{_m[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const m3={};_m.transitional=function(t,n,r){function i(o,s){return"[Axios v"+g3+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new qt(i(s," has been removed"+(n?" in "+n:"")),qt.ERR_DEPRECATED);return n&&!m3[s]&&(m3[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function AI(e,t,n){if(typeof e!="object")throw new qt("options must be an object",qt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new qt("option "+o+" must be "+c,qt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qt("Unknown option "+o,qt.ERR_BAD_OPTION)}}const xm={assertOptions:AI,validators:_m},Es=xm.validators;let Sa=class{constructor(t){this.defaults=t,this.interceptors={request:new J4,response:new J4}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ca(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&xm.assertOptions(r,{silentJSONParsing:Es.transitional(Es.boolean),forcedJSONParsing:Es.transitional(Es.boolean),clarifyTimeoutError:Es.transitional(Es.boolean)},!1),i!=null&&(Ie.isFunction(i)?n.paramsSerializer={serialize:i}:xm.assertOptions(i,{encode:Es.function,serialize:Es.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&Ie.merge(o.common,o[n.method]);o&&Ie.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),n.headers=ti.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(c=c&&S.synchronous,a.unshift(S.fulfilled,S.rejected))});const d=[];this.interceptors.response.forEach(function(S){d.push(S.fulfilled,S.rejected)});let f,p=0,g;if(!c){const _=[p3.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,d),g=_.length,f=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new Kl(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new gA(function(i){t=i}),cancel:t}}};function TI(e){return function(n){return e.apply(null,n)}}function PI(e){return Ie.isObject(e)&&e.isAxiosError===!0}const Cm={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Cm).forEach(([e,t])=>{Cm[t]=e});function y3(e){const t=new Sa(e),n=M4(Sa.prototype.request,t);return Ie.extend(n,Sa.prototype,t,{allOwnKeys:!0}),Ie.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return y3(Ca(e,i))},n}const Dn=y3(hu);Dn.Axios=Sa,Dn.CanceledError=Kl,Dn.CancelToken=EI,Dn.isCancel=t3,Dn.VERSION=g3,Dn.toFormData=Lf,Dn.AxiosError=qt,Dn.Cancel=Dn.CanceledError,Dn.all=function(t){return Promise.all(t)},Dn.spread=TI,Dn.isAxiosError=PI,Dn.mergeConfig=Ca,Dn.AxiosHeaders=ti,Dn.formToJSON=e=>X4(Ie.isHTMLForm(e)?new FormData(e):e),Dn.getAdapter=h3.getAdapter,Dn.HttpStatusCode=Cm,Dn.default=Dn;var et=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ka(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function BI(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var Ff={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */Ff.exports,function(e,t){(function(){var n,r="4.17.21",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",d=500,f="__lodash_placeholder__",p=1,g=2,b=4,_=1,S=2,k=1,I=2,B=4,R=8,$=16,L=32,U=64,G=128,X=256,J=512,me=30,oe="...",Q=800,re=16,Z=1,be=2,Ae=3,Se=1/0,Te=9007199254740991,le=17976931348623157e292,tt=NaN,Ke=4294967295,Nt=Ke-1,It=Ke>>>1,yt=[["ary",G],["bind",k],["bindKey",I],["curry",R],["curryRight",$],["flip",J],["partial",L],["partialRight",U],["rearg",X]],rt="[object Arguments]",Et="[object Array]",xn="[object AsyncFunction]",Be="[object Boolean]",Ee="[object Date]",Ce="[object DOMException]",ke="[object Error]",Oe="[object Function]",Ze="[object GeneratorFunction]",it="[object Map]",Xe="[object Number]",Mt="[object Null]",Ct="[object Object]",ct="[object Promise]",Jt="[object Proxy]",Vt="[object RegExp]",pn="[object Set]",vn="[object String]",on="[object Symbol]",kn="[object Undefined]",ue="[object WeakMap]",D="[object WeakSet]",ne="[object ArrayBuffer]",ee="[object DataView]",he="[object Float32Array]",x="[object Float64Array]",y="[object Int8Array]",v="[object Int16Array]",M="[object Int32Array]",Y="[object Uint8Array]",de="[object Uint8ClampedArray]",fe="[object Uint16Array]",De="[object Uint32Array]",je=/\b__p \+= '';/g,$e=/\b(__p \+=) '' \+/g,gt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,nt=/&(?:amp|lt|gt|quot|#39);/g,tn=/[&<>"']/g,gn=RegExp(nt.source),Mn=RegExp(tn.source),Rn=/<%-([\s\S]+?)%>/g,zn=/<%([\s\S]+?)%>/g,ci=/<%=([\s\S]+?)%>/g,Gr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Yr=/^\w*$/,Fi=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xn=/[\\^$.*+?()[\]{}|]/g,ds=RegExp(Xn.source),T=/^\s+/,F=/\s/,N=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,w=/\{\n\/\* \[wrapped with (.+)\] \*/,A=/,? & /,te=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,_e=/\\(\\)?/g,Le=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ge=/\w*$/,We=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,Qe=/^\[object .+?Constructor\]$/,lt=/^0o[0-7]+$/i,ut=/^(?:0|[1-9]\d*)$/,xt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,St=/($^)/,Pt=/['\n\r\u2028\u2029\\]/g,bt="\\ud800-\\udfff",$t="\\u0300-\\u036f",ft="\\ufe20-\\ufe2f",vt="\\u20d0-\\u20ff",ot=$t+ft+vt,ht="\\u2700-\\u27bf",q="a-z\\xdf-\\xf6\\xf8-\\xff",m="\\xac\\xb1\\xd7\\xf7",E="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",P="\\u2000-\\u206f",W=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",V="A-Z\\xc0-\\xd6\\xd8-\\xde",ge="\\ufe0e\\ufe0f",pe=m+E+P+W,Fe="['’]",He="["+bt+"]",Ye="["+pe+"]",wt="["+ot+"]",ae="\\d+",Ft="["+ht+"]",ln="["+q+"]",cn="[^"+bt+pe+ae+ht+q+V+"]",Wt="\\ud83c[\\udffb-\\udfff]",un="(?:"+wt+"|"+Wt+")",sn="[^"+bt+"]",Vn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",An="["+V+"]",Wn="\\u200d",Hn="(?:"+ln+"|"+cn+")",ar="(?:"+An+"|"+cn+")",br="(?:"+Fe+"(?:d|ll|m|re|s|t|ve))?",vr="(?:"+Fe+"(?:D|LL|M|RE|S|T|VE))?",wr=un+"?",s9="["+ge+"]?",SG="(?:"+Wn+"(?:"+[sn,Vn,mn].join("|")+")"+s9+wr+")*",kG="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",AG="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",a9=s9+wr+SG,EG="(?:"+[Ft,Vn,mn].join("|")+")"+a9,TG="(?:"+[sn+wt+"?",wt,Vn,mn,He].join("|")+")",PG=RegExp(Fe,"g"),BG=RegExp(wt,"g"),Eb=RegExp(Wt+"(?="+Wt+")|"+TG+a9,"g"),IG=RegExp([An+"?"+ln+"+"+br+"(?="+[Ye,An,"$"].join("|")+")",ar+"+"+vr+"(?="+[Ye,An+Hn,"$"].join("|")+")",An+"?"+Hn+"+"+br,An+"+"+vr,AG,kG,ae,EG].join("|"),"g"),MG=RegExp("["+Wn+bt+ot+ge+"]"),RG=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,OG=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$G=-1,Kn={};Kn[he]=Kn[x]=Kn[y]=Kn[v]=Kn[M]=Kn[Y]=Kn[de]=Kn[fe]=Kn[De]=!0,Kn[rt]=Kn[Et]=Kn[ne]=Kn[Be]=Kn[ee]=Kn[Ee]=Kn[ke]=Kn[Oe]=Kn[it]=Kn[Xe]=Kn[Ct]=Kn[Vt]=Kn[pn]=Kn[vn]=Kn[ue]=!1;var Un={};Un[rt]=Un[Et]=Un[ne]=Un[ee]=Un[Be]=Un[Ee]=Un[he]=Un[x]=Un[y]=Un[v]=Un[M]=Un[it]=Un[Xe]=Un[Ct]=Un[Vt]=Un[pn]=Un[vn]=Un[on]=Un[Y]=Un[de]=Un[fe]=Un[De]=!0,Un[ke]=Un[Oe]=Un[ue]=!1;var LG={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},UG={"&":"&","<":"<",">":">",'"':""","'":"'"},NG={"&":"&","<":"<",">":">",""":'"',"'":"'"},DG={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},jG=parseFloat,FG=parseInt,l9=typeof et=="object"&&et&&et.Object===Object&&et,zG=typeof self=="object"&&self&&self.Object===Object&&self,Rr=l9||zG||Function("return this")(),Tb=t&&!t.nodeType&&t,Cl=Tb&&!0&&e&&!e.nodeType&&e,c9=Cl&&Cl.exports===Tb,Pb=c9&&l9.process,zi=function(){try{var ve=Cl&&Cl.require&&Cl.require("util").types;return ve||Pb&&Pb.binding&&Pb.binding("util")}catch{}}(),u9=zi&&zi.isArrayBuffer,d9=zi&&zi.isDate,f9=zi&&zi.isMap,h9=zi&&zi.isRegExp,p9=zi&&zi.isSet,g9=zi&&zi.isTypedArray;function Si(ve,Ue,Pe){switch(Pe.length){case 0:return ve.call(Ue);case 1:return ve.call(Ue,Pe[0]);case 2:return ve.call(Ue,Pe[0],Pe[1]);case 3:return ve.call(Ue,Pe[0],Pe[1],Pe[2])}return ve.apply(Ue,Pe)}function VG(ve,Ue,Pe,mt){for(var Ht=-1,wn=ve==null?0:ve.length;++Ht-1}function Bb(ve,Ue,Pe){for(var mt=-1,Ht=ve==null?0:ve.length;++mt-1;);return Pe}function C9(ve,Ue){for(var Pe=ve.length;Pe--&&Uc(Ue,ve[Pe],0)>-1;);return Pe}function QG(ve,Ue){for(var Pe=ve.length,mt=0;Pe--;)ve[Pe]===Ue&&++mt;return mt}var XG=Ob(LG),eY=Ob(UG);function tY(ve){return"\\"+DG[ve]}function nY(ve,Ue){return ve==null?n:ve[Ue]}function Nc(ve){return MG.test(ve)}function rY(ve){return RG.test(ve)}function iY(ve){for(var Ue,Pe=[];!(Ue=ve.next()).done;)Pe.push(Ue.value);return Pe}function Nb(ve){var Ue=-1,Pe=Array(ve.size);return ve.forEach(function(mt,Ht){Pe[++Ue]=[Ht,mt]}),Pe}function S9(ve,Ue){return function(Pe){return ve(Ue(Pe))}}function la(ve,Ue){for(var Pe=-1,mt=ve.length,Ht=0,wn=[];++Pe-1}function HY(l,u){var h=this.__data__,C=Pg(h,l);return C<0?(++this.size,h.push([l,u])):h[C][1]=u,this}fs.prototype.clear=FY,fs.prototype.delete=zY,fs.prototype.get=VY,fs.prototype.has=WY,fs.prototype.set=HY;function hs(l){var u=-1,h=l==null?0:l.length;for(this.clear();++u=u?l:u)),l}function Ki(l,u,h,C,O,H){var se,ye=u&p,we=u&g,ze=u&b;if(h&&(se=O?h(l,C,O,H):h(l)),se!==n)return se;if(!er(l))return l;var Ve=Kt(l);if(Ve){if(se=GJ(l),!ye)return ui(l,se)}else{var qe=jr(l),st=qe==Oe||qe==Ze;if(pa(l))return sk(l,ye);if(qe==Ct||qe==rt||st&&!O){if(se=we||st?{}:kk(l),!ye)return we?NJ(l,aJ(se,l)):UJ(l,L9(se,l))}else{if(!Un[qe])return O?l:{};se=YJ(l,qe,ye)}}H||(H=new oo);var _t=H.get(l);if(_t)return _t;H.set(l,se),eA(l)?l.forEach(function(Ut){se.add(Ki(Ut,u,h,Ut,l,H))}):Qk(l)&&l.forEach(function(Ut,an){se.set(an,Ki(Ut,u,h,an,l,H))});var Lt=ze?we?uv:cv:we?fi:Ar,nn=Ve?n:Lt(l);return Vi(nn||l,function(Ut,an){nn&&(an=Ut,Ut=l[an]),Jd(se,an,Ki(Ut,u,h,an,l,H))}),se}function lJ(l){var u=Ar(l);return function(h){return U9(h,l,u)}}function U9(l,u,h){var C=h.length;if(l==null)return!C;for(l=On(l);C--;){var O=h[C],H=u[O],se=l[O];if(se===n&&!(O in l)||!H(se))return!1}return!0}function N9(l,u,h){if(typeof l!="function")throw new Wi(s);return of(function(){l.apply(n,h)},u)}function Qd(l,u,h,C){var O=-1,H=fg,se=!0,ye=l.length,we=[],ze=u.length;if(!ye)return we;h&&(u=Gn(u,ki(h))),C?(H=Bb,se=!1):u.length>=i&&(H=Hd,se=!1,u=new Al(u));e:for(;++OO?0:O+h),C=C===n||C>O?O:Qt(C),C<0&&(C+=O),C=h>C?0:nA(C);h0&&h(ye)?u>1?Or(ye,u-1,h,C,O):aa(O,ye):C||(O[O.length]=ye)}return O}var Hb=fk(),F9=fk(!0);function Ro(l,u){return l&&Hb(l,u,Ar)}function Kb(l,u){return l&&F9(l,u,Ar)}function Ig(l,u){return sa(u,function(h){return bs(l[h])})}function Tl(l,u){u=fa(u,l);for(var h=0,C=u.length;l!=null&&hu}function dJ(l,u){return l!=null&&En.call(l,u)}function fJ(l,u){return l!=null&&u in On(l)}function hJ(l,u,h){return l>=Dr(u,h)&&l=120&&Ve.length>=120)?new Al(se&&Ve):n}Ve=l[0];var qe=-1,st=ye[0];e:for(;++qe-1;)ye!==l&&xg.call(ye,we,1),xg.call(l,we,1);return l}function Q9(l,u){for(var h=l?u.length:0,C=h-1;h--;){var O=u[h];if(h==C||O!==H){var H=O;ys(O)?xg.call(l,O,1):nv(l,O)}}return l}function Xb(l,u){return l+kg(M9()*(u-l+1))}function AJ(l,u,h,C){for(var O=-1,H=xr(Sg((u-l)/(h||1)),0),se=Pe(H);H--;)se[C?H:++O]=l,l+=h;return se}function ev(l,u){var h="";if(!l||u<1||u>Te)return h;do u%2&&(h+=l),u=kg(u/2),u&&(l+=l);while(u);return h}function rn(l,u){return yv(Tk(l,u,hi),l+"")}function EJ(l){return $9(Gc(l))}function TJ(l,u){var h=Gc(l);return zg(h,El(u,0,h.length))}function tf(l,u,h,C){if(!er(l))return l;u=fa(u,l);for(var O=-1,H=u.length,se=H-1,ye=l;ye!=null&&++OO?0:O+u),h=h>O?O:h,h<0&&(h+=O),O=u>h?0:h-u>>>0,u>>>=0;for(var H=Pe(O);++C>>1,se=l[H];se!==null&&!Ei(se)&&(h?se<=u:se=i){var ze=u?null:zJ(l);if(ze)return pg(ze);se=!1,O=Hd,we=new Al}else we=u?[]:ye;e:for(;++C=C?l:qi(l,u,h)}var ok=vY||function(l){return Rr.clearTimeout(l)};function sk(l,u){if(u)return l.slice();var h=l.length,C=E9?E9(h):new l.constructor(h);return l.copy(C),C}function sv(l){var u=new l.constructor(l.byteLength);return new wg(u).set(new wg(l)),u}function RJ(l,u){var h=u?sv(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.byteLength)}function OJ(l){var u=new l.constructor(l.source,Ge.exec(l));return u.lastIndex=l.lastIndex,u}function $J(l){return Yd?On(Yd.call(l)):{}}function ak(l,u){var h=u?sv(l.buffer):l.buffer;return new l.constructor(h,l.byteOffset,l.length)}function lk(l,u){if(l!==u){var h=l!==n,C=l===null,O=l===l,H=Ei(l),se=u!==n,ye=u===null,we=u===u,ze=Ei(u);if(!ye&&!ze&&!H&&l>u||H&&se&&we&&!ye&&!ze||C&&se&&we||!h&&we||!O)return 1;if(!C&&!H&&!ze&&l=ye)return we;var ze=h[C];return we*(ze=="desc"?-1:1)}}return l.index-u.index}function ck(l,u,h,C){for(var O=-1,H=l.length,se=h.length,ye=-1,we=u.length,ze=xr(H-se,0),Ve=Pe(we+ze),qe=!C;++ye1?h[O-1]:n,se=O>2?h[2]:n;for(H=l.length>3&&typeof H=="function"?(O--,H):n,se&&Qr(h[0],h[1],se)&&(H=O<3?n:H,O=1),u=On(u);++C-1?O[H?u[se]:se]:n}}function gk(l){return ms(function(u){var h=u.length,C=h,O=Hi.prototype.thru;for(l&&u.reverse();C--;){var H=u[C];if(typeof H!="function")throw new Wi(s);if(O&&!se&&jg(H)=="wrapper")var se=new Hi([],!0)}for(C=se?C:h;++C1&&fn.reverse(),Ve&&weye))return!1;var ze=H.get(l),Ve=H.get(u);if(ze&&Ve)return ze==u&&Ve==l;var qe=-1,st=!0,_t=h&S?new Al:n;for(H.set(l,u),H.set(u,l);++qe1?"& ":"")+u[C],u=u.join(h>2?", ":" "),l.replace(N,`{ /* [wrapped with `+u+`] */ `)}function QJ(l){return Kt(l)||Il(l)||!!(B9&&l&&l[B9])}function ys(l,u){var h=typeof l;return u=u??Te,!!u&&(h=="number"||h!="symbol"&&ut.test(l))&&l>-1&&l%1==0&&l0){if(++u>=Q)return arguments[0]}else u=0;return l.apply(n,arguments)}}function zg(l,u){var h=-1,C=l.length,O=C-1;for(u=u===n?C:u;++h1?l[u-1]:n;return h=typeof h=="function"?(l.pop(),h):n,jk(l,h)});function Fk(l){var u=z(l);return u.__chain__=!0,u}function cX(l,u){return u(l),l}function Vg(l,u){return u(l)}var uX=ms(function(l){var u=l.length,h=u?l[0]:0,C=this.__wrapped__,O=function(H){return Wb(H,l)};return u>1||this.__actions__.length||!(C instanceof dn)||!ys(h)?this.thru(O):(C=C.slice(h,+h+(u?1:0)),C.__actions__.push({func:Vg,args:[O],thisArg:n}),new Hi(C,this.__chain__).thru(function(H){return u&&!H.length&&H.push(n),H}))});function dX(){return Fk(this)}function fX(){return new Hi(this.value(),this.__chain__)}function hX(){this.__values__===n&&(this.__values__=tA(this.value()));var l=this.__index__>=this.__values__.length,u=l?n:this.__values__[this.__index__++];return{done:l,value:u}}function pX(){return this}function gX(l){for(var u,h=this;h instanceof Tg;){var C=Ok(h);C.__index__=0,C.__values__=n,u?O.__wrapped__=C:u=C;var O=C;h=h.__wrapped__}return O.__wrapped__=l,u}function mX(){var l=this.__wrapped__;if(l instanceof dn){var u=l;return this.__actions__.length&&(u=new dn(this)),u=u.reverse(),u.__actions__.push({func:Vg,args:[bv],thisArg:n}),new Hi(u,this.__chain__)}return this.thru(bv)}function yX(){return rk(this.__wrapped__,this.__actions__)}var bX=$g(function(l,u,h){En.call(l,h)?++l[h]:ps(l,h,1)});function vX(l,u,h){var C=Kt(l)?m9:cJ;return h&&Qr(l,u,h)&&(u=n),C(l,Rt(u,3))}function wX(l,u){var h=Kt(l)?sa:j9;return h(l,Rt(u,3))}var _X=pk($k),xX=pk(Lk);function CX(l,u){return Or(Wg(l,u),1)}function SX(l,u){return Or(Wg(l,u),Se)}function kX(l,u,h){return h=h===n?1:Qt(h),Or(Wg(l,u),h)}function zk(l,u){var h=Kt(l)?Vi:ua;return h(l,Rt(u,3))}function Vk(l,u){var h=Kt(l)?WG:D9;return h(l,Rt(u,3))}var AX=$g(function(l,u,h){En.call(l,h)?l[h].push(u):ps(l,h,[u])});function EX(l,u,h,C){l=di(l)?l:Gc(l),h=h&&!C?Qt(h):0;var O=l.length;return h<0&&(h=xr(O+h,0)),Gg(l)?h<=O&&l.indexOf(u,h)>-1:!!O&&Uc(l,u,h)>-1}var TX=rn(function(l,u,h){var C=-1,O=typeof u=="function",H=di(l)?Pe(l.length):[];return ua(l,function(se){H[++C]=O?Si(u,se,h):Xd(se,u,h)}),H}),PX=$g(function(l,u,h){ps(l,h,u)});function Wg(l,u){var h=Kt(l)?Gn:K9;return h(l,Rt(u,3))}function BX(l,u,h,C){return l==null?[]:(Kt(u)||(u=u==null?[]:[u]),h=C?n:h,Kt(h)||(h=h==null?[]:[h]),Y9(l,u,h))}var IX=$g(function(l,u,h){l[h?0:1].push(u)},function(){return[[],[]]});function MX(l,u,h){var C=Kt(l)?Ib:w9,O=arguments.length<3;return C(l,Rt(u,4),h,O,ua)}function RX(l,u,h){var C=Kt(l)?HG:w9,O=arguments.length<3;return C(l,Rt(u,4),h,O,D9)}function OX(l,u){var h=Kt(l)?sa:j9;return h(l,qg(Rt(u,3)))}function $X(l){var u=Kt(l)?$9:EJ;return u(l)}function LX(l,u,h){(h?Qr(l,u,h):u===n)?u=1:u=Qt(u);var C=Kt(l)?iJ:TJ;return C(l,u)}function UX(l){var u=Kt(l)?oJ:BJ;return u(l)}function NX(l){if(l==null)return 0;if(di(l))return Gg(l)?Dc(l):l.length;var u=jr(l);return u==it||u==pn?l.size:Yb(l).length}function DX(l,u,h){var C=Kt(l)?Mb:IJ;return h&&Qr(l,u,h)&&(u=n),C(l,Rt(u,3))}var jX=rn(function(l,u){if(l==null)return[];var h=u.length;return h>1&&Qr(l,u[0],u[1])?u=[]:h>2&&Qr(u[0],u[1],u[2])&&(u=[u[0]]),Y9(l,Or(u,1),[])}),Hg=wY||function(){return Rr.Date.now()};function FX(l,u){if(typeof u!="function")throw new Wi(s);return l=Qt(l),function(){if(--l<1)return u.apply(this,arguments)}}function Wk(l,u,h){return u=h?n:u,u=l&&u==null?l.length:u,gs(l,G,n,n,n,n,u)}function Hk(l,u){var h;if(typeof u!="function")throw new Wi(s);return l=Qt(l),function(){return--l>0&&(h=u.apply(this,arguments)),l<=1&&(u=n),h}}var wv=rn(function(l,u,h){var C=k;if(h.length){var O=la(h,qc(wv));C|=L}return gs(l,C,u,h,O)}),Kk=rn(function(l,u,h){var C=k|I;if(h.length){var O=la(h,qc(Kk));C|=L}return gs(u,C,l,h,O)});function qk(l,u,h){u=h?n:u;var C=gs(l,R,n,n,n,n,n,u);return C.placeholder=qk.placeholder,C}function Zk(l,u,h){u=h?n:u;var C=gs(l,$,n,n,n,n,n,u);return C.placeholder=Zk.placeholder,C}function Gk(l,u,h){var C,O,H,se,ye,we,ze=0,Ve=!1,qe=!1,st=!0;if(typeof l!="function")throw new Wi(s);u=Gi(u)||0,er(h)&&(Ve=!!h.leading,qe="maxWait"in h,H=qe?xr(Gi(h.maxWait)||0,u):H,st="trailing"in h?!!h.trailing:st);function _t(cr){var ao=C,ws=O;return C=O=n,ze=cr,se=l.apply(ws,ao),se}function Lt(cr){return ze=cr,ye=of(an,u),Ve?_t(cr):se}function nn(cr){var ao=cr-we,ws=cr-ze,pA=u-ao;return qe?Dr(pA,H-ws):pA}function Ut(cr){var ao=cr-we,ws=cr-ze;return we===n||ao>=u||ao<0||qe&&ws>=H}function an(){var cr=Hg();if(Ut(cr))return fn(cr);ye=of(an,nn(cr))}function fn(cr){return ye=n,st&&C?_t(cr):(C=O=n,se)}function Ti(){ye!==n&&ok(ye),ze=0,C=we=O=ye=n}function Xr(){return ye===n?se:fn(Hg())}function Pi(){var cr=Hg(),ao=Ut(cr);if(C=arguments,O=this,we=cr,ao){if(ye===n)return Lt(we);if(qe)return ok(ye),ye=of(an,u),_t(we)}return ye===n&&(ye=of(an,u)),se}return Pi.cancel=Ti,Pi.flush=Xr,Pi}var zX=rn(function(l,u){return N9(l,1,u)}),VX=rn(function(l,u,h){return N9(l,Gi(u)||0,h)});function WX(l){return gs(l,J)}function Kg(l,u){if(typeof l!="function"||u!=null&&typeof u!="function")throw new Wi(s);var h=function(){var C=arguments,O=u?u.apply(this,C):C[0],H=h.cache;if(H.has(O))return H.get(O);var se=l.apply(this,C);return h.cache=H.set(O,se)||H,se};return h.cache=new(Kg.Cache||hs),h}Kg.Cache=hs;function qg(l){if(typeof l!="function")throw new Wi(s);return function(){var u=arguments;switch(u.length){case 0:return!l.call(this);case 1:return!l.call(this,u[0]);case 2:return!l.call(this,u[0],u[1]);case 3:return!l.call(this,u[0],u[1],u[2])}return!l.apply(this,u)}}function HX(l){return Hk(2,l)}var KX=MJ(function(l,u){u=u.length==1&&Kt(u[0])?Gn(u[0],ki(Rt())):Gn(Or(u,1),ki(Rt()));var h=u.length;return rn(function(C){for(var O=-1,H=Dr(C.length,h);++O=u}),Il=V9(function(){return arguments}())?V9:function(l){return nr(l)&&En.call(l,"callee")&&!P9.call(l,"callee")},Kt=Pe.isArray,aee=u9?ki(u9):gJ;function di(l){return l!=null&&Zg(l.length)&&!bs(l)}function lr(l){return nr(l)&&di(l)}function lee(l){return l===!0||l===!1||nr(l)&&Jr(l)==Be}var pa=xY||Mv,cee=d9?ki(d9):mJ;function uee(l){return nr(l)&&l.nodeType===1&&!sf(l)}function dee(l){if(l==null)return!0;if(di(l)&&(Kt(l)||typeof l=="string"||typeof l.splice=="function"||pa(l)||Zc(l)||Il(l)))return!l.length;var u=jr(l);if(u==it||u==pn)return!l.size;if(rf(l))return!Yb(l).length;for(var h in l)if(En.call(l,h))return!1;return!0}function fee(l,u){return ef(l,u)}function hee(l,u,h){h=typeof h=="function"?h:n;var C=h?h(l,u):n;return C===n?ef(l,u,n,h):!!C}function xv(l){if(!nr(l))return!1;var u=Jr(l);return u==ke||u==Ce||typeof l.message=="string"&&typeof l.name=="string"&&!sf(l)}function pee(l){return typeof l=="number"&&I9(l)}function bs(l){if(!er(l))return!1;var u=Jr(l);return u==Oe||u==Ze||u==xn||u==Jt}function Jk(l){return typeof l=="number"&&l==Qt(l)}function Zg(l){return typeof l=="number"&&l>-1&&l%1==0&&l<=Te}function er(l){var u=typeof l;return l!=null&&(u=="object"||u=="function")}function nr(l){return l!=null&&typeof l=="object"}var Qk=f9?ki(f9):bJ;function gee(l,u){return l===u||Gb(l,u,fv(u))}function mee(l,u,h){return h=typeof h=="function"?h:n,Gb(l,u,fv(u),h)}function yee(l){return Xk(l)&&l!=+l}function bee(l){if(tQ(l))throw new Ht(o);return W9(l)}function vee(l){return l===null}function wee(l){return l==null}function Xk(l){return typeof l=="number"||nr(l)&&Jr(l)==Xe}function sf(l){if(!nr(l)||Jr(l)!=Ct)return!1;var u=_g(l);if(u===null)return!0;var h=En.call(u,"constructor")&&u.constructor;return typeof h=="function"&&h instanceof h&&yg.call(h)==mY}var Cv=h9?ki(h9):vJ;function _ee(l){return Jk(l)&&l>=-Te&&l<=Te}var eA=p9?ki(p9):wJ;function Gg(l){return typeof l=="string"||!Kt(l)&&nr(l)&&Jr(l)==vn}function Ei(l){return typeof l=="symbol"||nr(l)&&Jr(l)==on}var Zc=g9?ki(g9):_J;function xee(l){return l===n}function Cee(l){return nr(l)&&jr(l)==ue}function See(l){return nr(l)&&Jr(l)==D}var kee=Dg(Jb),Aee=Dg(function(l,u){return l<=u});function tA(l){if(!l)return[];if(di(l))return Gg(l)?io(l):ui(l);if(Kd&&l[Kd])return iY(l[Kd]());var u=jr(l),h=u==it?Nb:u==pn?pg:Gc;return h(l)}function vs(l){if(!l)return l===0?l:0;if(l=Gi(l),l===Se||l===-Se){var u=l<0?-1:1;return u*le}return l===l?l:0}function Qt(l){var u=vs(l),h=u%1;return u===u?h?u-h:u:0}function nA(l){return l?El(Qt(l),0,Ke):0}function Gi(l){if(typeof l=="number")return l;if(Ei(l))return tt;if(er(l)){var u=typeof l.valueOf=="function"?l.valueOf():l;l=er(u)?u+"":u}if(typeof l!="string")return l===0?l:+l;l=_9(l);var h=at.test(l);return h||lt.test(l)?FG(l.slice(2),h?2:8):We.test(l)?tt:+l}function rA(l){return Oo(l,fi(l))}function Eee(l){return l?El(Qt(l),-Te,Te):l===0?l:0}function Cn(l){return l==null?"":Ai(l)}var Tee=Hc(function(l,u){if(rf(u)||di(u)){Oo(u,Ar(u),l);return}for(var h in u)En.call(u,h)&&Jd(l,h,u[h])}),iA=Hc(function(l,u){Oo(u,fi(u),l)}),Yg=Hc(function(l,u,h,C){Oo(u,fi(u),l,C)}),Pee=Hc(function(l,u,h,C){Oo(u,Ar(u),l,C)}),Bee=ms(Wb);function Iee(l,u){var h=Wc(l);return u==null?h:L9(h,u)}var Mee=rn(function(l,u){l=On(l);var h=-1,C=u.length,O=C>2?u[2]:n;for(O&&Qr(u[0],u[1],O)&&(C=1);++h1),H}),Oo(l,uv(l),h),C&&(h=Ki(h,p|g|b,VJ));for(var O=u.length;O--;)nv(h,u[O]);return h});function Yee(l,u){return sA(l,qg(Rt(u)))}var Jee=ms(function(l,u){return l==null?{}:SJ(l,u)});function sA(l,u){if(l==null)return{};var h=Gn(uv(l),function(C){return[C]});return u=Rt(u),J9(l,h,function(C,O){return u(C,O[0])})}function Qee(l,u,h){u=fa(u,l);var C=-1,O=u.length;for(O||(O=1,l=n);++Cu){var C=l;l=u,u=C}if(h||l%1||u%1){var O=M9();return Dr(l+O*(u-l+jG("1e-"+((O+"").length-1))),u)}return Xb(l,u)}var cte=Kc(function(l,u,h){return u=u.toLowerCase(),l+(h?cA(u):u)});function cA(l){return Av(Cn(l).toLowerCase())}function uA(l){return l=Cn(l),l&&l.replace(xt,XG).replace(BG,"")}function ute(l,u,h){l=Cn(l),u=Ai(u);var C=l.length;h=h===n?C:El(Qt(h),0,C);var O=h;return h-=u.length,h>=0&&l.slice(h,O)==u}function dte(l){return l=Cn(l),l&&Mn.test(l)?l.replace(tn,eY):l}function fte(l){return l=Cn(l),l&&ds.test(l)?l.replace(Xn,"\\$&"):l}var hte=Kc(function(l,u,h){return l+(h?"-":"")+u.toLowerCase()}),pte=Kc(function(l,u,h){return l+(h?" ":"")+u.toLowerCase()}),gte=hk("toLowerCase");function mte(l,u,h){l=Cn(l),u=Qt(u);var C=u?Dc(l):0;if(!u||C>=u)return l;var O=(u-C)/2;return Ng(kg(O),h)+l+Ng(Sg(O),h)}function yte(l,u,h){l=Cn(l),u=Qt(u);var C=u?Dc(l):0;return u&&C>>0,h?(l=Cn(l),l&&(typeof u=="string"||u!=null&&!Cv(u))&&(u=Ai(u),!u&&Nc(l))?ha(io(l),0,h):l.split(u,h)):[]}var Ste=Kc(function(l,u,h){return l+(h?" ":"")+Av(u)});function kte(l,u,h){return l=Cn(l),h=h==null?0:El(Qt(h),0,l.length),u=Ai(u),l.slice(h,h+u.length)==u}function Ate(l,u,h){var C=z.templateSettings;h&&Qr(l,u,h)&&(u=n),l=Cn(l),u=Yg({},u,C,wk);var O=Yg({},u.imports,C.imports,wk),H=Ar(O),se=Ub(O,H),ye,we,ze=0,Ve=u.interpolate||St,qe="__p += '",st=Db((u.escape||St).source+"|"+Ve.source+"|"+(Ve===ci?Le:St).source+"|"+(u.evaluate||St).source+"|$","g"),_t="//# sourceURL="+(En.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++$G+"]")+` `;l.replace(st,function(Ut,an,fn,Ti,Xr,Pi){return fn||(fn=Ti),qe+=l.slice(ze,Pi).replace(Pt,tY),an&&(ye=!0,qe+=`' + __e(`+an+`) + '`),Xr&&(we=!0,qe+=`'; `+Xr+`; __p += '`),fn&&(qe+=`' + ((__t = (`+fn+`)) == null ? '' : __t) + '`),ze=Pi+Ut.length,Ut}),qe+=`'; `;var Lt=En.call(u,"variable")&&u.variable;if(!Lt)qe=`with (obj) { `+qe+` } `;else if(ce.test(Lt))throw new Ht(a);qe=(we?qe.replace(je,""):qe).replace($e,"$1").replace(gt,"$1;"),qe="function("+(Lt||"obj")+`) { `+(Lt?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(we?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+qe+`return __p }`;var nn=fA(function(){return wn(H,_t+"return "+qe).apply(n,se)});if(nn.source=qe,xv(nn))throw nn;return nn}function Ete(l){return Cn(l).toLowerCase()}function Tte(l){return Cn(l).toUpperCase()}function Pte(l,u,h){if(l=Cn(l),l&&(h||u===n))return _9(l);if(!l||!(u=Ai(u)))return l;var C=io(l),O=io(u),H=x9(C,O),se=C9(C,O)+1;return ha(C,H,se).join("")}function Bte(l,u,h){if(l=Cn(l),l&&(h||u===n))return l.slice(0,k9(l)+1);if(!l||!(u=Ai(u)))return l;var C=io(l),O=C9(C,io(u))+1;return ha(C,0,O).join("")}function Ite(l,u,h){if(l=Cn(l),l&&(h||u===n))return l.replace(T,"");if(!l||!(u=Ai(u)))return l;var C=io(l),O=x9(C,io(u));return ha(C,O).join("")}function Mte(l,u){var h=me,C=oe;if(er(u)){var O="separator"in u?u.separator:O;h="length"in u?Qt(u.length):h,C="omission"in u?Ai(u.omission):C}l=Cn(l);var H=l.length;if(Nc(l)){var se=io(l);H=se.length}if(h>=H)return l;var ye=h-Dc(C);if(ye<1)return C;var we=se?ha(se,0,ye).join(""):l.slice(0,ye);if(O===n)return we+C;if(se&&(ye+=we.length-ye),Cv(O)){if(l.slice(ye).search(O)){var ze,Ve=we;for(O.global||(O=Db(O.source,Cn(Ge.exec(O))+"g")),O.lastIndex=0;ze=O.exec(Ve);)var qe=ze.index;we=we.slice(0,qe===n?ye:qe)}}else if(l.indexOf(Ai(O),ye)!=ye){var st=we.lastIndexOf(O);st>-1&&(we=we.slice(0,st))}return we+C}function Rte(l){return l=Cn(l),l&&gn.test(l)?l.replace(nt,lY):l}var Ote=Kc(function(l,u,h){return l+(h?" ":"")+u.toUpperCase()}),Av=hk("toUpperCase");function dA(l,u,h){return l=Cn(l),u=h?n:u,u===n?rY(l)?dY(l):ZG(l):l.match(u)||[]}var fA=rn(function(l,u){try{return Si(l,n,u)}catch(h){return xv(h)?h:new Ht(h)}}),$te=ms(function(l,u){return Vi(u,function(h){h=$o(h),ps(l,h,wv(l[h],l))}),l});function Lte(l){var u=l==null?0:l.length,h=Rt();return l=u?Gn(l,function(C){if(typeof C[1]!="function")throw new Wi(s);return[h(C[0]),C[1]]}):[],rn(function(C){for(var O=-1;++OTe)return[];var h=Ke,C=Dr(l,Ke);u=Rt(u),l-=Ke;for(var O=Lb(C,u);++h0||u<0)?new dn(h):(l<0?h=h.takeRight(-l):l&&(h=h.drop(l)),u!==n&&(u=Qt(u),h=u<0?h.dropRight(-u):h.take(u-l)),h)},dn.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},dn.prototype.toArray=function(){return this.take(Ke)},Ro(dn.prototype,function(l,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),C=/^(?:head|last)$/.test(u),O=z[C?"take"+(u=="last"?"Right":""):u],H=C||/^find/.test(u);O&&(z.prototype[u]=function(){var se=this.__wrapped__,ye=C?[1]:arguments,we=se instanceof dn,ze=ye[0],Ve=we||Kt(se),qe=function(an){var fn=O.apply(z,aa([an],ye));return C&&st?fn[0]:fn};Ve&&h&&typeof ze=="function"&&ze.length!=1&&(we=Ve=!1);var st=this.__chain__,_t=!!this.__actions__.length,Lt=H&&!st,nn=we&&!_t;if(!H&&Ve){se=nn?se:new dn(this);var Ut=l.apply(se,ye);return Ut.__actions__.push({func:Vg,args:[qe],thisArg:n}),new Hi(Ut,st)}return Lt&&nn?l.apply(this,ye):(Ut=this.thru(qe),Lt?C?Ut.value()[0]:Ut.value():Ut)})}),Vi(["pop","push","shift","sort","splice","unshift"],function(l){var u=gg[l],h=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",C=/^(?:pop|shift)$/.test(l);z.prototype[l]=function(){var O=arguments;if(C&&!this.__chain__){var H=this.value();return u.apply(Kt(H)?H:[],O)}return this[h](function(se){return u.apply(Kt(se)?se:[],O)})}}),Ro(dn.prototype,function(l,u){var h=z[u];if(h){var C=h.name+"";En.call(Vc,C)||(Vc[C]=[]),Vc[C].push({name:u,func:h})}}),Vc[Lg(n,I).name]=[{name:"wrapper",func:n}],dn.prototype.clone=RY,dn.prototype.reverse=OY,dn.prototype.value=$Y,z.prototype.at=uX,z.prototype.chain=dX,z.prototype.commit=fX,z.prototype.next=hX,z.prototype.plant=gX,z.prototype.reverse=mX,z.prototype.toJSON=z.prototype.valueOf=z.prototype.value=yX,z.prototype.first=z.prototype.head,Kd&&(z.prototype[Kd]=pX),z},jc=fY();Cl?((Cl.exports=jc)._=jc,Tb._=jc):Rr._=jc}).call(et)}(Ff,Ff.exports);var b3=Ff.exports,Ri={},$n={},yi={},ql=Symbol.for("nodejs.util.inspect.custom"),Zl={};Object.defineProperty(Zl,"__esModule",{value:!0}),Zl.crc16=void 0;function II(e){let n=0;const r=Ne.alloc(e.length+2);r.set(e);for(let i of r){let o=128;for(;o>0;)n<<=1,i&o&&(n+=1),o>>=1,n>65535&&(n&=65535,n^=4129)}return Ne.from([Math.floor(n/256),n%256])}Zl.crc16=II;var MI=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},v3;Object.defineProperty(yi,"__esModule",{value:!0}),yi.address=yi.Address=void 0;const RI=MI(ql),w3=Zl,Sm=17,_3=81,km=128;function x3(e){if(typeof e=="string"&&!Ji.isFriendly(e))throw new Error("Unknown address type");const t=Ne.isBuffer(e)?e:Ne.from(e,"base64");if(t.length!==36)throw new Error("Unknown address type: byte length is not equal to 36");const n=t.subarray(0,34),r=t.subarray(34,36),i=(0,w3.crc16)(n);if(!(i[0]===r[0]&&i[1]===r[1]))throw new Error("Invalid checksum: "+e);let o=n[0],s=!1,a=!1;if(o&km&&(s=!0,o=o^km),o!==Sm&&o!==_3)throw"Unknown address tag";a=o===Sm;let c=null;n[1]===255?c=-1:c=n[1];const d=n.subarray(2,34);return{isTestOnly:s,isBounceable:a,workchain:c,hashPart:d}}class Ji{static isAddress(t){return t instanceof Ji}static isFriendly(t){return!(t.length!==48||!/[A-Za-z0-9+/_-]+/.test(t))}static isRaw(t){if(t.indexOf(":")===-1)return!1;let[n,r]=t.split(":");return!(!Number.isInteger(parseFloat(n))||!/[a-f0-9]+/.test(r.toLowerCase())||r.length!==64)}static normalize(t){return typeof t=="string"?Ji.parse(t).toString():t.toString()}static parse(t){if(Ji.isFriendly(t))return this.parseFriendly(t).address;if(Ji.isRaw(t))return this.parseRaw(t);throw new Error("Unknown address type: "+t)}static parseRaw(t){let n=parseInt(t.split(":")[0]),r=Ne.from(t.split(":")[1],"hex");return new Ji(n,r)}static parseFriendly(t){if(Ne.isBuffer(t)){let n=x3(t);return{isBounceable:n.isBounceable,isTestOnly:n.isTestOnly,address:new Ji(n.workchain,n.hashPart)}}else{let n=t.replace(/\-/g,"+").replace(/_/g,"/"),r=x3(n);return{isBounceable:r.isBounceable,isTestOnly:r.isTestOnly,address:new Ji(r.workchain,r.hashPart)}}}constructor(t,n){if(this.toRawString=()=>this.workChain+":"+this.hash.toString("hex"),this.toRaw=()=>{const r=Ne.alloc(36);return r.set(this.hash),r.set([this.workChain,this.workChain,this.workChain,this.workChain],32),r},this.toStringBuffer=r=>{let i=r&&r.testOnly!==void 0?r.testOnly:!1,s=(r&&r.bounceable!==void 0?r.bounceable:!0)?Sm:_3;i&&(s|=km);const a=Ne.alloc(34);a[0]=s,a[1]=this.workChain,a.set(this.hash,2);const c=Ne.alloc(36);return c.set(a),c.set((0,w3.crc16)(a),34),c},this.toString=r=>{let i=r&&r.urlSafe!==void 0?r.urlSafe:!0,o=this.toStringBuffer(r);return i?o.toString("base64").replace(/\+/g,"-").replace(/\//g,"_"):o.toString("base64")},this[v3]=()=>this.toString(),n.length!==32)throw new Error("Invalid address hash length: "+n.length);this.workChain=t,this.hash=n,Object.freeze(this)}equals(t){return t.workChain!==this.workChain?!1:t.hash.equals(this.hash)}}yi.Address=Ji,v3=RI.default;function OI(e){return Ji.parse(e)}yi.address=OI;var Gl={},$I=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},C3;Object.defineProperty(Gl,"__esModule",{value:!0}),Gl.ExternalAddress=void 0;const LI=$I(ql);class Am{static isAddress(t){return t instanceof Am}constructor(t,n){this[C3]=()=>this.toString(),this.value=t,this.bits=n}toString(){return`External<${this.bits}:${this.value}>`}}Gl.ExternalAddress=Am,C3=LI.default;var zf={},Aa={};Object.defineProperty(Aa,"__esModule",{value:!0}),Aa.base32Decode=Aa.base32Encode=void 0;const Em="abcdefghijklmnopqrstuvwxyz234567";function UI(e){const t=e.byteLength;let n=0,r=0,i="";for(let o=0;o=5;)i+=Em[r>>>n-5&31],n-=5;return n>0&&(i+=Em[r<<5-n&31]),i}Aa.base32Encode=UI;function NI(e,t){const n=e.indexOf(t);if(n===-1)throw new Error("Invalid character found: "+t);return n}function DI(e){let t;t=e.toLowerCase();const{length:n}=t;let r=0,i=0,o=0;const s=Ne.alloc(n*5/8|0);for(let a=0;a=8&&(s[o++]=i>>>r-8&255,r-=8);return s}Aa.base32Decode=DI;var jI=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},S3;Object.defineProperty(zf,"__esModule",{value:!0}),zf.ADNLAddress=void 0;const FI=jI(ql),k3=Aa,A3=Zl;class Vf{static parseFriendly(t){if(t.length!==55)throw Error("Invalid address");t="f"+t;let n=(0,k3.base32Decode)(t);if(n[0]!==45)throw Error("Invalid address");let r=n.slice(33);if(!(0,A3.crc16)(n.slice(0,33)).equals(r))throw Error("Invalid address");return new Vf(n.slice(1,33))}static parseRaw(t){const n=Ne.from(t,"base64");return new Vf(n)}constructor(t){if(this.toRaw=()=>this.address.toString("hex").toUpperCase(),this.toString=()=>{let n=Ne.concat([Ne.from([45]),this.address]),r=(0,A3.crc16)(n);return n=Ne.concat([n,r]),(0,k3.base32Encode)(n).slice(1)},this[S3]=()=>this.toString(),t.length!==32)throw Error("Invalid address");this.address=t}equals(t){return this.address.equals(t.address)}}zf.ADNLAddress=Vf,S3=FI.default;var Wf={},Ea={},gu={},mu={},Ta={},E3;function Hf(){if(E3)return Ta;E3=1,Object.defineProperty(Ta,"__esModule",{value:!0}),Ta.paddedBufferToBits=Ta.bitsToPaddedBuffer=void 0;const e=Kf(),t=Ts();function n(i){let o=new e.BitBuilder(Math.ceil(i.length/8)*8);o.writeBits(i);let s=Math.ceil(i.length/8)*8-i.length;for(let a=0;a=0;s--)if(i[s]!==0){const a=i[s];let c=a&-a;c&1||(c=Math.log2(c)+1),s>0&&(o=s<<3),o+=8-c;break}return new t.BitString(i,0,o)}return Ta.paddedBufferToBits=r,Ta}var T3;function Ts(){if(T3)return mu;T3=1;var e=et&&et.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},t;Object.defineProperty(mu,"__esModule",{value:!0}),mu.BitString=void 0;const n=Hf(),r=e(ql);let i=class Jg{static isBitString(s){return s instanceof Jg}constructor(s,a,c){if(this[t]=()=>this.toString(),c<0)throw new Error(`Length ${c} is out of bounds`);this._length=c,this._data=s,this._offset=a}get length(){return this._length}at(s){if(s>=this._length)throw new Error(`Index ${s} > ${this._length} is out of bounds`);if(s<0)throw new Error(`Index ${s} < 0 is out of bounds`);let a=this._offset+s>>3,c=7-(this._offset+s)%8;return(this._data[a]&1<this._length)throw new Error(`Offset(${s}) > ${this._length} is out of bounds`);if(s<0)throw new Error(`Offset(${s}) < 0 is out of bounds`);if(a===0)return Jg.EMPTY;if(s+a>this._length)throw new Error(`Offset ${s} + Length ${a} > ${this._length} is out of bounds`);return new Jg(this._data,this._offset+s,a)}subbuffer(s,a){if(s>this._length)throw new Error(`Offset ${s} is out of bounds`);if(s<0)throw new Error(`Offset ${s} is out of bounds`);if(s+a>this._length)throw new Error(`Offset + Lenght = ${s+a} is out of bounds`);if(a%8!==0||(this._offset+s)%8!==0)return null;let c=this._offset+s>>3,d=c+(a>>3);return this._data.subarray(c,d)}equals(s){if(this._length!==s._length)return!1;for(let a=0;athis._buffer.length*8)throw new Error("BitBuilder overflow");(typeof o=="boolean"&&o===!0||typeof o=="number"&&o>0)&&(this._buffer[s/8|0]|=1<<7-s%8),this._length++}writeBits(o){for(let s=0;sthis._buffer.length*8)throw new Error("BitBuilder overflow");o.copy(this._buffer,this._length/8),this._length+=o.length*8}else for(let s=0;s=c)throw Error(`bitLength is too small for a value ${o}. Got ${s}`);if(this._length+s>this._buffer.length*8)throw new Error("BitBuilder overflow");const d=8-this._length%8;if(d>0){const f=Math.floor(this._length/8);if(s>BigInt(s-d));this._buffer[f]|=p,this._length+=d}}for(s-=d;s>0;)s>=8?(this._buffer[this._length/8]=Number(a>>BigInt(s-8)&0xffn),this._length+=8,s-=8):(this._buffer[this._length/8]=Number(a<=c)throw Error(`value is out of range for ${s} bits. Got ${o}`);a<0?(this.writeBit(!0),a=c+a):this.writeBit(!1),this.writeUint(a,s-1)}writeVarUint(o,s){let a=BigInt(o);if(s<0||!Number.isSafeInteger(s))throw Error(`invalid bit length. Got ${s}`);if(a<0)throw Error(`value is negative. Got ${o}`);if(a===0n){this.writeUint(0,s);return}const c=Math.ceil(a.toString(2).length/8),d=c*8;this.writeUint(c,s),this.writeUint(a,d)}writeVarInt(o,s){let a=BigInt(o);if(s<0||!Number.isSafeInteger(s))throw Error(`invalid bit length. Got ${s}`);if(a===0n){this.writeUint(0,s);return}let c=a>0?a:-a;const d=1+Math.ceil(c.toString(2).length/8),f=d*8;this.writeUint(d,s),this.writeInt(a,f)}writeCoins(o){this.writeVarUint(o,4)}writeAddress(o){if(o==null){this.writeUint(0,2);return}if(e.Address.isAddress(o)){this.writeUint(2,2),this.writeUint(0,1),this.writeInt(o.workChain,8),this.writeBuffer(o.hash);return}if(t.ExternalAddress.isAddress(o)){this.writeUint(1,2),this.writeUint(o.bits,9),this.writeUint(o.value,o.bits);return}throw Error(`Invalid address. Got ${o}`)}build(){return new n.BitString(this._buffer,0,this._length)}buffer(){if(this._length%8!==0)throw new Error("BitBuilder buffer is not byte aligned");return this._buffer.subarray(0,this._length/8)}};return gu.BitBuilder=r,gu}var yu={},Ps={};Object.defineProperty(Ps,"__esModule",{value:!0}),Ps.CellType=void 0;var B3;(function(e){e[e.Ordinary=-1]="Ordinary",e[e.PrunedBranch=1]="PrunedBranch",e[e.Library=2]="Library",e[e.MerkleProof=3]="MerkleProof",e[e.MerkleUpdate=4]="MerkleUpdate"})(B3||(Ps.CellType=B3={}));var bu={},vu={},Pa={},qf={};Object.defineProperty(qf,"__esModule",{value:!0}),qf.readUnaryLength=void 0;function zI(e){let t=0;for(;e.loadBit();)t++;return t}qf.readUnaryLength=zI;var Ba={},Qi={};Object.defineProperty(Qi,"__esModule",{value:!0}),Qi.BitReader=void 0;const VI=yi,WI=Gl;class Tm{constructor(t,n=0){this._checkpoints=[],this._bits=t,this._offset=n}get offset(){return this._offset}get remaining(){return this._bits.length-this._offset}skip(t){if(t<0||this._offset+t>this._bits.length)throw new Error(`Index ${this._offset+t} is out of bounds`);this._offset+=t}reset(){this._checkpoints.length>0?this._offset=this._checkpoints.pop():this._offset=0}save(){this._checkpoints.push(this._offset)}loadBit(){let t=this._bits.at(this._offset);return this._offset++,t}preloadBit(){return this._bits.at(this._offset)}loadBits(t){let n=this._bits.substring(this._offset,t);return this._offset+=t,n}preloadBits(t){return this._bits.substring(this._offset,t)}loadBuffer(t){let n=this._preloadBuffer(t,this._offset);return this._offset+=t*8,n}preloadBuffer(t){return this._preloadBuffer(t,this._offset)}loadUint(t){return this._toSafeInteger(this.loadUintBig(t),"loadUintBig")}loadUintBig(t){let n=this.preloadUintBig(t);return this._offset+=t,n}preloadUint(t){return this._toSafeInteger(this._preloadUint(t,this._offset),"preloadUintBig")}preloadUintBig(t){return this._preloadUint(t,this._offset)}loadInt(t){let n=this._preloadInt(t,this._offset);return this._offset+=t,this._toSafeInteger(n,"loadUintBig")}loadIntBig(t){let n=this._preloadInt(t,this._offset);return this._offset+=t,n}preloadInt(t){return this._toSafeInteger(this._preloadInt(t,this._offset),"preloadIntBig")}preloadIntBig(t){return this._preloadInt(t,this._offset)}loadVarUint(t){let n=Number(this.loadUint(t));return this._toSafeInteger(this.loadUintBig(n*8),"loadVarUintBig")}loadVarUintBig(t){let n=Number(this.loadUint(t));return this.loadUintBig(n*8)}preloadVarUint(t){let n=Number(this._preloadUint(t,this._offset));return this._toSafeInteger(this._preloadUint(n*8,this._offset+t),"preloadVarUintBig")}preloadVarUintBig(t){let n=Number(this._preloadUint(t,this._offset));return this._preloadUint(n*8,this._offset+t)}loadVarInt(t){let n=Number(this.loadUint(t));return this._toSafeInteger(this.loadIntBig(n*8),"loadVarIntBig")}loadVarIntBig(t){let n=Number(this.loadUint(t));return this.loadIntBig(n*8)}preloadVarInt(t){let n=Number(this._preloadUint(t,this._offset));return this._toSafeInteger(this._preloadInt(n*8,this._offset+t),"preloadVarIntBig")}preloadVarIntBig(t){let n=Number(this._preloadUint(t,this._offset));return this._preloadInt(n*8,this._offset+t)}loadCoins(){return this.loadVarUintBig(4)}preloadCoins(){return this.preloadVarUintBig(4)}loadAddress(){let t=Number(this._preloadUint(2,this._offset));if(t===2)return this._loadInternalAddress();throw new Error("Invalid address: "+t)}loadMaybeAddress(){let t=Number(this._preloadUint(2,this._offset));if(t===0)return this._offset+=2,null;if(t===2)return this._loadInternalAddress();throw new Error("Invalid address")}loadExternalAddress(){if(Number(this._preloadUint(2,this._offset))===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadMaybeExternalAddress(){let t=Number(this._preloadUint(2,this._offset));if(t===0)return this._offset+=2,null;if(t===1)return this._loadExternalAddress();throw new Error("Invalid address")}loadAddressAny(){let t=Number(this._preloadUint(2,this._offset));if(t===0)return this._offset+=2,null;if(t===2)return this._loadInternalAddress();if(t===1)return this._loadExternalAddress();throw Error(t===3?"Unsupported":"Unreachable")}loadPaddedBits(t){if(t%8!==0)throw new Error("Invalid number of bits");let n=t;for(;;)if(this._bits.at(this._offset+n-1)){n--;break}else n--;let r=this._bits.substring(this._offset,n);return this._offset+=t,r}clone(){return new Tm(this._bits,this._offset)}_preloadInt(t,n){if(t==0)return 0n;let r=this._bits.at(n),i=0n;for(let o=0;o_+"0"===R.slice(0,_.length+1));k=i(_+"0",k.beginParse(),d-b-1,B)}if(!I.isExotic){const B=f.filter(R=>_+"1"===R.slice(0,_.length+1));I=i(_+"1",I.beginParse(),d-b-1,B)}return(0,e.beginCell)().storeSlice(S).storeRef(k).storeRef(I).endCell()}}function o(a,c,d){c.forEach(p=>{if(!a.has(p))throw new Error(`Trying to generate merkle proof for a missing key "${p}"`)});const f=(0,e.beginCell)().storeDictDirect(a).asSlice();return i("",f,d.bits,c.map(p=>d.serialize(p).toString(2).padStart(d.bits,"0")))}Pa.generateMerkleProofDirect=o;function s(a,c,d){return(0,n.convertToMerkleProof)(o(a,c,d))}return Pa.generateMerkleProof=s,Pa}var wu={},R3;function O3(){if(R3)return wu;R3=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.generateMerkleUpdate=void 0;const e=ur(),t=Pm();function n(i,o){return(0,e.beginCell)().storeUint(4,8).storeBuffer(i.hash(0)).storeBuffer(o.hash(0)).storeUint(i.depth(0),16).storeUint(o.depth(0),16).storeRef(i).storeRef(o).endCell({exotic:!0})}function r(i,o,s,a){const c=(0,t.generateMerkleProof)(i,[o],s).refs[0];i.set(o,a);const d=(0,t.generateMerkleProof)(i,[o],s).refs[0];return n(c,d)}return wu.generateMerkleUpdate=r,wu}var Gf={};Object.defineProperty(Gf,"__esModule",{value:!0}),Gf.parseDict=void 0;function HI(e){let t=0;for(;e.loadBit();)t++;return t}function Bm(e,t,n,r,i){let o=t.loadBit()?1:0,s=0,a=e;if(o===0){s=HI(t);for(let c=0;c0&&$.storeUint(BigInt("0b"+R),R.length),$}Fr.writeLabelShort=a;function c(R){return 1+R.length+1+R.length}function d(R,$,L){L.storeBit(1),L.storeBit(0);let U=Math.ceil(Math.log2($+1));return L.storeUint(R.length,U),R.length>0&&L.storeUint(BigInt("0b"+R),R.length),L}Fr.writeLabelLong=d;function f(R,$){return 2+Math.ceil(Math.log2($+1))+R.length}function p(R,$,L,U){U.storeBit(1),U.storeBit(1),U.storeBit(R);let G=Math.ceil(Math.log2(L+1));U.storeUint($,G)}Fr.writeLabelSame=p;function g(R){return 3+Math.ceil(Math.log2(R+1))}function b(R){if(R.length===0||R.length===1)return!0;for(let $=1;$(0,c.deserializeInternalKey)(Z))}values(){return Array.from(this._map.values())}store(Z,be,Ae){if(this._map.size===0)Z.storeBit(0);else{let Se=this._key;be!=null&&(Se=be);let Te=this._value;if(Ae!=null&&(Te=Ae),!Se)throw Error("Key serializer is not defined");if(!Te)throw Error("Value serializer is not defined");let le=new Map;for(const[Ke,Nt]of this._map)le.set(Se.serialize((0,c.deserializeInternalKey)(Ke)),Nt);Z.storeBit(1);let tt=(0,t.beginCell)();(0,a.serializeDict)(le,Se.bits,Te.serialize,tt),Z.storeRef(tt.endCell())}}storeDirect(Z,be,Ae){if(this._map.size===0)throw Error("Cannot store empty dictionary directly");let Se=this._key;be!=null&&(Se=be);let Te=this._value;if(Ae!=null&&(Te=Ae),!Se)throw Error("Key serializer is not defined");if(!Te)throw Error("Value serializer is not defined");let le=new Map;for(const[tt,Ke]of this._map)le.set(Se.serialize((0,c.deserializeInternalKey)(tt)),Ke);(0,a.serializeDict)(le,Se.bits,Te.serialize,Z)}generateMerkleProof(Z){return(0,i.generateMerkleProof)(this,Z,this._key)}generateMerkleProofDirect(Z){return(0,i.generateMerkleProofDirect)(this,Z,this._key)}generateMerkleUpdate(Z,be){return(0,o.generateMerkleUpdate)(this,Z,this._key,be)}};vu.Dictionary=d,d.Keys={Address:()=>f(),BigInt:re=>p(re),Int:re=>g(re),BigUint:re=>b(re),Uint:re=>_(re),Buffer:re=>S(re),BitString:re=>k(re)},d.Values={BigInt:re=>B(re),Int:re=>I(re),BigVarInt:re=>R(re),BigUint:re=>U(re),Uint:re=>L(re),BigVarUint:re=>$(re),Bool:()=>G(),Address:()=>X(),Cell:()=>J(),Buffer:re=>oe(re),BitString:re=>Q(re),Dictionary:(re,Z)=>me(re,Z)};function f(){return{bits:267,serialize:re=>{if(!e.Address.isAddress(re))throw Error("Key is not an address");return(0,t.beginCell)().storeAddress(re).endCell().beginParse().preloadUintBig(267)},parse:re=>(0,t.beginCell)().storeUint(re,267).endCell().beginParse().loadAddress()}}function p(re){return{bits:re,serialize:Z=>{if(typeof Z!="bigint")throw Error("Key is not a bigint");return(0,t.beginCell)().storeInt(Z,re).endCell().beginParse().loadUintBig(re)},parse:Z=>(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadIntBig(re)}}function g(re){return{bits:re,serialize:Z=>{if(typeof Z!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(Z))throw Error("Key is not a safe integer: "+Z);return(0,t.beginCell)().storeInt(Z,re).endCell().beginParse().loadUintBig(re)},parse:Z=>(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadInt(re)}}function b(re){return{bits:re,serialize:Z=>{if(typeof Z!="bigint")throw Error("Key is not a bigint");if(Z<0)throw Error("Key is negative: "+Z);return(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadUintBig(re)},parse:Z=>(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadUintBig(re)}}function _(re){return{bits:re,serialize:Z=>{if(typeof Z!="number")throw Error("Key is not a number");if(!Number.isSafeInteger(Z))throw Error("Key is not a safe integer: "+Z);if(Z<0)throw Error("Key is negative: "+Z);return(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadUintBig(re)},parse:Z=>Number((0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadUint(re))}}function S(re){return{bits:re*8,serialize:Z=>{if(!Ne.isBuffer(Z))throw Error("Key is not a buffer");return(0,t.beginCell)().storeBuffer(Z).endCell().beginParse().loadUintBig(re*8)},parse:Z=>(0,t.beginCell)().storeUint(Z,re*8).endCell().beginParse().loadBuffer(re)}}function k(re){return{bits:re,serialize:Z=>{if(!r.BitString.isBitString(Z))throw Error("Key is not a BitString");return(0,t.beginCell)().storeBits(Z).endCell().beginParse().loadUintBig(re)},parse:Z=>(0,t.beginCell)().storeUint(Z,re).endCell().beginParse().loadBits(re)}}function I(re){return{serialize:(Z,be)=>{be.storeInt(Z,re)},parse:Z=>Z.loadInt(re)}}function B(re){return{serialize:(Z,be)=>{be.storeInt(Z,re)},parse:Z=>Z.loadIntBig(re)}}function R(re){return{serialize:(Z,be)=>{be.storeVarInt(Z,re)},parse:Z=>Z.loadVarIntBig(re)}}function $(re){return{serialize:(Z,be)=>{be.storeVarUint(Z,re)},parse:Z=>Z.loadVarUintBig(re)}}function L(re){return{serialize:(Z,be)=>{be.storeUint(Z,re)},parse:Z=>Z.loadUint(re)}}function U(re){return{serialize:(Z,be)=>{be.storeUint(Z,re)},parse:Z=>Z.loadUintBig(re)}}function G(){return{serialize:(re,Z)=>{Z.storeBit(re)},parse:re=>re.loadBit()}}function X(){return{serialize:(re,Z)=>{Z.storeAddress(re)},parse:re=>re.loadAddress()}}function J(){return{serialize:(re,Z)=>{Z.storeRef(re)},parse:re=>re.loadRef()}}function me(re,Z){return{serialize:(be,Ae)=>{be.store(Ae)},parse:be=>d.load(re,Z,be)}}function oe(re){return{serialize:(Z,be)=>{if(Z.length!==re)throw Error("Invalid buffer size");be.storeBuffer(Z)},parse:Z=>Z.loadBuffer(re)}}function Q(re){return{serialize:(Z,be)=>{if(Z.length!==re)throw Error("Invalid BitString size");be.storeBits(Z)},parse:Z=>Z.loadBits(re)}}return vu}var Wo={},N3;function D3(){if(N3)return Wo;N3=1,Object.defineProperty(Wo,"__esModule",{value:!0}),Wo.writeString=Wo.stringToCell=Wo.readString=void 0;const e=ur();function t(s){if(s.remainingBits%8!==0)throw new Error(`Invalid string length: ${s.remainingBits}`);if(s.remainingRefs!==0&&s.remainingRefs!==1)throw new Error(`invalid number of refs: ${s.remainingRefs}`);let a;return s.remainingBits===0?a=Ne.alloc(0):a=s.loadBuffer(s.remainingBits/8),s.remainingRefs===1&&(a=Ne.concat([a,t(s.loadRef().beginParse())])),a}function n(s){return t(s).toString()}Wo.readString=n;function r(s,a){if(s.length>0){let c=Math.floor(a.availableBits/8);if(s.length>c){let d=s.subarray(0,c),f=s.subarray(c);a=a.storeBuffer(d);let p=(0,e.beginCell)();r(f,p),a=a.storeRef(p.endCell())}else a=a.storeBuffer(s)}}function i(s){let a=(0,e.beginCell)();return r(Ne.from(s),a),a.endCell()}Wo.stringToCell=i;function o(s,a){r(Ne.from(s),a)}return Wo.writeString=o,Wo}var j3;function Mm(){if(j3)return bu;j3=1;var e=et&&et.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t;Object.defineProperty(bu,"__esModule",{value:!0}),bu.Slice=void 0;const n=e(ql),r=Ia(),i=ur(),o=D3();let s=class Rv{constructor(c,d){this[t]=()=>this.toString(),this._reader=c.clone(),this._refs=[...d],this._refsOffset=0}get remainingBits(){return this._reader.remaining}get offsetBits(){return this._reader.offset}get remainingRefs(){return this._refs.length-this._refsOffset}get offsetRefs(){return this._refsOffset}skip(c){return this._reader.skip(c),this}loadBit(){return this._reader.loadBit()}preloadBit(){return this._reader.preloadBit()}loadBoolean(){return this.loadBit()}loadMaybeBoolean(){return this.loadBit()?this.loadBoolean():null}loadBits(c){return this._reader.loadBits(c)}preloadBits(c){return this._reader.preloadBits(c)}loadUint(c){return this._reader.loadUint(c)}loadUintBig(c){return this._reader.loadUintBig(c)}preloadUint(c){return this._reader.preloadUint(c)}preloadUintBig(c){return this._reader.preloadUintBig(c)}loadMaybeUint(c){return this.loadBit()?this.loadUint(c):null}loadMaybeUintBig(c){return this.loadBit()?this.loadUintBig(c):null}loadInt(c){return this._reader.loadInt(c)}loadIntBig(c){return this._reader.loadIntBig(c)}preloadInt(c){return this._reader.preloadInt(c)}preloadIntBig(c){return this._reader.preloadIntBig(c)}loadMaybeInt(c){return this.loadBit()?this.loadInt(c):null}loadMaybeIntBig(c){return this.loadBit()?this.loadIntBig(c):null}loadVarUint(c){return this._reader.loadVarUint(c)}loadVarUintBig(c){return this._reader.loadVarUintBig(c)}preloadVarUint(c){return this._reader.preloadVarUint(c)}preloadVarUintBig(c){return this._reader.preloadVarUintBig(c)}loadVarInt(c){return this._reader.loadVarInt(c)}loadVarIntBig(c){return this._reader.loadVarIntBig(c)}preloadVarInt(c){return this._reader.preloadVarInt(c)}preloadVarIntBig(c){return this._reader.preloadVarIntBig(c)}loadCoins(){return this._reader.loadCoins()}preloadCoins(){return this._reader.preloadCoins()}loadMaybeCoins(){return this._reader.loadBit()?this._reader.loadCoins():null}loadAddress(){return this._reader.loadAddress()}loadMaybeAddress(){return this._reader.loadMaybeAddress()}loadExternalAddress(){return this._reader.loadExternalAddress()}loadMaybeExternalAddress(){return this._reader.loadMaybeExternalAddress()}loadAddressAny(){return this._reader.loadAddressAny()}loadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset++]}preloadRef(){if(this._refsOffset>=this._refs.length)throw new Error("No more references");return this._refs[this._refsOffset]}loadMaybeRef(){return this.loadBit()?this.loadRef():null}preloadMaybeRef(){return this.preloadBit()?this.preloadRef():null}loadBuffer(c){return this._reader.loadBuffer(c)}preloadBuffer(c){return this._reader.preloadBuffer(c)}loadStringTail(){return(0,o.readString)(this)}loadMaybeStringTail(){return this.loadBit()?(0,o.readString)(this):null}loadStringRefTail(){return(0,o.readString)(this.loadRef().beginParse())}loadMaybeStringRefTail(){const c=this.loadMaybeRef();return c?(0,o.readString)(c.beginParse()):null}loadDict(c,d){return r.Dictionary.load(c,d,this)}loadDictDirect(c,d){return r.Dictionary.loadDirect(c,d,this)}endParse(){if(this.remainingBits>0||this.remainingRefs>0)throw new Error("Slice is not empty")}asCell(){return(0,i.beginCell)().storeSlice(this).endCell()}asBuilder(){return(0,i.beginCell)().storeSlice(this)}clone(c=!1){if(c){let d=this._reader.clone();return d.reset(),new Rv(d,this._refs)}else{let d=new Rv(this._reader,this._refs);return d._refsOffset=this._refsOffset,d}}toString(){return this.asCell().toString()}};return bu.Slice=s,t=n.default,bu}var _u={},xu={};Object.defineProperty(xu,"__esModule",{value:!0}),xu.exoticLibrary=void 0;const QI=Qi;function XI(e,t){const n=new QI.BitReader(e);if(e.length!==264)throw new Error(`Library cell must have exactly (8 + 256) bits, got "${e.length}"`);let i=n.loadUint(8);if(i!==2)throw new Error(`Library cell must have type 2, got "${i}"`);return{}}xu.exoticLibrary=XI;var Jl={};Object.defineProperty(Jl,"__esModule",{value:!0}),Jl.exoticMerkleUpdate=void 0;const eM=Qi;function tM(e,t){const n=new eM.BitReader(e),r=8+2*272;if(e.length!==r)throw new Error(`Merkle Update cell must have exactly (8 + (2 * (256 + 16))) bits, got "${e.length}"`);if(t.length!==2)throw new Error(`Merkle Update cell must have exactly 2 refs, got "${t.length}"`);let i=n.loadUint(8);if(i!==4)throw new Error(`Merkle Update cell type must be exactly 4, got "${i}"`);const o=n.loadBuffer(32),s=n.loadBuffer(32),a=n.loadUint(16),c=n.loadUint(16);if(a!==t[0].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${a}", got "${t[0].depth(0)}"`);if(!o.equals(t[0].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${o.toString("hex")}", got "${t[0].hash(0).toString("hex")}"`);if(c!==t[1].depth(0))throw new Error(`Merkle Update cell ref depth must be exactly "${c}", got "${t[1].depth(0)}"`);if(!s.equals(t[1].hash(0)))throw new Error(`Merkle Update cell ref hash must be exactly "${s.toString("hex")}", got "${t[1].hash(0).toString("hex")}"`);return{proofDepth1:a,proofDepth2:c,proofHash1:o,proofHash2:s}}Jl.exoticMerkleUpdate=tM;var Ql={},Xl={};Object.defineProperty(Xl,"__esModule",{value:!0}),Xl.LevelMask=void 0;class Rm{constructor(t=0){this._mask=0,this._mask=t,this._hashIndex=nM(this._mask),this._hashCount=this._hashIndex+1}get value(){return this._mask}get level(){return 32-Math.clz32(this._mask)}get hashIndex(){return this._hashIndex}get hashCount(){return this._hashCount}apply(t){return new Rm(this._mask&(1<>t-1)%2!==0}}Xl.LevelMask=Rm;function nM(e){return e=e-(e>>1&1431655765),e=(e&858993459)+(e>>2&858993459),(e+(e>>4)&252645135)*16843009>>24}Object.defineProperty(Ql,"__esModule",{value:!0}),Ql.exoticPruned=void 0;const rM=Qi,F3=Xl;function iM(e,t){let n=new rM.BitReader(e),r=n.loadUint(8);if(r!==1)throw new Error(`Pruned branch cell must have type 1, got "${r}"`);if(t.length!==0)throw new Error(`Pruned Branch cell can't has refs, got "${t.length}"`);let i;if(e.length===280)i=new F3.LevelMask(1);else{if(i=new F3.LevelMask(n.loadUint(8)),i.level<1||i.level>3)throw new Error(`Pruned Branch cell level must be >= 1 and <= 3, got "${i.level}/${i.value}"`);const c=16+i.apply(i.level-1).hashCount*272;if(e.length!==c)throw new Error(`Pruned branch cell must have exactly ${c} bits, got "${e.length}"`)}let o=[],s=[],a=[];for(let c=0;c>1);return{type:t.CellType.MerkleProof,depths:_,hashes:S,mask:k}}function f(g,b){(0,i.exoticMerkleUpdate)(g,b);let _=[],S=[],k=new s.LevelMask((b[0].level()|b[1].level())>>1);return{type:t.CellType.MerkleUpdate,depths:_,hashes:S,mask:k}}function p(g,b){let S=new e.BitReader(g).preloadUint(8);if(S===1)return a(g,b);if(S===2)return c(g,b);if(S===3)return d(g,b);if(S===4)return f(g,b);throw Error("Invalid exotic cell type: "+S)}return _u.resolveExotic=p,_u}var Cu={},Ho={};Object.defineProperty(Ho,"__esModule",{value:!0}),Ho.getRepr=Ho.getBitsDescriptor=Ho.getRefsDescriptor=void 0;const Su=Ps,sM=Hf();function V3(e,t,n){return e.length+(n!==Su.CellType.Ordinary?1:0)*8+t*32}Ho.getRefsDescriptor=V3;function W3(e){let t=e.length;return Math.ceil(t/8)+Math.floor(t/8)}Ho.getBitsDescriptor=W3;function aM(e,t,n,r,i,o){const s=Math.ceil(t.length/8),a=Ne.alloc(2+s+34*n.length);let c=0;a[c++]=V3(n,i,o),a[c++]=W3(e),(0,sM.bitsToPaddedBuffer)(t).copy(a,c),c+=s;for(const d of n){let f;o==Su.CellType.MerkleProof||o==Su.CellType.MerkleUpdate?f=d.depth(r+1):f=d.depth(r),a[c++]=Math.floor(f/256),a[c++]=f%256}for(const d of n){let f;o==Su.CellType.MerkleProof||o==Su.CellType.MerkleUpdate?f=d.hash(r+1):f=d.hash(r),f.copy(a,c),c+=32}return a}Ho.getRepr=aM;var Om={},Bs={},H3={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(et,function(){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function r(ue,D,ne,ee){var he,x,y,v=D||[0],M=(ne=ne||0)>>>3,Y=ee===-1?3:0;for(he=0;he>>2,v.length<=x&&v.push(0),v[x]|=ue[he]<<8*(Y+ee*(y%4));return{value:v,binLen:8*ue.length+ne}}function i(ue,D,ne){switch(D){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(ue){case"HEX":return function(ee,he,x){return function(y,v,M,Y){var de,fe,De,je;if(y.length%2!=0)throw new Error("String of HEX type must be in byte increments");var $e=v||[0],gt=(M=M||0)>>>3,nt=Y===-1?3:0;for(de=0;de>>1)+gt)>>>2;$e.length<=De;)$e.push(0);$e[De]|=fe<<8*(nt+Y*(je%4))}return{value:$e,binLen:4*y.length+M}}(ee,he,x,ne)};case"TEXT":return function(ee,he,x){return function(y,v,M,Y,de){var fe,De,je,$e,gt,nt,tn,gn,Mn=0,Rn=M||[0],zn=(Y=Y||0)>>>3;if(v==="UTF8")for(tn=de===-1?3:0,je=0;je(fe=y.charCodeAt(je))?De.push(fe):2048>fe?(De.push(192|fe>>>6),De.push(128|63&fe)):55296>fe||57344<=fe?De.push(224|fe>>>12,128|fe>>>6&63,128|63&fe):(je+=1,fe=65536+((1023&fe)<<10|1023&y.charCodeAt(je)),De.push(240|fe>>>18,128|fe>>>12&63,128|fe>>>6&63,128|63&fe)),$e=0;$e>>2;Rn.length<=gt;)Rn.push(0);Rn[gt]|=De[$e]<<8*(tn+de*(nt%4)),Mn+=1}else for(tn=de===-1?2:0,gn=v==="UTF16LE"&&de!==1||v!=="UTF16LE"&&de===1,je=0;je>>8),gt=(nt=Mn+zn)>>>2;Rn.length<=gt;)Rn.push(0);Rn[gt]|=fe<<8*(tn+de*(nt%4)),Mn+=2}return{value:Rn,binLen:8*Mn+Y}}(ee,D,he,x,ne)};case"B64":return function(ee,he,x){return function(y,v,M,Y){var de,fe,De,je,$e,gt,nt=0,tn=v||[0],gn=(M=M||0)>>>3,Mn=Y===-1?3:0,Rn=y.indexOf("=");if(y.search(/^[a-zA-Z0-9=+/]+$/)===-1)throw new Error("Invalid character in base-64 string");if(y=y.replace(/=/g,""),Rn!==-1&&Rn>24&255,T[F+1]=N>>16&255,T[F+2]=N>>8&255,T[F+3]=N&255,T[F+4]=w>>24&255,T[F+5]=w>>16&255,T[F+6]=w>>8&255,T[F+7]=w&255}function S(T,F,N,w,A){var te,ce=0;for(te=0;te>>8)-1}function k(T,F,N,w){return S(T,F,N,w,16)}function I(T,F,N,w){return S(T,F,N,w,32)}function B(T,F,N,w){for(var A=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,te=N[0]&255|(N[1]&255)<<8|(N[2]&255)<<16|(N[3]&255)<<24,ce=N[4]&255|(N[5]&255)<<8|(N[6]&255)<<16|(N[7]&255)<<24,_e=N[8]&255|(N[9]&255)<<8|(N[10]&255)<<16|(N[11]&255)<<24,Le=N[12]&255|(N[13]&255)<<8|(N[14]&255)<<16|(N[15]&255)<<24,Ge=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,We=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,at=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Qe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,lt=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,ut=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,xt=N[16]&255|(N[17]&255)<<8|(N[18]&255)<<16|(N[19]&255)<<24,St=N[20]&255|(N[21]&255)<<8|(N[22]&255)<<16|(N[23]&255)<<24,Pt=N[24]&255|(N[25]&255)<<8|(N[26]&255)<<16|(N[27]&255)<<24,bt=N[28]&255|(N[29]&255)<<8|(N[30]&255)<<16|(N[31]&255)<<24,$t=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,ft=A,vt=te,ot=ce,ht=_e,q=Le,m=Ge,E=We,P=at,W=Qe,V=lt,ge=ut,pe=xt,Fe=St,He=Pt,Ye=bt,wt=$t,ae,Ft=0;Ft<20;Ft+=2)ae=ft+Fe|0,q^=ae<<7|ae>>>25,ae=q+ft|0,W^=ae<<9|ae>>>23,ae=W+q|0,Fe^=ae<<13|ae>>>19,ae=Fe+W|0,ft^=ae<<18|ae>>>14,ae=m+vt|0,V^=ae<<7|ae>>>25,ae=V+m|0,He^=ae<<9|ae>>>23,ae=He+V|0,vt^=ae<<13|ae>>>19,ae=vt+He|0,m^=ae<<18|ae>>>14,ae=ge+E|0,Ye^=ae<<7|ae>>>25,ae=Ye+ge|0,ot^=ae<<9|ae>>>23,ae=ot+Ye|0,E^=ae<<13|ae>>>19,ae=E+ot|0,ge^=ae<<18|ae>>>14,ae=wt+pe|0,ht^=ae<<7|ae>>>25,ae=ht+wt|0,P^=ae<<9|ae>>>23,ae=P+ht|0,pe^=ae<<13|ae>>>19,ae=pe+P|0,wt^=ae<<18|ae>>>14,ae=ft+ht|0,vt^=ae<<7|ae>>>25,ae=vt+ft|0,ot^=ae<<9|ae>>>23,ae=ot+vt|0,ht^=ae<<13|ae>>>19,ae=ht+ot|0,ft^=ae<<18|ae>>>14,ae=m+q|0,E^=ae<<7|ae>>>25,ae=E+m|0,P^=ae<<9|ae>>>23,ae=P+E|0,q^=ae<<13|ae>>>19,ae=q+P|0,m^=ae<<18|ae>>>14,ae=ge+V|0,pe^=ae<<7|ae>>>25,ae=pe+ge|0,W^=ae<<9|ae>>>23,ae=W+pe|0,V^=ae<<13|ae>>>19,ae=V+W|0,ge^=ae<<18|ae>>>14,ae=wt+Ye|0,Fe^=ae<<7|ae>>>25,ae=Fe+wt|0,He^=ae<<9|ae>>>23,ae=He+Fe|0,Ye^=ae<<13|ae>>>19,ae=Ye+He|0,wt^=ae<<18|ae>>>14;ft=ft+A|0,vt=vt+te|0,ot=ot+ce|0,ht=ht+_e|0,q=q+Le|0,m=m+Ge|0,E=E+We|0,P=P+at|0,W=W+Qe|0,V=V+lt|0,ge=ge+ut|0,pe=pe+xt|0,Fe=Fe+St|0,He=He+Pt|0,Ye=Ye+bt|0,wt=wt+$t|0,T[0]=ft>>>0&255,T[1]=ft>>>8&255,T[2]=ft>>>16&255,T[3]=ft>>>24&255,T[4]=vt>>>0&255,T[5]=vt>>>8&255,T[6]=vt>>>16&255,T[7]=vt>>>24&255,T[8]=ot>>>0&255,T[9]=ot>>>8&255,T[10]=ot>>>16&255,T[11]=ot>>>24&255,T[12]=ht>>>0&255,T[13]=ht>>>8&255,T[14]=ht>>>16&255,T[15]=ht>>>24&255,T[16]=q>>>0&255,T[17]=q>>>8&255,T[18]=q>>>16&255,T[19]=q>>>24&255,T[20]=m>>>0&255,T[21]=m>>>8&255,T[22]=m>>>16&255,T[23]=m>>>24&255,T[24]=E>>>0&255,T[25]=E>>>8&255,T[26]=E>>>16&255,T[27]=E>>>24&255,T[28]=P>>>0&255,T[29]=P>>>8&255,T[30]=P>>>16&255,T[31]=P>>>24&255,T[32]=W>>>0&255,T[33]=W>>>8&255,T[34]=W>>>16&255,T[35]=W>>>24&255,T[36]=V>>>0&255,T[37]=V>>>8&255,T[38]=V>>>16&255,T[39]=V>>>24&255,T[40]=ge>>>0&255,T[41]=ge>>>8&255,T[42]=ge>>>16&255,T[43]=ge>>>24&255,T[44]=pe>>>0&255,T[45]=pe>>>8&255,T[46]=pe>>>16&255,T[47]=pe>>>24&255,T[48]=Fe>>>0&255,T[49]=Fe>>>8&255,T[50]=Fe>>>16&255,T[51]=Fe>>>24&255,T[52]=He>>>0&255,T[53]=He>>>8&255,T[54]=He>>>16&255,T[55]=He>>>24&255,T[56]=Ye>>>0&255,T[57]=Ye>>>8&255,T[58]=Ye>>>16&255,T[59]=Ye>>>24&255,T[60]=wt>>>0&255,T[61]=wt>>>8&255,T[62]=wt>>>16&255,T[63]=wt>>>24&255}function R(T,F,N,w){for(var A=w[0]&255|(w[1]&255)<<8|(w[2]&255)<<16|(w[3]&255)<<24,te=N[0]&255|(N[1]&255)<<8|(N[2]&255)<<16|(N[3]&255)<<24,ce=N[4]&255|(N[5]&255)<<8|(N[6]&255)<<16|(N[7]&255)<<24,_e=N[8]&255|(N[9]&255)<<8|(N[10]&255)<<16|(N[11]&255)<<24,Le=N[12]&255|(N[13]&255)<<8|(N[14]&255)<<16|(N[15]&255)<<24,Ge=w[4]&255|(w[5]&255)<<8|(w[6]&255)<<16|(w[7]&255)<<24,We=F[0]&255|(F[1]&255)<<8|(F[2]&255)<<16|(F[3]&255)<<24,at=F[4]&255|(F[5]&255)<<8|(F[6]&255)<<16|(F[7]&255)<<24,Qe=F[8]&255|(F[9]&255)<<8|(F[10]&255)<<16|(F[11]&255)<<24,lt=F[12]&255|(F[13]&255)<<8|(F[14]&255)<<16|(F[15]&255)<<24,ut=w[8]&255|(w[9]&255)<<8|(w[10]&255)<<16|(w[11]&255)<<24,xt=N[16]&255|(N[17]&255)<<8|(N[18]&255)<<16|(N[19]&255)<<24,St=N[20]&255|(N[21]&255)<<8|(N[22]&255)<<16|(N[23]&255)<<24,Pt=N[24]&255|(N[25]&255)<<8|(N[26]&255)<<16|(N[27]&255)<<24,bt=N[28]&255|(N[29]&255)<<8|(N[30]&255)<<16|(N[31]&255)<<24,$t=w[12]&255|(w[13]&255)<<8|(w[14]&255)<<16|(w[15]&255)<<24,ft=A,vt=te,ot=ce,ht=_e,q=Le,m=Ge,E=We,P=at,W=Qe,V=lt,ge=ut,pe=xt,Fe=St,He=Pt,Ye=bt,wt=$t,ae,Ft=0;Ft<20;Ft+=2)ae=ft+Fe|0,q^=ae<<7|ae>>>25,ae=q+ft|0,W^=ae<<9|ae>>>23,ae=W+q|0,Fe^=ae<<13|ae>>>19,ae=Fe+W|0,ft^=ae<<18|ae>>>14,ae=m+vt|0,V^=ae<<7|ae>>>25,ae=V+m|0,He^=ae<<9|ae>>>23,ae=He+V|0,vt^=ae<<13|ae>>>19,ae=vt+He|0,m^=ae<<18|ae>>>14,ae=ge+E|0,Ye^=ae<<7|ae>>>25,ae=Ye+ge|0,ot^=ae<<9|ae>>>23,ae=ot+Ye|0,E^=ae<<13|ae>>>19,ae=E+ot|0,ge^=ae<<18|ae>>>14,ae=wt+pe|0,ht^=ae<<7|ae>>>25,ae=ht+wt|0,P^=ae<<9|ae>>>23,ae=P+ht|0,pe^=ae<<13|ae>>>19,ae=pe+P|0,wt^=ae<<18|ae>>>14,ae=ft+ht|0,vt^=ae<<7|ae>>>25,ae=vt+ft|0,ot^=ae<<9|ae>>>23,ae=ot+vt|0,ht^=ae<<13|ae>>>19,ae=ht+ot|0,ft^=ae<<18|ae>>>14,ae=m+q|0,E^=ae<<7|ae>>>25,ae=E+m|0,P^=ae<<9|ae>>>23,ae=P+E|0,q^=ae<<13|ae>>>19,ae=q+P|0,m^=ae<<18|ae>>>14,ae=ge+V|0,pe^=ae<<7|ae>>>25,ae=pe+ge|0,W^=ae<<9|ae>>>23,ae=W+pe|0,V^=ae<<13|ae>>>19,ae=V+W|0,ge^=ae<<18|ae>>>14,ae=wt+Ye|0,Fe^=ae<<7|ae>>>25,ae=Fe+wt|0,He^=ae<<9|ae>>>23,ae=He+Fe|0,Ye^=ae<<13|ae>>>19,ae=Ye+He|0,wt^=ae<<18|ae>>>14;T[0]=ft>>>0&255,T[1]=ft>>>8&255,T[2]=ft>>>16&255,T[3]=ft>>>24&255,T[4]=m>>>0&255,T[5]=m>>>8&255,T[6]=m>>>16&255,T[7]=m>>>24&255,T[8]=ge>>>0&255,T[9]=ge>>>8&255,T[10]=ge>>>16&255,T[11]=ge>>>24&255,T[12]=wt>>>0&255,T[13]=wt>>>8&255,T[14]=wt>>>16&255,T[15]=wt>>>24&255,T[16]=E>>>0&255,T[17]=E>>>8&255,T[18]=E>>>16&255,T[19]=E>>>24&255,T[20]=P>>>0&255,T[21]=P>>>8&255,T[22]=P>>>16&255,T[23]=P>>>24&255,T[24]=W>>>0&255,T[25]=W>>>8&255,T[26]=W>>>16&255,T[27]=W>>>24&255,T[28]=V>>>0&255,T[29]=V>>>8&255,T[30]=V>>>16&255,T[31]=V>>>24&255}function $(T,F,N,w){B(T,F,N,w)}function L(T,F,N,w){R(T,F,N,w)}var U=new Uint8Array([101,120,112,97,110,100,32,51,50,45,98,121,116,101,32,107]);function G(T,F,N,w,A,te,ce){var _e=new Uint8Array(16),Le=new Uint8Array(64),Ge,We;for(We=0;We<16;We++)_e[We]=0;for(We=0;We<8;We++)_e[We]=te[We];for(;A>=64;){for($(Le,_e,ce,U),We=0;We<64;We++)T[F+We]=N[w+We]^Le[We];for(Ge=1,We=8;We<16;We++)Ge=Ge+(_e[We]&255)|0,_e[We]=Ge&255,Ge>>>=8;A-=64,F+=64,w+=64}if(A>0)for($(Le,_e,ce,U),We=0;We=64;){for($(ce,te,A,U),Le=0;Le<64;Le++)T[F+Le]=ce[Le];for(_e=1,Le=8;Le<16;Le++)_e=_e+(te[Le]&255)|0,te[Le]=_e&255,_e>>>=8;N-=64,F+=64}if(N>0)for($(ce,te,A,U),Le=0;Le>>13|N<<3)&8191,w=T[4]&255|(T[5]&255)<<8,this.r[2]=(N>>>10|w<<6)&7939,A=T[6]&255|(T[7]&255)<<8,this.r[3]=(w>>>7|A<<9)&8191,te=T[8]&255|(T[9]&255)<<8,this.r[4]=(A>>>4|te<<12)&255,this.r[5]=te>>>1&8190,ce=T[10]&255|(T[11]&255)<<8,this.r[6]=(te>>>14|ce<<2)&8191,_e=T[12]&255|(T[13]&255)<<8,this.r[7]=(ce>>>11|_e<<5)&8065,Le=T[14]&255|(T[15]&255)<<8,this.r[8]=(_e>>>8|Le<<8)&8191,this.r[9]=Le>>>5&127,this.pad[0]=T[16]&255|(T[17]&255)<<8,this.pad[1]=T[18]&255|(T[19]&255)<<8,this.pad[2]=T[20]&255|(T[21]&255)<<8,this.pad[3]=T[22]&255|(T[23]&255)<<8,this.pad[4]=T[24]&255|(T[25]&255)<<8,this.pad[5]=T[26]&255|(T[27]&255)<<8,this.pad[6]=T[28]&255|(T[29]&255)<<8,this.pad[7]=T[30]&255|(T[31]&255)<<8};oe.prototype.blocks=function(T,F,N){for(var w=this.fin?0:2048,A,te,ce,_e,Le,Ge,We,at,Qe,lt,ut,xt,St,Pt,bt,$t,ft,vt,ot,ht=this.h[0],q=this.h[1],m=this.h[2],E=this.h[3],P=this.h[4],W=this.h[5],V=this.h[6],ge=this.h[7],pe=this.h[8],Fe=this.h[9],He=this.r[0],Ye=this.r[1],wt=this.r[2],ae=this.r[3],Ft=this.r[4],ln=this.r[5],cn=this.r[6],Wt=this.r[7],un=this.r[8],sn=this.r[9];N>=16;)A=T[F+0]&255|(T[F+1]&255)<<8,ht+=A&8191,te=T[F+2]&255|(T[F+3]&255)<<8,q+=(A>>>13|te<<3)&8191,ce=T[F+4]&255|(T[F+5]&255)<<8,m+=(te>>>10|ce<<6)&8191,_e=T[F+6]&255|(T[F+7]&255)<<8,E+=(ce>>>7|_e<<9)&8191,Le=T[F+8]&255|(T[F+9]&255)<<8,P+=(_e>>>4|Le<<12)&8191,W+=Le>>>1&8191,Ge=T[F+10]&255|(T[F+11]&255)<<8,V+=(Le>>>14|Ge<<2)&8191,We=T[F+12]&255|(T[F+13]&255)<<8,ge+=(Ge>>>11|We<<5)&8191,at=T[F+14]&255|(T[F+15]&255)<<8,pe+=(We>>>8|at<<8)&8191,Fe+=at>>>5|w,Qe=0,lt=Qe,lt+=ht*He,lt+=q*(5*sn),lt+=m*(5*un),lt+=E*(5*Wt),lt+=P*(5*cn),Qe=lt>>>13,lt&=8191,lt+=W*(5*ln),lt+=V*(5*Ft),lt+=ge*(5*ae),lt+=pe*(5*wt),lt+=Fe*(5*Ye),Qe+=lt>>>13,lt&=8191,ut=Qe,ut+=ht*Ye,ut+=q*He,ut+=m*(5*sn),ut+=E*(5*un),ut+=P*(5*Wt),Qe=ut>>>13,ut&=8191,ut+=W*(5*cn),ut+=V*(5*ln),ut+=ge*(5*Ft),ut+=pe*(5*ae),ut+=Fe*(5*wt),Qe+=ut>>>13,ut&=8191,xt=Qe,xt+=ht*wt,xt+=q*Ye,xt+=m*He,xt+=E*(5*sn),xt+=P*(5*un),Qe=xt>>>13,xt&=8191,xt+=W*(5*Wt),xt+=V*(5*cn),xt+=ge*(5*ln),xt+=pe*(5*Ft),xt+=Fe*(5*ae),Qe+=xt>>>13,xt&=8191,St=Qe,St+=ht*ae,St+=q*wt,St+=m*Ye,St+=E*He,St+=P*(5*sn),Qe=St>>>13,St&=8191,St+=W*(5*un),St+=V*(5*Wt),St+=ge*(5*cn),St+=pe*(5*ln),St+=Fe*(5*Ft),Qe+=St>>>13,St&=8191,Pt=Qe,Pt+=ht*Ft,Pt+=q*ae,Pt+=m*wt,Pt+=E*Ye,Pt+=P*He,Qe=Pt>>>13,Pt&=8191,Pt+=W*(5*sn),Pt+=V*(5*un),Pt+=ge*(5*Wt),Pt+=pe*(5*cn),Pt+=Fe*(5*ln),Qe+=Pt>>>13,Pt&=8191,bt=Qe,bt+=ht*ln,bt+=q*Ft,bt+=m*ae,bt+=E*wt,bt+=P*Ye,Qe=bt>>>13,bt&=8191,bt+=W*He,bt+=V*(5*sn),bt+=ge*(5*un),bt+=pe*(5*Wt),bt+=Fe*(5*cn),Qe+=bt>>>13,bt&=8191,$t=Qe,$t+=ht*cn,$t+=q*ln,$t+=m*Ft,$t+=E*ae,$t+=P*wt,Qe=$t>>>13,$t&=8191,$t+=W*Ye,$t+=V*He,$t+=ge*(5*sn),$t+=pe*(5*un),$t+=Fe*(5*Wt),Qe+=$t>>>13,$t&=8191,ft=Qe,ft+=ht*Wt,ft+=q*cn,ft+=m*ln,ft+=E*Ft,ft+=P*ae,Qe=ft>>>13,ft&=8191,ft+=W*wt,ft+=V*Ye,ft+=ge*He,ft+=pe*(5*sn),ft+=Fe*(5*un),Qe+=ft>>>13,ft&=8191,vt=Qe,vt+=ht*un,vt+=q*Wt,vt+=m*cn,vt+=E*ln,vt+=P*Ft,Qe=vt>>>13,vt&=8191,vt+=W*ae,vt+=V*wt,vt+=ge*Ye,vt+=pe*He,vt+=Fe*(5*sn),Qe+=vt>>>13,vt&=8191,ot=Qe,ot+=ht*sn,ot+=q*un,ot+=m*Wt,ot+=E*cn,ot+=P*ln,Qe=ot>>>13,ot&=8191,ot+=W*Ft,ot+=V*ae,ot+=ge*wt,ot+=pe*Ye,ot+=Fe*He,Qe+=ot>>>13,ot&=8191,Qe=(Qe<<2)+Qe|0,Qe=Qe+lt|0,lt=Qe&8191,Qe=Qe>>>13,ut+=Qe,ht=lt,q=ut,m=xt,E=St,P=Pt,W=bt,V=$t,ge=ft,pe=vt,Fe=ot,F+=16,N-=16;this.h[0]=ht,this.h[1]=q,this.h[2]=m,this.h[3]=E,this.h[4]=P,this.h[5]=W,this.h[6]=V,this.h[7]=ge,this.h[8]=pe,this.h[9]=Fe},oe.prototype.finish=function(T,F){var N=new Uint16Array(10),w,A,te,ce;if(this.leftover){for(ce=this.leftover,this.buffer[ce++]=1;ce<16;ce++)this.buffer[ce]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(w=this.h[1]>>>13,this.h[1]&=8191,ce=2;ce<10;ce++)this.h[ce]+=w,w=this.h[ce]>>>13,this.h[ce]&=8191;for(this.h[0]+=w*5,w=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=w,w=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=w,N[0]=this.h[0]+5,w=N[0]>>>13,N[0]&=8191,ce=1;ce<10;ce++)N[ce]=this.h[ce]+w,w=N[ce]>>>13,N[ce]&=8191;for(N[9]-=8192,A=(w^1)-1,ce=0;ce<10;ce++)N[ce]&=A;for(A=~A,ce=0;ce<10;ce++)this.h[ce]=this.h[ce]&A|N[ce];for(this.h[0]=(this.h[0]|this.h[1]<<13)&65535,this.h[1]=(this.h[1]>>>3|this.h[2]<<10)&65535,this.h[2]=(this.h[2]>>>6|this.h[3]<<7)&65535,this.h[3]=(this.h[3]>>>9|this.h[4]<<4)&65535,this.h[4]=(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14)&65535,this.h[5]=(this.h[6]>>>2|this.h[7]<<11)&65535,this.h[6]=(this.h[7]>>>5|this.h[8]<<8)&65535,this.h[7]=(this.h[8]>>>8|this.h[9]<<5)&65535,te=this.h[0]+this.pad[0],this.h[0]=te&65535,ce=1;ce<8;ce++)te=(this.h[ce]+this.pad[ce]|0)+(te>>>16)|0,this.h[ce]=te&65535;T[F+0]=this.h[0]>>>0&255,T[F+1]=this.h[0]>>>8&255,T[F+2]=this.h[1]>>>0&255,T[F+3]=this.h[1]>>>8&255,T[F+4]=this.h[2]>>>0&255,T[F+5]=this.h[2]>>>8&255,T[F+6]=this.h[3]>>>0&255,T[F+7]=this.h[3]>>>8&255,T[F+8]=this.h[4]>>>0&255,T[F+9]=this.h[4]>>>8&255,T[F+10]=this.h[5]>>>0&255,T[F+11]=this.h[5]>>>8&255,T[F+12]=this.h[6]>>>0&255,T[F+13]=this.h[6]>>>8&255,T[F+14]=this.h[7]>>>0&255,T[F+15]=this.h[7]>>>8&255},oe.prototype.update=function(T,F,N){var w,A;if(this.leftover){for(A=16-this.leftover,A>N&&(A=N),w=0;w=16&&(A=N-N%16,this.blocks(T,F,A),F+=A,N-=A),N){for(w=0;w>16&1),te[N-1]&=65535;te[15]=ce[15]-32767-(te[14]>>16&1),A=te[15]>>16&1,te[14]&=65535,Te(ce,te,1-A)}for(N=0;N<16;N++)T[2*N]=ce[N]&255,T[2*N+1]=ce[N]>>8}function tt(T,F){var N=new Uint8Array(32),w=new Uint8Array(32);return le(N,T),le(w,F),I(N,0,w,0)}function Ke(T){var F=new Uint8Array(32);return le(F,T),F[0]&1}function Nt(T,F){var N;for(N=0;N<16;N++)T[N]=F[2*N]+(F[2*N+1]<<8);T[15]&=32767}function It(T,F,N){for(var w=0;w<16;w++)T[w]=F[w]+N[w]}function yt(T,F,N){for(var w=0;w<16;w++)T[w]=F[w]-N[w]}function rt(T,F,N){var w,A,te=0,ce=0,_e=0,Le=0,Ge=0,We=0,at=0,Qe=0,lt=0,ut=0,xt=0,St=0,Pt=0,bt=0,$t=0,ft=0,vt=0,ot=0,ht=0,q=0,m=0,E=0,P=0,W=0,V=0,ge=0,pe=0,Fe=0,He=0,Ye=0,wt=0,ae=N[0],Ft=N[1],ln=N[2],cn=N[3],Wt=N[4],un=N[5],sn=N[6],Vn=N[7],mn=N[8],An=N[9],Wn=N[10],Hn=N[11],ar=N[12],br=N[13],vr=N[14],wr=N[15];w=F[0],te+=w*ae,ce+=w*Ft,_e+=w*ln,Le+=w*cn,Ge+=w*Wt,We+=w*un,at+=w*sn,Qe+=w*Vn,lt+=w*mn,ut+=w*An,xt+=w*Wn,St+=w*Hn,Pt+=w*ar,bt+=w*br,$t+=w*vr,ft+=w*wr,w=F[1],ce+=w*ae,_e+=w*Ft,Le+=w*ln,Ge+=w*cn,We+=w*Wt,at+=w*un,Qe+=w*sn,lt+=w*Vn,ut+=w*mn,xt+=w*An,St+=w*Wn,Pt+=w*Hn,bt+=w*ar,$t+=w*br,ft+=w*vr,vt+=w*wr,w=F[2],_e+=w*ae,Le+=w*Ft,Ge+=w*ln,We+=w*cn,at+=w*Wt,Qe+=w*un,lt+=w*sn,ut+=w*Vn,xt+=w*mn,St+=w*An,Pt+=w*Wn,bt+=w*Hn,$t+=w*ar,ft+=w*br,vt+=w*vr,ot+=w*wr,w=F[3],Le+=w*ae,Ge+=w*Ft,We+=w*ln,at+=w*cn,Qe+=w*Wt,lt+=w*un,ut+=w*sn,xt+=w*Vn,St+=w*mn,Pt+=w*An,bt+=w*Wn,$t+=w*Hn,ft+=w*ar,vt+=w*br,ot+=w*vr,ht+=w*wr,w=F[4],Ge+=w*ae,We+=w*Ft,at+=w*ln,Qe+=w*cn,lt+=w*Wt,ut+=w*un,xt+=w*sn,St+=w*Vn,Pt+=w*mn,bt+=w*An,$t+=w*Wn,ft+=w*Hn,vt+=w*ar,ot+=w*br,ht+=w*vr,q+=w*wr,w=F[5],We+=w*ae,at+=w*Ft,Qe+=w*ln,lt+=w*cn,ut+=w*Wt,xt+=w*un,St+=w*sn,Pt+=w*Vn,bt+=w*mn,$t+=w*An,ft+=w*Wn,vt+=w*Hn,ot+=w*ar,ht+=w*br,q+=w*vr,m+=w*wr,w=F[6],at+=w*ae,Qe+=w*Ft,lt+=w*ln,ut+=w*cn,xt+=w*Wt,St+=w*un,Pt+=w*sn,bt+=w*Vn,$t+=w*mn,ft+=w*An,vt+=w*Wn,ot+=w*Hn,ht+=w*ar,q+=w*br,m+=w*vr,E+=w*wr,w=F[7],Qe+=w*ae,lt+=w*Ft,ut+=w*ln,xt+=w*cn,St+=w*Wt,Pt+=w*un,bt+=w*sn,$t+=w*Vn,ft+=w*mn,vt+=w*An,ot+=w*Wn,ht+=w*Hn,q+=w*ar,m+=w*br,E+=w*vr,P+=w*wr,w=F[8],lt+=w*ae,ut+=w*Ft,xt+=w*ln,St+=w*cn,Pt+=w*Wt,bt+=w*un,$t+=w*sn,ft+=w*Vn,vt+=w*mn,ot+=w*An,ht+=w*Wn,q+=w*Hn,m+=w*ar,E+=w*br,P+=w*vr,W+=w*wr,w=F[9],ut+=w*ae,xt+=w*Ft,St+=w*ln,Pt+=w*cn,bt+=w*Wt,$t+=w*un,ft+=w*sn,vt+=w*Vn,ot+=w*mn,ht+=w*An,q+=w*Wn,m+=w*Hn,E+=w*ar,P+=w*br,W+=w*vr,V+=w*wr,w=F[10],xt+=w*ae,St+=w*Ft,Pt+=w*ln,bt+=w*cn,$t+=w*Wt,ft+=w*un,vt+=w*sn,ot+=w*Vn,ht+=w*mn,q+=w*An,m+=w*Wn,E+=w*Hn,P+=w*ar,W+=w*br,V+=w*vr,ge+=w*wr,w=F[11],St+=w*ae,Pt+=w*Ft,bt+=w*ln,$t+=w*cn,ft+=w*Wt,vt+=w*un,ot+=w*sn,ht+=w*Vn,q+=w*mn,m+=w*An,E+=w*Wn,P+=w*Hn,W+=w*ar,V+=w*br,ge+=w*vr,pe+=w*wr,w=F[12],Pt+=w*ae,bt+=w*Ft,$t+=w*ln,ft+=w*cn,vt+=w*Wt,ot+=w*un,ht+=w*sn,q+=w*Vn,m+=w*mn,E+=w*An,P+=w*Wn,W+=w*Hn,V+=w*ar,ge+=w*br,pe+=w*vr,Fe+=w*wr,w=F[13],bt+=w*ae,$t+=w*Ft,ft+=w*ln,vt+=w*cn,ot+=w*Wt,ht+=w*un,q+=w*sn,m+=w*Vn,E+=w*mn,P+=w*An,W+=w*Wn,V+=w*Hn,ge+=w*ar,pe+=w*br,Fe+=w*vr,He+=w*wr,w=F[14],$t+=w*ae,ft+=w*Ft,vt+=w*ln,ot+=w*cn,ht+=w*Wt,q+=w*un,m+=w*sn,E+=w*Vn,P+=w*mn,W+=w*An,V+=w*Wn,ge+=w*Hn,pe+=w*ar,Fe+=w*br,He+=w*vr,Ye+=w*wr,w=F[15],ft+=w*ae,vt+=w*Ft,ot+=w*ln,ht+=w*cn,q+=w*Wt,m+=w*un,E+=w*sn,P+=w*Vn,W+=w*mn,V+=w*An,ge+=w*Wn,pe+=w*Hn,Fe+=w*ar,He+=w*br,Ye+=w*vr,wt+=w*wr,te+=38*vt,ce+=38*ot,_e+=38*ht,Le+=38*q,Ge+=38*m,We+=38*E,at+=38*P,Qe+=38*W,lt+=38*V,ut+=38*ge,xt+=38*pe,St+=38*Fe,Pt+=38*He,bt+=38*Ye,$t+=38*wt,A=1,w=te+A+65535,A=Math.floor(w/65536),te=w-A*65536,w=ce+A+65535,A=Math.floor(w/65536),ce=w-A*65536,w=_e+A+65535,A=Math.floor(w/65536),_e=w-A*65536,w=Le+A+65535,A=Math.floor(w/65536),Le=w-A*65536,w=Ge+A+65535,A=Math.floor(w/65536),Ge=w-A*65536,w=We+A+65535,A=Math.floor(w/65536),We=w-A*65536,w=at+A+65535,A=Math.floor(w/65536),at=w-A*65536,w=Qe+A+65535,A=Math.floor(w/65536),Qe=w-A*65536,w=lt+A+65535,A=Math.floor(w/65536),lt=w-A*65536,w=ut+A+65535,A=Math.floor(w/65536),ut=w-A*65536,w=xt+A+65535,A=Math.floor(w/65536),xt=w-A*65536,w=St+A+65535,A=Math.floor(w/65536),St=w-A*65536,w=Pt+A+65535,A=Math.floor(w/65536),Pt=w-A*65536,w=bt+A+65535,A=Math.floor(w/65536),bt=w-A*65536,w=$t+A+65535,A=Math.floor(w/65536),$t=w-A*65536,w=ft+A+65535,A=Math.floor(w/65536),ft=w-A*65536,te+=A-1+37*(A-1),A=1,w=te+A+65535,A=Math.floor(w/65536),te=w-A*65536,w=ce+A+65535,A=Math.floor(w/65536),ce=w-A*65536,w=_e+A+65535,A=Math.floor(w/65536),_e=w-A*65536,w=Le+A+65535,A=Math.floor(w/65536),Le=w-A*65536,w=Ge+A+65535,A=Math.floor(w/65536),Ge=w-A*65536,w=We+A+65535,A=Math.floor(w/65536),We=w-A*65536,w=at+A+65535,A=Math.floor(w/65536),at=w-A*65536,w=Qe+A+65535,A=Math.floor(w/65536),Qe=w-A*65536,w=lt+A+65535,A=Math.floor(w/65536),lt=w-A*65536,w=ut+A+65535,A=Math.floor(w/65536),ut=w-A*65536,w=xt+A+65535,A=Math.floor(w/65536),xt=w-A*65536,w=St+A+65535,A=Math.floor(w/65536),St=w-A*65536,w=Pt+A+65535,A=Math.floor(w/65536),Pt=w-A*65536,w=bt+A+65535,A=Math.floor(w/65536),bt=w-A*65536,w=$t+A+65535,A=Math.floor(w/65536),$t=w-A*65536,w=ft+A+65535,A=Math.floor(w/65536),ft=w-A*65536,te+=A-1+37*(A-1),T[0]=te,T[1]=ce,T[2]=_e,T[3]=Le,T[4]=Ge,T[5]=We,T[6]=at,T[7]=Qe,T[8]=lt,T[9]=ut,T[10]=xt,T[11]=St,T[12]=Pt,T[13]=bt,T[14]=$t,T[15]=ft}function Et(T,F){rt(T,F,F)}function xn(T,F){var N=n(),w;for(w=0;w<16;w++)N[w]=F[w];for(w=253;w>=0;w--)Et(N,N),w!==2&&w!==4&&rt(N,N,F);for(w=0;w<16;w++)T[w]=N[w]}function Be(T,F){var N=n(),w;for(w=0;w<16;w++)N[w]=F[w];for(w=250;w>=0;w--)Et(N,N),w!==1&&rt(N,N,F);for(w=0;w<16;w++)T[w]=N[w]}function Ee(T,F,N){var w=new Uint8Array(32),A=new Float64Array(80),te,ce,_e=n(),Le=n(),Ge=n(),We=n(),at=n(),Qe=n();for(ce=0;ce<31;ce++)w[ce]=F[ce];for(w[31]=F[31]&127|64,w[0]&=248,Nt(A,N),ce=0;ce<16;ce++)Le[ce]=A[ce],We[ce]=_e[ce]=Ge[ce]=0;for(_e[0]=We[0]=1,ce=254;ce>=0;--ce)te=w[ce>>>3]>>>(ce&7)&1,Te(_e,Le,te),Te(Ge,We,te),It(at,_e,Ge),yt(_e,_e,Ge),It(Ge,Le,We),yt(Le,Le,We),Et(We,at),Et(Qe,_e),rt(_e,Ge,_e),rt(Ge,Le,at),It(at,_e,Ge),yt(_e,_e,Ge),Et(Le,_e),yt(Ge,We,Qe),rt(_e,Ge,c),It(_e,_e,We),rt(Ge,Ge,_e),rt(_e,We,Qe),rt(We,Le,A),Et(Le,at),Te(_e,Le,te),Te(Ge,We,te);for(ce=0;ce<16;ce++)A[ce+16]=_e[ce],A[ce+32]=Ge[ce],A[ce+48]=Le[ce],A[ce+64]=We[ce];var lt=A.subarray(32),ut=A.subarray(16);return xn(lt,lt),rt(ut,ut,lt),le(T,ut),0}function Ce(T,F){return Ee(T,F,o)}function ke(T,F){return r(F,32),Ce(T,F)}function Oe(T,F,N){var w=new Uint8Array(32);return Ee(w,N,F),L(T,i,w,U)}var Ze=Z,it=be;function Xe(T,F,N,w,A,te){var ce=new Uint8Array(32);return Oe(ce,A,te),Ze(T,F,N,w,ce)}function Mt(T,F,N,w,A,te){var ce=new Uint8Array(32);return Oe(ce,A,te),it(T,F,N,w,ce)}var Ct=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function ct(T,F,N,w){for(var A=new Int32Array(16),te=new Int32Array(16),ce,_e,Le,Ge,We,at,Qe,lt,ut,xt,St,Pt,bt,$t,ft,vt,ot,ht,q,m,E,P,W,V,ge,pe,Fe=T[0],He=T[1],Ye=T[2],wt=T[3],ae=T[4],Ft=T[5],ln=T[6],cn=T[7],Wt=F[0],un=F[1],sn=F[2],Vn=F[3],mn=F[4],An=F[5],Wn=F[6],Hn=F[7],ar=0;w>=128;){for(q=0;q<16;q++)m=8*q+ar,A[q]=N[m+0]<<24|N[m+1]<<16|N[m+2]<<8|N[m+3],te[q]=N[m+4]<<24|N[m+5]<<16|N[m+6]<<8|N[m+7];for(q=0;q<80;q++)if(ce=Fe,_e=He,Le=Ye,Ge=wt,We=ae,at=Ft,Qe=ln,lt=cn,ut=Wt,xt=un,St=sn,Pt=Vn,bt=mn,$t=An,ft=Wn,vt=Hn,E=cn,P=Hn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=(ae>>>14|mn<<18)^(ae>>>18|mn<<14)^(mn>>>9|ae<<23),P=(mn>>>14|ae<<18)^(mn>>>18|ae<<14)^(ae>>>9|mn<<23),W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,E=ae&Ft^~ae&ln,P=mn&An^~mn&Wn,W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,E=Ct[q*2],P=Ct[q*2+1],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,E=A[q%16],P=te[q%16],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,ot=ge&65535|pe<<16,ht=W&65535|V<<16,E=ot,P=ht,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=(Fe>>>28|Wt<<4)^(Wt>>>2|Fe<<30)^(Wt>>>7|Fe<<25),P=(Wt>>>28|Fe<<4)^(Fe>>>2|Wt<<30)^(Fe>>>7|Wt<<25),W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,E=Fe&He^Fe&Ye^He&Ye,P=Wt&un^Wt&sn^un&sn,W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,lt=ge&65535|pe<<16,vt=W&65535|V<<16,E=Ge,P=Pt,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=ot,P=ht,W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,Ge=ge&65535|pe<<16,Pt=W&65535|V<<16,He=ce,Ye=_e,wt=Le,ae=Ge,Ft=We,ln=at,cn=Qe,Fe=lt,un=ut,sn=xt,Vn=St,mn=Pt,An=bt,Wn=$t,Hn=ft,Wt=vt,q%16===15)for(m=0;m<16;m++)E=A[m],P=te[m],W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=A[(m+9)%16],P=te[(m+9)%16],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,ot=A[(m+1)%16],ht=te[(m+1)%16],E=(ot>>>1|ht<<31)^(ot>>>8|ht<<24)^ot>>>7,P=(ht>>>1|ot<<31)^(ht>>>8|ot<<24)^(ht>>>7|ot<<25),W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,ot=A[(m+14)%16],ht=te[(m+14)%16],E=(ot>>>19|ht<<13)^(ht>>>29|ot<<3)^ot>>>6,P=(ht>>>19|ot<<13)^(ot>>>29|ht<<3)^(ht>>>6|ot<<26),W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,A[m]=ge&65535|pe<<16,te[m]=W&65535|V<<16;E=Fe,P=Wt,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[0],P=F[0],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[0]=Fe=ge&65535|pe<<16,F[0]=Wt=W&65535|V<<16,E=He,P=un,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[1],P=F[1],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[1]=He=ge&65535|pe<<16,F[1]=un=W&65535|V<<16,E=Ye,P=sn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[2],P=F[2],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[2]=Ye=ge&65535|pe<<16,F[2]=sn=W&65535|V<<16,E=wt,P=Vn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[3],P=F[3],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[3]=wt=ge&65535|pe<<16,F[3]=Vn=W&65535|V<<16,E=ae,P=mn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[4],P=F[4],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[4]=ae=ge&65535|pe<<16,F[4]=mn=W&65535|V<<16,E=Ft,P=An,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[5],P=F[5],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[5]=Ft=ge&65535|pe<<16,F[5]=An=W&65535|V<<16,E=ln,P=Wn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[6],P=F[6],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[6]=ln=ge&65535|pe<<16,F[6]=Wn=W&65535|V<<16,E=cn,P=Hn,W=P&65535,V=P>>>16,ge=E&65535,pe=E>>>16,E=T[7],P=F[7],W+=P&65535,V+=P>>>16,ge+=E&65535,pe+=E>>>16,V+=W>>>16,ge+=V>>>16,pe+=ge>>>16,T[7]=cn=ge&65535|pe<<16,F[7]=Hn=W&65535|V<<16,ar+=128,w-=128}return w}function Jt(T,F,N){var w=new Int32Array(8),A=new Int32Array(8),te=new Uint8Array(256),ce,_e=N;for(w[0]=1779033703,w[1]=3144134277,w[2]=1013904242,w[3]=2773480762,w[4]=1359893119,w[5]=2600822924,w[6]=528734635,w[7]=1541459225,A[0]=4089235720,A[1]=2227873595,A[2]=4271175723,A[3]=1595750129,A[4]=2917565137,A[5]=725511199,A[6]=4215389547,A[7]=327033209,ct(w,A,F,N),N%=128,ce=0;ce=0;--A)w=N[A/8|0]>>(A&7)&1,pn(T,F,w),Vt(F,T),Vt(T,T),pn(T,F,w)}function kn(T,F){var N=[n(),n(),n(),n()];Ae(N[0],p),Ae(N[1],g),Ae(N[2],a),rt(N[3],p,g),on(T,N,F)}function ue(T,F,N){var w=new Uint8Array(64),A=[n(),n(),n(),n()],te;for(N||r(F,32),Jt(w,F,32),w[0]&=248,w[31]&=127,w[31]|=64,kn(A,w),vn(T,A),te=0;te<32;te++)F[te+32]=T[te];return 0}var D=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function ne(T,F){var N,w,A,te;for(w=63;w>=32;--w){for(N=0,A=w-32,te=w-12;A>4)*D[A],N=F[A]>>8,F[A]&=255;for(A=0;A<32;A++)F[A]-=N*D[A];for(w=0;w<32;w++)F[w+1]+=F[w]>>8,T[w]=F[w]&255}function ee(T){var F=new Float64Array(64),N;for(N=0;N<64;N++)F[N]=T[N];for(N=0;N<64;N++)T[N]=0;ne(T,F)}function he(T,F,N,w){var A=new Uint8Array(64),te=new Uint8Array(64),ce=new Uint8Array(64),_e,Le,Ge=new Float64Array(64),We=[n(),n(),n(),n()];Jt(A,w,32),A[0]&=248,A[31]&=127,A[31]|=64;var at=N+64;for(_e=0;_e>7&&yt(T[0],s,T[0]),rt(T[3],T[0],T[1]),0)}function y(T,F,N,w){var A,te=new Uint8Array(32),ce=new Uint8Array(64),_e=[n(),n(),n(),n()],Le=[n(),n(),n(),n()];if(N<64||x(Le,w))return-1;for(A=0;A=0},t.sign.keyPair=function(){var T=new Uint8Array(Rn),F=new Uint8Array(zn);return ue(T,F),{publicKey:T,secretKey:F}},t.sign.keyPair.fromSecretKey=function(T){if(Xn(T),T.length!==zn)throw new Error("bad secret key size");for(var F=new Uint8Array(Rn),N=0;N0;)t.push(parseInt(e.slice(0,8),2)),e=e.slice(8);return Ne.from(t)}Ms.bitsToBytes=DM;var Eu={};Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.wordlist=void 0;const jM=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];Eu.wordlist=jM;var FM=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(jn,"__esModule",{value:!0}),jn.mnemonicFromRandomSeed=jn.mnemonicIndexesToBytes=jn.bytesToMnemonics=jn.bytesToMnemonicIndexes=jn.mnemonicNew=jn.mnemonicValidate=jn.mnemonicToHDSeed=jn.mnemonicToWalletKey=jn.mnemonicToPrivateKey=jn.mnemonicToSeed=jn.mnemonicToEntropy=void 0;const e_=FM(Lm),zM=mo,VM=go,ih=ku,Um=Ms,oh=Eu,Nm=1e5;async function t_(e){const t=await Tu(e);return await WM(t)&&!await jm(t)}function Dm(e){return e.map(t=>t.toLowerCase().trim())}async function jm(e){return(await(0,ih.pbkdf2_sha512)(e,"TON seed version",Math.max(1,Math.floor(Nm/256)),64))[0]==0}async function WM(e){return(await(0,ih.pbkdf2_sha512)(e,"TON fast seed version",1,64))[0]==1}async function Tu(e,t){return await(0,VM.hmac_sha512)(e.join(" "),t&&t.length>0?t:"")}jn.mnemonicToEntropy=Tu;async function Fm(e,t,n){const r=await Tu(e,n);return await(0,ih.pbkdf2_sha512)(r,t,Nm,64)}jn.mnemonicToSeed=Fm;async function n_(e,t){e=Dm(e);const n=await Fm(e,"TON default seed",t);let r=e_.default.sign.keyPair.fromSeed(n.slice(0,32));return{publicKey:Ne.from(r.publicKey),secretKey:Ne.from(r.secretKey)}}jn.mnemonicToPrivateKey=n_;async function HM(e,t){let r=(await n_(e,t)).secretKey.slice(0,32);const i=e_.default.sign.keyPair.fromSeed(r);return{publicKey:Ne.from(i.publicKey),secretKey:Ne.from(i.secretKey)}}jn.mnemonicToWalletKey=HM;async function KM(e,t){return e=Dm(e),await Fm(e,"TON HD Keys seed",t)}jn.mnemonicToHDSeed=KM;async function r_(e,t){e=Dm(e);for(let n of e)if(oh.wordlist.indexOf(n)<0)return!1;return t&&t.length>0&&!await t_(e)?!1:await jm(await Tu(e,t))}jn.mnemonicValidate=r_;async function qM(e=24,t){let n=[];for(;;){n=[];for(let r=0;r0&&!await t_(n))&&await jm(await Tu(n,t)))break}return n}jn.mnemonicNew=qM;function i_(e,t){let n=(0,Um.bytesToBits)(e),r=[];for(let i=0;i=2028)throw Error("Invalid input");t+=(0,Um.lpad)(n.toString(2),"0",11)}for(;t.length%8!==0;)t=t+"0";return(0,Um.bitsToBytes)(t)}jn.mnemonicIndexesToBytes=ZM;async function GM(e,t=24,n){const r=Math.ceil(t*11/8);let i=e;for(;;){let o=await(0,ih.pbkdf2_sha512)(i,"TON mnemonic seed",Math.max(1,Math.floor(Nm/256)),r),s=o_(o,t);if(await r_(s,n))return s;i=o}}jn.mnemonicFromRandomSeed=GM;var zr={},YM=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(zr,"__esModule",{value:!0}),zr.openBox=zr.sealBox=zr.signVerify=zr.sign=zr.keyPairFromSeed=zr.keyPairFromSecretKey=void 0;const nc=YM(Lm);function JM(e){let t=nc.default.sign.keyPair.fromSecretKey(new Uint8Array(e));return{publicKey:Ne.from(t.publicKey),secretKey:Ne.from(t.secretKey)}}zr.keyPairFromSecretKey=JM;function QM(e){let t=nc.default.sign.keyPair.fromSeed(new Uint8Array(e));return{publicKey:Ne.from(t.publicKey),secretKey:Ne.from(t.secretKey)}}zr.keyPairFromSeed=QM;function XM(e,t){return Ne.from(nc.default.sign.detached(new Uint8Array(e),new Uint8Array(t)))}zr.sign=XM;function eR(e,t,n){return nc.default.sign.detached.verify(new Uint8Array(e),new Uint8Array(t),new Uint8Array(n))}zr.signVerify=eR;function tR(e,t,n){return Ne.from(nc.default.secretbox(e,t,n))}zr.sealBox=tR;function nR(e,t,n){let r=nc.default.secretbox.open(e,t,n);return r?Ne.from(r):null}zr.openBox=nR;var Rs={};Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.deriveEd25519Path=Rs.deriveED25519HardenedKey=Rs.getED25519MasterKeyFromSeed=void 0;const s_=go,rR="ed25519 seed",a_=2147483648;async function l_(e){const t=await(0,s_.hmac_sha512)(rR,e),n=t.slice(0,32),r=t.slice(32);return{key:n,chainCode:r}}Rs.getED25519MasterKeyFromSeed=l_;async function c_(e,t){if(t>=a_)throw Error("Key index must be less than offset");const n=Ne.alloc(4);n.writeUInt32BE(t+a_,0);const r=Ne.concat([Ne.alloc(1,0),e.key,n]),i=await(0,s_.hmac_sha512)(e.chainCode,r),o=i.slice(0,32),s=i.slice(32);return{key:o,chainCode:s}}Rs.deriveED25519HardenedKey=c_;async function iR(e,t){let n=await l_(e),r=[...t];for(;r.length>0;){let i=r[0];r=r.slice(1),n=await c_(n,i)}return n.key}Rs.deriveEd25519Path=iR;var Os={};Object.defineProperty(Os,"__esModule",{value:!0}),Os.deriveSymmetricPath=Os.deriveSymmetricHardenedKey=Os.getSymmetricMasterKeyFromSeed=void 0;const u_=go,oR="Symmetric key seed";async function d_(e){const t=await(0,u_.hmac_sha512)(oR,e),n=t.slice(32),r=t.slice(0,32);return{key:n,chainCode:r}}Os.getSymmetricMasterKeyFromSeed=d_;async function f_(e,t){const n=Ne.concat([Ne.alloc(1,0),Ne.from(t)]),r=await(0,u_.hmac_sha512)(e.chainCode,n),i=r.slice(32),o=r.slice(0,32);return{key:i,chainCode:o}}Os.deriveSymmetricHardenedKey=f_;async function sR(e,t){let n=await d_(e),r=[...t];for(;r.length>0;){let i=r[0];r=r.slice(1),n=await f_(n,i)}return n.key}Os.deriveSymmetricPath=sR;var $s={};Object.defineProperty($s,"__esModule",{value:!0}),$s.deriveMnemonicsPath=$s.deriveMnemonicHardenedKey=$s.getMnemonicsMasterKeyFromSeed=void 0;const aR=jn,h_=go,p_=2147483648,lR="TON Mnemonics HD seed";async function g_(e){const t=await(0,h_.hmac_sha512)(lR,e),n=t.slice(0,32),r=t.slice(32);return{key:n,chainCode:r}}$s.getMnemonicsMasterKeyFromSeed=g_;async function m_(e,t){if(t>=p_)throw Error("Key index must be less than offset");const n=Ne.alloc(4);n.writeUInt32BE(t+p_,0);const r=Ne.concat([Ne.alloc(1,0),e.key,n]),i=await(0,h_.hmac_sha512)(e.chainCode,r),o=i.slice(0,32),s=i.slice(32);return{key:o,chainCode:s}}$s.deriveMnemonicHardenedKey=m_;async function cR(e,t,n=24,r){let i=await g_(e),o=[...t];for(;o.length>0;){let s=o[0];o=o.slice(1),i=await m_(i,s)}return await(0,aR.mnemonicFromRandomSeed)(i.key,n,r)}$s.deriveMnemonicsPath=cR;var y_;function Ma(){return y_||(y_=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMnemonicsMasterKeyFromSeed=e.deriveMnemonicHardenedKey=e.deriveMnemonicsPath=e.deriveSymmetricPath=e.deriveSymmetricHardenedKey=e.getSymmetricMasterKeyFromSeed=e.deriveEd25519Path=e.deriveED25519HardenedKey=e.getED25519MasterKeyFromSeed=e.signVerify=e.sign=e.keyPairFromSecretKey=e.keyPairFromSeed=e.openBox=e.sealBox=e.mnemonicWordList=e.mnemonicToHDSeed=e.mnemonicToSeed=e.mnemonicToWalletKey=e.mnemonicToPrivateKey=e.mnemonicValidate=e.mnemonicNew=e.newSecurePassphrase=e.newSecureWords=e.getSecureRandomNumber=e.getSecureRandomWords=e.getSecureRandomBytes=e.hmac_sha512=e.pbkdf2_sha512=e.sha512_sync=e.sha512=e.sha256_sync=e.sha256=void 0;var t=Bs;Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return t.sha256}}),Object.defineProperty(e,"sha256_sync",{enumerable:!0,get:function(){return t.sha256_sync}});var n=Is;Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return n.sha512}}),Object.defineProperty(e,"sha512_sync",{enumerable:!0,get:function(){return n.sha512_sync}});var r=ku;Object.defineProperty(e,"pbkdf2_sha512",{enumerable:!0,get:function(){return r.pbkdf2_sha512}});var i=go;Object.defineProperty(e,"hmac_sha512",{enumerable:!0,get:function(){return i.hmac_sha512}});var o=mo;Object.defineProperty(e,"getSecureRandomBytes",{enumerable:!0,get:function(){return o.getSecureRandomBytes}}),Object.defineProperty(e,"getSecureRandomWords",{enumerable:!0,get:function(){return o.getSecureRandomWords}}),Object.defineProperty(e,"getSecureRandomNumber",{enumerable:!0,get:function(){return o.getSecureRandomNumber}});var s=th;Object.defineProperty(e,"newSecureWords",{enumerable:!0,get:function(){return s.newSecureWords}});var a=$M();Object.defineProperty(e,"newSecurePassphrase",{enumerable:!0,get:function(){return a.newSecurePassphrase}});var c=jn;Object.defineProperty(e,"mnemonicNew",{enumerable:!0,get:function(){return c.mnemonicNew}}),Object.defineProperty(e,"mnemonicValidate",{enumerable:!0,get:function(){return c.mnemonicValidate}}),Object.defineProperty(e,"mnemonicToPrivateKey",{enumerable:!0,get:function(){return c.mnemonicToPrivateKey}}),Object.defineProperty(e,"mnemonicToWalletKey",{enumerable:!0,get:function(){return c.mnemonicToWalletKey}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return c.mnemonicToSeed}}),Object.defineProperty(e,"mnemonicToHDSeed",{enumerable:!0,get:function(){return c.mnemonicToHDSeed}});var d=Eu;Object.defineProperty(e,"mnemonicWordList",{enumerable:!0,get:function(){return d.wordlist}});var f=zr;Object.defineProperty(e,"sealBox",{enumerable:!0,get:function(){return f.sealBox}}),Object.defineProperty(e,"openBox",{enumerable:!0,get:function(){return f.openBox}});var p=zr;Object.defineProperty(e,"keyPairFromSeed",{enumerable:!0,get:function(){return p.keyPairFromSeed}}),Object.defineProperty(e,"keyPairFromSecretKey",{enumerable:!0,get:function(){return p.keyPairFromSecretKey}}),Object.defineProperty(e,"sign",{enumerable:!0,get:function(){return p.sign}}),Object.defineProperty(e,"signVerify",{enumerable:!0,get:function(){return p.signVerify}});var g=Rs;Object.defineProperty(e,"getED25519MasterKeyFromSeed",{enumerable:!0,get:function(){return g.getED25519MasterKeyFromSeed}}),Object.defineProperty(e,"deriveED25519HardenedKey",{enumerable:!0,get:function(){return g.deriveED25519HardenedKey}}),Object.defineProperty(e,"deriveEd25519Path",{enumerable:!0,get:function(){return g.deriveEd25519Path}});var b=Os;Object.defineProperty(e,"getSymmetricMasterKeyFromSeed",{enumerable:!0,get:function(){return b.getSymmetricMasterKeyFromSeed}}),Object.defineProperty(e,"deriveSymmetricHardenedKey",{enumerable:!0,get:function(){return b.deriveSymmetricHardenedKey}}),Object.defineProperty(e,"deriveSymmetricPath",{enumerable:!0,get:function(){return b.deriveSymmetricPath}});var _=$s;Object.defineProperty(e,"deriveMnemonicsPath",{enumerable:!0,get:function(){return _.deriveMnemonicsPath}}),Object.defineProperty(e,"deriveMnemonicHardenedKey",{enumerable:!0,get:function(){return _.deriveMnemonicHardenedKey}}),Object.defineProperty(e,"getMnemonicsMasterKeyFromSeed",{enumerable:!0,get:function(){return _.getMnemonicsMasterKeyFromSeed}})}(Om)),Om}var b_;function uR(){if(b_)return Cu;b_=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.wonderCalculator=void 0;const e=Ts(),t=Ps,n=Xl,r=Ql,i=Zf(),o=Ho,s=Ma(),a=Jl,c=xu;function d(f,p,g){let b,_=null;if(f===t.CellType.Ordinary){let U=0;for(let G of g)U=U|G.mask.value;b=new n.LevelMask(U)}else if(f===t.CellType.PrunedBranch)_=(0,r.exoticPruned)(p,g),b=new n.LevelMask(_.mask);else if(f===t.CellType.MerkleProof)(0,i.exoticMerkleProof)(p,g),b=new n.LevelMask(g[0].mask.value>>1);else if(f===t.CellType.MerkleUpdate)(0,a.exoticMerkleUpdate)(p,g),b=new n.LevelMask((g[0].mask.value|g[1].mask.value)>>1);else if(f===t.CellType.Library)(0,c.exoticLibrary)(p,g),b=new n.LevelMask;else throw new Error("Unsupported exotic type");let S=[],k=[],I=f===t.CellType.PrunedBranch?1:b.hashCount,R=b.hashCount-I;for(let U=0,G=0;U<=b.level;U++){if(!b.isSignificant(U))continue;if(G0&&J++;let me=(0,o.getRepr)(p,X,g,U,b.apply(U).value,f),oe=(0,s.sha256_sync)(me),Q=G-R;S[Q]=J,k[Q]=oe,G++}let $=[],L=[];if(_)for(let U=0;U<4;U++){const{hashIndex:G}=b.apply(U),{hashIndex:X}=b;G!==X?($.push(_.pruned[G].hash),L.push(_.pruned[G].depth)):($.push(k[0]),L.push(S[0]))}else for(let U=0;U<4;U++)$.push(k[b.apply(U).hashIndex]),L.push(S[b.apply(U).hashIndex]);return{mask:b,hashes:$,depths:L}}return Cu.wonderCalculator=d,Cu}var Ko={},sh={};Object.defineProperty(sh,"__esModule",{value:!0}),sh.topologicalSort=void 0;function dR(e){let t=[e],n=new Map,r=new Set,i=[];for(;t.length>0;){const d=[...t];t=[];for(let f of d){const p=f.hash().toString("hex");if(!n.has(p)){r.add(p),n.set(p,{cell:f,refs:f.refs.map(g=>g.hash().toString("hex"))});for(let g of f.refs)t.push(g)}}}let o=new Set;function s(d){if(!r.has(d))return;if(o.has(d))throw Error("Not a DAG");o.add(d);let f=n.get(d).refs;for(let p=f.length-1;p>=0;p--)s(f[p]);i.push(d),o.delete(d),r.delete(d)}for(;r.size>0;){const d=Array.from(r)[0];s(d)}let a=new Map;for(let d=0;d=0;d--){let f=i[d];const p=n.get(f);c.push({cell:p.cell,refs:p.refs.map(g=>a.get(g))})}return c}sh.topologicalSort=dR;var ah={};Object.defineProperty(ah,"__esModule",{value:!0}),ah.bitsForNumber=void 0;function fR(e,t){let n=BigInt(e);if(t==="int")return n===0n||n===-1n?1:(n>0?n:-n).toString(2).length+1;if(t==="uint"){if(n<0)throw Error(`value is negative. Got ${e}`);return n.toString(2).length}else throw Error(`invalid mode. Got ${t}`)}ah.bitsForNumber=fR;var Pu={};Object.defineProperty(Pu,"__esModule",{value:!0}),Pu.crc32c=void 0;const Ls=2197175160;function hR(e){let t=-1;for(let r=0;r>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1,t=t&1?t>>>1^Ls:t>>>1;t=t^4294967295;let n=Ne.alloc(4);return n.writeInt32LE(t),n}Pu.crc32c=hR;var v_;function pR(){if(v_)return Ko;v_=1,Object.defineProperty(Ko,"__esModule",{value:!0}),Ko.serializeBoc=Ko.deserializeBoc=Ko.parseBoc=void 0;const e=Qi,t=Ts(),n=Ra(),r=sh,i=ah,o=Kf(),s=Ho,a=Hf(),c=Pu;function d(I){return f(I&7)}function f(I){let B=0;for(let R=0;R<3;R++)B+=I&1,I=I>>1;return B+1}function p(I,B){const R=I.loadUint(8),$=R%8,L=!!(R&8),U=I.loadUint(8),G=Math.ceil(U/2),X=!!(U%2),J=R>>5,me=(R&16)!=0,Q=me?d(J)*32:0,re=me?d(J)*2:0;I.skip(Q*8),I.skip(re*8);let Z=t.BitString.EMPTY;G>0&&(X?Z=I.loadPaddedBits(G*8):Z=I.loadBits(G*8));let be=[];for(let Ae=0;Ae<$;Ae++)be.push(I.loadUint(B*8));return{bits:Z,refs:be,exotic:L}}function g(I,B){return 2+Math.ceil(I.bits.length/8)+I.refs.length*B}function b(I){let B=new e.BitReader(new t.BitString(I,0,I.length*8)),R=B.loadUint(32);if(R===1761568243){let $=B.loadUint(8),L=B.loadUint(8),U=B.loadUint($*8),G=B.loadUint($*8),X=B.loadUint($*8),J=B.loadUint(L*8),me=B.loadBuffer(U*L),oe=B.loadBuffer(J);return{size:$,offBytes:L,cells:U,roots:G,absent:X,totalCellSize:J,index:me,cellData:oe,root:[0]}}else if(R===2898503464){let $=B.loadUint(8),L=B.loadUint(8),U=B.loadUint($*8),G=B.loadUint($*8),X=B.loadUint($*8),J=B.loadUint(L*8),me=B.loadBuffer(U*L),oe=B.loadBuffer(J),Q=B.loadBuffer(4);if(!(0,c.crc32c)(I.subarray(0,I.length-4)).equals(Q))throw Error("Invalid CRC32C");return{size:$,offBytes:L,cells:U,roots:G,absent:X,totalCellSize:J,index:me,cellData:oe,root:[0]}}else if(R===3052313714){let $=B.loadUint(1),L=B.loadUint(1);B.loadUint(1),B.loadUint(2);let U=B.loadUint(3),G=B.loadUint(8),X=B.loadUint(U*8),J=B.loadUint(U*8),me=B.loadUint(U*8),oe=B.loadUint(G*8),Q=[];for(let be=0;be=0;U--){if($[U].result)throw Error("Impossible");let G=[];for(let X of $[U].refs){if(!$[X].result)throw Error("Invalid BOC file");G.push($[X].result)}$[U].result=new n.Cell({bits:$[U].bits,refs:G,exotic:$[U].exotic})}let L=[];for(let U=0;U{if(this.isExotic&&!$)throw new Error("Exotic cells cannot be parsed");return new o.Slice(new d.BitReader(this.bits),this.refs)},this.hash=($=3)=>this._hashes[Math.min(this._hashes.length-1,$)],this.depth=($=3)=>this._depths[Math.min(this._depths.length-1,$)],this.level=()=>this.mask.level,this.equals=$=>this.hash().equals($.hash()),this[t]=()=>this.toString();let _=r.BitString.EMPTY;b&&b.bits&&(_=b.bits);let S=[];b&&b.refs&&(S=[...b.refs]);let k,I,B,R=i.CellType.Ordinary;if(b&&b.exotic){let $=(0,s.resolveExotic)(_,S),L=(0,a.wonderCalculator)($.type,_,S);B=L.mask,I=L.depths,k=L.hashes,R=$.type}else{if(S.length>4)throw new Error("Invalid number of references");if(_.length>1023)throw new Error(`Bits overflow: ${_.length} > 1023`);let $=(0,a.wonderCalculator)(i.CellType.Ordinary,_,S);B=$.mask,I=$.depths,k=$.hashes,R=i.CellType.Ordinary}this.type=R,this.bits=_,this.refs=S,this.mask=B,this._depths=I,this._hashes=k,Object.freeze(this),Object.freeze(this.refs),Object.freeze(this.bits),Object.freeze(this.mask),Object.freeze(this._depths),Object.freeze(this._hashes)}get isExotic(){return this.type!==i.CellType.Ordinary}toBoc(b){let _=b&&b.idx!==null&&b.idx!==void 0?b.idx:!1,S=b&&b.crc32!==null&&b.crc32!==void 0?b.crc32:!0;return(0,c.serializeBoc)(this,{idx:_,crc32:S})}toString(b){let _=b||"",S="x";this.isExotic&&(this.type===i.CellType.MerkleProof?S="p":this.type===i.CellType.MerkleUpdate?S="u":this.type===i.CellType.PrunedBranch&&(S="p"));let k=_+(this.isExotic?S:"x")+"{"+this.bits.toString()+"}";for(let I in this.refs){const B=this.refs[I];k+=` `+B.toString(_+" ")}return k}asSlice(){return this.beginParse()}asBuilder(){return(0,f.beginCell)().storeSlice(this.asSlice())}};return yu.Cell=p,t=n.default,p.EMPTY=new p,yu}var __;function ur(){if(__)return Ea;__=1,Object.defineProperty(Ea,"__esModule",{value:!0}),Ea.Builder=Ea.beginCell=void 0;const e=Kf(),t=Ra(),n=D3();function r(){return new i}Ea.beginCell=r;let i=class mA{constructor(){this._bits=new e.BitBuilder,this._refs=[]}get bits(){return this._bits.length}get refs(){return this._refs.length}get availableBits(){return 1023-this.bits}get availableRefs(){return 4-this.refs}storeBit(s){return this._bits.writeBit(s),this}storeBits(s){return this._bits.writeBits(s),this}storeBuffer(s,a){if(a!=null&&s.length!==a)throw Error(`Buffer length ${s.length} is not equal to ${a}`);return this._bits.writeBuffer(s),this}storeMaybeBuffer(s,a){return s!==null?(this.storeBit(1),this.storeBuffer(s,a)):this.storeBit(0),this}storeUint(s,a){return this._bits.writeUint(s,a),this}storeMaybeUint(s,a){return s!=null?(this.storeBit(1),this.storeUint(s,a)):this.storeBit(0),this}storeInt(s,a){return this._bits.writeInt(s,a),this}storeMaybeInt(s,a){return s!=null?(this.storeBit(1),this.storeInt(s,a)):this.storeBit(0),this}storeVarUint(s,a){return this._bits.writeVarUint(s,a),this}storeMaybeVarUint(s,a){return s!=null?(this.storeBit(1),this.storeVarUint(s,a)):this.storeBit(0),this}storeVarInt(s,a){return this._bits.writeVarInt(s,a),this}storeMaybeVarInt(s,a){return s!=null?(this.storeBit(1),this.storeVarInt(s,a)):this.storeBit(0),this}storeCoins(s){return this._bits.writeCoins(s),this}storeMaybeCoins(s){return s!=null?(this.storeBit(1),this.storeCoins(s)):this.storeBit(0),this}storeAddress(s){return this._bits.writeAddress(s),this}storeRef(s){if(this._refs.length>=4)throw new Error("Too many references");if(s instanceof t.Cell)this._refs.push(s);else if(s instanceof mA)this._refs.push(s.endCell());else throw new Error("Invalid argument");return this}storeMaybeRef(s){return s?(this.storeBit(1),this.storeRef(s)):this.storeBit(0),this}storeSlice(s){let a=s.clone();for(a.remainingBits>0&&this.storeBits(a.loadBits(a.remainingBits));a.remainingRefs>0;)this.storeRef(a.loadRef());return this}storeMaybeSlice(s){return s?(this.storeBit(1),this.storeSlice(s)):this.storeBit(0),this}storeBuilder(s){return this.storeSlice(s.endCell().beginParse())}storeMaybeBuilder(s){return s?(this.storeBit(1),this.storeBuilder(s)):this.storeBit(0),this}storeWritable(s){return typeof s=="object"?s.writeTo(this):s(this),this}storeMaybeWritable(s){return s?(this.storeBit(1),this.storeWritable(s)):this.storeBit(0),this}store(s){return this.storeWritable(s),this}storeStringTail(s){return(0,n.writeString)(s,this),this}storeMaybeStringTail(s){return s!=null?(this.storeBit(1),(0,n.writeString)(s,this)):this.storeBit(0),this}storeStringRefTail(s){return this.storeRef(r().storeStringTail(s)),this}storeMaybeStringRefTail(s){return s!=null?(this.storeBit(1),this.storeStringRefTail(s)):this.storeBit(0),this}storeDict(s,a,c){return s?s.store(this,a,c):this.storeBit(0),this}storeDictDirect(s,a,c){return s.storeDirect(this,a,c),this}endCell(s){return new t.Cell({bits:this._bits.build(),refs:this._refs,exotic:s==null?void 0:s.exotic})}asCell(){return this.endCell()}asSlice(){return this.endCell().beginParse()}};return Ea.Builder=i,Ea}var yo={},qo={};Object.defineProperty(qo,"__esModule",{value:!0}),qo.SimpleLibraryValue=qo.storeSimpleLibrary=qo.loadSimpleLibrary=void 0;function x_(e){return{public:e.loadBit(),root:e.loadRef()}}qo.loadSimpleLibrary=x_;function C_(e){return t=>{t.storeBit(e.public),t.storeRef(e.root)}}qo.storeSimpleLibrary=C_,qo.SimpleLibraryValue={serialize(e,t){C_(e)(t)},parse(e){return x_(e)}};var Oa={};Object.defineProperty(Oa,"__esModule",{value:!0}),Oa.storeTickTock=Oa.loadTickTock=void 0;function gR(e){return{tick:e.loadBit(),tock:e.loadBit()}}Oa.loadTickTock=gR;function mR(e){return t=>{t.storeBit(e.tick),t.storeBit(e.tock)}}Oa.storeTickTock=mR,Object.defineProperty(yo,"__esModule",{value:!0}),yo.storeStateInit=yo.loadStateInit=void 0;const yR=Ia(),bR=qo,S_=Oa;function vR(e){let t;e.loadBit()&&(t=e.loadUint(5));let n;e.loadBit()&&(n=(0,S_.loadTickTock)(e));let r=e.loadMaybeRef(),i=e.loadMaybeRef(),o=e.loadDict(yR.Dictionary.Keys.BigUint(256),bR.SimpleLibraryValue);return o.size===0&&(o=void 0),{splitDepth:t,special:n,code:r,data:i,libraries:o}}yo.loadStateInit=vR;function wR(e){return t=>{e.splitDepth!==null&&e.splitDepth!==void 0?(t.storeBit(!0),t.storeUint(e.splitDepth,5)):t.storeBit(!1),e.special!==null&&e.special!==void 0?(t.storeBit(!0),t.store((0,S_.storeTickTock)(e.special))):t.storeBit(!1),t.storeMaybeRef(e.code),t.storeMaybeRef(e.data),t.storeDict(e.libraries)}}yo.storeStateInit=wR,Object.defineProperty(Wf,"__esModule",{value:!0}),Wf.contractAddress=void 0;const _R=ur(),xR=yo,CR=yi;function SR(e,t){let n=(0,_R.beginCell)().store((0,xR.storeStateInit)(t)).endCell().hash();return new CR.Address(e,n)}Wf.contractAddress=SR;var rc={};Object.defineProperty(rc,"__esModule",{value:!0}),rc.parseTuple=rc.serializeTuple=void 0;const Bu=ur(),kR=BigInt("-9223372036854775808"),AR=BigInt("9223372036854775807");function k_(e,t){if(e.type==="null")t.storeUint(0,8);else if(e.type==="int")e.value<=AR&&e.value>=kR?(t.storeUint(1,8),t.storeInt(e.value,64)):(t.storeUint(256,15),t.storeInt(e.value,257));else if(e.type==="nan")t.storeInt(767,16);else if(e.type==="cell")t.storeUint(3,8),t.storeRef(e.cell);else if(e.type==="slice")t.storeUint(4,8),t.storeUint(0,10),t.storeUint(e.cell.bits.length,10),t.storeUint(0,3),t.storeUint(e.cell.refs.length,3),t.storeRef(e.cell);else if(e.type==="builder")t.storeUint(5,8),t.storeRef(e.cell);else if(e.type==="tuple"){let n=null,r=null;for(let i=0;i1&&(n=(0,Bu.beginCell)().storeRef(r).storeRef(n).endCell());let s=(0,Bu.beginCell)();k_(e.items[i],s),r=s.endCell()}t.storeUint(7,8),t.storeUint(e.items.length,16),n&&t.storeRef(n),r&&t.storeRef(r)}else throw Error("Invalid value")}function Iu(e){let t=e.loadUint(8);if(t===0)return{type:"null"};if(t===1)return{type:"int",value:e.loadIntBig(64)};if(t===2)return e.loadUint(7)===0?{type:"int",value:e.loadIntBig(257)}:(e.loadBit(),{type:"nan"});if(t===3)return{type:"cell",cell:e.loadRef()};if(t===4){let n=e.loadUint(10),r=e.loadUint(10),i=e.loadUint(3),o=e.loadUint(3),s=e.loadRef().beginParse();s.skip(n);let a=s.loadBits(r-n),c=(0,Bu.beginCell)().storeBits(a);if(i1){let i=e.loadRef().beginParse(),o=e.loadRef().beginParse();r.unshift(Iu(o));for(let s=0;s0){let n=(0,Bu.beginCell)();A_(e.slice(0,e.length-1),n),t.storeRef(n.endCell()),k_(e[e.length-1],t)}}function ER(e){let t=(0,Bu.beginCell)();t.storeUint(e.length,24);let n=[...e];return A_(n,t),t.endCell()}rc.serializeTuple=ER;function TR(e){let t=[],n=e.beginParse(),r=n.loadUint(24);for(let i=0;i2)throw Error("Invalid number");let r=n[0],i=n[1];if(r||(r="0"),i||(i="0"),i.length>9)throw Error("Invalid number");for(;i.length<9;)i+="0";let o=BigInt(r)*1000000000n+BigInt(i);return t&&(o=-o),o}}$a.toNano=BR;function IR(e){let t=BigInt(e),n=!1;t<0&&(n=!0,t=-t);let i=(t%1000000000n).toString();for(;i.length<9;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];let a=`${(t/1000000000n).toString()}${i==="0"?"":`.${i}`}`;return n&&(a="-"+a),a}$a.fromNano=IR,Object.defineProperty(Us,"__esModule",{value:!0}),Us.comment=Us.external=Us.internal=void 0;const uh=yi,T_=Ra(),P_=ur(),MR=$a;function RR(e){let t=!0;e.bounce!==null&&e.bounce!==void 0&&(t=e.bounce);let n;if(typeof e.to=="string")n=uh.Address.parse(e.to);else if(uh.Address.isAddress(e.to))n=e.to;else throw new Error(`Invalid address ${e.to}`);let r;typeof e.value=="string"?r=(0,MR.toNano)(e.value):r=e.value;let i=T_.Cell.EMPTY;return typeof e.body=="string"?i=(0,P_.beginCell)().storeUint(0,32).storeStringTail(e.body).endCell():e.body&&(i=e.body),{info:{type:"internal",dest:n,value:{coins:r},bounce:t,ihrDisabled:!0,bounced:!1,ihrFee:0n,forwardFee:0n,createdAt:0,createdLt:0n},init:e.init??void 0,body:i}}Us.internal=RR;function OR(e){let t;if(typeof e.to=="string")t=uh.Address.parse(e.to);else if(uh.Address.isAddress(e.to))t=e.to;else throw new Error(`Invalid address ${e.to}`);return{info:{type:"external-in",dest:t,importFee:0n},init:e.init??void 0,body:e.body||T_.Cell.EMPTY}}Us.external=OR;function $R(e){return(0,P_.beginCell)().storeUint(0,32).storeStringTail(e).endCell()}Us.comment=$R;var La={},Ua={},Na={};Object.defineProperty(Na,"__esModule",{value:!0}),Na.storeAccountState=Na.loadAccountState=void 0;const B_=yo;function LR(e){return e.loadBit()?{type:"active",state:(0,B_.loadStateInit)(e)}:e.loadBit()?{type:"frozen",stateHash:e.loadUintBig(256)}:{type:"uninit"}}Na.loadAccountState=LR;function UR(e){return t=>{e.type==="active"?(t.storeBit(!0),t.store((0,B_.storeStateInit)(e.state))):e.type==="frozen"?(t.storeBit(!1),t.storeBit(!0),t.storeUint(e.stateHash,256)):e.type==="uninit"&&(t.storeBit(!1),t.storeBit(!1))}}Na.storeAccountState=UR;var ni={};Object.defineProperty(ni,"__esModule",{value:!0}),ni.storeCurrencyCollection=ni.loadCurrencyCollection=void 0;const I_=Ia();function NR(e){const t=e.loadCoins(),n=e.loadDict(I_.Dictionary.Keys.Uint(32),I_.Dictionary.Values.BigVarUint(5));return n.size===0?{coins:t}:{other:n,coins:t}}ni.loadCurrencyCollection=NR;function DR(e){return t=>{t.storeCoins(e.coins),e.other?t.storeDict(e.other):t.storeBit(0)}}ni.storeCurrencyCollection=DR,Object.defineProperty(Ua,"__esModule",{value:!0}),Ua.storeAccountStorage=Ua.loadAccountStorage=void 0;const M_=Na,R_=ni;function jR(e){return{lastTransLt:e.loadUintBig(64),balance:(0,R_.loadCurrencyCollection)(e),state:(0,M_.loadAccountState)(e)}}Ua.loadAccountStorage=jR;function FR(e){return t=>{t.storeUint(e.lastTransLt,64),t.store((0,R_.storeCurrencyCollection)(e.balance)),t.store((0,M_.storeAccountState)(e.state))}}Ua.storeAccountStorage=FR;var Da={},ja={};Object.defineProperty(ja,"__esModule",{value:!0}),ja.storeStorageUsed=ja.loadStorageUsed=void 0;function zR(e){return{cells:e.loadVarUintBig(3),bits:e.loadVarUintBig(3),publicCells:e.loadVarUintBig(3)}}ja.loadStorageUsed=zR;function VR(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3),t.storeVarUint(e.publicCells,3)}}ja.storeStorageUsed=VR,Object.defineProperty(Da,"__esModule",{value:!0}),Da.storeStorageInfo=Da.loadStorageInfo=void 0;const O_=ja;function WR(e){return{used:(0,O_.loadStorageUsed)(e),lastPaid:e.loadUint(32),duePayment:e.loadMaybeCoins()}}Da.loadStorageInfo=WR;function HR(e){return t=>{t.store((0,O_.storeStorageUsed)(e.used)),t.storeUint(e.lastPaid,32),t.storeMaybeCoins(e.duePayment)}}Da.storeStorageInfo=HR,Object.defineProperty(La,"__esModule",{value:!0}),La.storeAccount=La.loadAccount=void 0;const $_=Ua,L_=Da;function KR(e){return{addr:e.loadAddress(),storageStats:(0,L_.loadStorageInfo)(e),storage:(0,$_.loadAccountStorage)(e)}}La.loadAccount=KR;function qR(e){return t=>{t.storeAddress(e.addr),t.store((0,L_.storeStorageInfo)(e.storageStats)),t.store((0,$_.storeAccountStorage)(e.storage))}}La.storeAccount=qR;var Fa={};Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.storeAccountStatus=Fa.loadAccountStatus=void 0;function ZR(e){const t=e.loadUint(2);if(t===0)return"uninitialized";if(t===1)return"frozen";if(t===2)return"active";if(t===3)return"non-existing";throw Error("Invalid data")}Fa.loadAccountStatus=ZR;function GR(e){return t=>{if(e==="uninitialized")t.storeUint(0,2);else if(e==="frozen")t.storeUint(1,2);else if(e==="active")t.storeUint(2,2);else if(e==="non-existing")t.storeUint(3,2);else throw Error("Invalid data");return t}}Fa.storeAccountStatus=GR;var Ns={};Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.storeAccountStatusChange=Ns.loadAccountStatusChange=void 0;function YR(e){return e.loadBit()?e.loadBit()?"deleted":"frozen":"unchanged"}Ns.loadAccountStatusChange=YR;function JR(e){return t=>{if(e=="unchanged")t.storeBit(0);else if(e==="frozen")t.storeBit(1),t.storeBit(0);else if(e==="deleted")t.storeBit(1),t.storeBit(1);else throw Error("Invalid account status change")}}Ns.storeAccountStatusChange=JR;var bo={},za={},Va={};Object.defineProperty(Va,"__esModule",{value:!0}),Va.storeCommonMessageInfoRelaxed=Va.loadCommonMessageInfoRelaxed=void 0;const U_=ni;function QR(e){if(!e.loadBit()){const o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadMaybeAddress(),d=e.loadAddress(),f=(0,U_.loadCurrencyCollection)(e),p=e.loadCoins(),g=e.loadCoins(),b=e.loadUintBig(64),_=e.loadUint(32);return{type:"internal",ihrDisabled:o,bounce:s,bounced:a,src:c,dest:d,value:f,ihrFee:p,forwardFee:g,createdLt:b,createdAt:_}}if(!e.loadBit())throw Error("External In message is not possible for CommonMessageInfoRelaxed");const t=e.loadMaybeAddress(),n=e.loadMaybeExternalAddress(),r=e.loadUintBig(64),i=e.loadUint(32);return{type:"external-out",src:t,dest:n,createdLt:r,createdAt:i}}Va.loadCommonMessageInfoRelaxed=QR;function XR(e){return t=>{if(e.type==="internal")t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,U_.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else if(e.type==="external-out")t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}Va.storeCommonMessageInfoRelaxed=XR,Object.defineProperty(za,"__esModule",{value:!0}),za.storeMessageRelaxed=za.loadMessageRelaxed=void 0;const eO=ur(),N_=Va,Hm=yo;function tO(e){const t=(0,N_.loadCommonMessageInfoRelaxed)(e);let n=null;e.loadBit()&&(e.loadBit()?n=(0,Hm.loadStateInit)(e.loadRef().beginParse()):n=(0,Hm.loadStateInit)(e));const r=e.loadBit()?e.loadRef():e.asCell();return{info:t,init:n,body:r}}za.loadMessageRelaxed=tO;function nO(e,t){return n=>{if(n.store((0,N_.storeCommonMessageInfoRelaxed)(e.info)),e.init){n.storeBit(!0);let i=(0,eO.beginCell)().store((0,Hm.storeStateInit)(e.init)),o=!1;t&&t.forceRef?o=!0:n.availableBits-2>=i.bits?o=!1:o=!0,o?(n.storeBit(!0),n.storeRef(i)):(n.storeBit(!1),n.storeBuilder(i))}else n.storeBit(!1);let r=!1;t&&t.forceRef?r=!0:n.availableBits-1>=e.body.bits.length&&n.refs+e.body.refs.length<=4&&!e.body.isExotic?r=!1:r=!0,r?(n.storeBit(!0),n.storeRef(e.body)):(n.storeBit(!1),n.storeBuilder(e.body.asBuilder()))}}za.storeMessageRelaxed=nO;var Wa={};Object.defineProperty(Wa,"__esModule",{value:!0}),Wa.storeLibRef=Wa.loadLibRef=void 0;function rO(e){return e.loadUint(1)===0?{type:"hash",libHash:e.loadBuffer(32)}:{type:"ref",library:e.loadRef()}}Wa.loadLibRef=rO;function iO(e){return t=>{e.type==="hash"?(t.storeUint(0,1),t.storeBuffer(e.libHash)):(t.storeUint(1,1),t.storeRef(e.library))}}Wa.storeLibRef=iO,Object.defineProperty(bo,"__esModule",{value:!0}),bo.loadOutList=bo.storeOutList=bo.loadOutAction=bo.storeOutAction=void 0;const D_=za,Km=ur(),j_=ni,F_=Wa;function z_(e){switch(e.type){case"sendMsg":return oO(e);case"setCode":return sO(e);case"reserve":return aO(e);case"changeLibrary":return lO(e);default:throw new Error(`Unknown action type ${e.type}`)}}bo.storeOutAction=z_;const V_=247711853;function oO(e){return t=>{t.storeUint(V_,32).storeUint(e.mode,8).storeRef((0,Km.beginCell)().store((0,D_.storeMessageRelaxed)(e.outMsg)).endCell())}}const W_=2907562126;function sO(e){return t=>{t.storeUint(W_,32).storeRef(e.newCode)}}const H_=921090057;function aO(e){return t=>{t.storeUint(H_,32).storeUint(e.mode,8).store((0,j_.storeCurrencyCollection)(e.currency))}}const K_=653925844;function lO(e){return t=>{t.storeUint(K_,32).storeUint(e.mode,7).store((0,F_.storeLibRef)(e.libRef))}}function q_(e){const t=e.loadUint(32);if(t===V_){const n=e.loadUint(8),r=(0,D_.loadMessageRelaxed)(e.loadRef().beginParse());return{type:"sendMsg",mode:n,outMsg:r}}if(t===W_)return{type:"setCode",newCode:e.loadRef()};if(t===H_){const n=e.loadUint(8),r=(0,j_.loadCurrencyCollection)(e);return{type:"reserve",mode:n,currency:r}}if(t===K_){const n=e.loadUint(7),r=(0,F_.loadLibRef)(e);return{type:"changeLibrary",mode:n,libRef:r}}throw new Error(`Unknown out action tag 0x${t.toString(16)}`)}bo.loadOutAction=q_;function cO(e){const t=e.reduce((n,r)=>(0,Km.beginCell)().storeRef(n).store(z_(r)).endCell(),(0,Km.beginCell)().endCell());return n=>{n.storeSlice(t.beginParse())}}bo.storeOutList=cO;function uO(e){const t=[];for(;e.remainingRefs;){const n=e.loadRef();t.push(q_(e)),e=n.beginParse()}return t.reverse()}bo.loadOutList=uO;var Ha={};Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.storeCommonMessageInfo=Ha.loadCommonMessageInfo=void 0;const Z_=ni;function dO(e){if(!e.loadBit()){const o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadAddress(),d=e.loadAddress(),f=(0,Z_.loadCurrencyCollection)(e),p=e.loadCoins(),g=e.loadCoins(),b=e.loadUintBig(64),_=e.loadUint(32);return{type:"internal",ihrDisabled:o,bounce:s,bounced:a,src:c,dest:d,value:f,ihrFee:p,forwardFee:g,createdLt:b,createdAt:_}}if(!e.loadBit()){const o=e.loadMaybeExternalAddress(),s=e.loadAddress(),a=e.loadCoins();return{type:"external-in",src:o,dest:s,importFee:a}}const t=e.loadAddress(),n=e.loadMaybeExternalAddress(),r=e.loadUintBig(64),i=e.loadUint(32);return{type:"external-out",src:t,dest:n,createdLt:r,createdAt:i}}Ha.loadCommonMessageInfo=dO;function fO(e){return t=>{if(e.type==="internal")t.storeBit(0),t.storeBit(e.ihrDisabled),t.storeBit(e.bounce),t.storeBit(e.bounced),t.storeAddress(e.src),t.storeAddress(e.dest),t.store((0,Z_.storeCurrencyCollection)(e.value)),t.storeCoins(e.ihrFee),t.storeCoins(e.forwardFee),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else if(e.type==="external-in")t.storeBit(1),t.storeBit(0),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeCoins(e.importFee);else if(e.type==="external-out")t.storeBit(1),t.storeBit(1),t.storeAddress(e.src),t.storeAddress(e.dest),t.storeUint(e.createdLt,64),t.storeUint(e.createdAt,32);else throw new Error("Unknown CommonMessageInfo type")}}Ha.storeCommonMessageInfo=fO;var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.storeComputeSkipReason=Ka.loadComputeSkipReason=void 0;function hO(e){let t=e.loadUint(2);if(t===0)return"no-state";if(t===1)return"bad-state";if(t===2)return"no-gas";throw new Error(`Unknown ComputeSkipReason: ${t}`)}Ka.loadComputeSkipReason=hO;function pO(e){return t=>{if(e==="no-state")t.storeUint(0,2);else if(e==="bad-state")t.storeUint(1,2);else if(e==="no-gas")t.storeUint(2,2);else throw new Error(`Unknown ComputeSkipReason: ${e}`)}}Ka.storeComputeSkipReason=pO;var qa={};Object.defineProperty(qa,"__esModule",{value:!0}),qa.storeDepthBalanceInfo=qa.loadDepthBalanceInfo=void 0;const G_=ni;function gO(e){return{splitDepth:e.loadUint(5),balance:(0,G_.loadCurrencyCollection)(e)}}qa.loadDepthBalanceInfo=gO;function mO(e){return t=>{t.storeUint(e.splitDepth,5),t.store((0,G_.storeCurrencyCollection)(e.balance))}}qa.storeDepthBalanceInfo=mO;var Za={};Object.defineProperty(Za,"__esModule",{value:!0}),Za.storeHashUpdate=Za.loadHashUpdate=void 0;function yO(e){if(e.loadUint(8)!==114)throw Error("Invalid data");const t=e.loadBuffer(32),n=e.loadBuffer(32);return{oldHash:t,newHash:n}}Za.loadHashUpdate=yO;function bO(e){return t=>{t.storeUint(114,8),t.storeBuffer(e.oldHash),t.storeBuffer(e.newHash)}}Za.storeHashUpdate=bO;var Mu={};Object.defineProperty(Mu,"__esModule",{value:!0}),Mu.loadMasterchainStateExtra=void 0;const qm=Ia(),vO=ni;function wO(e){if(e.loadUint(16)!==52262)throw Error("Invalid data");e.loadBit()&&e.loadRef();let t=e.loadUintBig(256),n=qm.Dictionary.load(qm.Dictionary.Keys.Int(32),qm.Dictionary.Values.Cell(),e);const r=(0,vO.loadCurrencyCollection)(e);return{config:n,configAddress:t,globalBalance:r}}Mu.loadMasterchainStateExtra=wO;var Zo={};Object.defineProperty(Zo,"__esModule",{value:!0}),Zo.MessageValue=Zo.storeMessage=Zo.loadMessage=void 0;const Y_=ur(),J_=Ha,Zm=yo;function Q_(e){const t=(0,J_.loadCommonMessageInfo)(e);let n=null;e.loadBit()&&(e.loadBit()?n=(0,Zm.loadStateInit)(e.loadRef().beginParse()):n=(0,Zm.loadStateInit)(e));const r=e.loadBit()?e.loadRef():e.asCell();return{info:t,init:n,body:r}}Zo.loadMessage=Q_;function X_(e,t){return n=>{if(n.store((0,J_.storeCommonMessageInfo)(e.info)),e.init){n.storeBit(!0);let i=(0,Y_.beginCell)().store((0,Zm.storeStateInit)(e.init)),o=!1;t&&t.forceRef?o=!0:o=n.availableBits-24,r?(n.storeBit(!0),n.storeRef(e.body)):(n.storeBit(!1),n.storeBuilder(e.body.asBuilder()))}}Zo.storeMessage=X_,Zo.MessageValue={serialize(e,t){t.storeRef((0,Y_.beginCell)().store(X_(e)))},parse(e){return Q_(e.loadRef().beginParse())}};var dh={};Object.defineProperty(dh,"__esModule",{value:!0}),dh.SendMode=void 0;var e5;(function(e){e[e.CARRY_ALL_REMAINING_BALANCE=128]="CARRY_ALL_REMAINING_BALANCE",e[e.CARRY_ALL_REMAINING_INCOMING_VALUE=64]="CARRY_ALL_REMAINING_INCOMING_VALUE",e[e.DESTROY_ACCOUNT_IF_ZERO=32]="DESTROY_ACCOUNT_IF_ZERO",e[e.PAY_GAS_SEPARATELY=1]="PAY_GAS_SEPARATELY",e[e.IGNORE_ERRORS=2]="IGNORE_ERRORS",e[e.NONE=0]="NONE"})(e5||(dh.SendMode=e5={}));var fh={};Object.defineProperty(fh,"__esModule",{value:!0}),fh.ReserveMode=void 0;var t5;(function(e){e[e.THIS_AMOUNT=0]="THIS_AMOUNT",e[e.LEAVE_THIS_AMOUNT=1]="LEAVE_THIS_AMOUNT",e[e.AT_MOST_THIS_AMOUNT=2]="AT_MOST_THIS_AMOUNT",e[e.LEAVE_MAX_THIS_AMOUNT=3]="LEAVE_MAX_THIS_AMOUNT",e[e.BEFORE_BALANCE_PLUS_THIS_AMOUNT=4]="BEFORE_BALANCE_PLUS_THIS_AMOUNT",e[e.LEAVE_BBALANCE_PLUS_THIS_AMOUNT=5]="LEAVE_BBALANCE_PLUS_THIS_AMOUNT",e[e.BEFORE_BALANCE_MINUS_THIS_AMOUNT=12]="BEFORE_BALANCE_MINUS_THIS_AMOUNT",e[e.LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT=13]="LEAVE_BEFORE_BALANCE_MINUS_THIS_AMOUNT"})(t5||(fh.ReserveMode=t5={}));var Ga={};Object.defineProperty(Ga,"__esModule",{value:!0}),Ga.storeShardAccount=Ga.loadShardAccount=void 0;const n5=ur(),r5=La;function _O(e){let t=e.loadRef(),n;if(!t.isExotic){let r=t.beginParse();r.loadBit()&&(n=(0,r5.loadAccount)(r))}return{account:n,lastTransactionHash:e.loadUintBig(256),lastTransactionLt:e.loadUintBig(64)}}Ga.loadShardAccount=_O;function xO(e){return t=>{e.account?t.storeRef((0,n5.beginCell)().storeBit(!0).store((0,r5.storeAccount)(e.account))):t.storeRef((0,n5.beginCell)().storeBit(!1)),t.storeUint(e.lastTransactionHash,256),t.storeUint(e.lastTransactionLt,64)}}Ga.storeShardAccount=xO;var Gm={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.storeShardAccounts=e.loadShardAccounts=e.ShardAccountRefValue=void 0;const t=Ia(),n=qa,r=Ga;e.ShardAccountRefValue={parse:s=>{let a=(0,n.loadDepthBalanceInfo)(s),c=(0,r.loadShardAccount)(s);return{depthBalanceInfo:a,shardAccount:c}},serialize(s,a){a.store((0,n.storeDepthBalanceInfo)(s.depthBalanceInfo)),a.store((0,r.storeShardAccount)(s.shardAccount))}};function i(s){return t.Dictionary.load(t.Dictionary.Keys.BigUint(256),e.ShardAccountRefValue,s)}e.loadShardAccounts=i;function o(s){return a=>{a.storeDict(s)}}e.storeShardAccounts=o})(Gm);var Ya={};Object.defineProperty(Ya,"__esModule",{value:!0}),Ya.storeShardIdent=Ya.loadShardIdent=void 0;function CO(e){if(e.loadUint(2)!==0)throw Error("Invalid data");return{shardPrefixBits:e.loadUint(6),workchainId:e.loadInt(32),shardPrefix:e.loadUintBig(64)}}Ya.loadShardIdent=CO;function SO(e){return t=>{t.storeUint(0,2),t.storeUint(e.shardPrefixBits,6),t.storeInt(e.workchainId,32),t.storeUint(e.shardPrefix,64)}}Ya.storeShardIdent=SO;var hh={};Object.defineProperty(hh,"__esModule",{value:!0}),hh.loadShardStateUnsplit=void 0;const kO=Mu,AO=Gm,EO=Ya;function TO(e){if(e.loadUint(32)!==2418257890)throw Error("Invalid data");let t=e.loadInt(32),n=(0,EO.loadShardIdent)(e),r=e.loadUint(32),i=e.loadUint(32),o=e.loadUint(32),s=e.loadUintBig(64),a=e.loadUint(32);e.loadRef();let c=e.loadBit(),d=e.loadRef(),f;d.isExotic||(f=(0,AO.loadShardAccounts)(d.beginParse())),e.loadRef();let p=e.loadBit(),g=null;if(p){let b=e.loadRef();b.isExotic||(g=(0,kO.loadMasterchainStateExtra)(b.beginParse()))}return{globalId:t,shardId:n,seqno:r,vertSeqNo:i,genUtime:o,genLt:s,minRefMcSeqno:a,beforeSplit:c,accounts:f,extras:g}}hh.loadShardStateUnsplit=TO;var Ja={};Object.defineProperty(Ja,"__esModule",{value:!0}),Ja.storeSplitMergeInfo=Ja.loadSplitMergeInfo=void 0;function PO(e){let t=e.loadUint(6),n=e.loadUint(6),r=e.loadUintBig(256),i=e.loadUintBig(256);return{currentShardPrefixLength:t,accountSplitDepth:n,thisAddress:r,siblingAddress:i}}Ja.loadSplitMergeInfo=PO;function BO(e){return t=>{t.storeUint(e.currentShardPrefixLength,6),t.storeUint(e.accountSplitDepth,6),t.storeUint(e.thisAddress,256),t.storeUint(e.siblingAddress,256)}}Ja.storeSplitMergeInfo=BO;var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0}),Ds.storeStorageUsedShort=Ds.loadStorageUsedShort=void 0;function IO(e){let t=e.loadVarUintBig(3),n=e.loadVarUintBig(3);return{cells:t,bits:n}}Ds.loadStorageUsedShort=IO;function MO(e){return t=>{t.storeVarUint(e.cells,3),t.storeVarUint(e.bits,3)}}Ds.storeStorageUsedShort=MO;var Qa={},Xa={},el={};Object.defineProperty(el,"__esModule",{value:!0}),el.storeTransactionActionPhase=el.loadTransactionActionPhase=void 0;const i5=Ns,o5=Ds;function RO(e){let t=e.loadBit(),n=e.loadBit(),r=e.loadBit(),i=(0,i5.loadAccountStatusChange)(e),o=e.loadBit()?e.loadCoins():void 0,s=e.loadBit()?e.loadCoins():void 0,a=e.loadInt(32),c=e.loadBit()?e.loadInt(32):void 0,d=e.loadUint(16),f=e.loadUint(16),p=e.loadUint(16),g=e.loadUint(16),b=e.loadUintBig(256),_=(0,o5.loadStorageUsedShort)(e);return{success:t,valid:n,noFunds:r,statusChange:i,totalFwdFees:o,totalActionFees:s,resultCode:a,resultArg:c,totalActions:d,specActions:f,skippedActions:p,messagesCreated:g,actionListHash:b,totalMessageSize:_}}el.loadTransactionActionPhase=RO;function OO(e){return t=>{t.storeBit(e.success),t.storeBit(e.valid),t.storeBit(e.noFunds),t.store((0,i5.storeAccountStatusChange)(e.statusChange)),t.storeMaybeCoins(e.totalFwdFees),t.storeMaybeCoins(e.totalActionFees),t.storeInt(e.resultCode,32),t.storeMaybeInt(e.resultArg,32),t.storeUint(e.totalActions,16),t.storeUint(e.specActions,16),t.storeUint(e.skippedActions,16),t.storeUint(e.messagesCreated,16),t.storeUint(e.actionListHash,256),t.store((0,o5.storeStorageUsedShort)(e.totalMessageSize))}}el.storeTransactionActionPhase=OO;var tl={};Object.defineProperty(tl,"__esModule",{value:!0}),tl.storeTransactionBouncePhase=tl.loadTransactionBouncePhase=void 0;const ph=Ds;function $O(e){if(e.loadBit()){let t=(0,ph.loadStorageUsedShort)(e),n=e.loadCoins(),r=e.loadCoins();return{type:"ok",messageSize:t,messageFees:n,forwardFees:r}}if(e.loadBit()){let t=(0,ph.loadStorageUsedShort)(e),n=e.loadCoins();return{type:"no-funds",messageSize:t,requiredForwardFees:n}}return{type:"negative-funds"}}tl.loadTransactionBouncePhase=$O;function LO(e){return t=>{if(e.type==="ok")t.storeBit(!0),t.store((0,ph.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.messageFees),t.storeCoins(e.forwardFees);else if(e.type==="negative-funds")t.storeBit(!1),t.storeBit(!1);else if(e.type==="no-funds")t.storeBit(!1),t.storeBit(!0),t.store((0,ph.storeStorageUsedShort)(e.messageSize)),t.storeCoins(e.requiredForwardFees);else throw new Error("Invalid TransactionBouncePhase type")}}tl.storeTransactionBouncePhase=LO;var nl={};Object.defineProperty(nl,"__esModule",{value:!0}),nl.storeTransactionComputePhase=nl.loadTransactionComputePhase=void 0;const UO=ur(),s5=Ka;function NO(e){if(!e.loadBit())return{type:"skipped",reason:(0,s5.loadComputeSkipReason)(e)};let t=e.loadBit(),n=e.loadBit(),r=e.loadBit(),i=e.loadCoins();const o=e.loadRef().beginParse();let s=o.loadVarUintBig(3),a=o.loadVarUintBig(3),c=o.loadBit()?o.loadVarUintBig(2):void 0,d=o.loadUint(8),f=o.loadInt(32),p=o.loadBit()?o.loadInt(32):void 0,g=o.loadUint(32),b=o.loadUintBig(256),_=o.loadUintBig(256);return{type:"vm",success:t,messageStateUsed:n,accountActivated:r,gasFees:i,gasUsed:s,gasLimit:a,gasCredit:c,mode:d,exitCode:f,exitArg:p,vmSteps:g,vmInitStateHash:b,vmFinalStateHash:_}}nl.loadTransactionComputePhase=NO;function DO(e){return t=>{if(e.type==="skipped"){t.storeBit(0),t.store((0,s5.storeComputeSkipReason)(e.reason));return}t.storeBit(1),t.storeBit(e.success),t.storeBit(e.messageStateUsed),t.storeBit(e.accountActivated),t.storeCoins(e.gasFees),t.storeRef((0,UO.beginCell)().storeVarUint(e.gasUsed,3).storeVarUint(e.gasLimit,3).store(n=>e.gasCredit!==void 0&&e.gasCredit!==null?n.storeBit(1).storeVarUint(e.gasCredit,2):n.storeBit(0)).storeUint(e.mode,8).storeInt(e.exitCode,32).store(n=>e.exitArg!==void 0&&e.exitArg!==null?n.storeBit(1).storeInt(e.exitArg,32):n.storeBit(0)).storeUint(e.vmSteps,32).storeUint(e.vmInitStateHash,256).storeUint(e.vmFinalStateHash,256).endCell())}}nl.storeTransactionComputePhase=DO;var rl={};Object.defineProperty(rl,"__esModule",{value:!0}),rl.storeTransactionCreditPhase=rl.loadTransactionCreditPhase=void 0;const a5=ni;function jO(e){const t=e.loadBit()?e.loadCoins():void 0,n=(0,a5.loadCurrencyCollection)(e);return{dueFeesColelcted:t,credit:n}}rl.loadTransactionCreditPhase=jO;function FO(e){return t=>{e.dueFeesColelcted===null||e.dueFeesColelcted===void 0?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.dueFeesColelcted)),t.store((0,a5.storeCurrencyCollection)(e.credit))}}rl.storeTransactionCreditPhase=FO;var il={};Object.defineProperty(il,"__esModule",{value:!0}),il.storeTransactionsStoragePhase=il.loadTransactionStoragePhase=void 0;const l5=Ns;function zO(e){const t=e.loadCoins();let n;e.loadBit()&&(n=e.loadCoins());const r=(0,l5.loadAccountStatusChange)(e);return{storageFeesCollected:t,storageFeesDue:n,statusChange:r}}il.loadTransactionStoragePhase=zO;function VO(e){return t=>{t.storeCoins(e.storageFeesCollected),e.storageFeesDue===null||e.storageFeesDue===void 0?t.storeBit(!1):(t.storeBit(!0),t.storeCoins(e.storageFeesDue)),t.store((0,l5.storeAccountStatusChange)(e.statusChange))}}il.storeTransactionsStoragePhase=VO;var c5;function u5(){if(c5)return Xa;c5=1,Object.defineProperty(Xa,"__esModule",{value:!0}),Xa.storeTransactionDescription=Xa.loadTransactionDescription=void 0;const e=ur(),t=Ja,n=f5(),r=el,i=tl,o=nl,s=rl,a=il;function c(f){let p=f.loadUint(4);if(p===0){const g=f.loadBit();let b;f.loadBit()&&(b=(0,a.loadTransactionStoragePhase)(f));let _;f.loadBit()&&(_=(0,s.loadTransactionCreditPhase)(f));let S=(0,o.loadTransactionComputePhase)(f),k;f.loadBit()&&(k=(0,r.loadTransactionActionPhase)(f.loadRef().beginParse()));let I=f.loadBit(),B;f.loadBit()&&(B=(0,i.loadTransactionBouncePhase)(f));const R=f.loadBit();return{type:"generic",creditFirst:g,storagePhase:b,creditPhase:_,computePhase:S,actionPhase:k,bouncePhase:B,aborted:I,destroyed:R}}if(p===1)return{type:"storage",storagePhase:(0,a.loadTransactionStoragePhase)(f)};if(p===2||p===3){const g=p===3;let b=(0,a.loadTransactionStoragePhase)(f),_=(0,o.loadTransactionComputePhase)(f),S;f.loadBit()&&(S=(0,r.loadTransactionActionPhase)(f.loadRef().beginParse()));const k=f.loadBit(),I=f.loadBit();return{type:"tick-tock",isTock:g,storagePhase:b,computePhase:_,actionPhase:S,aborted:k,destroyed:I}}if(p===4){let g=(0,t.loadSplitMergeInfo)(f),b;f.loadBit()&&(b=(0,a.loadTransactionStoragePhase)(f));let _=(0,o.loadTransactionComputePhase)(f),S;f.loadBit()&&(S=(0,r.loadTransactionActionPhase)(f.loadRef().beginParse()));const k=f.loadBit(),I=f.loadBit();return{type:"split-prepare",splitInfo:g,storagePhase:b,computePhase:_,actionPhase:S,aborted:k,destroyed:I}}if(p===5){let g=(0,t.loadSplitMergeInfo)(f),b=(0,n.loadTransaction)(f.loadRef().beginParse());const _=f.loadBit();return{type:"split-install",splitInfo:g,prepareTransaction:b,installed:_}}throw Error(`Unsupported transaction description type ${p}`)}Xa.loadTransactionDescription=c;function d(f){return p=>{if(f.type==="generic")p.storeUint(0,4),p.storeBit(f.creditFirst),f.storagePhase?(p.storeBit(!0),p.store((0,a.storeTransactionsStoragePhase)(f.storagePhase))):p.storeBit(!1),f.creditPhase?(p.storeBit(!0),p.store((0,s.storeTransactionCreditPhase)(f.creditPhase))):p.storeBit(!1),p.store((0,o.storeTransactionComputePhase)(f.computePhase)),f.actionPhase?(p.storeBit(!0),p.storeRef((0,e.beginCell)().store((0,r.storeTransactionActionPhase)(f.actionPhase)))):p.storeBit(!1),p.storeBit(f.aborted),f.bouncePhase?(p.storeBit(!0),p.store((0,i.storeTransactionBouncePhase)(f.bouncePhase))):p.storeBit(!1),p.storeBit(f.destroyed);else if(f.type==="storage")p.storeUint(1,4),p.store((0,a.storeTransactionsStoragePhase)(f.storagePhase));else if(f.type==="tick-tock")p.storeUint(f.isTock?3:2,4),p.store((0,a.storeTransactionsStoragePhase)(f.storagePhase)),p.store((0,o.storeTransactionComputePhase)(f.computePhase)),f.actionPhase?(p.storeBit(!0),p.storeRef((0,e.beginCell)().store((0,r.storeTransactionActionPhase)(f.actionPhase)))):p.storeBit(!1),p.storeBit(f.aborted),p.storeBit(f.destroyed);else if(f.type==="split-prepare")p.storeUint(4,4),p.store((0,t.storeSplitMergeInfo)(f.splitInfo)),f.storagePhase?(p.storeBit(!0),p.store((0,a.storeTransactionsStoragePhase)(f.storagePhase))):p.storeBit(!1),p.store((0,o.storeTransactionComputePhase)(f.computePhase)),f.actionPhase?(p.storeBit(!0),p.store((0,r.storeTransactionActionPhase)(f.actionPhase))):p.storeBit(!1),p.storeBit(f.aborted),p.storeBit(f.destroyed);else if(f.type==="split-install")p.storeUint(5,4),p.store((0,t.storeSplitMergeInfo)(f.splitInfo)),p.storeRef((0,e.beginCell)().store((0,n.storeTransaction)(f.prepareTransaction))),p.storeBit(f.installed);else throw Error(`Unsupported transaction description type ${f.type}`)}}return Xa.storeTransactionDescription=d,Xa}var d5;function f5(){if(d5)return Qa;d5=1,Object.defineProperty(Qa,"__esModule",{value:!0}),Qa.storeTransaction=Qa.loadTransaction=void 0;const e=ur(),t=Ia(),n=Fa,r=ni,i=Za,o=Zo,s=u5();function a(d){let f=d.asCell();if(d.loadUint(4)!==7)throw Error("Invalid data");let p=d.loadUintBig(256),g=d.loadUintBig(64),b=d.loadUintBig(256),_=d.loadUintBig(64),S=d.loadUint(32),k=d.loadUint(15),I=(0,n.loadAccountStatus)(d),B=(0,n.loadAccountStatus)(d),$=d.loadRef().beginParse(),L=$.loadBit()?(0,o.loadMessage)($.loadRef().beginParse()):void 0,U=$.loadDict(t.Dictionary.Keys.Uint(15),o.MessageValue);$.endParse();let G=(0,r.loadCurrencyCollection)(d),X=(0,i.loadHashUpdate)(d.loadRef().beginParse()),J=(0,s.loadTransactionDescription)(d.loadRef().beginParse());return{address:p,lt:g,prevTransactionHash:b,prevTransactionLt:_,now:S,outMessagesCount:k,oldStatus:I,endStatus:B,inMessage:L,outMessages:U,totalFees:G,stateUpdate:X,description:J,raw:f,hash:()=>f.hash()}}Qa.loadTransaction=a;function c(d){return f=>{f.storeUint(7,4),f.storeUint(d.address,256),f.storeUint(d.lt,64),f.storeUint(d.prevTransactionHash,256),f.storeUint(d.prevTransactionLt,64),f.storeUint(d.now,32),f.storeUint(d.outMessagesCount,15),f.store((0,n.storeAccountStatus)(d.oldStatus)),f.store((0,n.storeAccountStatus)(d.endStatus));let p=(0,e.beginCell)();d.inMessage?(p.storeBit(!0),p.storeRef((0,e.beginCell)().store((0,o.storeMessage)(d.inMessage)))):p.storeBit(!1),p.storeDict(d.outMessages),f.storeRef(p),f.store((0,r.storeCurrencyCollection)(d.totalFees)),f.storeRef((0,e.beginCell)().store((0,i.storeHashUpdate)(d.stateUpdate))),f.storeRef((0,e.beginCell)().store((0,s.storeTransactionDescription)(d.description)))}}return Qa.storeTransaction=c,Qa}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.storeSplitMergeInfo=e.loadSplitMergeInfo=e.storeLibRef=e.loadLibRef=e.storeSimpleLibrary=e.loadSimpleLibrary=e.loadShardStateUnsplit=e.storeShardIdent=e.loadShardIdent=e.storeShardAccounts=e.loadShardAccounts=e.ShardAccountRefValue=e.storeShardAccount=e.loadShardAccount=e.ReserveMode=e.SendMode=e.storeMessageRelaxed=e.loadMessageRelaxed=e.storeMessage=e.loadMessage=e.loadMasterchainStateExtra=e.storeHashUpdate=e.loadHashUpdate=e.storeDepthBalanceInfo=e.loadDepthBalanceInfo=e.storeCurrencyCollection=e.loadCurrencyCollection=e.storeComputeSkipReason=e.loadComputeSkipReason=e.storeCommonMessageInfoRelaxed=e.loadCommonMessageInfoRelaxed=e.storeCommonMessageInfo=e.loadCommonMessageInfo=e.storeOutList=e.loadOutList=e.storeOutAction=e.loadOutAction=e.storeAccountStorage=e.loadAccountStorage=e.storeAccountStatusChange=e.loadAccountStatusChange=e.storeAccountStatus=e.loadAccountStatus=e.storeAccountState=e.loadAccountState=e.storeAccount=e.loadAccount=e.comment=e.external=e.internal=void 0,e.storeTransactionsStoragePhase=e.loadTransactionStoragePhase=e.storeTransactionDescription=e.loadTransactionDescription=e.storeTransactionCreditPhase=e.loadTransactionCreditPhase=e.storeTransactionComputePhase=e.loadTransactionComputePhase=e.storeTransactionBouncePhase=e.loadTransactionBouncePhase=e.storeTransactionActionPhase=e.loadTransactionActionPhase=e.storeTransaction=e.loadTransaction=e.storeTickTock=e.loadTickTock=e.storeStorageUsedShort=e.loadStorageUsedShort=e.storeStorageUsed=e.loadStorageUsed=e.storeStorageInfo=e.loadStorageInfo=e.storeStateInit=e.loadStateInit=void 0;var t=Us;Object.defineProperty(e,"internal",{enumerable:!0,get:function(){return t.internal}}),Object.defineProperty(e,"external",{enumerable:!0,get:function(){return t.external}}),Object.defineProperty(e,"comment",{enumerable:!0,get:function(){return t.comment}});var n=La;Object.defineProperty(e,"loadAccount",{enumerable:!0,get:function(){return n.loadAccount}}),Object.defineProperty(e,"storeAccount",{enumerable:!0,get:function(){return n.storeAccount}});var r=Na;Object.defineProperty(e,"loadAccountState",{enumerable:!0,get:function(){return r.loadAccountState}}),Object.defineProperty(e,"storeAccountState",{enumerable:!0,get:function(){return r.storeAccountState}});var i=Fa;Object.defineProperty(e,"loadAccountStatus",{enumerable:!0,get:function(){return i.loadAccountStatus}}),Object.defineProperty(e,"storeAccountStatus",{enumerable:!0,get:function(){return i.storeAccountStatus}});var o=Ns;Object.defineProperty(e,"loadAccountStatusChange",{enumerable:!0,get:function(){return o.loadAccountStatusChange}}),Object.defineProperty(e,"storeAccountStatusChange",{enumerable:!0,get:function(){return o.storeAccountStatusChange}});var s=Ua;Object.defineProperty(e,"loadAccountStorage",{enumerable:!0,get:function(){return s.loadAccountStorage}}),Object.defineProperty(e,"storeAccountStorage",{enumerable:!0,get:function(){return s.storeAccountStorage}});var a=bo;Object.defineProperty(e,"loadOutAction",{enumerable:!0,get:function(){return a.loadOutAction}}),Object.defineProperty(e,"storeOutAction",{enumerable:!0,get:function(){return a.storeOutAction}}),Object.defineProperty(e,"loadOutList",{enumerable:!0,get:function(){return a.loadOutList}}),Object.defineProperty(e,"storeOutList",{enumerable:!0,get:function(){return a.storeOutList}});var c=Ha;Object.defineProperty(e,"loadCommonMessageInfo",{enumerable:!0,get:function(){return c.loadCommonMessageInfo}}),Object.defineProperty(e,"storeCommonMessageInfo",{enumerable:!0,get:function(){return c.storeCommonMessageInfo}});var d=Va;Object.defineProperty(e,"loadCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return d.loadCommonMessageInfoRelaxed}}),Object.defineProperty(e,"storeCommonMessageInfoRelaxed",{enumerable:!0,get:function(){return d.storeCommonMessageInfoRelaxed}});var f=Ka;Object.defineProperty(e,"loadComputeSkipReason",{enumerable:!0,get:function(){return f.loadComputeSkipReason}}),Object.defineProperty(e,"storeComputeSkipReason",{enumerable:!0,get:function(){return f.storeComputeSkipReason}});var p=ni;Object.defineProperty(e,"loadCurrencyCollection",{enumerable:!0,get:function(){return p.loadCurrencyCollection}}),Object.defineProperty(e,"storeCurrencyCollection",{enumerable:!0,get:function(){return p.storeCurrencyCollection}});var g=qa;Object.defineProperty(e,"loadDepthBalanceInfo",{enumerable:!0,get:function(){return g.loadDepthBalanceInfo}}),Object.defineProperty(e,"storeDepthBalanceInfo",{enumerable:!0,get:function(){return g.storeDepthBalanceInfo}});var b=Za;Object.defineProperty(e,"loadHashUpdate",{enumerable:!0,get:function(){return b.loadHashUpdate}}),Object.defineProperty(e,"storeHashUpdate",{enumerable:!0,get:function(){return b.storeHashUpdate}});var _=Mu;Object.defineProperty(e,"loadMasterchainStateExtra",{enumerable:!0,get:function(){return _.loadMasterchainStateExtra}});var S=Zo;Object.defineProperty(e,"loadMessage",{enumerable:!0,get:function(){return S.loadMessage}}),Object.defineProperty(e,"storeMessage",{enumerable:!0,get:function(){return S.storeMessage}});var k=za;Object.defineProperty(e,"loadMessageRelaxed",{enumerable:!0,get:function(){return k.loadMessageRelaxed}}),Object.defineProperty(e,"storeMessageRelaxed",{enumerable:!0,get:function(){return k.storeMessageRelaxed}});var I=dh;Object.defineProperty(e,"SendMode",{enumerable:!0,get:function(){return I.SendMode}});var B=fh;Object.defineProperty(e,"ReserveMode",{enumerable:!0,get:function(){return B.ReserveMode}});var R=Ga;Object.defineProperty(e,"loadShardAccount",{enumerable:!0,get:function(){return R.loadShardAccount}}),Object.defineProperty(e,"storeShardAccount",{enumerable:!0,get:function(){return R.storeShardAccount}});var $=Gm;Object.defineProperty(e,"ShardAccountRefValue",{enumerable:!0,get:function(){return $.ShardAccountRefValue}}),Object.defineProperty(e,"loadShardAccounts",{enumerable:!0,get:function(){return $.loadShardAccounts}}),Object.defineProperty(e,"storeShardAccounts",{enumerable:!0,get:function(){return $.storeShardAccounts}});var L=Ya;Object.defineProperty(e,"loadShardIdent",{enumerable:!0,get:function(){return L.loadShardIdent}}),Object.defineProperty(e,"storeShardIdent",{enumerable:!0,get:function(){return L.storeShardIdent}});var U=hh;Object.defineProperty(e,"loadShardStateUnsplit",{enumerable:!0,get:function(){return U.loadShardStateUnsplit}});var G=qo;Object.defineProperty(e,"loadSimpleLibrary",{enumerable:!0,get:function(){return G.loadSimpleLibrary}}),Object.defineProperty(e,"storeSimpleLibrary",{enumerable:!0,get:function(){return G.storeSimpleLibrary}});var X=Wa;Object.defineProperty(e,"loadLibRef",{enumerable:!0,get:function(){return X.loadLibRef}}),Object.defineProperty(e,"storeLibRef",{enumerable:!0,get:function(){return X.storeLibRef}});var J=Ja;Object.defineProperty(e,"loadSplitMergeInfo",{enumerable:!0,get:function(){return J.loadSplitMergeInfo}}),Object.defineProperty(e,"storeSplitMergeInfo",{enumerable:!0,get:function(){return J.storeSplitMergeInfo}});var me=yo;Object.defineProperty(e,"loadStateInit",{enumerable:!0,get:function(){return me.loadStateInit}}),Object.defineProperty(e,"storeStateInit",{enumerable:!0,get:function(){return me.storeStateInit}});var oe=Da;Object.defineProperty(e,"loadStorageInfo",{enumerable:!0,get:function(){return oe.loadStorageInfo}}),Object.defineProperty(e,"storeStorageInfo",{enumerable:!0,get:function(){return oe.storeStorageInfo}});var Q=ja;Object.defineProperty(e,"loadStorageUsed",{enumerable:!0,get:function(){return Q.loadStorageUsed}}),Object.defineProperty(e,"storeStorageUsed",{enumerable:!0,get:function(){return Q.storeStorageUsed}});var re=Ds;Object.defineProperty(e,"loadStorageUsedShort",{enumerable:!0,get:function(){return re.loadStorageUsedShort}}),Object.defineProperty(e,"storeStorageUsedShort",{enumerable:!0,get:function(){return re.storeStorageUsedShort}});var Z=Oa;Object.defineProperty(e,"loadTickTock",{enumerable:!0,get:function(){return Z.loadTickTock}}),Object.defineProperty(e,"storeTickTock",{enumerable:!0,get:function(){return Z.storeTickTock}});var be=f5();Object.defineProperty(e,"loadTransaction",{enumerable:!0,get:function(){return be.loadTransaction}}),Object.defineProperty(e,"storeTransaction",{enumerable:!0,get:function(){return be.storeTransaction}});var Ae=el;Object.defineProperty(e,"loadTransactionActionPhase",{enumerable:!0,get:function(){return Ae.loadTransactionActionPhase}}),Object.defineProperty(e,"storeTransactionActionPhase",{enumerable:!0,get:function(){return Ae.storeTransactionActionPhase}});var Se=tl;Object.defineProperty(e,"loadTransactionBouncePhase",{enumerable:!0,get:function(){return Se.loadTransactionBouncePhase}}),Object.defineProperty(e,"storeTransactionBouncePhase",{enumerable:!0,get:function(){return Se.storeTransactionBouncePhase}});var Te=nl;Object.defineProperty(e,"loadTransactionComputePhase",{enumerable:!0,get:function(){return Te.loadTransactionComputePhase}}),Object.defineProperty(e,"storeTransactionComputePhase",{enumerable:!0,get:function(){return Te.storeTransactionComputePhase}});var le=rl;Object.defineProperty(e,"loadTransactionCreditPhase",{enumerable:!0,get:function(){return le.loadTransactionCreditPhase}}),Object.defineProperty(e,"storeTransactionCreditPhase",{enumerable:!0,get:function(){return le.storeTransactionCreditPhase}});var tt=u5();Object.defineProperty(e,"loadTransactionDescription",{enumerable:!0,get:function(){return tt.loadTransactionDescription}}),Object.defineProperty(e,"storeTransactionDescription",{enumerable:!0,get:function(){return tt.storeTransactionDescription}});var Ke=il;Object.defineProperty(e,"loadTransactionStoragePhase",{enumerable:!0,get:function(){return Ke.loadTransactionStoragePhase}}),Object.defineProperty(e,"storeTransactionsStoragePhase",{enumerable:!0,get:function(){return Ke.storeTransactionsStoragePhase}})})(E_);var gh={};Object.defineProperty(gh,"__esModule",{value:!0}),gh.openContract=void 0;const WO=yi,h5=Ra();function HO(e,t){let n,r=null;if(!WO.Address.isAddress(e.address))throw Error("Invalid address");if(n=e.address,e.init){if(!(e.init.code instanceof h5.Cell))throw Error("Invalid init.code");if(!(e.init.data instanceof h5.Cell))throw Error("Invalid init.data");r=e.init}let i=t({address:n,init:r});return new Proxy(e,{get(o,s){const a=o[s];return typeof s=="string"&&(s.startsWith("get")||s.startsWith("send")||s.startsWith("is"))&&typeof a=="function"?(...c)=>a.apply(o,[i,...c]):a}})}gh.openContract=HO;var mh={};Object.defineProperty(mh,"__esModule",{value:!0}),mh.ComputeError=void 0;class Ym extends Error{constructor(t,n,r){super(t),this.exitCode=n,this.debugLogs=r&&r.debugLogs?r.debugLogs:null,this.logs=r&&r.logs?r.logs:null,Object.setPrototypeOf(this,Ym.prototype)}}mh.ComputeError=Ym;var yh={};Object.defineProperty(yh,"__esModule",{value:!0}),yh.getMethodId=void 0;const KO=new Int16Array([0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920]);function qO(e){e instanceof Ne||(e=Ne.from(e));let t=0;for(let n=0;n>8^r)&255]^t<<8)&65535}return t}function ZO(e){return qO(e)&65535|65536}yh.getMethodId=ZO;var oc={};Object.defineProperty(oc,"__esModule",{value:!0}),oc.safeSignVerify=oc.safeSign=void 0;const Jm=Ma(),GO=8,YO=64;function p5(e,t){let n=Ne.from(t);if(n.length>YO)throw Error("Seed can be longer than 64 bytes");if(n.length{r!==null?this.cache.set(t+"$$"+n,r):this.cache.delete(t+"$$"+n)},this.get=async(t,n)=>{let r=this.cache.get(t+"$$"+n);return r!==void 0?r:null}}}bh.InMemoryCache=XO;var e$=function(){function e(n,r){if(typeof n!="function")throw new TypeError("DataLoader must be constructed with a function which accepts "+("Array and returns Promise>, but got: "+n+"."));this._batchLoadFn=n,this._maxBatchSize=i$(r),this._batchScheduleFn=o$(r),this._cacheKeyFn=s$(r),this._cacheMap=a$(r),this._batch=null,this.name=l$(r)}var t=e.prototype;return t.load=function(r){if(r==null)throw new TypeError("The loader.load() function must be called with a value, "+("but got: "+String(r)+"."));var i=n$(this),o=this._cacheMap,s=this._cacheKeyFn(r);if(o){var a=o.get(s);if(a){var c=i.cacheHits||(i.cacheHits=[]);return new Promise(function(f){c.push(function(){f(a)})})}}i.keys.push(r);var d=new Promise(function(f,p){i.callbacks.push({resolve:f,reject:p})});return o&&o.set(s,d),d},t.loadMany=function(r){if(!g5(r))throw new TypeError("The loader.loadMany() function must be called with Array "+("but got: "+r+"."));for(var i=[],o=0;o and returns Promise>, but the function "+("errored synchronously: "+String(r)+".")))}if(!n||typeof n.then!="function")return Xm(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did "+("not return a Promise: "+String(n)+".")));n.then(function(r){if(!g5(r))throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did "+("not return a Promise of an Array: "+String(r)+"."));if(r.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array and returns Promise>, but the function did not return a Promise of an Array of the same length as the Array of keys."+(` Keys: `+String(t.keys))+(` Values: `+String(r)));e1(t);for(var i=0;i0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}var c$=e$;function m5(e,t){return function(){return e.apply(t,arguments)}}const{toString:u$}=Object.prototype,{getPrototypeOf:t1}=Object,vh=(e=>t=>{const n=u$.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Xi=e=>(e=e.toLowerCase(),t=>vh(t)===e),wh=e=>t=>typeof t===e,{isArray:sc}=Array,Ou=wh("undefined");function d$(e){return e!==null&&!Ou(e)&&e.constructor!==null&&!Ou(e.constructor)&&bi(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const y5=Xi("ArrayBuffer");function f$(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&y5(e.buffer),t}const h$=wh("string"),bi=wh("function"),b5=wh("number"),_h=e=>e!==null&&typeof e=="object",p$=e=>e===!0||e===!1,xh=e=>{if(vh(e)!=="object")return!1;const t=t1(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},g$=Xi("Date"),m$=Xi("File"),y$=Xi("Blob"),b$=Xi("FileList"),v$=e=>_h(e)&&bi(e.pipe),w$=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||bi(e.append)&&((t=vh(e))==="formdata"||t==="object"&&bi(e.toString)&&e.toString()==="[object FormData]"))},_$=Xi("URLSearchParams"),[x$,C$,S$,k$]=["ReadableStream","Request","Response","Headers"].map(Xi),A$=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function $u(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),sc(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const ol=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:et,w5=e=>!Ou(e)&&e!==ol;function n1(){const{caseless:e}=w5(this)&&this||{},t={},n=(r,i)=>{const o=e&&v5(t,i)||i;xh(t[o])&&xh(r)?t[o]=n1(t[o],r):xh(r)?t[o]=n1({},r):sc(r)?t[o]=r.slice():t[o]=r};for(let r=0,i=arguments.length;r($u(t,(i,o)=>{n&&bi(i)?e[o]=m5(i,n):e[o]=i},{allOwnKeys:r}),e),T$=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),P$=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},B$=(e,t,n,r)=>{let i,o,s;const a={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)s=i[o],(!r||r(s,e,t))&&!a[s]&&(t[s]=e[s],a[s]=!0);e=n!==!1&&t1(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},I$=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},M$=e=>{if(!e)return null;if(sc(e))return e;let t=e.length;if(!b5(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},R$=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&t1(Uint8Array)),O$=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},$$=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},L$=Xi("HTMLFormElement"),U$=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),_5=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),N$=Xi("RegExp"),x5=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};$u(n,(i,o)=>{let s;(s=t(i,o,e))!==!1&&(r[o]=s||i)}),Object.defineProperties(e,r)},D$=e=>{x5(e,(t,n)=>{if(bi(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(bi(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},j$=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return sc(e)?r(e):r(String(e).split(t)),n},F$=()=>{},z$=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,r1="abcdefghijklmnopqrstuvwxyz",C5="0123456789",S5={DIGIT:C5,ALPHA:r1,ALPHA_DIGIT:r1+r1.toUpperCase()+C5},V$=(e=16,t=S5.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function W$(e){return!!(e&&bi(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const H$=e=>{const t=new Array(10),n=(r,i)=>{if(_h(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[i]=r;const o=sc(r)?[]:{};return $u(r,(s,a)=>{const c=n(s,i+1);!Ou(c)&&(o[a]=c)}),t[i]=void 0,o}}return r};return n(e,0)},K$=Xi("AsyncFunction"),q$=e=>e&&(_h(e)||bi(e))&&bi(e.then)&&bi(e.catch),k5=((e,t)=>e?setImmediate:t?((n,r)=>(ol.addEventListener("message",({source:i,data:o})=>{i===ol&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),ol.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",bi(ol.postMessage)),Z$=typeof queueMicrotask<"u"?queueMicrotask.bind(ol):typeof Nn<"u"&&Nn.nextTick||k5;var Me={isArray:sc,isArrayBuffer:y5,isBuffer:d$,isFormData:w$,isArrayBufferView:f$,isString:h$,isNumber:b5,isBoolean:p$,isObject:_h,isPlainObject:xh,isReadableStream:x$,isRequest:C$,isResponse:S$,isHeaders:k$,isUndefined:Ou,isDate:g$,isFile:m$,isBlob:y$,isRegExp:N$,isFunction:bi,isStream:v$,isURLSearchParams:_$,isTypedArray:R$,isFileList:b$,forEach:$u,merge:n1,extend:E$,trim:A$,stripBOM:T$,inherits:P$,toFlatObject:B$,kindOf:vh,kindOfTest:Xi,endsWith:I$,toArray:M$,forEachEntry:O$,matchAll:$$,isHTMLForm:L$,hasOwnProperty:_5,hasOwnProp:_5,reduceDescriptors:x5,freezeMethods:D$,toObjectSet:j$,toCamelCase:U$,noop:F$,toFiniteNumber:z$,findKey:v5,global:ol,isContextDefined:w5,ALPHABET:S5,generateString:V$,isSpecCompliantForm:W$,toJSONObject:H$,isAsyncFn:K$,isThenable:q$,setImmediate:k5,asap:Z$};function Zt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Me.inherits(Zt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Me.toJSONObject(this.config),code:this.code,status:this.status}}});const A5=Zt.prototype,E5={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{E5[e]={value:e}}),Object.defineProperties(Zt,E5),Object.defineProperty(A5,"isAxiosError",{value:!0}),Zt.from=(e,t,n,r,i,o)=>{const s=Object.create(A5);return Me.toFlatObject(e,s,function(c){return c!==Error.prototype},a=>a!=="isAxiosError"),Zt.call(s,e.message,t,n,r,i),s.cause=e,s.name=e.name,o&&Object.assign(s,o),s};var G$=null;function i1(e){return Me.isPlainObject(e)||Me.isArray(e)}function T5(e){return Me.endsWith(e,"[]")?e.slice(0,-2):e}function P5(e,t,n){return e?e.concat(t).map(function(i,o){return i=T5(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function Y$(e){return Me.isArray(e)&&!e.some(i1)}const J$=Me.toFlatObject(Me,{},null,function(t){return/^is[A-Z]/.test(t)});function Ch(e,t,n){if(!Me.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=Me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(S,k){return!Me.isUndefined(k[S])});const r=n.metaTokens,i=n.visitor||f,o=n.dots,s=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&Me.isSpecCompliantForm(t);if(!Me.isFunction(i))throw new TypeError("visitor must be a function");function d(_){if(_===null)return"";if(Me.isDate(_))return _.toISOString();if(!c&&Me.isBlob(_))throw new Zt("Blob is not supported. Use a Buffer instead.");return Me.isArrayBuffer(_)||Me.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Ne.from(_):_}function f(_,S,k){let I=_;if(_&&!k&&typeof _=="object"){if(Me.endsWith(S,"{}"))S=r?S:S.slice(0,-2),_=JSON.stringify(_);else if(Me.isArray(_)&&Y$(_)||(Me.isFileList(_)||Me.endsWith(S,"[]"))&&(I=Me.toArray(_)))return S=T5(S),I.forEach(function(R,$){!(Me.isUndefined(R)||R===null)&&t.append(s===!0?P5([S],$,o):s===null?S:S+"[]",d(R))}),!1}return i1(_)?!0:(t.append(P5(k,S,o),d(_)),!1)}const p=[],g=Object.assign(J$,{defaultVisitor:f,convertValue:d,isVisitable:i1});function b(_,S){if(!Me.isUndefined(_)){if(p.indexOf(_)!==-1)throw Error("Circular reference detected in "+S.join("."));p.push(_),Me.forEach(_,function(I,B){(!(Me.isUndefined(I)||I===null)&&i.call(t,I,Me.isString(B)?B.trim():B,S,g))===!0&&b(I,S?S.concat(B):[B])}),p.pop()}}if(!Me.isObject(e))throw new TypeError("data must be an object");return b(e),t}function B5(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function o1(e,t){this._pairs=[],e&&Ch(e,this,t)}const I5=o1.prototype;I5.append=function(t,n){this._pairs.push([t,n])},I5.toString=function(t){const n=t?function(r){return t.call(this,r,B5)}:B5;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Q$(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function M5(e,t,n){if(!t)return e;const r=n&&n.encode||Q$,i=n&&n.serialize;let o;if(i?o=i(t,n):o=Me.isURLSearchParams(t)?t.toString():new o1(t,n).toString(r),o){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class X${constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Me.forEach(this.handlers,function(r){r!==null&&t(r)})}}var R5=X$,O5={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},eL=typeof URLSearchParams<"u"?URLSearchParams:o1,tL=typeof FormData<"u"?FormData:null,nL=typeof Blob<"u"?Blob:null,rL={isBrowser:!0,classes:{URLSearchParams:eL,FormData:tL,Blob:nL},protocols:["http","https","file","blob","url","data"]};const s1=typeof window<"u"&&typeof document<"u",a1=typeof navigator=="object"&&navigator||void 0,iL=s1&&(!a1||["ReactNative","NativeScript","NS"].indexOf(a1.product)<0),oL=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",sL=s1&&window.location.href||"http://localhost";var aL=Object.freeze({__proto__:null,hasBrowserEnv:s1,hasStandardBrowserWebWorkerEnv:oL,hasStandardBrowserEnv:iL,navigator:a1,origin:sL}),ri={...aL,...rL};function lL(e,t){return Ch(e,new ri.classes.URLSearchParams,Object.assign({visitor:function(n,r,i,o){return ri.isNode&&Me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)}},t))}function cL(e){return Me.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function uL(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return s=!s&&Me.isArray(i)?i.length:s,c?(Me.hasOwnProp(i,s)?i[s]=[i[s],r]:i[s]=r,!a):((!i[s]||!Me.isObject(i[s]))&&(i[s]=[]),t(n,r,i[s],o)&&Me.isArray(i[s])&&(i[s]=uL(i[s])),!a)}if(Me.isFormData(e)&&Me.isFunction(e.entries)){const n={};return Me.forEachEntry(e,(r,i)=>{t(cL(r),i,n,0)}),n}return null}function dL(e,t,n){if(Me.isString(e))try{return(t||JSON.parse)(e),Me.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(0,JSON.stringify)(e)}const l1={transitional:O5,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=Me.isObject(t);if(o&&Me.isHTMLForm(t)&&(t=new FormData(t)),Me.isFormData(t))return i?JSON.stringify($5(t)):t;if(Me.isArrayBuffer(t)||Me.isBuffer(t)||Me.isStream(t)||Me.isFile(t)||Me.isBlob(t)||Me.isReadableStream(t))return t;if(Me.isArrayBufferView(t))return t.buffer;if(Me.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return lL(t,this.formSerializer).toString();if((a=Me.isFileList(t))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return Ch(a?{"files[]":t}:t,c&&new c,this.formSerializer)}}return o||i?(n.setContentType("application/json",!1),dL(t)):t}],transformResponse:[function(t){const n=this.transitional||l1.transitional,r=n&&n.forcedJSONParsing,i=this.responseType==="json";if(Me.isResponse(t)||Me.isReadableStream(t))return t;if(t&&Me.isString(t)&&(r&&!this.responseType||i)){const s=!(n&&n.silentJSONParsing)&&i;try{return JSON.parse(t)}catch(a){if(s)throw a.name==="SyntaxError"?Zt.from(a,Zt.ERR_BAD_RESPONSE,this,null,this.response):a}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ri.classes.FormData,Blob:ri.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Me.forEach(["delete","get","head","post","put","patch"],e=>{l1.headers[e]={}});var c1=l1;const fL=Me.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var hL=e=>{const t={};let n,r,i;return e&&e.split(` `).forEach(function(s){i=s.indexOf(":"),n=s.substring(0,i).trim().toLowerCase(),r=s.substring(i+1).trim(),!(!n||t[n]&&fL[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};const L5=Symbol("internals");function Lu(e){return e&&String(e).trim().toLowerCase()}function Sh(e){return e===!1||e==null?e:Me.isArray(e)?e.map(Sh):String(e)}function pL(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const gL=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function u1(e,t,n,r,i){if(Me.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!Me.isString(t)){if(Me.isString(r))return t.indexOf(r)!==-1;if(Me.isRegExp(r))return r.test(t)}}function mL(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function yL(e,t){const n=Me.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(i,o,s){return this[r].call(this,t,i,o,s)},configurable:!0})})}class kh{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(a,c,d){const f=Lu(c);if(!f)throw new Error("header name must be a non-empty string");const p=Me.findKey(i,f);(!p||i[p]===void 0||d===!0||d===void 0&&i[p]!==!1)&&(i[p||c]=Sh(a))}const s=(a,c)=>Me.forEach(a,(d,f)=>o(d,f,c));if(Me.isPlainObject(t)||t instanceof this.constructor)s(t,n);else if(Me.isString(t)&&(t=t.trim())&&!gL(t))s(hL(t),n);else if(Me.isHeaders(t))for(const[a,c]of t.entries())o(c,a,r);else t!=null&&o(n,t,r);return this}get(t,n){if(t=Lu(t),t){const r=Me.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return pL(i);if(Me.isFunction(n))return n.call(this,i,r);if(Me.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Lu(t),t){const r=Me.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||u1(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(s){if(s=Lu(s),s){const a=Me.findKey(r,s);a&&(!n||u1(r,r[a],a,n))&&(delete r[a],i=!0)}}return Me.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||u1(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return Me.forEach(this,(i,o)=>{const s=Me.findKey(r,o);if(s){n[s]=Sh(i),delete n[o];return}const a=t?mL(o):String(o).trim();a!==o&&delete n[o],n[a]=Sh(i),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return Me.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&Me.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[L5]=this[L5]={accessors:{}}).accessors,i=this.prototype;function o(s){const a=Lu(s);r[a]||(yL(i,s),r[a]=!0)}return Me.isArray(t)?t.forEach(o):o(t),this}}kh.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Me.reduceDescriptors(kh.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),Me.freezeMethods(kh);var eo=kh;function d1(e,t){const n=this||c1,r=t||n,i=eo.from(r.headers);let o=r.data;return Me.forEach(e,function(a){o=a.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function U5(e){return!!(e&&e.__CANCEL__)}function ac(e,t,n){Zt.call(this,e??"canceled",Zt.ERR_CANCELED,t,n),this.name="CanceledError"}Me.inherits(ac,Zt,{__CANCEL__:!0});function N5(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Zt("Request failed with status code "+n.status,[Zt.ERR_BAD_REQUEST,Zt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function bL(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function vL(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,s;return t=t!==void 0?t:1e3,function(c){const d=Date.now(),f=r[o];s||(s=d),n[i]=c,r[i]=d;let p=o,g=0;for(;p!==i;)g+=n[p++],p=p%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),d-s{n=f,i=null,o&&(clearTimeout(o),o=null),e.apply(null,d)};return[(...d)=>{const f=Date.now(),p=f-n;p>=r?s(d,f):(i=d,o||(o=setTimeout(()=>{o=null,s(i)},r-p)))},()=>i&&s(i)]}const Ah=(e,t,n=3)=>{let r=0;const i=vL(50,250);return wL(o=>{const s=o.loaded,a=o.lengthComputable?o.total:void 0,c=s-r,d=i(c),f=s<=a;r=s;const p={loaded:s,total:a,progress:a?s/a:void 0,bytes:c,rate:d||void 0,estimated:d&&a&&f?(a-s)/d:void 0,event:o,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(p)},n)},D5=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},j5=e=>(...t)=>Me.asap(()=>e(...t));var _L=ri.hasStandardBrowserEnv?function(){const t=ri.navigator&&/(msie|trident)/i.test(ri.navigator.userAgent),n=document.createElement("a");let r;function i(o){let s=o;return t&&(n.setAttribute("href",s),s=n.href),n.setAttribute("href",s),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(s){const a=Me.isString(s)?i(s):s;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),xL=ri.hasStandardBrowserEnv?{write(e,t,n,r,i,o){const s=[e+"="+encodeURIComponent(t)];Me.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),Me.isString(r)&&s.push("path="+r),Me.isString(i)&&s.push("domain="+i),o===!0&&s.push("secure"),document.cookie=s.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function CL(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function SL(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function F5(e,t){return e&&!CL(t)?SL(e,t):t}const z5=e=>e instanceof eo?{...e}:e;function sl(e,t){t=t||{};const n={};function r(d,f,p){return Me.isPlainObject(d)&&Me.isPlainObject(f)?Me.merge.call({caseless:p},d,f):Me.isPlainObject(f)?Me.merge({},f):Me.isArray(f)?f.slice():f}function i(d,f,p){if(Me.isUndefined(f)){if(!Me.isUndefined(d))return r(void 0,d,p)}else return r(d,f,p)}function o(d,f){if(!Me.isUndefined(f))return r(void 0,f)}function s(d,f){if(Me.isUndefined(f)){if(!Me.isUndefined(d))return r(void 0,d)}else return r(void 0,f)}function a(d,f,p){if(p in t)return r(d,f);if(p in e)return r(void 0,d)}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(d,f)=>i(z5(d),z5(f),!0)};return Me.forEach(Object.keys(Object.assign({},e,t)),function(f){const p=c[f]||i,g=p(e[f],t[f],f);Me.isUndefined(g)&&p!==a||(n[f]=g)}),n}var V5=e=>{const t=sl({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:i,xsrfCookieName:o,headers:s,auth:a}=t;t.headers=s=eo.from(s),t.url=M5(F5(t.baseURL,t.url),e.params,e.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let c;if(Me.isFormData(n)){if(ri.hasStandardBrowserEnv||ri.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if((c=s.getContentType())!==!1){const[d,...f]=c?c.split(";").map(p=>p.trim()).filter(Boolean):[];s.setContentType([d||"multipart/form-data",...f].join("; "))}}if(ri.hasStandardBrowserEnv&&(r&&Me.isFunction(r)&&(r=r(t)),r||r!==!1&&_L(t.url))){const d=i&&o&&xL.read(o);d&&s.set(i,d)}return t},kL=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const i=V5(e);let o=i.data;const s=eo.from(i.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:d}=i,f,p,g,b,_;function S(){b&&b(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(f),i.signal&&i.signal.removeEventListener("abort",f)}let k=new XMLHttpRequest;k.open(i.method.toUpperCase(),i.url,!0),k.timeout=i.timeout;function I(){if(!k)return;const R=eo.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),L={data:!a||a==="text"||a==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:R,config:e,request:k};N5(function(G){n(G),S()},function(G){r(G),S()},L),k=null}"onloadend"in k?k.onloadend=I:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(I)},k.onabort=function(){k&&(r(new Zt("Request aborted",Zt.ECONNABORTED,e,k)),k=null)},k.onerror=function(){r(new Zt("Network Error",Zt.ERR_NETWORK,e,k)),k=null},k.ontimeout=function(){let $=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const L=i.transitional||O5;i.timeoutErrorMessage&&($=i.timeoutErrorMessage),r(new Zt($,L.clarifyTimeoutError?Zt.ETIMEDOUT:Zt.ECONNABORTED,e,k)),k=null},o===void 0&&s.setContentType(null),"setRequestHeader"in k&&Me.forEach(s.toJSON(),function($,L){k.setRequestHeader(L,$)}),Me.isUndefined(i.withCredentials)||(k.withCredentials=!!i.withCredentials),a&&a!=="json"&&(k.responseType=i.responseType),d&&([g,_]=Ah(d,!0),k.addEventListener("progress",g)),c&&k.upload&&([p,b]=Ah(c),k.upload.addEventListener("progress",p),k.upload.addEventListener("loadend",b)),(i.cancelToken||i.signal)&&(f=R=>{k&&(r(!R||R.type?new ac(null,e,k):R),k.abort(),k=null)},i.cancelToken&&i.cancelToken.subscribe(f),i.signal&&(i.signal.aborted?f():i.signal.addEventListener("abort",f)));const B=bL(i.url);if(B&&ri.protocols.indexOf(B)===-1){r(new Zt("Unsupported protocol "+B+":",Zt.ERR_BAD_REQUEST,e));return}k.send(o||null)})},AL=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,i;const o=function(d){if(!i){i=!0,a();const f=d instanceof Error?d:this.reason;r.abort(f instanceof Zt?f:new ac(f instanceof Error?f.message:f))}};let s=t&&setTimeout(()=>{s=null,o(new Zt(`timeout ${t} of ms exceeded`,Zt.ETIMEDOUT))},t);const a=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(d=>{d.unsubscribe?d.unsubscribe(o):d.removeEventListener("abort",o)}),e=null)};e.forEach(d=>d.addEventListener("abort",o));const{signal:c}=r;return c.unsubscribe=()=>Me.asap(a),c}};const EL=function*(e,t){let n=e.byteLength;if(n{const i=TL(e,t);let o=0,s,a=c=>{s||(s=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:d,value:f}=await i.next();if(d){a(),c.close();return}let p=f.byteLength;if(n){let g=o+=p;n(g)}c.enqueue(new Uint8Array(f))}catch(d){throw a(d),d}},cancel(c){return a(c),i.return()}},{highWaterMark:2})},Eh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",H5=Eh&&typeof ReadableStream=="function",BL=Eh&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),K5=(e,...t)=>{try{return!!e(...t)}catch{return!1}},IL=H5&&K5(()=>{let e=!1;const t=new Request(ri.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),q5=64*1024,f1=H5&&K5(()=>Me.isReadableStream(new Response("").body)),Th={stream:f1&&(e=>e.body)};Eh&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Th[t]&&(Th[t]=Me.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Zt(`Response type '${t}' is not supported`,Zt.ERR_NOT_SUPPORT,r)})})})(new Response);const ML=async e=>{if(e==null)return 0;if(Me.isBlob(e))return e.size;if(Me.isSpecCompliantForm(e))return(await new Request(ri.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(Me.isArrayBufferView(e)||Me.isArrayBuffer(e))return e.byteLength;if(Me.isURLSearchParams(e)&&(e=e+""),Me.isString(e))return(await BL(e)).byteLength},RL=async(e,t)=>{const n=Me.toFiniteNumber(e.getContentLength());return n??ML(t)};var OL=Eh&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:o,timeout:s,onDownloadProgress:a,onUploadProgress:c,responseType:d,headers:f,withCredentials:p="same-origin",fetchOptions:g}=V5(e);d=d?(d+"").toLowerCase():"text";let b=AL([i,o&&o.toAbortSignal()],s),_;const S=b&&b.unsubscribe&&(()=>{b.unsubscribe()});let k;try{if(c&&IL&&n!=="get"&&n!=="head"&&(k=await RL(f,r))!==0){let L=new Request(t,{method:"POST",body:r,duplex:"half"}),U;if(Me.isFormData(r)&&(U=L.headers.get("content-type"))&&f.setContentType(U),L.body){const[G,X]=D5(k,Ah(j5(c)));r=W5(L.body,q5,G,X)}}Me.isString(p)||(p=p?"include":"omit");const I="credentials"in Request.prototype;_=new Request(t,{...g,signal:b,method:n.toUpperCase(),headers:f.normalize().toJSON(),body:r,duplex:"half",credentials:I?p:void 0});let B=await fetch(_);const R=f1&&(d==="stream"||d==="response");if(f1&&(a||R&&S)){const L={};["status","statusText","headers"].forEach(J=>{L[J]=B[J]});const U=Me.toFiniteNumber(B.headers.get("content-length")),[G,X]=a&&D5(U,Ah(j5(a),!0))||[];B=new Response(W5(B.body,q5,G,()=>{X&&X(),S&&S()}),L)}d=d||"text";let $=await Th[Me.findKey(Th,d)||"text"](B,e);return!R&&S&&S(),await new Promise((L,U)=>{N5(L,U,{data:$,headers:eo.from(B.headers),status:B.status,statusText:B.statusText,config:e,request:_})})}catch(I){throw S&&S(),I&&I.name==="TypeError"&&/fetch/i.test(I.message)?Object.assign(new Zt("Network Error",Zt.ERR_NETWORK,e,_),{cause:I.cause||I}):Zt.from(I,I&&I.code,e,_)}});const h1={http:G$,xhr:kL,fetch:OL};Me.forEach(h1,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Z5=e=>`- ${e}`,$L=e=>Me.isFunction(e)||e===null||e===!1;var G5={getAdapter:e=>{e=Me.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let o=0;o`adapter ${a} `+(c===!1?"is not supported by the environment":"is not available in the build"));let s=t?o.length>1?`since : `+o.map(Z5).join(` `):" "+Z5(o[0]):"as no adapter specified";throw new Zt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:h1};function p1(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ac(null,e)}function Y5(e){return p1(e),e.headers=eo.from(e.headers),e.data=d1.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),G5.getAdapter(e.adapter||c1.adapter)(e).then(function(r){return p1(e),r.data=d1.call(e,e.transformResponse,r),r.headers=eo.from(r.headers),r},function(r){return U5(r)||(p1(e),r&&r.response&&(r.response.data=d1.call(e,e.transformResponse,r.response),r.response.headers=eo.from(r.response.headers))),Promise.reject(r)})}const J5="1.7.7",g1={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{g1[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Q5={};g1.transitional=function(t,n,r){function i(o,s){return"[Axios v"+J5+"] Transitional option '"+o+"'"+s+(r?". "+r:"")}return(o,s,a)=>{if(t===!1)throw new Zt(i(s," has been removed"+(n?" in "+n:"")),Zt.ERR_DEPRECATED);return n&&!Q5[s]&&(Q5[s]=!0,console.warn(i(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,s,a):!0}};function LL(e,t,n){if(typeof e!="object")throw new Zt("options must be an object",Zt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],s=t[o];if(s){const a=e[o],c=a===void 0||s(a,o,e);if(c!==!0)throw new Zt("option "+o+" must be "+c,Zt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Zt("Unknown option "+o,Zt.ERR_BAD_OPTION)}}var m1={assertOptions:LL,validators:g1};const js=m1.validators;class Ph{constructor(t){this.defaults=t,this.interceptors={request:new R5,response:new R5}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i;Error.captureStackTrace?Error.captureStackTrace(i={}):i=new Error;const o=i.stack?i.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=sl(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&m1.assertOptions(r,{silentJSONParsing:js.transitional(js.boolean),forcedJSONParsing:js.transitional(js.boolean),clarifyTimeoutError:js.transitional(js.boolean)},!1),i!=null&&(Me.isFunction(i)?n.paramsSerializer={serialize:i}:m1.assertOptions(i,{encode:js.function,serialize:js.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=o&&Me.merge(o.common,o[n.method]);o&&Me.forEach(["delete","get","head","post","put","patch","common"],_=>{delete o[_]}),n.headers=eo.concat(s,o);const a=[];let c=!0;this.interceptors.request.forEach(function(S){typeof S.runWhen=="function"&&S.runWhen(n)===!1||(c=c&&S.synchronous,a.unshift(S.fulfilled,S.rejected))});const d=[];this.interceptors.response.forEach(function(S){d.push(S.fulfilled,S.rejected)});let f,p=0,g;if(!c){const _=[Y5.bind(this),void 0];for(_.unshift.apply(_,a),_.push.apply(_,d),g=_.length,f=Promise.resolve(n);p{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const s=new Promise(a=>{r.subscribe(a),o=a}).then(i);return s.cancel=function(){r.unsubscribe(o)},s},t(function(o,s,a){r.reason||(r.reason=new ac(o,s,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new y1(function(i){t=i}),cancel:t}}}var UL=y1;function NL(e){return function(n){return e.apply(null,n)}}function DL(e){return Me.isObject(e)&&e.isAxiosError===!0}const b1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(b1).forEach(([e,t])=>{b1[t]=e});var jL=b1;function X5(e){const t=new Bh(e),n=m5(Bh.prototype.request,t);return Me.extend(n,Bh.prototype,t,{allOwnKeys:!0}),Me.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return X5(sl(e,i))},n}const dr=X5(c1);dr.Axios=Bh,dr.CanceledError=ac,dr.CancelToken=UL,dr.isCancel=U5,dr.VERSION=J5,dr.toFormData=Ch,dr.AxiosError=Zt,dr.Cancel=dr.CanceledError,dr.all=function(t){return Promise.all(t)},dr.spread=NL,dr.isAxiosError=DL,dr.mergeConfig=sl,dr.AxiosHeaders=eo,dr.formToJSON=e=>$5(Me.isHTMLForm(e)?new FormData(e):e),dr.getAdapter=G5.getAdapter,dr.HttpStatusCode=jL,dr.default=dr;var ex=dr,v1={},w1={},vo={},Ih={},Uu={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getParsedType=e.ZodParsedType=e.objectUtil=e.util=void 0;var t;(function(r){r.assertEqual=a=>a;function i(a){}r.assertIs=i;function o(a){throw new Error}r.assertNever=o,r.arrayToEnum=a=>{const c={};for(const d of a)c[d]=d;return c},r.getValidEnumValues=a=>{const c=r.objectKeys(a).filter(f=>typeof a[a[f]]!="number"),d={};for(const f of c)d[f]=a[f];return r.objectValues(d)},r.objectValues=a=>r.objectKeys(a).map(function(c){return a[c]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const c=[];for(const d in a)Object.prototype.hasOwnProperty.call(a,d)&&c.push(d);return c},r.find=(a,c)=>{for(const d of a)if(c(d))return d},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&isFinite(a)&&Math.floor(a)===a;function s(a,c=" | "){return a.map(d=>typeof d=="string"?`'${d}'`:d).join(c)}r.joinValues=s,r.jsonStringifyReplacer=(a,c)=>typeof c=="bigint"?c.toString():c})(t=e.util||(e.util={})),function(r){r.mergeShapes=(i,o)=>({...i,...o})}(e.objectUtil||(e.objectUtil={})),e.ZodParsedType=t.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]);const n=r=>{switch(typeof r){case"undefined":return e.ZodParsedType.undefined;case"string":return e.ZodParsedType.string;case"number":return isNaN(r)?e.ZodParsedType.nan:e.ZodParsedType.number;case"boolean":return e.ZodParsedType.boolean;case"function":return e.ZodParsedType.function;case"bigint":return e.ZodParsedType.bigint;case"symbol":return e.ZodParsedType.symbol;case"object":return Array.isArray(r)?e.ZodParsedType.array:r===null?e.ZodParsedType.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?e.ZodParsedType.promise:typeof Map<"u"&&r instanceof Map?e.ZodParsedType.map:typeof Set<"u"&&r instanceof Set?e.ZodParsedType.set:typeof Date<"u"&&r instanceof Date?e.ZodParsedType.date:e.ZodParsedType.object;default:return e.ZodParsedType.unknown}};e.getParsedType=n})(Uu);var wo={};Object.defineProperty(wo,"__esModule",{value:!0}),wo.ZodError=wo.quotelessJson=wo.ZodIssueCode=void 0;const tx=Uu;wo.ZodIssueCode=tx.util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);const FL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");wo.quotelessJson=FL;class Nu extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(o){return o.message},r={_errors:[]},i=o=>{for(const s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)r._errors.push(n(s));else{let a=r,c=0;for(;cn.message){const n={},r=[];for(const i of this.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}wo.ZodError=Nu,Nu.create=e=>new Nu(e),Object.defineProperty(Ih,"__esModule",{value:!0});const al=Uu,Ur=wo,zL=(e,t)=>{let n;switch(e.code){case Ur.ZodIssueCode.invalid_type:e.received===al.ZodParsedType.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ur.ZodIssueCode.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,al.util.jsonStringifyReplacer)}`;break;case Ur.ZodIssueCode.unrecognized_keys:n=`Unrecognized key(s) in object: ${al.util.joinValues(e.keys,", ")}`;break;case Ur.ZodIssueCode.invalid_union:n="Invalid input";break;case Ur.ZodIssueCode.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${al.util.joinValues(e.options)}`;break;case Ur.ZodIssueCode.invalid_enum_value:n=`Invalid enum value. Expected ${al.util.joinValues(e.options)}, received '${e.received}'`;break;case Ur.ZodIssueCode.invalid_arguments:n="Invalid function arguments";break;case Ur.ZodIssueCode.invalid_return_type:n="Invalid function return type";break;case Ur.ZodIssueCode.invalid_date:n="Invalid date";break;case Ur.ZodIssueCode.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:al.util.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ur.ZodIssueCode.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ur.ZodIssueCode.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ur.ZodIssueCode.custom:n="Invalid input";break;case Ur.ZodIssueCode.invalid_intersection_types:n="Intersection results could not be merged";break;case Ur.ZodIssueCode.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ur.ZodIssueCode.not_finite:n="Number must be finite";break;default:n=t.defaultError,al.util.assertNever(e)}return{message:n}};Ih.default=zL;var VL=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(vo,"__esModule",{value:!0}),vo.getErrorMap=vo.setErrorMap=vo.defaultErrorMap=void 0;const nx=VL(Ih);vo.defaultErrorMap=nx.default;let rx=nx.default;function WL(e){rx=e}vo.setErrorMap=WL;function HL(){return rx}vo.getErrorMap=HL;var _1={};(function(e){var t=et&&et.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.isAsync=e.isValid=e.isDirty=e.isAborted=e.OK=e.DIRTY=e.INVALID=e.ParseStatus=e.addIssueToContext=e.EMPTY_PATH=e.makeIssue=void 0;const n=vo,r=t(Ih),i=b=>{const{data:_,path:S,errorMaps:k,issueData:I}=b,B=[...S,...I.path||[]],R={...I,path:B};if(I.message!==void 0)return{...I,path:B,message:I.message};let $="";const L=k.filter(U=>!!U).slice().reverse();for(const U of L)$=U(R,{data:_,defaultError:$}).message;return{...I,path:B,message:$}};e.makeIssue=i,e.EMPTY_PATH=[];function o(b,_){const S=(0,n.getErrorMap)(),k=(0,e.makeIssue)({issueData:_,data:b.data,path:b.path,errorMaps:[b.common.contextualErrorMap,b.schemaErrorMap,S,S===r.default?void 0:r.default].filter(I=>!!I)});b.common.issues.push(k)}e.addIssueToContext=o;class s{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(_,S){const k=[];for(const I of S){if(I.status==="aborted")return e.INVALID;I.status==="dirty"&&_.dirty(),k.push(I.value)}return{status:_.value,value:k}}static async mergeObjectAsync(_,S){const k=[];for(const I of S){const B=await I.key,R=await I.value;k.push({key:B,value:R})}return s.mergeObjectSync(_,k)}static mergeObjectSync(_,S){const k={};for(const I of S){const{key:B,value:R}=I;if(B.status==="aborted"||R.status==="aborted")return e.INVALID;B.status==="dirty"&&_.dirty(),R.status==="dirty"&&_.dirty(),B.value!=="__proto__"&&(typeof R.value<"u"||I.alwaysSet)&&(k[B.value]=R.value)}return{status:_.value,value:k}}}e.ParseStatus=s,e.INVALID=Object.freeze({status:"aborted"});const a=b=>({status:"dirty",value:b});e.DIRTY=a;const c=b=>({status:"valid",value:b});e.OK=c;const d=b=>b.status==="aborted";e.isAborted=d;const f=b=>b.status==="dirty";e.isDirty=f;const p=b=>b.status==="valid";e.isValid=p;const g=b=>typeof Promise<"u"&&b instanceof Promise;e.isAsync=g})(_1);var ix={};Object.defineProperty(ix,"__esModule",{value:!0});var ox={},sx={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.errorUtil=void 0,function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message}(e.errorUtil||(e.errorUtil={}))})(sx),function(e){var t=et&&et.__classPrivateFieldGet||function(q,m,E,P){if(E==="a"&&!P)throw new TypeError("Private accessor was defined without a getter");if(typeof m=="function"?q!==m||!P:!m.has(q))throw new TypeError("Cannot read private member from an object whose class did not declare it");return E==="m"?P:E==="a"?P.call(q):P?P.value:m.get(q)},n=et&&et.__classPrivateFieldSet||function(q,m,E,P,W){if(P==="m")throw new TypeError("Private method is not writable");if(P==="a"&&!W)throw new TypeError("Private accessor was defined without a setter");if(typeof m=="function"?q!==m||!W:!m.has(q))throw new TypeError("Cannot write private member to an object whose class did not declare it");return P==="a"?W.call(q,E):W?W.value=E:m.set(q,E),E},r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.boolean=e.bigint=e.array=e.any=e.coerce=e.ZodFirstPartyTypeKind=e.late=e.ZodSchema=e.Schema=e.custom=e.ZodReadonly=e.ZodPipeline=e.ZodBranded=e.BRAND=e.ZodNaN=e.ZodCatch=e.ZodDefault=e.ZodNullable=e.ZodOptional=e.ZodTransformer=e.ZodEffects=e.ZodPromise=e.ZodNativeEnum=e.ZodEnum=e.ZodLiteral=e.ZodLazy=e.ZodFunction=e.ZodSet=e.ZodMap=e.ZodRecord=e.ZodTuple=e.ZodIntersection=e.ZodDiscriminatedUnion=e.ZodUnion=e.ZodObject=e.ZodArray=e.ZodVoid=e.ZodNever=e.ZodUnknown=e.ZodAny=e.ZodNull=e.ZodUndefined=e.ZodSymbol=e.ZodDate=e.ZodBoolean=e.ZodBigInt=e.ZodNumber=e.ZodString=e.datetimeRegex=e.ZodType=void 0,e.NEVER=e.void=e.unknown=e.union=e.undefined=e.tuple=e.transformer=e.symbol=e.string=e.strictObject=e.set=e.record=e.promise=e.preprocess=e.pipeline=e.ostring=e.optional=e.onumber=e.oboolean=e.object=e.number=e.nullable=e.null=e.never=e.nativeEnum=e.nan=e.map=e.literal=e.lazy=e.intersection=e.instanceof=e.function=e.enum=e.effect=e.discriminatedUnion=e.date=void 0;const o=vo,s=sx,a=_1,c=Uu,d=wo;class f{constructor(m,E,P,W){this._cachedPath=[],this.parent=m,this.data=E,this._path=P,this._key=W}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const p=(q,m)=>{if((0,a.isValid)(m))return{success:!0,data:m.value};if(!q.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const E=new d.ZodError(q.common.issues);return this._error=E,this._error}}};function g(q){if(!q)return{};const{errorMap:m,invalid_type_error:E,required_error:P,description:W}=q;if(m&&(E||P))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return m?{errorMap:m,description:W}:{errorMap:(ge,pe)=>{var Fe,He;const{message:Ye}=q;return ge.code==="invalid_enum_value"?{message:Ye??pe.defaultError}:typeof pe.data>"u"?{message:(Fe=Ye??P)!==null&&Fe!==void 0?Fe:pe.defaultError}:ge.code!=="invalid_type"?{message:pe.defaultError}:{message:(He=Ye??E)!==null&&He!==void 0?He:pe.defaultError}},description:W}}class b{constructor(m){this.spa=this.safeParseAsync,this._def=m,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(m){return(0,c.getParsedType)(m.data)}_getOrReturnCtx(m,E){return E||{common:m.parent.common,data:m.data,parsedType:(0,c.getParsedType)(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}_processInputParams(m){return{status:new a.ParseStatus,ctx:{common:m.parent.common,data:m.data,parsedType:(0,c.getParsedType)(m.data),schemaErrorMap:this._def.errorMap,path:m.path,parent:m.parent}}}_parseSync(m){const E=this._parse(m);if((0,a.isAsync)(E))throw new Error("Synchronous parse encountered promise.");return E}_parseAsync(m){const E=this._parse(m);return Promise.resolve(E)}parse(m,E){const P=this.safeParse(m,E);if(P.success)return P.data;throw P.error}safeParse(m,E){var P;const W={common:{issues:[],async:(P=E==null?void 0:E.async)!==null&&P!==void 0?P:!1,contextualErrorMap:E==null?void 0:E.errorMap},path:(E==null?void 0:E.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:(0,c.getParsedType)(m)},V=this._parseSync({data:m,path:W.path,parent:W});return p(W,V)}async parseAsync(m,E){const P=await this.safeParseAsync(m,E);if(P.success)return P.data;throw P.error}async safeParseAsync(m,E){const P={common:{issues:[],contextualErrorMap:E==null?void 0:E.errorMap,async:!0},path:(E==null?void 0:E.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:m,parsedType:(0,c.getParsedType)(m)},W=this._parse({data:m,path:P.path,parent:P}),V=await((0,a.isAsync)(W)?W:Promise.resolve(W));return p(P,V)}refine(m,E){const P=W=>typeof E=="string"||typeof E>"u"?{message:E}:typeof E=="function"?E(W):E;return this._refinement((W,V)=>{const ge=m(W),pe=()=>V.addIssue({code:d.ZodIssueCode.custom,...P(W)});return typeof Promise<"u"&&ge instanceof Promise?ge.then(Fe=>Fe?!0:(pe(),!1)):ge?!0:(pe(),!1)})}refinement(m,E){return this._refinement((P,W)=>m(P)?!0:(W.addIssue(typeof E=="function"?E(P,W):E),!1))}_refinement(m){return new ee({schema:this,typeName:je.ZodEffects,effect:{type:"refinement",refinement:m}})}superRefine(m){return this._refinement(m)}optional(){return he.create(this,this._def)}nullable(){return x.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this,this._def)}promise(){return ne.create(this,this._def)}or(m){return Oe.create([this,m],this._def)}and(m){return Mt.create(this,m,this._def)}transform(m){return new ee({...g(this._def),schema:this,typeName:je.ZodEffects,effect:{type:"transform",transform:m}})}default(m){const E=typeof m=="function"?m:()=>m;return new y({...g(this._def),innerType:this,defaultValue:E,typeName:je.ZodDefault})}brand(){return new Y({typeName:je.ZodBranded,type:this,...g(this._def)})}catch(m){const E=typeof m=="function"?m:()=>m;return new v({...g(this._def),innerType:this,catchValue:E,typeName:je.ZodCatch})}describe(m){const E=this.constructor;return new E({...this._def,description:m})}pipe(m){return de.create(this,m)}readonly(){return fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}e.ZodType=b,e.Schema=b,e.ZodSchema=b;const _=/^c[^\s-]{8,}$/i,S=/^[0-9a-z]+$/,k=/^[0-9A-HJKMNP-TV-Z]{26}$/,I=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,B=/^[a-z0-9_-]{21}$/i,R=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,L="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let U;const G=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,X=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,J=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,me="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",oe=new RegExp(`^${me}$`);function Q(q){let m="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return q.precision?m=`${m}\\.\\d{${q.precision}}`:q.precision==null&&(m=`${m}(\\.\\d+)?`),m}function re(q){return new RegExp(`^${Q(q)}$`)}function Z(q){let m=`${me}T${Q(q)}`;const E=[];return E.push(q.local?"Z?":"Z"),q.offset&&E.push("([+-]\\d{2}:?\\d{2})"),m=`${m}(${E.join("|")})`,new RegExp(`^${m}$`)}e.datetimeRegex=Z;function be(q,m){return!!((m==="v4"||!m)&&G.test(q)||(m==="v6"||!m)&&X.test(q))}class Ae extends b{_parse(m){if(this._def.coerce&&(m.data=String(m.data)),this._getType(m)!==c.ZodParsedType.string){const V=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(V,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.string,received:V.parsedType}),a.INVALID}const P=new a.ParseStatus;let W;for(const V of this._def.checks)if(V.kind==="min")m.data.lengthV.value&&(W=this._getOrReturnCtx(m,W),(0,a.addIssueToContext)(W,{code:d.ZodIssueCode.too_big,maximum:V.value,type:"string",inclusive:!0,exact:!1,message:V.message}),P.dirty());else if(V.kind==="length"){const ge=m.data.length>V.value,pe=m.data.lengthm.test(W),{validation:E,code:d.ZodIssueCode.invalid_string,...s.errorUtil.errToObj(P)})}_addCheck(m){return new Ae({...this._def,checks:[...this._def.checks,m]})}email(m){return this._addCheck({kind:"email",...s.errorUtil.errToObj(m)})}url(m){return this._addCheck({kind:"url",...s.errorUtil.errToObj(m)})}emoji(m){return this._addCheck({kind:"emoji",...s.errorUtil.errToObj(m)})}uuid(m){return this._addCheck({kind:"uuid",...s.errorUtil.errToObj(m)})}nanoid(m){return this._addCheck({kind:"nanoid",...s.errorUtil.errToObj(m)})}cuid(m){return this._addCheck({kind:"cuid",...s.errorUtil.errToObj(m)})}cuid2(m){return this._addCheck({kind:"cuid2",...s.errorUtil.errToObj(m)})}ulid(m){return this._addCheck({kind:"ulid",...s.errorUtil.errToObj(m)})}base64(m){return this._addCheck({kind:"base64",...s.errorUtil.errToObj(m)})}ip(m){return this._addCheck({kind:"ip",...s.errorUtil.errToObj(m)})}datetime(m){var E,P;return typeof m=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:m}):this._addCheck({kind:"datetime",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,offset:(E=m==null?void 0:m.offset)!==null&&E!==void 0?E:!1,local:(P=m==null?void 0:m.local)!==null&&P!==void 0?P:!1,...s.errorUtil.errToObj(m==null?void 0:m.message)})}date(m){return this._addCheck({kind:"date",message:m})}time(m){return typeof m=="string"?this._addCheck({kind:"time",precision:null,message:m}):this._addCheck({kind:"time",precision:typeof(m==null?void 0:m.precision)>"u"?null:m==null?void 0:m.precision,...s.errorUtil.errToObj(m==null?void 0:m.message)})}duration(m){return this._addCheck({kind:"duration",...s.errorUtil.errToObj(m)})}regex(m,E){return this._addCheck({kind:"regex",regex:m,...s.errorUtil.errToObj(E)})}includes(m,E){return this._addCheck({kind:"includes",value:m,position:E==null?void 0:E.position,...s.errorUtil.errToObj(E==null?void 0:E.message)})}startsWith(m,E){return this._addCheck({kind:"startsWith",value:m,...s.errorUtil.errToObj(E)})}endsWith(m,E){return this._addCheck({kind:"endsWith",value:m,...s.errorUtil.errToObj(E)})}min(m,E){return this._addCheck({kind:"min",value:m,...s.errorUtil.errToObj(E)})}max(m,E){return this._addCheck({kind:"max",value:m,...s.errorUtil.errToObj(E)})}length(m,E){return this._addCheck({kind:"length",value:m,...s.errorUtil.errToObj(E)})}nonempty(m){return this.min(1,s.errorUtil.errToObj(m))}trim(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(m=>m.kind==="datetime")}get isDate(){return!!this._def.checks.find(m=>m.kind==="date")}get isTime(){return!!this._def.checks.find(m=>m.kind==="time")}get isDuration(){return!!this._def.checks.find(m=>m.kind==="duration")}get isEmail(){return!!this._def.checks.find(m=>m.kind==="email")}get isURL(){return!!this._def.checks.find(m=>m.kind==="url")}get isEmoji(){return!!this._def.checks.find(m=>m.kind==="emoji")}get isUUID(){return!!this._def.checks.find(m=>m.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(m=>m.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(m=>m.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(m=>m.kind==="cuid2")}get isULID(){return!!this._def.checks.find(m=>m.kind==="ulid")}get isIP(){return!!this._def.checks.find(m=>m.kind==="ip")}get isBase64(){return!!this._def.checks.find(m=>m.kind==="base64")}get minLength(){let m=null;for(const E of this._def.checks)E.kind==="min"&&(m===null||E.value>m)&&(m=E.value);return m}get maxLength(){let m=null;for(const E of this._def.checks)E.kind==="max"&&(m===null||E.value{var m;return new Ae({checks:[],typeName:je.ZodString,coerce:(m=q==null?void 0:q.coerce)!==null&&m!==void 0?m:!1,...g(q)})};function Se(q,m){const E=(q.toString().split(".")[1]||"").length,P=(m.toString().split(".")[1]||"").length,W=E>P?E:P,V=parseInt(q.toFixed(W).replace(".","")),ge=parseInt(m.toFixed(W).replace(".",""));return V%ge/Math.pow(10,W)}class Te extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(m){if(this._def.coerce&&(m.data=Number(m.data)),this._getType(m)!==c.ZodParsedType.number){const V=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(V,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.number,received:V.parsedType}),a.INVALID}let P;const W=new a.ParseStatus;for(const V of this._def.checks)V.kind==="int"?c.util.isInteger(m.data)||(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:"integer",received:"float",message:V.message}),W.dirty()):V.kind==="min"?(V.inclusive?m.dataV.value:m.data>=V.value)&&(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.too_big,maximum:V.value,type:"number",inclusive:V.inclusive,exact:!1,message:V.message}),W.dirty()):V.kind==="multipleOf"?Se(m.data,V.value)!==0&&(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.not_multiple_of,multipleOf:V.value,message:V.message}),W.dirty()):V.kind==="finite"?Number.isFinite(m.data)||(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.not_finite,message:V.message}),W.dirty()):c.util.assertNever(V);return{status:W.value,value:m.data}}gte(m,E){return this.setLimit("min",m,!0,s.errorUtil.toString(E))}gt(m,E){return this.setLimit("min",m,!1,s.errorUtil.toString(E))}lte(m,E){return this.setLimit("max",m,!0,s.errorUtil.toString(E))}lt(m,E){return this.setLimit("max",m,!1,s.errorUtil.toString(E))}setLimit(m,E,P,W){return new Te({...this._def,checks:[...this._def.checks,{kind:m,value:E,inclusive:P,message:s.errorUtil.toString(W)}]})}_addCheck(m){return new Te({...this._def,checks:[...this._def.checks,m]})}int(m){return this._addCheck({kind:"int",message:s.errorUtil.toString(m)})}positive(m){return this._addCheck({kind:"min",value:0,inclusive:!1,message:s.errorUtil.toString(m)})}negative(m){return this._addCheck({kind:"max",value:0,inclusive:!1,message:s.errorUtil.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:0,inclusive:!0,message:s.errorUtil.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:0,inclusive:!0,message:s.errorUtil.toString(m)})}multipleOf(m,E){return this._addCheck({kind:"multipleOf",value:m,message:s.errorUtil.toString(E)})}finite(m){return this._addCheck({kind:"finite",message:s.errorUtil.toString(m)})}safe(m){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:s.errorUtil.toString(m)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:s.errorUtil.toString(m)})}get minValue(){let m=null;for(const E of this._def.checks)E.kind==="min"&&(m===null||E.value>m)&&(m=E.value);return m}get maxValue(){let m=null;for(const E of this._def.checks)E.kind==="max"&&(m===null||E.valuem.kind==="int"||m.kind==="multipleOf"&&c.util.isInteger(m.value))}get isFinite(){let m=null,E=null;for(const P of this._def.checks){if(P.kind==="finite"||P.kind==="int"||P.kind==="multipleOf")return!0;P.kind==="min"?(E===null||P.value>E)&&(E=P.value):P.kind==="max"&&(m===null||P.valuenew Te({checks:[],typeName:je.ZodNumber,coerce:(q==null?void 0:q.coerce)||!1,...g(q)});class le extends b{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(m){if(this._def.coerce&&(m.data=BigInt(m.data)),this._getType(m)!==c.ZodParsedType.bigint){const V=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(V,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.bigint,received:V.parsedType}),a.INVALID}let P;const W=new a.ParseStatus;for(const V of this._def.checks)V.kind==="min"?(V.inclusive?m.dataV.value:m.data>=V.value)&&(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.too_big,type:"bigint",maximum:V.value,inclusive:V.inclusive,message:V.message}),W.dirty()):V.kind==="multipleOf"?m.data%V.value!==BigInt(0)&&(P=this._getOrReturnCtx(m,P),(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.not_multiple_of,multipleOf:V.value,message:V.message}),W.dirty()):c.util.assertNever(V);return{status:W.value,value:m.data}}gte(m,E){return this.setLimit("min",m,!0,s.errorUtil.toString(E))}gt(m,E){return this.setLimit("min",m,!1,s.errorUtil.toString(E))}lte(m,E){return this.setLimit("max",m,!0,s.errorUtil.toString(E))}lt(m,E){return this.setLimit("max",m,!1,s.errorUtil.toString(E))}setLimit(m,E,P,W){return new le({...this._def,checks:[...this._def.checks,{kind:m,value:E,inclusive:P,message:s.errorUtil.toString(W)}]})}_addCheck(m){return new le({...this._def,checks:[...this._def.checks,m]})}positive(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(m)})}negative(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:s.errorUtil.toString(m)})}nonpositive(m){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(m)})}nonnegative(m){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:s.errorUtil.toString(m)})}multipleOf(m,E){return this._addCheck({kind:"multipleOf",value:m,message:s.errorUtil.toString(E)})}get minValue(){let m=null;for(const E of this._def.checks)E.kind==="min"&&(m===null||E.value>m)&&(m=E.value);return m}get maxValue(){let m=null;for(const E of this._def.checks)E.kind==="max"&&(m===null||E.value{var m;return new le({checks:[],typeName:je.ZodBigInt,coerce:(m=q==null?void 0:q.coerce)!==null&&m!==void 0?m:!1,...g(q)})};class tt extends b{_parse(m){if(this._def.coerce&&(m.data=!!m.data),this._getType(m)!==c.ZodParsedType.boolean){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.boolean,received:P.parsedType}),a.INVALID}return(0,a.OK)(m.data)}}e.ZodBoolean=tt,tt.create=q=>new tt({typeName:je.ZodBoolean,coerce:(q==null?void 0:q.coerce)||!1,...g(q)});class Ke extends b{_parse(m){if(this._def.coerce&&(m.data=new Date(m.data)),this._getType(m)!==c.ZodParsedType.date){const V=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(V,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.date,received:V.parsedType}),a.INVALID}if(isNaN(m.data.getTime())){const V=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(V,{code:d.ZodIssueCode.invalid_date}),a.INVALID}const P=new a.ParseStatus;let W;for(const V of this._def.checks)V.kind==="min"?m.data.getTime()V.value&&(W=this._getOrReturnCtx(m,W),(0,a.addIssueToContext)(W,{code:d.ZodIssueCode.too_big,message:V.message,inclusive:!0,exact:!1,maximum:V.value,type:"date"}),P.dirty()):c.util.assertNever(V);return{status:P.value,value:new Date(m.data.getTime())}}_addCheck(m){return new Ke({...this._def,checks:[...this._def.checks,m]})}min(m,E){return this._addCheck({kind:"min",value:m.getTime(),message:s.errorUtil.toString(E)})}max(m,E){return this._addCheck({kind:"max",value:m.getTime(),message:s.errorUtil.toString(E)})}get minDate(){let m=null;for(const E of this._def.checks)E.kind==="min"&&(m===null||E.value>m)&&(m=E.value);return m!=null?new Date(m):null}get maxDate(){let m=null;for(const E of this._def.checks)E.kind==="max"&&(m===null||E.valuenew Ke({checks:[],coerce:(q==null?void 0:q.coerce)||!1,typeName:je.ZodDate,...g(q)});class Nt extends b{_parse(m){if(this._getType(m)!==c.ZodParsedType.symbol){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.symbol,received:P.parsedType}),a.INVALID}return(0,a.OK)(m.data)}}e.ZodSymbol=Nt,Nt.create=q=>new Nt({typeName:je.ZodSymbol,...g(q)});class It extends b{_parse(m){if(this._getType(m)!==c.ZodParsedType.undefined){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.undefined,received:P.parsedType}),a.INVALID}return(0,a.OK)(m.data)}}e.ZodUndefined=It,It.create=q=>new It({typeName:je.ZodUndefined,...g(q)});class yt extends b{_parse(m){if(this._getType(m)!==c.ZodParsedType.null){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.null,received:P.parsedType}),a.INVALID}return(0,a.OK)(m.data)}}e.ZodNull=yt,yt.create=q=>new yt({typeName:je.ZodNull,...g(q)});class rt extends b{constructor(){super(...arguments),this._any=!0}_parse(m){return(0,a.OK)(m.data)}}e.ZodAny=rt,rt.create=q=>new rt({typeName:je.ZodAny,...g(q)});class Et extends b{constructor(){super(...arguments),this._unknown=!0}_parse(m){return(0,a.OK)(m.data)}}e.ZodUnknown=Et,Et.create=q=>new Et({typeName:je.ZodUnknown,...g(q)});class xn extends b{_parse(m){const E=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.never,received:E.parsedType}),a.INVALID}}e.ZodNever=xn,xn.create=q=>new xn({typeName:je.ZodNever,...g(q)});class Be extends b{_parse(m){if(this._getType(m)!==c.ZodParsedType.undefined){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.void,received:P.parsedType}),a.INVALID}return(0,a.OK)(m.data)}}e.ZodVoid=Be,Be.create=q=>new Be({typeName:je.ZodVoid,...g(q)});class Ee extends b{_parse(m){const{ctx:E,status:P}=this._processInputParams(m),W=this._def;if(E.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:E.parsedType}),a.INVALID;if(W.exactLength!==null){const ge=E.data.length>W.exactLength.value,pe=E.data.lengthW.maxLength.value&&((0,a.addIssueToContext)(E,{code:d.ZodIssueCode.too_big,maximum:W.maxLength.value,type:"array",inclusive:!0,exact:!1,message:W.maxLength.message}),P.dirty()),E.common.async)return Promise.all([...E.data].map((ge,pe)=>W.type._parseAsync(new f(E,ge,E.path,pe)))).then(ge=>a.ParseStatus.mergeArray(P,ge));const V=[...E.data].map((ge,pe)=>W.type._parseSync(new f(E,ge,E.path,pe)));return a.ParseStatus.mergeArray(P,V)}get element(){return this._def.type}min(m,E){return new Ee({...this._def,minLength:{value:m,message:s.errorUtil.toString(E)}})}max(m,E){return new Ee({...this._def,maxLength:{value:m,message:s.errorUtil.toString(E)}})}length(m,E){return new Ee({...this._def,exactLength:{value:m,message:s.errorUtil.toString(E)}})}nonempty(m){return this.min(1,m)}}e.ZodArray=Ee,Ee.create=(q,m)=>new Ee({type:q,minLength:null,maxLength:null,exactLength:null,typeName:je.ZodArray,...g(m)});function Ce(q){if(q instanceof ke){const m={};for(const E in q.shape){const P=q.shape[E];m[E]=he.create(Ce(P))}return new ke({...q._def,shape:()=>m})}else return q instanceof Ee?new Ee({...q._def,type:Ce(q.element)}):q instanceof he?he.create(Ce(q.unwrap())):q instanceof x?x.create(Ce(q.unwrap())):q instanceof Ct?Ct.create(q.items.map(m=>Ce(m))):q}class ke extends b{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const m=this._def.shape(),E=c.util.objectKeys(m);return this._cached={shape:m,keys:E}}_parse(m){if(this._getType(m)!==c.ZodParsedType.object){const He=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(He,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:He.parsedType}),a.INVALID}const{status:P,ctx:W}=this._processInputParams(m),{shape:V,keys:ge}=this._getCached(),pe=[];if(!(this._def.catchall instanceof xn&&this._def.unknownKeys==="strip"))for(const He in W.data)ge.includes(He)||pe.push(He);const Fe=[];for(const He of ge){const Ye=V[He],wt=W.data[He];Fe.push({key:{status:"valid",value:He},value:Ye._parse(new f(W,wt,W.path,He)),alwaysSet:He in W.data})}if(this._def.catchall instanceof xn){const He=this._def.unknownKeys;if(He==="passthrough")for(const Ye of pe)Fe.push({key:{status:"valid",value:Ye},value:{status:"valid",value:W.data[Ye]}});else if(He==="strict")pe.length>0&&((0,a.addIssueToContext)(W,{code:d.ZodIssueCode.unrecognized_keys,keys:pe}),P.dirty());else if(He!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const He=this._def.catchall;for(const Ye of pe){const wt=W.data[Ye];Fe.push({key:{status:"valid",value:Ye},value:He._parse(new f(W,wt,W.path,Ye)),alwaysSet:Ye in W.data})}}return W.common.async?Promise.resolve().then(async()=>{const He=[];for(const Ye of Fe){const wt=await Ye.key,ae=await Ye.value;He.push({key:wt,value:ae,alwaysSet:Ye.alwaysSet})}return He}).then(He=>a.ParseStatus.mergeObjectSync(P,He)):a.ParseStatus.mergeObjectSync(P,Fe)}get shape(){return this._def.shape()}strict(m){return s.errorUtil.errToObj,new ke({...this._def,unknownKeys:"strict",...m!==void 0?{errorMap:(E,P)=>{var W,V,ge,pe;const Fe=(ge=(V=(W=this._def).errorMap)===null||V===void 0?void 0:V.call(W,E,P).message)!==null&&ge!==void 0?ge:P.defaultError;return E.code==="unrecognized_keys"?{message:(pe=s.errorUtil.errToObj(m).message)!==null&&pe!==void 0?pe:Fe}:{message:Fe}}}:{}})}strip(){return new ke({...this._def,unknownKeys:"strip"})}passthrough(){return new ke({...this._def,unknownKeys:"passthrough"})}extend(m){return new ke({...this._def,shape:()=>({...this._def.shape(),...m})})}merge(m){return new ke({unknownKeys:m._def.unknownKeys,catchall:m._def.catchall,shape:()=>({...this._def.shape(),...m._def.shape()}),typeName:je.ZodObject})}setKey(m,E){return this.augment({[m]:E})}catchall(m){return new ke({...this._def,catchall:m})}pick(m){const E={};return c.util.objectKeys(m).forEach(P=>{m[P]&&this.shape[P]&&(E[P]=this.shape[P])}),new ke({...this._def,shape:()=>E})}omit(m){const E={};return c.util.objectKeys(this.shape).forEach(P=>{m[P]||(E[P]=this.shape[P])}),new ke({...this._def,shape:()=>E})}deepPartial(){return Ce(this)}partial(m){const E={};return c.util.objectKeys(this.shape).forEach(P=>{const W=this.shape[P];m&&!m[P]?E[P]=W:E[P]=W.optional()}),new ke({...this._def,shape:()=>E})}required(m){const E={};return c.util.objectKeys(this.shape).forEach(P=>{if(m&&!m[P])E[P]=this.shape[P];else{let V=this.shape[P];for(;V instanceof he;)V=V._def.innerType;E[P]=V}}),new ke({...this._def,shape:()=>E})}keyof(){return kn(c.util.objectKeys(this.shape))}}e.ZodObject=ke,ke.create=(q,m)=>new ke({shape:()=>q,unknownKeys:"strip",catchall:xn.create(),typeName:je.ZodObject,...g(m)}),ke.strictCreate=(q,m)=>new ke({shape:()=>q,unknownKeys:"strict",catchall:xn.create(),typeName:je.ZodObject,...g(m)}),ke.lazycreate=(q,m)=>new ke({shape:q,unknownKeys:"strip",catchall:xn.create(),typeName:je.ZodObject,...g(m)});class Oe extends b{_parse(m){const{ctx:E}=this._processInputParams(m),P=this._def.options;function W(V){for(const pe of V)if(pe.result.status==="valid")return pe.result;for(const pe of V)if(pe.result.status==="dirty")return E.common.issues.push(...pe.ctx.common.issues),pe.result;const ge=V.map(pe=>new d.ZodError(pe.ctx.common.issues));return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_union,unionErrors:ge}),a.INVALID}if(E.common.async)return Promise.all(P.map(async V=>{const ge={...E,common:{...E.common,issues:[]},parent:null};return{result:await V._parseAsync({data:E.data,path:E.path,parent:ge}),ctx:ge}})).then(W);{let V;const ge=[];for(const Fe of P){const He={...E,common:{...E.common,issues:[]},parent:null},Ye=Fe._parseSync({data:E.data,path:E.path,parent:He});if(Ye.status==="valid")return Ye;Ye.status==="dirty"&&!V&&(V={result:Ye,ctx:He}),He.common.issues.length&&ge.push(He.common.issues)}if(V)return E.common.issues.push(...V.ctx.common.issues),V.result;const pe=ge.map(Fe=>new d.ZodError(Fe));return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_union,unionErrors:pe}),a.INVALID}}get options(){return this._def.options}}e.ZodUnion=Oe,Oe.create=(q,m)=>new Oe({options:q,typeName:je.ZodUnion,...g(m)});const Ze=q=>q instanceof vn?Ze(q.schema):q instanceof ee?Ze(q.innerType()):q instanceof on?[q.value]:q instanceof ue?q.options:q instanceof D?c.util.objectValues(q.enum):q instanceof y?Ze(q._def.innerType):q instanceof It?[void 0]:q instanceof yt?[null]:q instanceof he?[void 0,...Ze(q.unwrap())]:q instanceof x?[null,...Ze(q.unwrap())]:q instanceof Y||q instanceof fe?Ze(q.unwrap()):q instanceof v?Ze(q._def.innerType):[];class it extends b{_parse(m){const{ctx:E}=this._processInputParams(m);if(E.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:E.parsedType}),a.INVALID;const P=this.discriminator,W=E.data[P],V=this.optionsMap.get(W);return V?E.common.async?V._parseAsync({data:E.data,path:E.path,parent:E}):V._parseSync({data:E.data,path:E.path,parent:E}):((0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[P]}),a.INVALID)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(m,E,P){const W=new Map;for(const V of E){const ge=Ze(V.shape[m]);if(!ge.length)throw new Error(`A discriminator value for key \`${m}\` could not be extracted from all schema options`);for(const pe of ge){if(W.has(pe))throw new Error(`Discriminator property ${String(m)} has duplicate value ${String(pe)}`);W.set(pe,V)}}return new it({typeName:je.ZodDiscriminatedUnion,discriminator:m,options:E,optionsMap:W,...g(P)})}}e.ZodDiscriminatedUnion=it;function Xe(q,m){const E=(0,c.getParsedType)(q),P=(0,c.getParsedType)(m);if(q===m)return{valid:!0,data:q};if(E===c.ZodParsedType.object&&P===c.ZodParsedType.object){const W=c.util.objectKeys(m),V=c.util.objectKeys(q).filter(pe=>W.indexOf(pe)!==-1),ge={...q,...m};for(const pe of V){const Fe=Xe(q[pe],m[pe]);if(!Fe.valid)return{valid:!1};ge[pe]=Fe.data}return{valid:!0,data:ge}}else if(E===c.ZodParsedType.array&&P===c.ZodParsedType.array){if(q.length!==m.length)return{valid:!1};const W=[];for(let V=0;V{if((0,a.isAborted)(V)||(0,a.isAborted)(ge))return a.INVALID;const pe=Xe(V.value,ge.value);return pe.valid?(((0,a.isDirty)(V)||(0,a.isDirty)(ge))&&E.dirty(),{status:E.value,value:pe.data}):((0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_intersection_types}),a.INVALID)};return P.common.async?Promise.all([this._def.left._parseAsync({data:P.data,path:P.path,parent:P}),this._def.right._parseAsync({data:P.data,path:P.path,parent:P})]).then(([V,ge])=>W(V,ge)):W(this._def.left._parseSync({data:P.data,path:P.path,parent:P}),this._def.right._parseSync({data:P.data,path:P.path,parent:P}))}}e.ZodIntersection=Mt,Mt.create=(q,m,E)=>new Mt({left:q,right:m,typeName:je.ZodIntersection,...g(E)});class Ct extends b{_parse(m){const{status:E,ctx:P}=this._processInputParams(m);if(P.parsedType!==c.ZodParsedType.array)return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.array,received:P.parsedType}),a.INVALID;if(P.data.lengththis._def.items.length&&((0,a.addIssueToContext)(P,{code:d.ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E.dirty());const V=[...P.data].map((ge,pe)=>{const Fe=this._def.items[pe]||this._def.rest;return Fe?Fe._parse(new f(P,ge,P.path,pe)):null}).filter(ge=>!!ge);return P.common.async?Promise.all(V).then(ge=>a.ParseStatus.mergeArray(E,ge)):a.ParseStatus.mergeArray(E,V)}get items(){return this._def.items}rest(m){return new Ct({...this._def,rest:m})}}e.ZodTuple=Ct,Ct.create=(q,m)=>{if(!Array.isArray(q))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ct({items:q,typeName:je.ZodTuple,rest:null,...g(m)})};class ct extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:E,ctx:P}=this._processInputParams(m);if(P.parsedType!==c.ZodParsedType.object)return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.object,received:P.parsedType}),a.INVALID;const W=[],V=this._def.keyType,ge=this._def.valueType;for(const pe in P.data)W.push({key:V._parse(new f(P,pe,P.path,pe)),value:ge._parse(new f(P,P.data[pe],P.path,pe)),alwaysSet:pe in P.data});return P.common.async?a.ParseStatus.mergeObjectAsync(E,W):a.ParseStatus.mergeObjectSync(E,W)}get element(){return this._def.valueType}static create(m,E,P){return E instanceof b?new ct({keyType:m,valueType:E,typeName:je.ZodRecord,...g(P)}):new ct({keyType:Ae.create(),valueType:m,typeName:je.ZodRecord,...g(E)})}}e.ZodRecord=ct;class Jt extends b{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(m){const{status:E,ctx:P}=this._processInputParams(m);if(P.parsedType!==c.ZodParsedType.map)return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.map,received:P.parsedType}),a.INVALID;const W=this._def.keyType,V=this._def.valueType,ge=[...P.data.entries()].map(([pe,Fe],He)=>({key:W._parse(new f(P,pe,P.path,[He,"key"])),value:V._parse(new f(P,Fe,P.path,[He,"value"]))}));if(P.common.async){const pe=new Map;return Promise.resolve().then(async()=>{for(const Fe of ge){const He=await Fe.key,Ye=await Fe.value;if(He.status==="aborted"||Ye.status==="aborted")return a.INVALID;(He.status==="dirty"||Ye.status==="dirty")&&E.dirty(),pe.set(He.value,Ye.value)}return{status:E.value,value:pe}})}else{const pe=new Map;for(const Fe of ge){const He=Fe.key,Ye=Fe.value;if(He.status==="aborted"||Ye.status==="aborted")return a.INVALID;(He.status==="dirty"||Ye.status==="dirty")&&E.dirty(),pe.set(He.value,Ye.value)}return{status:E.value,value:pe}}}}e.ZodMap=Jt,Jt.create=(q,m,E)=>new Jt({valueType:m,keyType:q,typeName:je.ZodMap,...g(E)});class Vt extends b{_parse(m){const{status:E,ctx:P}=this._processInputParams(m);if(P.parsedType!==c.ZodParsedType.set)return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.set,received:P.parsedType}),a.INVALID;const W=this._def;W.minSize!==null&&P.data.sizeW.maxSize.value&&((0,a.addIssueToContext)(P,{code:d.ZodIssueCode.too_big,maximum:W.maxSize.value,type:"set",inclusive:!0,exact:!1,message:W.maxSize.message}),E.dirty());const V=this._def.valueType;function ge(Fe){const He=new Set;for(const Ye of Fe){if(Ye.status==="aborted")return a.INVALID;Ye.status==="dirty"&&E.dirty(),He.add(Ye.value)}return{status:E.value,value:He}}const pe=[...P.data.values()].map((Fe,He)=>V._parse(new f(P,Fe,P.path,He)));return P.common.async?Promise.all(pe).then(Fe=>ge(Fe)):ge(pe)}min(m,E){return new Vt({...this._def,minSize:{value:m,message:s.errorUtil.toString(E)}})}max(m,E){return new Vt({...this._def,maxSize:{value:m,message:s.errorUtil.toString(E)}})}size(m,E){return this.min(m,E).max(m,E)}nonempty(m){return this.min(1,m)}}e.ZodSet=Vt,Vt.create=(q,m)=>new Vt({valueType:q,minSize:null,maxSize:null,typeName:je.ZodSet,...g(m)});class pn extends b{constructor(){super(...arguments),this.validate=this.implement}_parse(m){const{ctx:E}=this._processInputParams(m);if(E.parsedType!==c.ZodParsedType.function)return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.function,received:E.parsedType}),a.INVALID;function P(pe,Fe){return(0,a.makeIssue)({data:pe,path:E.path,errorMaps:[E.common.contextualErrorMap,E.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter(He=>!!He),issueData:{code:d.ZodIssueCode.invalid_arguments,argumentsError:Fe}})}function W(pe,Fe){return(0,a.makeIssue)({data:pe,path:E.path,errorMaps:[E.common.contextualErrorMap,E.schemaErrorMap,(0,o.getErrorMap)(),o.defaultErrorMap].filter(He=>!!He),issueData:{code:d.ZodIssueCode.invalid_return_type,returnTypeError:Fe}})}const V={errorMap:E.common.contextualErrorMap},ge=E.data;if(this._def.returns instanceof ne){const pe=this;return(0,a.OK)(async function(...Fe){const He=new d.ZodError([]),Ye=await pe._def.args.parseAsync(Fe,V).catch(Ft=>{throw He.addIssue(P(Fe,Ft)),He}),wt=await Reflect.apply(ge,this,Ye);return await pe._def.returns._def.type.parseAsync(wt,V).catch(Ft=>{throw He.addIssue(W(wt,Ft)),He})})}else{const pe=this;return(0,a.OK)(function(...Fe){const He=pe._def.args.safeParse(Fe,V);if(!He.success)throw new d.ZodError([P(Fe,He.error)]);const Ye=Reflect.apply(ge,this,He.data),wt=pe._def.returns.safeParse(Ye,V);if(!wt.success)throw new d.ZodError([W(Ye,wt.error)]);return wt.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...m){return new pn({...this._def,args:Ct.create(m).rest(Et.create())})}returns(m){return new pn({...this._def,returns:m})}implement(m){return this.parse(m)}strictImplement(m){return this.parse(m)}static create(m,E,P){return new pn({args:m||Ct.create([]).rest(Et.create()),returns:E||Et.create(),typeName:je.ZodFunction,...g(P)})}}e.ZodFunction=pn;class vn extends b{get schema(){return this._def.getter()}_parse(m){const{ctx:E}=this._processInputParams(m);return this._def.getter()._parse({data:E.data,path:E.path,parent:E})}}e.ZodLazy=vn,vn.create=(q,m)=>new vn({getter:q,typeName:je.ZodLazy,...g(m)});class on extends b{_parse(m){if(m.data!==this._def.value){const E=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(E,{received:E.data,code:d.ZodIssueCode.invalid_literal,expected:this._def.value}),a.INVALID}return{status:"valid",value:m.data}}get value(){return this._def.value}}e.ZodLiteral=on,on.create=(q,m)=>new on({value:q,typeName:je.ZodLiteral,...g(m)});function kn(q,m){return new ue({values:q,typeName:je.ZodEnum,...g(m)})}class ue extends b{constructor(){super(...arguments),r.set(this,void 0)}_parse(m){if(typeof m.data!="string"){const E=this._getOrReturnCtx(m),P=this._def.values;return(0,a.addIssueToContext)(E,{expected:c.util.joinValues(P),received:E.parsedType,code:d.ZodIssueCode.invalid_type}),a.INVALID}if(t(this,r,"f")||n(this,r,new Set(this._def.values),"f"),!t(this,r,"f").has(m.data)){const E=this._getOrReturnCtx(m),P=this._def.values;return(0,a.addIssueToContext)(E,{received:E.data,code:d.ZodIssueCode.invalid_enum_value,options:P}),a.INVALID}return(0,a.OK)(m.data)}get options(){return this._def.values}get enum(){const m={};for(const E of this._def.values)m[E]=E;return m}get Values(){const m={};for(const E of this._def.values)m[E]=E;return m}get Enum(){const m={};for(const E of this._def.values)m[E]=E;return m}extract(m,E=this._def){return ue.create(m,{...this._def,...E})}exclude(m,E=this._def){return ue.create(this.options.filter(P=>!m.includes(P)),{...this._def,...E})}}e.ZodEnum=ue,r=new WeakMap,ue.create=kn;class D extends b{constructor(){super(...arguments),i.set(this,void 0)}_parse(m){const E=c.util.getValidEnumValues(this._def.values),P=this._getOrReturnCtx(m);if(P.parsedType!==c.ZodParsedType.string&&P.parsedType!==c.ZodParsedType.number){const W=c.util.objectValues(E);return(0,a.addIssueToContext)(P,{expected:c.util.joinValues(W),received:P.parsedType,code:d.ZodIssueCode.invalid_type}),a.INVALID}if(t(this,i,"f")||n(this,i,new Set(c.util.getValidEnumValues(this._def.values)),"f"),!t(this,i,"f").has(m.data)){const W=c.util.objectValues(E);return(0,a.addIssueToContext)(P,{received:P.data,code:d.ZodIssueCode.invalid_enum_value,options:W}),a.INVALID}return(0,a.OK)(m.data)}get enum(){return this._def.values}}e.ZodNativeEnum=D,i=new WeakMap,D.create=(q,m)=>new D({values:q,typeName:je.ZodNativeEnum,...g(m)});class ne extends b{unwrap(){return this._def.type}_parse(m){const{ctx:E}=this._processInputParams(m);if(E.parsedType!==c.ZodParsedType.promise&&E.common.async===!1)return(0,a.addIssueToContext)(E,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.promise,received:E.parsedType}),a.INVALID;const P=E.parsedType===c.ZodParsedType.promise?E.data:Promise.resolve(E.data);return(0,a.OK)(P.then(W=>this._def.type.parseAsync(W,{path:E.path,errorMap:E.common.contextualErrorMap})))}}e.ZodPromise=ne,ne.create=(q,m)=>new ne({type:q,typeName:je.ZodPromise,...g(m)});class ee extends b{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===je.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(m){const{status:E,ctx:P}=this._processInputParams(m),W=this._def.effect||null,V={addIssue:ge=>{(0,a.addIssueToContext)(P,ge),ge.fatal?E.abort():E.dirty()},get path(){return P.path}};if(V.addIssue=V.addIssue.bind(V),W.type==="preprocess"){const ge=W.transform(P.data,V);if(P.common.async)return Promise.resolve(ge).then(async pe=>{if(E.value==="aborted")return a.INVALID;const Fe=await this._def.schema._parseAsync({data:pe,path:P.path,parent:P});return Fe.status==="aborted"?a.INVALID:Fe.status==="dirty"||E.value==="dirty"?(0,a.DIRTY)(Fe.value):Fe});{if(E.value==="aborted")return a.INVALID;const pe=this._def.schema._parseSync({data:ge,path:P.path,parent:P});return pe.status==="aborted"?a.INVALID:pe.status==="dirty"||E.value==="dirty"?(0,a.DIRTY)(pe.value):pe}}if(W.type==="refinement"){const ge=pe=>{const Fe=W.refinement(pe,V);if(P.common.async)return Promise.resolve(Fe);if(Fe instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return pe};if(P.common.async===!1){const pe=this._def.schema._parseSync({data:P.data,path:P.path,parent:P});return pe.status==="aborted"?a.INVALID:(pe.status==="dirty"&&E.dirty(),ge(pe.value),{status:E.value,value:pe.value})}else return this._def.schema._parseAsync({data:P.data,path:P.path,parent:P}).then(pe=>pe.status==="aborted"?a.INVALID:(pe.status==="dirty"&&E.dirty(),ge(pe.value).then(()=>({status:E.value,value:pe.value}))))}if(W.type==="transform")if(P.common.async===!1){const ge=this._def.schema._parseSync({data:P.data,path:P.path,parent:P});if(!(0,a.isValid)(ge))return ge;const pe=W.transform(ge.value,V);if(pe instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:E.value,value:pe}}else return this._def.schema._parseAsync({data:P.data,path:P.path,parent:P}).then(ge=>(0,a.isValid)(ge)?Promise.resolve(W.transform(ge.value,V)).then(pe=>({status:E.value,value:pe})):ge);c.util.assertNever(W)}}e.ZodEffects=ee,e.ZodTransformer=ee,ee.create=(q,m,E)=>new ee({schema:q,typeName:je.ZodEffects,effect:m,...g(E)}),ee.createWithPreprocess=(q,m,E)=>new ee({schema:m,effect:{type:"preprocess",transform:q},typeName:je.ZodEffects,...g(E)});class he extends b{_parse(m){return this._getType(m)===c.ZodParsedType.undefined?(0,a.OK)(void 0):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}e.ZodOptional=he,he.create=(q,m)=>new he({innerType:q,typeName:je.ZodOptional,...g(m)});class x extends b{_parse(m){return this._getType(m)===c.ZodParsedType.null?(0,a.OK)(null):this._def.innerType._parse(m)}unwrap(){return this._def.innerType}}e.ZodNullable=x,x.create=(q,m)=>new x({innerType:q,typeName:je.ZodNullable,...g(m)});class y extends b{_parse(m){const{ctx:E}=this._processInputParams(m);let P=E.data;return E.parsedType===c.ZodParsedType.undefined&&(P=this._def.defaultValue()),this._def.innerType._parse({data:P,path:E.path,parent:E})}removeDefault(){return this._def.innerType}}e.ZodDefault=y,y.create=(q,m)=>new y({innerType:q,typeName:je.ZodDefault,defaultValue:typeof m.default=="function"?m.default:()=>m.default,...g(m)});class v extends b{_parse(m){const{ctx:E}=this._processInputParams(m),P={...E,common:{...E.common,issues:[]}},W=this._def.innerType._parse({data:P.data,path:P.path,parent:{...P}});return(0,a.isAsync)(W)?W.then(V=>({status:"valid",value:V.status==="valid"?V.value:this._def.catchValue({get error(){return new d.ZodError(P.common.issues)},input:P.data})})):{status:"valid",value:W.status==="valid"?W.value:this._def.catchValue({get error(){return new d.ZodError(P.common.issues)},input:P.data})}}removeCatch(){return this._def.innerType}}e.ZodCatch=v,v.create=(q,m)=>new v({innerType:q,typeName:je.ZodCatch,catchValue:typeof m.catch=="function"?m.catch:()=>m.catch,...g(m)});class M extends b{_parse(m){if(this._getType(m)!==c.ZodParsedType.nan){const P=this._getOrReturnCtx(m);return(0,a.addIssueToContext)(P,{code:d.ZodIssueCode.invalid_type,expected:c.ZodParsedType.nan,received:P.parsedType}),a.INVALID}return{status:"valid",value:m.data}}}e.ZodNaN=M,M.create=q=>new M({typeName:je.ZodNaN,...g(q)}),e.BRAND=Symbol("zod_brand");class Y extends b{_parse(m){const{ctx:E}=this._processInputParams(m),P=E.data;return this._def.type._parse({data:P,path:E.path,parent:E})}unwrap(){return this._def.type}}e.ZodBranded=Y;class de extends b{_parse(m){const{status:E,ctx:P}=this._processInputParams(m);if(P.common.async)return(async()=>{const V=await this._def.in._parseAsync({data:P.data,path:P.path,parent:P});return V.status==="aborted"?a.INVALID:V.status==="dirty"?(E.dirty(),(0,a.DIRTY)(V.value)):this._def.out._parseAsync({data:V.value,path:P.path,parent:P})})();{const W=this._def.in._parseSync({data:P.data,path:P.path,parent:P});return W.status==="aborted"?a.INVALID:W.status==="dirty"?(E.dirty(),{status:"dirty",value:W.value}):this._def.out._parseSync({data:W.value,path:P.path,parent:P})}}static create(m,E){return new de({in:m,out:E,typeName:je.ZodPipeline})}}e.ZodPipeline=de;class fe extends b{_parse(m){const E=this._def.innerType._parse(m),P=W=>((0,a.isValid)(W)&&(W.value=Object.freeze(W.value)),W);return(0,a.isAsync)(E)?E.then(W=>P(W)):P(E)}unwrap(){return this._def.innerType}}e.ZodReadonly=fe,fe.create=(q,m)=>new fe({innerType:q,typeName:je.ZodReadonly,...g(m)});function De(q,m={},E){return q?rt.create().superRefine((P,W)=>{var V,ge;if(!q(P)){const pe=typeof m=="function"?m(P):typeof m=="string"?{message:m}:m,Fe=(ge=(V=pe.fatal)!==null&&V!==void 0?V:E)!==null&&ge!==void 0?ge:!0,He=typeof pe=="string"?{message:pe}:pe;W.addIssue({code:"custom",...He,fatal:Fe})}}):rt.create()}e.custom=De,e.late={object:ke.lazycreate};var je;(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(je=e.ZodFirstPartyTypeKind||(e.ZodFirstPartyTypeKind={}));const $e=(q,m={message:`Input not instance of ${q.name}`})=>De(E=>E instanceof q,m);e.instanceof=$e;const gt=Ae.create;e.string=gt;const nt=Te.create;e.number=nt;const tn=M.create;e.nan=tn;const gn=le.create;e.bigint=gn;const Mn=tt.create;e.boolean=Mn;const Rn=Ke.create;e.date=Rn;const zn=Nt.create;e.symbol=zn;const ci=It.create;e.undefined=ci;const Gr=yt.create;e.null=Gr;const Yr=rt.create;e.any=Yr;const Fi=Et.create;e.unknown=Fi;const Xn=xn.create;e.never=Xn;const ds=Be.create;e.void=ds;const T=Ee.create;e.array=T;const F=ke.create;e.object=F;const N=ke.strictCreate;e.strictObject=N;const w=Oe.create;e.union=w;const A=it.create;e.discriminatedUnion=A;const te=Mt.create;e.intersection=te;const ce=Ct.create;e.tuple=ce;const _e=ct.create;e.record=_e;const Le=Jt.create;e.map=Le;const Ge=Vt.create;e.set=Ge;const We=pn.create;e.function=We;const at=vn.create;e.lazy=at;const Qe=on.create;e.literal=Qe;const lt=ue.create;e.enum=lt;const ut=D.create;e.nativeEnum=ut;const xt=ne.create;e.promise=xt;const St=ee.create;e.effect=St,e.transformer=St;const Pt=he.create;e.optional=Pt;const bt=x.create;e.nullable=bt;const $t=ee.createWithPreprocess;e.preprocess=$t;const ft=de.create;e.pipeline=ft;const vt=()=>gt().optional();e.ostring=vt;const ot=()=>nt().optional();e.onumber=ot;const ht=()=>Mn().optional();e.oboolean=ht,e.coerce={string:q=>Ae.create({...q,coerce:!0}),number:q=>Te.create({...q,coerce:!0}),boolean:q=>tt.create({...q,coerce:!0}),bigint:q=>le.create({...q,coerce:!0}),date:q=>Ke.create({...q,coerce:!0})},e.NEVER=a.INVALID}(ox),function(e){var t=et&&et.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o),Object.defineProperty(r,s,{enumerable:!0,get:function(){return i[o]}})}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=et&&et.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(vo,e),n(_1,e),n(ix,e),n(Uu,e),n(ox,e),n(wo,e)}(w1),function(e){var t=et&&et.__createBinding||(Object.create?function(s,a,c,d){d===void 0&&(d=c),Object.defineProperty(s,d,{enumerable:!0,get:function(){return a[c]}})}:function(s,a,c,d){d===void 0&&(d=c),s[d]=a[c]}),n=et&&et.__setModuleDefault||(Object.create?function(s,a){Object.defineProperty(s,"default",{enumerable:!0,value:a})}:function(s,a){s.default=a}),r=et&&et.__importStar||function(s){if(s&&s.__esModule)return s;var a={};if(s!=null)for(var c in s)c!=="default"&&Object.prototype.hasOwnProperty.call(s,c)&&t(a,s,c);return n(a,s),a},i=et&&et.__exportStar||function(s,a){for(var c in s)c!=="default"&&!Object.prototype.hasOwnProperty.call(a,c)&&t(a,s,c)};Object.defineProperty(e,"__esModule",{value:!0}),e.z=void 0;const o=r(w1);e.z=o,i(w1,e),e.default=o}(v1);const KL={name:"@ton/ton",version:"15.1.0",repository:"https://github.com/ton-org/ton.git",author:"Whales Corp. ",license:"MIT",main:"dist/index.js",files:["dist"],scripts:{docs:"rm -fr docs && typedoc src/index.ts",build:"rm -fr dist && tsc --declaration",test:"jest --verbose --runInBand",release:"yarn build && yarn release-it --npm.yarn1"},devDependencies:{"@release-it/keep-a-changelog":"^5.0.0","@ton/core":"^0.59.0","@ton/crypto":"3.2.0","@ton/emulator":"^2.1.1","@types/jest":"^27.0.1","@types/node":"^16.7.10",buffer:"^6.0.3",expect:"^27.1.0",jest:"^27.1.0","jest-mock":"^27.1.0",karma:"^6.3.4","karma-chrome-launcher":"^3.1.0","karma-jasmine":"^4.0.1","karma-typescript":"^5.5.2","karma-webpack":"^5.0.0",prando:"^6.0.1","release-it":"^17.1.1","ts-jest":"^27.0.5","ts-loader":"^9.2.5","ts-node":"^10.7.0",typedoc:"^0.23.24",typescript:"^5.6.3",webpack:"^5.51.2"},dependencies:{axios:"^1.6.7",dataloader:"^2.0.0","symbol.inspect":"1.0.1",teslabot:"^1.3.0",zod:"^3.21.4"},peerDependencies:{"@ton/core":">=0.59.0","@ton/crypto":">=3.2.0"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},"release-it":{github:{release:!0},plugins:{"@release-it/keep-a-changelog":{filename:"CHANGELOG.md"}}},packageManager:"yarn@3.4.1"};var ax=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.HttpApi=void 0;const qL=bh,lx=ax(c$),ZL=ax(ex),Je=v1,GL=KL.version,lc=Je.z.object({"@type":Je.z.literal("ton.blockIdExt"),workchain:Je.z.number(),shard:Je.z.string(),seqno:Je.z.number(),root_hash:Je.z.string(),file_hash:Je.z.string()}),YL=Je.z.object({balance:Je.z.union([Je.z.number(),Je.z.string()]),state:Je.z.union([Je.z.literal("active"),Je.z.literal("uninitialized"),Je.z.literal("frozen")]),data:Je.z.string(),code:Je.z.string(),last_transaction_id:Je.z.object({"@type":Je.z.literal("internal.transactionId"),lt:Je.z.string(),hash:Je.z.string()}),block_id:lc,sync_utime:Je.z.number()}),JL=Je.z.object({"@type":Je.z.literal("ok")}),QL=Je.z.object({"@type":Je.z.literal("query.fees"),source_fees:Je.z.object({"@type":Je.z.literal("fees"),in_fwd_fee:Je.z.number(),storage_fee:Je.z.number(),gas_fee:Je.z.number(),fwd_fee:Je.z.number()})}),XL=Je.z.object({gas_used:Je.z.number(),exit_code:Je.z.number(),stack:Je.z.array(Je.z.unknown())}),eU=Je.z.union([Je.z.object({"@type":Je.z.literal("msg.dataRaw"),body:Je.z.string()}),Je.z.object({"@type":Je.z.literal("msg.dataText"),text:Je.z.string()}),Je.z.object({"@type":Je.z.literal("msg.dataDecryptedText"),text:Je.z.string()}),Je.z.object({"@type":Je.z.literal("msg.dataEncryptedText"),text:Je.z.string()})]),cx=Je.z.object({source:Je.z.string(),destination:Je.z.string(),value:Je.z.string(),fwd_fee:Je.z.string(),ihr_fee:Je.z.string(),created_lt:Je.z.string(),body_hash:Je.z.string(),msg_data:eU,message:Je.z.string().optional()}),x1=Je.z.object({data:Je.z.string(),utime:Je.z.number(),transaction_id:Je.z.object({lt:Je.z.string(),hash:Je.z.string()}),fee:Je.z.string(),storage_fee:Je.z.string(),other_fee:Je.z.string(),in_msg:Je.z.union([Je.z.undefined(),cx]),out_msgs:Je.z.array(cx)}),ux=Je.z.array(x1),tU=Je.z.object({state_root_hash:Je.z.string(),last:lc,init:lc}),nU=Je.z.object({shards:Je.z.array(lc)}),rU=Je.z.object({"@type":Je.z.literal("blocks.shortTxId"),mode:Je.z.number(),account:Je.z.string(),lt:Je.z.string(),hash:Je.z.string()}),dx=Je.z.object({id:lc,req_count:Je.z.number(),incomplete:Je.z.boolean(),transactions:Je.z.array(rU)});class fx{constructor(t,n,r,i){this.namespace=t,this.cache=n,this.codec=r,this.keyEncoder=i}async get(t){let n=await this.cache.get(this.namespace,this.keyEncoder(t));if(n){let r=this.codec.safeParse(JSON.parse(n));if(r.success)return r.data}return null}async set(t,n){n!==null?await this.cache.set(this.namespace,this.keyEncoder(t),JSON.stringify(n)):await this.cache.set(this.namespace,this.keyEncoder(t),null)}}class iU{constructor(t,n){this.endpoint=t,this.cache=new qL.InMemoryCache,this.parameters={timeout:(n==null?void 0:n.timeout)||3e4,apiKey:n==null?void 0:n.apiKey,adapter:n==null?void 0:n.adapter},this.shardCache=new fx("ton-shard",this.cache,Je.z.array(lc),r=>r+""),this.shardLoader=new lx.default(async r=>await Promise.all(r.map(async i=>{const o=await this.shardCache.get(i);if(o)return o;let s=(await this.doCall("shards",{seqno:i},nU)).shards;return await this.shardCache.set(i,s),s}))),this.shardTransactionsCache=new fx("ton-shard-tx",this.cache,dx,r=>r.workchain+":"+r.shard+":"+r.seqno),this.shardTransactionsLoader=new lx.default(async r=>await Promise.all(r.map(async i=>{const o=await this.shardTransactionsCache.get(i);if(o)return o;let s=await this.doCall("getBlockTransactions",{workchain:i.workchain,seqno:i.seqno,shard:i.shard},dx);return await this.shardTransactionsCache.set(i,s),s})),{cacheKeyFn:r=>r.workchain+":"+r.shard+":"+r.seqno})}getAddressInformation(t){return this.doCall("getAddressInformation",{address:t.toString()},YL)}async getTransactions(t,n){const r=n.inclusive;delete n.inclusive;let i;n.hash&&(i=Ne.from(n.hash,"base64").toString("hex"));let o=n.limit;n.hash&&n.lt&&r!==!0&&o++;let s=await this.doCall("getTransactions",{address:t.toString(),...n,limit:o,hash:i},ux);return s.length>o&&(s=s.slice(0,o)),n.hash&&n.lt&&r!==!0&&s.shift(),s}async getMasterchainInfo(){return await this.doCall("getMasterchainInfo",{},tU)}async getShards(t){return await this.shardLoader.load(t)}async getBlockTransactions(t,n,r){return await this.shardTransactionsLoader.load({workchain:t,seqno:n,shard:r})}async getTransaction(t,n,r){let i=Ne.from(r,"base64").toString("hex"),s=(await this.doCall("getTransactions",{address:t.toString(),lt:n,hash:i,limit:1},ux)).find(a=>a.transaction_id.lt===n&&a.transaction_id.hash===r);return s||null}async callGetMethod(t,n,r){return await this.doCall("runGetMethod",{address:t.toString(),method:n,stack:oU(r)},XL)}async sendBoc(t){await this.doCall("sendBoc",{boc:t.toString("base64")},JL)}async estimateFee(t,n){return await this.doCall("estimateFee",{address:t.toString(),body:n.body.toBoc().toString("base64"),init_data:n.initData?n.initData.toBoc().toString("base64"):"",init_code:n.initCode?n.initCode.toBoc().toString("base64"):"",ignore_chksig:n.ignoreSignature},QL)}async tryLocateResultTx(t,n,r){return await this.doCall("tryLocateResultTx",{source:t.toString(),destination:n.toString(),created_lt:r},x1)}async tryLocateSourceTx(t,n,r){return await this.doCall("tryLocateSourceTx",{source:t.toString(),destination:n.toString(),created_lt:r},x1)}async doCall(t,n,r){let i={"Content-Type":"application/json","X-Ton-Client-Version":GL};this.parameters.apiKey&&(i["X-API-Key"]=this.parameters.apiKey);let o=await ZL.default.post(this.endpoint,JSON.stringify({id:"1",jsonrpc:"2.0",method:t,params:n}),{headers:i,timeout:this.parameters.timeout,adapter:this.parameters.adapter});if(o.status!==200||!o.data.ok)throw Error("Received error: "+JSON.stringify(o.data));let s=r.safeParse(o.data.result);if(s.success)return s.data;throw Error("Malformed response: "+s.error.format()._errors.join(", "))}}Ru.HttpApi=iU;function oU(e){let t=[];for(let n of e)if(n.type==="int")t.push(["num",n.value.toString()]);else if(n.type==="cell")t.push(["tvm.Cell",n.cell.toBoc().toString("base64")]);else if(n.type==="slice")t.push(["tvm.Slice",n.cell.toBoc().toString("base64")]);else if(n.type==="builder")t.push(["tvm.Builder",n.cell.toBoc().toString("base64")]);else throw Error("Unsupported stack item type: "+n.type);return t}var Mh={};Object.defineProperty(Mh,"__esModule",{value:!0}),Mh.TonClient=void 0;const sU=Ru,Ln=$n;class aU{constructor(t){this.parameters={endpoint:t.endpoint},this.api=new sU.HttpApi(this.parameters.endpoint,{timeout:t.timeout,apiKey:t.apiKey,adapter:t.httpAdapter})}async getBalance(t){return(await this.getContractState(t)).balance}async runMethod(t,n,r=[]){let i=await this.api.callGetMethod(t,n,r);if(i.exit_code!==0)throw Error("Unable to execute get method. Got exit_code: "+i.exit_code);return{gas_used:i.gas_used,stack:hx(i.stack)}}async callGetMethod(t,n,r=[]){return this.runMethod(t,n,r)}async runMethodWithError(t,n,r=[]){let i=await this.api.callGetMethod(t,n,r);return{gas_used:i.gas_used,stack:hx(i.stack),exit_code:i.exit_code}}async callGetMethodWithError(t,n,r=[]){return this.runMethodWithError(t,n,r)}async getTransactions(t,n){let r=await this.api.getTransactions(t,n),i=[];for(let o of r)i.push((0,Ln.loadTransaction)(Ln.Cell.fromBoc(Ne.from(o.data,"base64"))[0].beginParse()));return i}async getTransaction(t,n,r){let i=await this.api.getTransaction(t,n,r);return i?(0,Ln.loadTransaction)(Ln.Cell.fromBoc(Ne.from(i.data,"base64"))[0].beginParse()):null}async tryLocateResultTx(t,n,r){let i=await this.api.tryLocateResultTx(t,n,r);return(0,Ln.loadTransaction)(Ln.Cell.fromBase64(i.data).beginParse())}async tryLocateSourceTx(t,n,r){let i=await this.api.tryLocateSourceTx(t,n,r);return(0,Ln.loadTransaction)(Ln.Cell.fromBase64(i.data).beginParse())}async getMasterchainInfo(){let t=await this.api.getMasterchainInfo();return{workchain:t.init.workchain,shard:t.last.shard,initSeqno:t.init.seqno,latestSeqno:t.last.seqno}}async getWorkchainShards(t){return(await this.api.getShards(t)).map(r=>({workchain:r.workchain,shard:r.shard,seqno:r.seqno}))}async getShardTransactions(t,n,r){let i=await this.api.getBlockTransactions(t,n,r);if(i.incomplete)throw Error("Unsupported");return i.transactions.map(o=>({account:Ln.Address.parseRaw(o.account),lt:o.lt,hash:o.hash}))}async sendMessage(t){const n=(0,Ln.beginCell)().store((0,Ln.storeMessage)(t)).endCell().toBoc();await this.api.sendBoc(n)}async sendFile(t){await this.api.sendBoc(t)}async estimateExternalMessageFee(t,n){return await this.api.estimateFee(t,{body:n.body,initCode:n.initCode,initData:n.initData,ignoreSignature:n.ignoreSignature})}async sendExternalMessage(t,n){if(await this.isContractDeployed(t.address)||!t.init){const r=(0,Ln.external)({to:t.address,body:n});await this.sendMessage(r)}else{const r=(0,Ln.external)({to:t.address,init:t.init,body:n});await this.sendMessage(r)}}async isContractDeployed(t){return(await this.getContractState(t)).state==="active"}async getContractState(t){let n=await this.api.getAddressInformation(t),r=BigInt(n.balance),i=n.state;return{balance:r,state:i,code:n.code!==""?Ne.from(n.code,"base64"):null,data:n.data!==""?Ne.from(n.data,"base64"):null,lastTransaction:n.last_transaction_id.lt!=="0"?{lt:n.last_transaction_id.lt,hash:n.last_transaction_id.hash}:null,blockId:{workchain:n.block_id.workchain,shard:n.block_id.shard,seqno:n.block_id.seqno},timestampt:n.sync_utime}}open(t){return(0,Ln.openContract)(t,n=>C1(this,n.address,n.init))}provider(t,n){return C1(this,t,n??null)}}Mh.TonClient=aU;function ll(e){const t=e["@type"];switch(t){case"tvm.list":case"tvm.tuple":return e.elements.map(ll);case"tvm.cell":return Ln.Cell.fromBoc(Ne.from(e.bytes,"base64"))[0];case"tvm.slice":return Ln.Cell.fromBoc(Ne.from(e.bytes,"base64"))[0];case"tvm.stackEntryCell":return ll(e.cell);case"tvm.stackEntrySlice":return ll(e.slice);case"tvm.stackEntryTuple":return ll(e.tuple);case"tvm.stackEntryList":return ll(e.list);case"tvm.stackEntryNumber":return ll(e.number);case"tvm.numberDecimal":return BigInt(e.number);default:throw Error("Unsupported item type: "+t)}}function lU(e){if(e[0]==="num"){let t=e[1];return t.startsWith("-")?{type:"int",value:-BigInt(t.slice(1))}:{type:"int",value:BigInt(t)}}else{if(e[0]==="null")return{type:"null"};if(e[0]==="cell")return{type:"cell",cell:Ln.Cell.fromBoc(Ne.from(e[1].bytes,"base64"))[0]};if(e[0]==="slice")return{type:"slice",cell:Ln.Cell.fromBoc(Ne.from(e[1].bytes,"base64"))[0]};if(e[0]==="builder")return{type:"builder",cell:Ln.Cell.fromBoc(Ne.from(e[1].bytes,"base64"))[0]};if(e[0]==="tuple"||e[0]==="list")return e[1].elements.length===0?{type:"null"}:{type:"tuple",items:e[1].elements.map(ll)};throw Error("Unsupported stack item type: "+e[0])}}function hx(e){let t=[];for(let n of e)t.push(lU(n));return new Ln.TupleReader(t)}function C1(e,t,n){return{async getState(){let r=await e.getContractState(t),i=r.balance,o=r.lastTransaction?{lt:BigInt(r.lastTransaction.lt),hash:Ne.from(r.lastTransaction.hash,"base64")}:null,s;if(r.state==="active")s={type:"active",code:r.code?r.code:null,data:r.data?r.data:null};else if(r.state==="uninitialized")s={type:"uninit"};else if(r.state==="frozen")s={type:"frozen",stateHash:Ne.alloc(0)};else throw Error("Unsupported state");return{balance:i,last:o,state:s}},async get(r,i){if(typeof r!="string")throw new Error("Method name must be a string for TonClient provider");return{stack:(await e.runMethod(t,r,i)).stack}},async external(r){let i=null;n&&!await e.isContractDeployed(t)&&(i=n);const o=(0,Ln.external)({to:t,init:i,body:r});let s=(0,Ln.beginCell)().store((0,Ln.storeMessage)(o)).endCell().toBoc();await e.sendFile(s)},async internal(r,i){let o=null;n&&!await e.isContractDeployed(t)&&(o=n);let s=!0;i.bounce!==null&&i.bounce!==void 0&&(s=i.bounce);let a;typeof i.value=="string"?a=(0,Ln.toNano)(i.value):a=i.value;let c=null;typeof i.body=="string"?c=(0,Ln.comment)(i.body):i.body&&(c=i.body),await r.send({to:t,value:a,bounce:s,sendMode:i.sendMode,init:o,body:c})},open(r){return(0,Ln.openContract)(r,i=>C1(e,i.address,i.init??null))},getTransactions(r,i,o,s){return e.getTransactions(r,{limit:s??100,lt:i.toString(),hash:o.toString("base64"),inclusive:!0})}}}var Rh={},S1={};Object.defineProperty(S1,"__esModule",{value:!0}),S1.toUrlSafe=cU;function cU(e){for(;e.indexOf("/")>=0;)e=e.replace("/","_");for(;e.indexOf("+")>=0;)e=e.replace("+","-");for(;e.indexOf("=")>=0;)e=e.replace("=","");return e}var Oh=et&&et.__classPrivateFieldSet||function(e,t,n,r,i){if(r==="m")throw new TypeError("Private method is not writable");if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return r==="a"?i.call(e,n):i?i.value=n:t.set(e,n),n},jt=et&&et.__classPrivateFieldGet||function(e,t,n,r){if(n==="a"&&!r)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?r:n==="a"?r.call(e):r?r.value:t.get(e)},uU=et&&et.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},ii,oi,si,Vr;Object.defineProperty(Rh,"__esModule",{value:!0}),Rh.TonClient4=void 0;const dU=uU(ex),Wr=$n,k1=S1,ie=v1;class fU{constructor(t){ii.set(this,void 0),oi.set(this,void 0),si.set(this,void 0),Vr.set(this,void 0),Oh(this,Vr,dU.default.create(),"f"),Oh(this,ii,t.endpoint,"f"),Oh(this,oi,t.timeout||5e3,"f"),Oh(this,si,t.httpAdapter,"f"),t.requestInterceptor&&jt(this,Vr,"f").interceptors.request.use(t.requestInterceptor)}async getLastBlock(){let t=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/latest",{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),n=hU.safeParse(t.data);if(!n.success)throw Error("Mailformed response: "+n.error.format()._errors.join(", "));return n.data}async getBlock(t){let n=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/"+t,{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),r=px.safeParse(n.data);if(!r.success)throw Error("Mailformed response");if(!r.data.exist)throw Error("Block is out of scope");return r.data.block}async getBlockByUtime(t){let n=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/utime/"+t,{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),r=px.safeParse(n.data);if(!r.success)throw Error("Mailformed response");if(!r.data.exist)throw Error("Block is out of scope");return r.data.block}async getAccount(t,n){let r=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0}),{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),i=pU.safeParse(r.data);if(!i.success)throw Error("Mailformed response");return i.data}async getAccountLite(t,n){let r=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/lite",{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),i=gU.safeParse(r.data);if(!i.success)throw Error("Mailformed response");return i.data}async isContractDeployed(t,n){return(await this.getAccountLite(t,n)).account.state.type==="active"}async isAccountChanged(t,n,r){let i=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/changed/"+r.toString(10),{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),o=mU.safeParse(i.data);if(!o.success)throw Error("Mailformed response");return o.data}async getAccountTransactions(t,n,r){let i=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/account/"+t.toString({urlSafe:!0})+"/tx/"+n.toString(10)+"/"+(0,k1.toUrlSafe)(r.toString("base64")),{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),o=wU.safeParse(i.data);if(!o.success)throw Error("Mailformed response");let s=o.data,a=[],c=Wr.Cell.fromBoc(Ne.from(s.boc,"base64"));for(let d=0;d0&&(r="/"+[...n].sort().join(","));let i=await jt(this,Vr,"f").get(jt(this,ii,"f")+"/block/"+t+"/config"+r,{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),o=bU.safeParse(i.data);if(!o.success)throw Error("Mailformed response");return o.data}async runMethod(t,n,r,i){let o=i&&i.length>0?"/"+(0,k1.toUrlSafe)((0,Wr.serializeTuple)(i).toBoc({idx:!1,crc32:!1}).toString("base64")):"",s=jt(this,ii,"f")+"/block/"+t+"/"+n.toString({urlSafe:!0})+"/run/"+encodeURIComponent(r)+o,a=await jt(this,Vr,"f").get(s,{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")}),c=yU.safeParse(a.data);if(!c.success)throw Error("Mailformed response");let d=c.data.resultRaw?(0,Wr.parseTuple)(Wr.Cell.fromBoc(Ne.from(c.data.resultRaw,"base64"))[0]):[];return{exitCode:c.data.exitCode,result:d,resultRaw:c.data.resultRaw,block:c.data.block,shardBlock:c.data.shardBlock,reader:new Wr.TupleReader(d)}}async sendMessage(t){let n=await jt(this,Vr,"f").post(jt(this,ii,"f")+"/send",{boc:t.toString("base64")},{adapter:jt(this,si,"f"),timeout:jt(this,oi,"f")});if(!vU.safeParse(n.data).success)throw Error("Mailformed response");return{status:n.data.status}}open(t){return(0,Wr.openContract)(t,n=>Du(this,null,n.address,n.init))}openAt(t,n){return(0,Wr.openContract)(n,r=>Du(this,t,r.address,r.init))}provider(t,n){return Du(this,null,t,n??null)}providerAt(t,n,r){return Du(this,t,n,r??null)}}Rh.TonClient4=fU,ii=new WeakMap,oi=new WeakMap,si=new WeakMap,Vr=new WeakMap;function Du(e,t,n,r){return{async getState(){let i=t;i===null&&(i=(await e.getLastBlock()).last.seqno);let o=await e.getAccount(i,n),s=o.account.last?{lt:BigInt(o.account.last.lt),hash:Ne.from(o.account.last.hash,"base64")}:null,a;if(o.account.state.type==="active")a={type:"active",code:o.account.state.code?Ne.from(o.account.state.code,"base64"):null,data:o.account.state.data?Ne.from(o.account.state.data,"base64"):null};else if(o.account.state.type==="uninit")a={type:"uninit"};else if(o.account.state.type==="frozen")a={type:"frozen",stateHash:Ne.from(o.account.state.stateHash,"base64")};else throw Error("Unsupported state");return{balance:BigInt(o.account.balance.coins),last:s,state:a}},async get(i,o){if(typeof i!="string")throw new Error("Method name must be a string for TonClient4 provider");let s=t;s===null&&(s=(await e.getLastBlock()).last.seqno);let a=await e.runMethod(s,n,i,o);if(a.exitCode!==0&&a.exitCode!==1)throw Error("Exit code: "+a.exitCode);return{stack:new Wr.TupleReader(a.result)}},async external(i){let o=await e.getLastBlock(),s=null;r&&(await e.getAccountLite(o.last.seqno,n)).account.state.type!=="active"&&(s=r);const a=(0,Wr.external)({to:n,init:s,body:i});let c=(0,Wr.beginCell)().store((0,Wr.storeMessage)(a)).endCell().toBoc();await e.sendMessage(c)},async internal(i,o){let s=await e.getLastBlock(),a=null;r&&(await e.getAccountLite(s.last.seqno,n)).account.state.type!=="active"&&(a=r);let c=!0;o.bounce!==null&&o.bounce!==void 0&&(c=o.bounce);let d;typeof o.value=="string"?d=(0,Wr.toNano)(o.value):d=o.value;let f=null;typeof o.body=="string"?f=(0,Wr.comment)(o.body):o.body&&(f=o.body),await i.send({to:n,value:d,bounce:c,sendMode:o.sendMode,init:a,body:f})},open(i){return(0,Wr.openContract)(i,o=>Du(e,t,o.address,o.init??null))},async getTransactions(i,o,s,a){const c=typeof a=="number";if(c&&a<=0)return[];let d=[];do{const f=await e.getAccountTransactions(i,o,s),p=f[0].tx,[g,b]=[p.lt,p.hash()];if(d.length>0&&g===o&&b.equals(s)&&f.shift(),f.length===0)break;const S=f[f.length-1].tx,[k,I]=[S.lt,S.hash()];if(k===o&&I.equals(s))break;d.push(...f.map(B=>B.tx)),o=k,s=I}while(c&&d.lengthd===i))==null?void 0:a[0];if(s===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${i}`);return{networkGlobalId:n,workchain:r,walletVersion:s,subwalletNumber:o}}function IU(e){return t=>{t.storeInt(e.networkGlobalId,32),t.storeInt(e.workchain,8),t.storeUint(wx[e.walletVersion],8),t.storeUint(e.subwalletNumber,32)}}var _x;function xx(){if(_x)return ju;_x=1,Object.defineProperty(ju,"__esModule",{value:!0}),ju.WalletContractV5Beta=void 0;const e=$n,t=_o(),n=Fu;class r{static create(o){var a,c,d,f;const s={networkGlobalId:((a=o.walletId)==null?void 0:a.networkGlobalId)??-239,workchain:((c=o==null?void 0:o.walletId)==null?void 0:c.workchain)??0,subwalletNumber:((d=o==null?void 0:o.walletId)==null?void 0:d.subwalletNumber)??0,walletVersion:((f=o==null?void 0:o.walletId)==null?void 0:f.walletVersion)??"v5"};return new r(s,o.publicKey)}constructor(o,s){this.walletId=o,this.publicKey=s,this.walletId=o;let a=e.Cell.fromBoc(Ne.from("te6cckEBAQEAIwAIQgLkzzsvTG1qYeoPK1RH0mZ4WyavNjfbLe7mvNGqgm80Eg3NjhE=","base64"))[0],c=(0,e.beginCell)().storeInt(0,33).store((0,n.storeWalletIdV5Beta)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:a,data:c},this.address=(0,e.contractAddress)(this.walletId.workchain,{code:a,data:c})}async getBalance(o){return(await o.getState()).balance}async getSeqno(o){return(await o.getState()).state.type==="active"?(await o.get("seqno",[])).stack.readNumber():0}async getExtensions(o){return(await o.getState()).state.type==="active"?(await o.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(o){const s=await this.getExtensions(o);if(!s)return[];const a=e.Dictionary.loadDirect(e.Dictionary.Keys.BigUint(256),e.Dictionary.Values.BigInt(8),s);return a.keys().map(c=>{const d=a.get(c),f=c^d+1n;return e.Address.parseRaw(`${d}:${f.toString(16).padStart(64,"0")}`)})}async getIsSecretKeyAuthEnabled(o){return(await o.get("get_is_signature_auth_allowed",[])).stack.readNumber()!==0}async send(o,s){await o.external(s)}async sendTransfer(o,s){const a=await this.createTransfer(s);await this.send(o,a)}async sendAddExtension(o,s){const a=await this.createAddExtension(s);await this.send(o,a)}async sendRemoveExtension(o,s){const a=await this.createRemoveExtension(s);await this.send(o,a)}async sendActionsBatch(o,s){const a=await this.createRequest(s);await this.send(o,a)}createActions(o){return o.messages.map(a=>({type:"sendMsg",mode:o.sendMode,outMsg:a}))}createTransfer(o){return this.createRequest({...o,actions:this.createActions({messages:o.messages,sendMode:o.sendMode})})}createAddExtension(o){return this.createRequest({...o,actions:[{type:"addExtension",address:o.extensionAddress}]})}createRemoveExtension(o){return this.createRequest({...o,actions:[{type:"removeExtension",address:o.extensionAddress}]})}createRequest(o){return o.authType==="extension"?(0,t.createWalletTransferV5Beta)(o):(0,t.createWalletTransferV5Beta)({...o,walletId:(0,n.storeWalletIdV5Beta)(this.walletId)})}sender(o,s){return{send:async a=>{let c=await this.getSeqno(o),d=this.createTransfer({seqno:c,secretKey:s,sendMode:a.sendMode??e.SendMode.PAY_GAS_SEPARATELY+e.SendMode.IGNORE_ERRORS,messages:[(0,e.internal)({to:a.to,value:a.value,init:a.init,body:a.body,bounce:a.bounce})]});await this.send(o,d)}}}}return ju.WalletContractV5Beta=r,r.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396},ju}var cl={},zu={};Object.defineProperty(zu,"__esModule",{value:!0}),zu.isOutActionExtended=Cx,zu.isOutActionBasic=MU;function Cx(e){return e.type==="setIsPublicKeyEnabled"||e.type==="addExtension"||e.type==="removeExtension"}function MU(e){return!Cx(e)}Object.defineProperty(cl,"__esModule",{value:!0}),cl.storeOutActionExtendedV5Beta=Tx,cl.loadOutActionV5BetaExtended=Px,cl.storeOutListExtendedV5Beta=Bx,cl.loadOutListExtendedV5Beta=LU;const Lh=$n,Sx=zu,kx=550222170;function RU(e){return t=>{t.storeUint(kx,32).storeUint(e.isEnabled?1:0,1)}}const Ax=474012575;function OU(e){return t=>{t.storeUint(Ax,32).storeAddress(e.address)}}const Ex=1588524196;function $U(e){return t=>{t.storeUint(Ex,32).storeAddress(e.address)}}function Tx(e){switch(e.type){case"setIsPublicKeyEnabled":return RU(e);case"addExtension":return OU(e);case"removeExtension":return $U(e);default:throw new Error("Unknown action type"+(e==null?void 0:e.type))}}function Px(e){const t=e.loadUint(32);switch(t){case kx:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case Ax:return{type:"addExtension",address:e.loadAddress()};case Ex:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}function Bx(e){const[t,...n]=e;if(!t||!(0,Sx.isOutActionExtended)(t)){if(e.some(Sx.isOutActionExtended))throw new Error("Can't serialize actions list: all extended actions must be placed before out actions");return r=>{r.storeUint(0,1).storeRef((0,Lh.beginCell)().store((0,Lh.storeOutList)(e)).endCell())}}return r=>{r.storeUint(1,1).store(Tx(t)).storeRef((0,Lh.beginCell)().store(Bx(n)).endCell())}}function LU(e){const t=[];for(;e.loadUint(1);){const r=Px(e);t.push(r),e=e.loadRef().beginParse()}const n=(0,Lh.loadOutList)(e.loadRef().beginParse());if(n.some(r=>r.type==="setCode"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5");return t.concat(n)}var E1={};Object.defineProperty(E1,"__esModule",{value:!0}),E1.signPayload=NU;const UU=Ma();function NU(e,t,n){return"secretKey"in e?n((0,UU.sign)(t.endCell().hash(),e.secretKey),t):e.signer(t.endCell()).then(r=>n(r,t))}var Vu={},cc={};Object.defineProperty(cc,"__esModule",{value:!0}),cc.isWalletIdV5R1ClientContext=Ix,cc.loadWalletIdV5R1=DU,cc.storeWalletIdV5R1=jU;const uc=$n;function Ix(e){return typeof e!="number"}const Mx={v5r1:0};function DU(e,t){var s;const n=new uc.BitReader(new uc.BitString(typeof e=="bigint"?Ne.from(e.toString(16),"hex"):e instanceof uc.Slice?e.loadBuffer(4):e,0,32)).loadInt(32),r=BigInt(n)^BigInt(t),i=(0,uc.beginCell)().storeInt(r,32).endCell().beginParse();if(i.loadUint(1)){const a=i.loadInt(8),c=i.loadUint(8),d=i.loadUint(15),f=(s=Object.entries(Mx).find(([p,g])=>g===c))==null?void 0:s[0];if(f===void 0)throw new Error(`Can't deserialize walletId: unknown wallet version ${c}`);return{networkGlobalId:t,context:{walletVersion:f,workchain:a,subwalletNumber:d}}}else{const a=i.loadUint(31);return{networkGlobalId:t,context:a}}}function jU(e){return t=>{let n;return Ix(e.context)?n=(0,uc.beginCell)().storeUint(1,1).storeInt(e.context.workchain,8).storeUint(Mx[e.context.walletVersion],8).storeUint(e.context.subwalletNumber,15).endCell().beginParse().loadInt(32):n=(0,uc.beginCell)().storeUint(0,1).storeUint(e.context,31).endCell().beginParse().loadInt(32),t.storeInt(BigInt(e.networkGlobalId)^BigInt(n),32)}}var Rx;function Ox(){if(Rx)return Vu;Rx=1,Object.defineProperty(Vu,"__esModule",{value:!0}),Vu.WalletContractV5R1=void 0;const e=$n,t=_o(),n=cc;class r{static create(o){var a,c,d;let s=0;return"workchain"in o&&o.workchain!=null&&(s=o.workchain),(a=o.walletId)!=null&&a.context&&(0,n.isWalletIdV5R1ClientContext)(o.walletId.context)&&o.walletId.context.workchain!=null&&(s=o.walletId.context.workchain),new r(s,o.publicKey,{networkGlobalId:((c=o.walletId)==null?void 0:c.networkGlobalId)??-239,context:((d=o.walletId)==null?void 0:d.context)??{workchain:0,walletVersion:"v5r1",subwalletNumber:0}})}constructor(o,s,a){this.publicKey=s,this.walletId=a,this.walletId=a;let c=e.Cell.fromBoc(Ne.from("b5ee9c7241021401000281000114ff00f4a413f4bcf2c80b01020120020d020148030402dcd020d749c120915b8f6320d70b1f2082106578746ebd21821073696e74bdb0925f03e082106578746eba8eb48020d72101d074d721fa4030fa44f828fa443058bd915be0ed44d0810141d721f4058307f40e6fa1319130e18040d721707fdb3ce03120d749810280b99130e070e2100f020120050c020120060902016e07080019adce76a2684020eb90eb85ffc00019af1df6a2684010eb90eb858fc00201480a0b0017b325fb51341c75c875c2c7e00011b262fb513435c280200019be5f0f6a2684080a0eb90fa02c0102f20e011e20d70b1f82107369676ebaf2e08a7f0f01e68ef0eda2edfb218308d722028308d723208020d721d31fd31fd31fed44d0d200d31f20d31fd3ffd70a000af90140ccf9109a28945f0adb31e1f2c087df02b35007b0f2d0845125baf2e0855036baf2e086f823bbf2d0882292f800de01a47fc8ca00cb1f01cf16c9ed542092f80fde70db3cd81003f6eda2edfb02f404216e926c218e4c0221d73930709421c700b38e2d01d72820761e436c20d749c008f2e09320d74ac002f2e09320d71d06c712c2005230b0f2d089d74cd7393001a4e86c128407bbf2e093d74ac000f2e093ed55e2d20001c000915be0ebd72c08142091709601d72c081c12e25210b1e30f20d74a111213009601fa4001fa44f828fa443058baf2e091ed44d0810141d718f405049d7fc8ca0040048307f453f2e08b8e14038307f45bf2e08c22d70a00216e01b3b0f2d090e2c85003cf1612f400c9ed54007230d72c08248e2d21f2e092d200ed44d0d2005113baf2d08f54503091319c01810140d721d70a00f2e08ee2c8ca0058cf16c9ed5493f2c08de20010935bdb31e1d74cd0b4d6c35e","hex"))[0],d=(0,e.beginCell)().storeUint(1,1).storeUint(0,32).store((0,n.storeWalletIdV5R1)(this.walletId)).storeBuffer(this.publicKey,32).storeBit(0).endCell();this.init={code:c,data:d},this.address=(0,e.contractAddress)(o,{code:c,data:d})}async getBalance(o){return(await o.getState()).balance}async getSeqno(o){return(await o.getState()).state.type==="active"?(await o.get("seqno",[])).stack.readNumber():0}async getExtensions(o){return(await o.getState()).state.type==="active"?(await o.get("get_extensions",[])).stack.readCellOpt():null}async getExtensionsArray(o){const s=await this.getExtensions(o);return s?e.Dictionary.loadDirect(e.Dictionary.Keys.BigUint(256),e.Dictionary.Values.BigInt(1),s).keys().map(c=>{const d=this.address.workChain;return e.Address.parseRaw(`${d}:${c.toString(16).padStart(64,"0")}`)}):[]}async getIsSecretKeyAuthEnabled(o){return(await o.get("is_signature_allowed",[])).stack.readBoolean()}async send(o,s){await o.external(s)}async sendTransfer(o,s){const a=await this.createTransfer(s);await this.send(o,a)}async sendAddExtension(o,s){const a=await this.createAddExtension(s);await this.send(o,a)}async sendRemoveExtension(o,s){const a=await this.createRemoveExtension(s);await this.send(o,a)}createActions(o){return o.messages.map(a=>({type:"sendMsg",mode:o.sendMode,outMsg:a}))}createTransfer(o){return this.createRequest({actions:this.createActions({messages:o.messages,sendMode:o.sendMode}),...o})}createAddExtension(o){return this.createRequest({actions:[{type:"addExtension",address:o.extensionAddress}],...o})}createRemoveExtension(o){return this.createRequest({actions:[{type:"removeExtension",address:o.extensionAddress}],...o})}createRequest(o){return o.authType==="extension"?(0,t.createWalletTransferV5R1)(o):(0,t.createWalletTransferV5R1)({...o,walletId:(0,n.storeWalletIdV5R1)(this.walletId)})}sender(o,s){return{send:async a=>{let c=await this.getSeqno(o),d=this.createTransfer({seqno:c,secretKey:s,sendMode:a.sendMode??e.SendMode.PAY_GAS_SEPARATELY+e.SendMode.IGNORE_ERRORS,messages:[(0,e.internal)({to:a.to,value:a.value,init:a.init,body:a.body,bounce:a.bounce})]});await this.send(o,d)}}}}return Vu.WalletContractV5R1=r,r.OpCodes={auth_extension:1702392942,auth_signed_external:1936287598,auth_signed_internal:1936289396},Vu}var Yo={};Object.defineProperty(Yo,"__esModule",{value:!0}),Yo.storeOutActionExtendedV5R1=T1,Yo.loadOutActionExtendedV5R1=P1,Yo.storeOutListExtendedV5R1=WU,Yo.loadOutListExtendedV5R1=HU,Yo.toSafeV5R1SendMode=jx,Yo.patchV5R1ActionsSendMode=KU;const Wu=$n,$x=zu,Lx=4;function FU(e){return t=>{t.storeUint(Lx,8).storeUint(e.isEnabled?1:0,1)}}const Ux=2;function zU(e){return t=>{t.storeUint(Ux,8).storeAddress(e.address)}}const Nx=3;function VU(e){return t=>{t.storeUint(Nx,8).storeAddress(e.address)}}function T1(e){switch(e.type){case"setIsPublicKeyEnabled":return FU(e);case"addExtension":return zU(e);case"removeExtension":return VU(e);default:throw new Error("Unknown action type"+(e==null?void 0:e.type))}}function P1(e){const t=e.loadUint(8);switch(t){case Lx:return{type:"setIsPublicKeyEnabled",isEnabled:!!e.loadUint(1)};case Ux:return{type:"addExtension",address:e.loadAddress()};case Nx:return{type:"removeExtension",address:e.loadAddress()};default:throw new Error(`Unknown extended out action tag 0x${t.toString(16)}`)}}function WU(e){const t=e.filter($x.isOutActionExtended),n=e.filter($x.isOutActionBasic);return r=>{const i=n.length?(0,Wu.beginCell)().store((0,Wu.storeOutList)(n.slice().reverse())):null;if(r.storeMaybeRef(i),t.length===0)r.storeUint(0,1);else{const[o,...s]=t;r.storeUint(1,1).store(T1(o)),s.length>0&&r.storeRef(Dx(s))}}}function Dx(e){const[t,...n]=e;let r=(0,Wu.beginCell)().store(T1(t));return n.length>0&&(r=r.storeRef(Dx(n))),r.endCell()}function HU(e){const t=[],n=e.loadMaybeRef();if(n){const r=(0,Wu.loadOutList)(n.beginParse());if(r.some(i=>i.type!=="sendMsg"))throw new Error("Can't deserialize actions list: only sendMsg actions are allowed for wallet v5r1");t.push(...r)}if(e.loadBoolean()){const r=P1(e);t.push(r)}for(;e.remainingRefs>0;){e=e.loadRef().beginParse();const r=P1(e);t.push(r)}return t}function jx(e,t){return t==="internal"||t==="extension"?e:e|Wu.SendMode.IGNORE_ERRORS}function KU(e,t){return e.map(n=>n.type==="sendMsg"?{...n,mode:jx(n.mode,t)}:n)}var Fx;function _o(){if(Fx)return Go;Fx=1,Object.defineProperty(Go,"__esModule",{value:!0}),Go.createWalletTransferV1=d,Go.createWalletTransferV2=f,Go.createWalletTransferV3=p,Go.createWalletTransferV4=g,Go.createWalletTransferV5Beta=b,Go.createWalletTransferV5R1=_;const e=$n,t=Ma(),n=xx(),r=cl,i=E1,o=Ox(),s=Yo;function a(S,k){return(0,e.beginCell)().storeBuffer(S).storeBuilder(k).endCell()}function c(S,k){return(0,e.beginCell)().storeBuilder(k).storeBuffer(S).endCell()}function d(S){let k=(0,e.beginCell)().storeUint(S.seqno,32);S.message&&(k.storeUint(S.sendMode,8),k.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(S.message))));let I=(0,t.sign)(k.endCell().hash(),S.secretKey);return(0,e.beginCell)().storeBuffer(I).storeBuilder(k).endCell()}function f(S){if(S.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let k=(0,e.beginCell)().storeUint(S.seqno,32);if(S.seqno===0)for(let R=0;R<32;R++)k.storeBit(1);else k.storeUint(S.timeout||Math.floor(Date.now()/1e3)+60,32);for(let R of S.messages)k.storeUint(S.sendMode,8),k.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(R)));let I=(0,t.sign)(k.endCell().hash(),S.secretKey);return(0,e.beginCell)().storeBuffer(I).storeBuilder(k).endCell()}function p(S){if(S.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let k=(0,e.beginCell)().storeUint(S.walletId,32);if(S.seqno===0)for(let I=0;I<32;I++)k.storeBit(1);else k.storeUint(S.timeout||Math.floor(Date.now()/1e3)+60,32);k.storeUint(S.seqno,32);for(let I of S.messages)k.storeUint(S.sendMode,8),k.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(I)));return(0,i.signPayload)(S,k,a)}function g(S){if(S.messages.length>4)throw Error("Maximum number of messages in a single transfer is 4");let k=(0,e.beginCell)().storeUint(S.walletId,32);if(S.seqno===0)for(let I=0;I<32;I++)k.storeBit(1);else k.storeUint(S.timeout||Math.floor(Date.now()/1e3)+60,32);k.storeUint(S.seqno,32),k.storeUint(0,8);for(let I of S.messages)k.storeUint(S.sendMode,8),k.storeRef((0,e.beginCell)().store((0,e.storeMessageRelaxed)(I)));return(0,i.signPayload)(S,k,a)}function b(S){if(S.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(S.authType==="extension")return(0,e.beginCell)().storeUint(n.WalletContractV5Beta.OpCodes.auth_extension,32).store((0,r.storeOutListExtendedV5Beta)(S.actions)).endCell();const k=(0,e.beginCell)().storeUint(S.authType==="internal"?n.WalletContractV5Beta.OpCodes.auth_signed_internal:n.WalletContractV5Beta.OpCodes.auth_signed_external,32).store(S.walletId);if(S.seqno===0)for(let I=0;I<32;I++)k.storeBit(1);else k.storeUint(S.timeout||Math.floor(Date.now()/1e3)+60,32);return k.storeUint(S.seqno,32).store((0,r.storeOutListExtendedV5Beta)(S.actions)),(0,i.signPayload)(S,k,c)}function _(S){if(S.actions.length>255)throw Error("Maximum number of OutActions in a single request is 255");if(S={...S},S.authType==="extension")return(0,e.beginCell)().storeUint(o.WalletContractV5R1.OpCodes.auth_extension,32).storeUint(S.queryId??0,64).store((0,s.storeOutListExtendedV5R1)(S.actions)).endCell();S.actions=(0,s.patchV5R1ActionsSendMode)(S.actions,S.authType);const k=(0,e.beginCell)().storeUint(S.authType==="internal"?o.WalletContractV5R1.OpCodes.auth_signed_internal:o.WalletContractV5R1.OpCodes.auth_signed_external,32).store(S.walletId);if(S.seqno===0)for(let I=0;I<32;I++)k.storeBit(1);else k.storeUint(S.timeout||Math.floor(Date.now()/1e3)+60,32);return k.storeUint(S.seqno,32).store((0,s.storeOutListExtendedV5R1)(S.actions)),(0,i.signPayload)(S,k,c)}return Go}Object.defineProperty($h,"__esModule",{value:!0}),$h.WalletContractV1R1=void 0;const dc=$n,qU=_o();class B1{static create(t){return new B1(t.workchain,t.publicKey)}constructor(t,n){this.workchain=t,this.publicKey=n;let r=dc.Cell.fromBoc(Ne.from("te6cckEBAQEARAAAhP8AIN2k8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVEH98Ik=","base64"))[0],i=(0,dc.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:i},this.address=(0,dc.contractAddress)(t,{code:r,data:i})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){let n=await t.getState();return n.state.type==="active"?dc.Cell.fromBoc(n.state.data)[0].beginParse().loadUint(32):0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=dc.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,qU.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,message:(0,dc.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,o)}}}}$h.WalletContractV1R1=B1;var Uh={};Object.defineProperty(Uh,"__esModule",{value:!0}),Uh.WalletContractV1R2=void 0;const Hu=$n,ZU=_o();class I1{static create(t){return new I1(t.workchain,t.publicKey)}constructor(t,n){this.workchain=t,this.publicKey=n;let r=Hu.Cell.fromBoc(Ne.from("te6cckEBAQEAUwAAov8AIN0gggFMl7qXMO1E0NcLH+Ck8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVNDieG8=","base64"))[0],i=(0,Hu.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:i},this.address=(0,Hu.contractAddress)(t,{code:r,data:i})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=Hu.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,ZU.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,message:(0,Hu.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,o)}}}}Uh.WalletContractV1R2=I1;var Nh={};Object.defineProperty(Nh,"__esModule",{value:!0}),Nh.WalletContractV1R3=void 0;const Ku=$n,GU=_o();class M1{static create(t){return new M1(t.workchain,t.publicKey)}constructor(t,n){this.workchain=t,this.publicKey=n;let r=Ku.Cell.fromBoc(Ne.from("te6cckEBAQEAXwAAuv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCBAgDXGCDXCx/tRNDTH9P/0VESuvKhIvkBVBBE+RDyovgAAdMfMSDXSpbTB9QC+wDe0aTIyx/L/8ntVLW4bkI=","base64"))[0],i=(0,Ku.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:i},this.address=(0,Ku.contractAddress)(t,{code:r,data:i})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=Ku.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,GU.createWalletTransferV1)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,message:t.message})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,message:(0,Ku.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})});await this.send(t,o)}}}}Nh.WalletContractV1R3=M1;var Dh={};Object.defineProperty(Dh,"__esModule",{value:!0}),Dh.WalletContractV2R1=void 0;const qu=$n,YU=_o();class R1{static create(t){return new R1(t.workchain,t.publicKey)}constructor(t,n){this.workchain=t,this.publicKey=n;let r=qu.Cell.fromBoc(Ne.from("te6cckEBAQEAVwAAqv8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VShNwu2","base64"))[0],i=(0,qu.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:i},this.address=(0,qu.contractAddress)(t,{code:r,data:i})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=qu.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,YU.createWalletTransferV2)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,messages:[(0,qu.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,o)}}}}Dh.WalletContractV2R1=R1;var jh={};Object.defineProperty(jh,"__esModule",{value:!0}),jh.WalletContractV2R2=void 0;const Zu=$n,JU=_o();class O1{static create(t){return new O1(t.workchain,t.publicKey)}constructor(t,n){this.workchain=t,this.publicKey=n;let r=Zu.Cell.fromBoc(Ne.from("te6cckEBAQEAYwAAwv8AIN0gggFMl7ohggEznLqxnHGw7UTQ0x/XC//jBOCk8mCDCNcYINMf0x8B+CO78mPtRNDTH9P/0VExuvKhA/kBVBBC+RDyovgAApMg10qW0wfUAvsA6NGkyMsfy//J7VQETNeh","base64"))[0],i=(0,Zu.beginCell)().storeUint(0,32).storeBuffer(n).endCell();this.init={code:r,data:i},this.address=(0,Zu.contractAddress)(t,{code:r,data:i})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){let n=Zu.SendMode.PAY_GAS_SEPARATELY;return t.sendMode!==null&&t.sendMode!==void 0&&(n=t.sendMode),(0,JU.createWalletTransferV2)({seqno:t.seqno,sendMode:n,secretKey:t.secretKey,messages:t.messages,timeout:t.timeout})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,messages:[(0,Zu.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,o)}}}}jh.WalletContractV2R2=O1;var Fh={};Object.defineProperty(Fh,"__esModule",{value:!0}),Fh.WalletContractV3R1=void 0;const Gu=$n,QU=_o();class $1{static create(t){return new $1(t.workchain,t.publicKey,t.walletId)}constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let i=Gu.Cell.fromBoc(Ne.from("te6cckEBAQEAYgAAwP8AIN0gggFMl7qXMO1E0NcLH+Ck8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVD++buA=","base64"))[0],o=(0,Gu.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(n).endCell();this.init={code:i,data:o},this.address=(0,Gu.contractAddress)(t,{code:i,data:o})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){return(0,QU.createWalletTransferV3)({...t,sendMode:t.sendMode??Gu.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,messages:[(0,Gu.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,o)}}}}Fh.WalletContractV3R1=$1;var zh={};Object.defineProperty(zh,"__esModule",{value:!0}),zh.WalletContractV3R2=void 0;const Yu=$n,XU=_o();class L1{static create(t){return new L1(t.workchain,t.publicKey,t.walletId)}constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let i=Yu.Cell.fromBoc(Ne.from("te6cckEBAQEAcQAA3v8AIN0gggFMl7ohggEznLqxn3Gw7UTQ0x/THzHXC//jBOCk8mCDCNcYINMf0x/TH/gjE7vyY+1E0NMf0x/T/9FRMrryoVFEuvKiBPkBVBBV+RDyo/gAkyDXSpbTB9QC+wDo0QGkyMsfyx/L/8ntVBC9ba0=","base64"))[0],o=(0,Yu.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(n).endCell();this.init={code:i,data:o},this.address=(0,Yu.contractAddress)(t,{code:i,data:o})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){return(0,XU.createWalletTransferV3)({...t,sendMode:t.sendMode??Yu.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,messages:[(0,Yu.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,o)}}}}zh.WalletContractV3R2=L1;var Vh={};Object.defineProperty(Vh,"__esModule",{value:!0}),Vh.WalletContractV4=void 0;const Ju=$n,eN=_o();class U1{static create(t){return new U1(t.workchain,t.publicKey,t.walletId)}constructor(t,n,r){this.workchain=t,this.publicKey=n,r!=null?this.walletId=r:this.walletId=698983191+t;let i=Ju.Cell.fromBoc(Ne.from("te6ccgECFAEAAtQAART/APSkE/S88sgLAQIBIAIDAgFIBAUE+PKDCNcYINMf0x/THwL4I7vyZO1E0NMf0x/T//QE0VFDuvKhUVG68qIF+QFUEGT5EPKj+AAkpMjLH1JAyx9SMMv/UhD0AMntVPgPAdMHIcAAn2xRkyDXSpbTB9QC+wDoMOAhwAHjACHAAuMAAcADkTDjDQOkyMsfEssfy/8QERITAubQAdDTAyFxsJJfBOAi10nBIJJfBOAC0x8hghBwbHVnvSKCEGRzdHK9sJJfBeAD+kAwIPpEAcjKB8v/ydDtRNCBAUDXIfQEMFyBAQj0Cm+hMbOSXwfgBdM/yCWCEHBsdWe6kjgw4w0DghBkc3RyupJfBuMNBgcCASAICQB4AfoA9AQw+CdvIjBQCqEhvvLgUIIQcGx1Z4MesXCAGFAEywUmzxZY+gIZ9ADLaRfLH1Jgyz8gyYBA+wAGAIpQBIEBCPRZMO1E0IEBQNcgyAHPFvQAye1UAXKwjiOCEGRzdHKDHrFwgBhQBcsFUAPPFiP6AhPLassfyz/JgED7AJJfA+ICASAKCwBZvSQrb2omhAgKBrkPoCGEcNQICEekk30pkQzmkD6f+YN4EoAbeBAUiYcVnzGEAgFYDA0AEbjJftRNDXCx+AA9sp37UTQgQFA1yH0BDACyMoHy//J0AGBAQj0Cm+hMYAIBIA4PABmtznaiaEAga5Drhf/AABmvHfaiaEAQa5DrhY/AAG7SB/oA1NQi+QAFyMoHFcv/ydB3dIAYyMsFywIizxZQBfoCFMtrEszMyXP7AMhAFIEBCPRR8qcCAHCBAQjXGPoA0z/IVCBHgQEI9FHyp4IQbm90ZXB0gBjIywXLAlAGzxZQBPoCFMtqEssfyz/Jc/sAAgBsgQEI1xj6ANM/MFIkgQEI9Fnyp4IQZHN0cnB0gBjIywXLAlAFzxZQA/oCE8tqyx8Syz/Jc/sAAAr0AMntVA==","base64"))[0],o=(0,Ju.beginCell)().storeUint(0,32).storeUint(this.walletId,32).storeBuffer(this.publicKey).storeBit(0).endCell();this.init={code:i,data:o},this.address=(0,Ju.contractAddress)(t,{code:i,data:o})}async getBalance(t){return(await t.getState()).balance}async getSeqno(t){return(await t.getState()).state.type==="active"?(await t.get("seqno",[])).stack.readNumber():0}async send(t,n){await t.external(n)}async sendTransfer(t,n){let r=this.createTransfer(n);await this.send(t,r)}createTransfer(t){return(0,eN.createWalletTransferV4)({...t,sendMode:t.sendMode??Ju.SendMode.PAY_GAS_SEPARATELY,walletId:this.walletId})}sender(t,n){return{send:async r=>{let i=await this.getSeqno(t),o=this.createTransfer({seqno:i,secretKey:n,sendMode:r.sendMode,messages:[(0,Ju.internal)({to:r.to,value:r.value,init:r.init,body:r.body,bounce:r.bounce})]});await this.send(t,o)}}}}Vh.WalletContractV4=U1;var zx={};(function(e){var t=et&&et.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,s,a)}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=et&&et.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(xx(),e),n(cl,e),n(Fu,e)})(zx);var Vx={};(function(e){var t=et&&et.__createBinding||(Object.create?function(r,i,o,s){s===void 0&&(s=o);var a=Object.getOwnPropertyDescriptor(i,o);(!a||("get"in a?!i.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return i[o]}}),Object.defineProperty(r,s,a)}:function(r,i,o,s){s===void 0&&(s=o),r[s]=i[o]}),n=et&&et.__exportStar||function(r,i){for(var o in r)o!=="default"&&!Object.prototype.hasOwnProperty.call(i,o)&&t(i,r,o)};Object.defineProperty(e,"__esModule",{value:!0}),n(Ox(),e),n(Yo,e),n(cc,e)})(Vx);var Wh={};Object.defineProperty(Wh,"__esModule",{value:!0}),Wh.JettonMaster=void 0;const tN=$n;class N1{static create(t){return new N1(t)}constructor(t){this.address=t}async getWalletAddress(t,n){return(await t.get("get_wallet_address",[{type:"slice",cell:(0,tN.beginCell)().storeAddress(n).endCell()}])).stack.readAddress()}async getJettonData(t){let n=await t.get("get_jetton_data",[]),r=n.stack.readBigNumber(),i=n.stack.readBoolean(),o=n.stack.readAddress(),s=n.stack.readCell(),a=n.stack.readCell();return{totalSupply:r,mintable:i,adminAddress:o,content:s,walletCode:a}}}Wh.JettonMaster=N1;var Hh={};Object.defineProperty(Hh,"__esModule",{value:!0}),Hh.JettonWallet=void 0;class D1{static create(t){return new D1(t)}constructor(t){this.address=t}async getBalance(t){return(await t.getState()).state.type!=="active"?0n:(await t.get("get_wallet_data",[])).stack.readBigNumber()}}Hh.JettonWallet=D1;var Qu={};Object.defineProperty(Qu,"__esModule",{value:!0}),Qu.MultisigOrder=void 0;const Wx=Ma(),Kh=$n;class qh{constructor(t){this.signatures={},this.payload=t}static fromCell(t){var s;let n=t.beginParse(),r=(s=n.loadMaybeRef())==null?void 0:s.beginParse();const i=n.asCell();let o=new qh(i);if(r){for(;r.remainingBits>0;){const a=r.loadBuffer(64),c=r.loadUint(8);o.signatures[c]=a,r.remainingRefs>0?r=r.loadRef().asSlice():r.skip(1)}r.endParse()}return o}static fromPayload(t){return new qh(t)}addSignature(t,n,r){const i=this.payload.hash();if(!(0,Wx.signVerify)(i,n,r.owners.get(t).slice(0,-1)))throw Error("invalid signature");this.signatures[t]=n}sign(t,n){const r=this.payload.hash();return this.signatures[t]=(0,Wx.sign)(r,n),r}unionSignatures(t){this.signatures=Object.assign({},this.signatures,t.signatures)}clearSignatures(){this.signatures={}}toCell(t){let n=(0,Kh.beginCell)().storeBit(0);for(const r in this.signatures){const i=this.signatures[r];n=(0,Kh.beginCell)().storeBit(1).storeRef((0,Kh.beginCell)().storeBuffer(i).storeUint(parseInt(r),8).storeBuilder(n).endCell())}return(0,Kh.beginCell)().storeUint(t,8).storeBuilder(n).storeBuilder(this.payload.asBuilder()).endCell()}}Qu.MultisigOrder=qh;var Zh={};Object.defineProperty(Zh,"__esModule",{value:!0}),Zh.MultisigOrderBuilder=void 0;const Xu=$n,nN=Qu;class rN{constructor(t,n){this.messages=(0,Xu.beginCell)(),this.queryId=0n,this.walletId=t,this.queryOffset=n||7200}addMessage(t,n){if(this.messages.refs>=4)throw Error("only 4 refs are allowed");this.updateQueryId(),this.messages.storeUint(n,8),this.messages.storeRef((0,Xu.beginCell)().store((0,Xu.storeMessageRelaxed)(t)).endCell())}clearMessages(){this.messages=(0,Xu.beginCell)()}build(){return nN.MultisigOrder.fromPayload((0,Xu.beginCell)().storeUint(this.walletId,32).storeUint(this.queryId,64).storeBuilder(this.messages).endCell())}updateQueryId(){const t=BigInt(Math.floor(Date.now()/1e3+this.queryOffset));this.queryId=t<<32n}}Zh.MultisigOrderBuilder=rN;var Gh={};Object.defineProperty(Gh,"__esModule",{value:!0}),Gh.MultisigWallet=void 0;const Hx=Ma(),Hr=$n,iN=Hr.Cell.fromBase64("te6ccgECKwEABBgAART/APSkE/S88sgLAQIBIAIDAgFIBAUE2vIgxwCOgzDbPOCDCNcYIPkBAdMH2zwiwAAToVNxePQOb6Hyn9s8VBq6+RDyoAb0BCD5AQHTH1EYuvKq0z9wUwHwCgHCCAGDCryx8mhTFYBA9A5voSCYDqQgwgryZw7f+COqH1NAufJhVCOjU04gIyEiAgLMBgcCASAMDQIBIAgJAgFmCgsAA9GEAiPymAvHoHN9CYbZ5S7Z4BPHohwhJQAtAKkItdJEqCTItdKlwLUAdAT8ArobBKAATwhbpEx4CBukTDgAdAg10rDAJrUAvALyFjPFszJ4HHXI8gBzxb0AMmACASAODwIBIBQVARW77ZbVA0cFUg2zyCoCAUgQEQIBIBITAXOxHXQgwjXGCD5AQHTB4IB1MTtQ9hTIHj0Dm+h8p/XC/9eMfkQ8qCuAfQEIW6TW3Ey4PkBWNs8AaQBgJwA9rtqA6ADoAPoCAXoCEfyAgPyA3XlP+AXkegAA54tkwAAXrhlXP8EA1WZ2oexAAgEgFhcCASAYGQFRtyVbZ4YmRmpGEAgegc30McJNhFpAADMaYeYuAFrgJhwLb+4cC3d0bhAjAYm1WZtnhqvgb+2xxsoicAgej430pBHEoFpAADHDhBACGuQkuuBk9kUWE5kAOeLKhACQCB6IYFImHFImHFImXEA2YlzNijAjAgEgGhsAF7UGtc4QQDVZnah7EAIBIBwdAgOZOB4fARGsGm2eL4G2CUAjABWt+UEAzJV2oewYQAENqTbPBVfBYCMAFa3f3CCAarM7UPYgAiDbPALyZfgAUENxQxPbPO1UIyoACtP/0wcwBKDbPC+uUyCw8mISsQKkJbNTHLmwJYEA4aojoCi8sPJpggGGoPgBBZcCERACPj4wjo0REB/bPEDXePRDEL0F4lQWW1Rz51YQU9zbPFRxClR6vCQlKCYAIO1E0NMf0wfTB9M/9AT0BNEAXgGOGjDSAAHyo9MH0wdQA9cBIPkBBfkBFbrypFAD4GwhIddKqgIi10m68qtwVCATAAwByMv/ywcE1ts87VT4D3AlblOJvrGYEG4QLVDHXwePGzBUJANQTds8UFWgRlAQSRA6SwlTuds8UFQWf+L4AAeDJaGOLCaAQPSWb6UglDBTA7neII4WODk5CNIAAZfTBzAW8AcFkTDifwgHBZJsMeKz5jAGKicoKQBgcI4pA9CDCNcY0wf0BDBTFnj0Dm+h8qXXC/9URUT5EPKmrlIgsVIDvRShI27mbCIyAH5SML6OIF8D+ACTItdKmALTB9QC+wAC6DJwyMoAQBSAQPRDAvAHjhdxyMsAFMsHEssHWM8BWM8WQBOAQPRDAeIBII6KEEUQNEMA2zztVJJfBuIqABzIyx/LB8sHyz/0APQAyQ==");class j1{constructor(t,n,r,i,o){this.provider=null,this.owners=Hr.Dictionary.empty(),this.workchain=n,this.walletId=r,this.k=i;for(let s=0;s0;){const o=r.readTuple(),s=o.readNumber(),a=o.readNumber();o.pop();const c=o.readNumber();i.push({id:s,unfreezeAt:a,stakeHeld:c})}return i}async getPastElections(t){const n=await t.get("past_elections",[]),r=new Oi.TupleReader(n.stack.readLispList()),i=[];for(;r.remaining>0;){const o=r.readTuple(),s=o.readNumber(),a=o.readNumber(),c=o.readNumber();o.pop();const d=o.readCell(),f=o.readBigNumber(),p=o.readBigNumber();let g=new Map;const b=d.beginParse().loadDictDirect(Oi.Dictionary.Keys.Buffer(32),oN);for(const[_,S]of b)g.set(BigInt("0x"+_.toString("hex")).toString(10),{address:S.address,weight:S.weight,stake:S.stake});i.push({id:s,unfreezeAt:a,stakeHeld:c,totalStake:f,bonuses:p,frozen:g})}return i}async getElectionEntities(t){const n=await t.getState();if(n.state.type!=="active")throw Error("Unexpected error");const i=Oi.Cell.fromBoc(n.state.data)[0].beginParse();if(!i.loadBit())return null;const o=i.loadRef().beginParse(),s=o.loadUint(32),a=o.loadUint(32),c=o.loadCoins(),d=o.loadCoins(),f=o.loadDict(Oi.Dictionary.Keys.Buffer(32),sN);let p=[];if(f)for(const[g,b]of f)p.push({pubkey:g,stake:b.stake,address:b.address,adnl:b.adnl});return{minStake:c,allStakes:d,endElectionsTime:a,startWorkTime:s,entities:p}}async getActiveElectionId(t){const r=(await t.get("active_election_id",[])).stack.readNumber();return r>0?r:null}async getComplaints(t,n){const r=new Oi.TupleBuilder;r.writeNumber(n);const i=await t.get("list_complaints",r.build());if(i.stack.peek().type==="null")return[];const o=new Oi.TupleReader(i.stack.readLispList()),s=[];for(;o.remaining>0;){const a=o.readTuple(),c=a.readBigNumber(),d=a.readTuple(),f=d.readTuple(),p=Ne.from(f.readBigNumber().toString(16),"hex");f.readCell();const g=f.readNumber(),b=f.readNumber(),_=new Oi.Address(-1,Ne.from(f.readBigNumber().toString(16),"hex")),S=f.readBigNumber(),k=f.readBigNumber(),I=f.readBigNumber(),B=[],R=new Oi.TupleReader(d.readLispList());for(;R.remaining>0;)B.push(R.readNumber());const $=d.readBigNumber(),L=d.readBigNumber();s.push({id:c,publicKey:p,createdAt:g,severity:b,paid:S,suggestedFine:k,suggestedFinePart:I,rewardAddress:_,votes:B,remainingWeight:L,vsetId:$})}return s}}Yh.ElectorContract=F1;var Bn={};Object.defineProperty(Bn,"__esModule",{value:!0}),Bn.configParseMasterAddress=ed,Bn.parseValidatorSet=Zx,Bn.parseBridge=Gx,Bn.configParseMasterAddressRequired=z1,Bn.configParse5=Yx,Bn.configParse13=aN,Bn.configParse15=Jx,Bn.configParse16=Qx,Bn.configParse17=Xx,Bn.configParse18=e6,Bn.configParse8=t6,Bn.configParse40=n6,Bn.configParseWorkchainDescriptor=cN,Bn.configParse12=r6,Bn.configParseValidatorSet=ul,Bn.configParseBridge=Jh,Bn.configParseGasLimitsPrices=V1,Bn.configParseMsgPrices=W1,Bn.configParse28=i6,Bn.configParse29=o6,Bn.parseProposalSetup=H1,Bn.parseVotingSetup=s6,Bn.loadConfigParamById=fN,Bn.loadConfigParamsAsSlice=hN,Bn.parseFullConfig=pN;const ai=$n;function ed(e){return e?new ai.Address(-1,e.loadBuffer(32)):null}function Kx(e){if(e.loadUint(32)!==2390828938)throw Error("Invalid config");return e.loadBuffer(32)}const qx={serialize(e,t){throw Error("not implemented")},parse(e){const t=e.loadUint(8);if(t===83)return{publicKey:Kx(e),weight:e.loadUintBig(64),adnlAddress:null};if(t===115)return{publicKey:Kx(e),weight:e.loadUintBig(64),adnlAddress:e.loadBuffer(32)};throw Error("Invalid config")}};function Zx(e){const t=e.loadUint(8);if(t===17){const n=e.loadUint(32),r=e.loadUint(32),i=e.loadUint(16),o=e.loadUint(16),s=e.loadDictDirect(ai.Dictionary.Keys.Uint(16),qx);return{timeSince:n,timeUntil:r,total:i,main:o,totalWeight:null,list:s}}else if(t===18){const n=e.loadUint(32),r=e.loadUint(32),i=e.loadUint(16),o=e.loadUint(16),s=e.loadUintBig(64),a=e.loadDict(ai.Dictionary.Keys.Uint(16),qx);return{timeSince:n,timeUntil:r,total:i,main:o,totalWeight:s,list:a}}}function Gx(e){const t=new ai.Address(-1,e.loadBuffer(32)),n=new ai.Address(-1,e.loadBuffer(32)),r=e.loadDict(ai.Dictionary.Keys.Buffer(32),ai.Dictionary.Values.Buffer(32)),i=new Map;for(const[s,a]of r)i.set(new ai.Address(-1,s).toString(),a);const o=e.loadBuffer(32);return{bridgeAddress:t,oracleMultisigAddress:n,oracles:i,externalChainAddress:o}}function z1(e){if(!e)throw Error("Invalid config");return ed(e)}function Yx(e){if(!e)throw Error("Invalid config");if(e.loadUint(8)===1){const n=e.loadBit()?new ai.Address(-1,e.loadBuffer(32)):null,r=e.loadUint(32),i=e.loadUint(32);return{blackholeAddr:n,feeBurnNominator:r,feeBurnDenominator:i}}throw new Error("Invalid config")}function aN(e){if(!e)throw Error("Invalid config");if(e.loadUint(8)===26){const n=e.loadCoins(),r=e.loadCoins(),i=e.loadCoins();return{deposit:n,bitPrice:r,cellPrice:i}}throw new Error("Invalid config")}function Jx(e){if(!e)throw Error("Invalid config");const t=e.loadUint(32),n=e.loadUint(32),r=e.loadUint(32),i=e.loadUint(32);return{validatorsElectedFor:t,electorsStartBefore:n,electorsEndBefore:r,stakeHeldFor:i}}function Qx(e){if(!e)throw Error("Invalid config");const t=e.loadUint(16),n=e.loadUint(16),r=e.loadUint(16);return{maxValidators:t,maxMainValidators:n,minValidators:r}}function Xx(e){if(!e)throw Error("Invalid config");const t=e.loadCoins(),n=e.loadCoins(),r=e.loadCoins(),i=e.loadUint(32);return{minStake:t,maxStake:n,minTotalStake:r,maxStakeFactor:i}}const lN={serialize(e,t){throw Error("not implemented")},parse(e){if(e.loadUint(8)!==204)throw Error("Invalid config");const n=e.loadUint(32),r=e.loadUintBig(64),i=e.loadUintBig(64),o=e.loadUintBig(64),s=e.loadUintBig(64);return{utime_since:n,bit_price_ps:r,cell_price_ps:i,mc_bit_price_ps:o,mc_cell_price_ps:s}}};function e6(e){if(!e)throw Error("Invalid config");return e.loadDictDirect(ai.Dictionary.Keys.Buffer(4),lN).values()}function t6(e){if(!e)return{version:0,capabilities:0n};const t=e.loadUint(32),n=e.loadUintBig(64);return{version:t,capabilities:n}}function n6(e){if(!e)return null;if(e.loadUint(8)!==1)throw Error("Invalid config");const n=e.loadCoins(),r=e.loadCoins(),i=e.loadUint(16),o=e.loadUint(16),s=e.loadUint(16),a=e.loadUint(16),c=e.loadUint(16),d=e.loadUint(16),f=e.loadUint(16),p=e.loadUint(16),g=e.loadUint(16);return{defaultFlatFine:n,defaultProportionaFine:r,severityFlatMult:i,severityProportionalMult:o,unfunishableInterval:s,longInterval:a,longFlatMult:c,longProportionalMult:d,mediumInterval:f,mediumFlatMult:p,mediumProportionalMult:g}}function cN(e){if(e.loadUint(8)!==166)throw Error("Invalid config");const t=e.loadUint(32),n=e.loadUint(8),r=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadUint(13),d=e.loadBuffer(32),f=e.loadBuffer(32),p=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");const g=e.loadUint(32),b=e.loadUintBig(64);return{enabledSince:t,actialMinSplit:n,min_split:r,max_split:i,basic:o,active:s,accept_msgs:a,flags:c,zerostateRootHash:d,zerostateFileHash:f,version:p,format:{vmVersion:g,vmMode:b}}}const uN={serialize(e,t){throw Error("not implemented")},parse(e){if(e.loadUint(8)!==166)throw Error("Invalid config");const t=e.loadUint(32),n=e.loadUint(8),r=e.loadUint(8),i=e.loadUint(8),o=e.loadBit(),s=e.loadBit(),a=e.loadBit(),c=e.loadUint(13),d=e.loadBuffer(32),f=e.loadBuffer(32),p=e.loadUint(32);if(e.loadBit())throw Error("Invalid config");const g=e.loadUint(32),b=e.loadUintBig(64);return{enabledSince:t,actialMinSplit:n,min_split:r,max_split:i,basic:o,active:s,accept_msgs:a,flags:c,zerostateRootHash:d,zerostateFileHash:f,version:p,format:{vmVersion:g,vmMode:b}}}};function r6(e){if(!e)throw Error("Invalid config");const t=e.loadDict(ai.Dictionary.Keys.Uint(32),uN);if(t)return t;throw Error("No workchains exist")}function ul(e){return e?Zx(e):null}function Jh(e){return e?Gx(e):null}function dN(e){const t=e.loadUint(8);if(t===222){const n=e.loadUintBig(64),r=e.loadUintBig(64),i=e.loadUintBig(64),o=e.loadUintBig(64),s=e.loadUintBig(64),a=e.loadUintBig(64),c=e.loadUintBig(64);return{gasPrice:n,gasLimit:r,specialGasLimit:i,gasCredit:o,blockGasLimit:s,freezeDueLimit:a,deleteDueLimit:c}}else if(t===221){const n=e.loadUintBig(64),r=e.loadUintBig(64),i=e.loadUintBig(64),o=e.loadUintBig(64),s=e.loadUintBig(64),a=e.loadUintBig(64);return{gasPrice:n,gasLimit:r,gasCredit:i,blockGasLimit:o,freezeDueLimit:s,deleteDueLimit:a}}else throw Error("Invalid config")}function V1(e){if(!e)throw Error("Invalid config");if(e.loadUint(8)===209){const n=e.loadUintBig(64),r=e.loadUintBig(64),i=dN(e);return{flatLimit:n,flatGasPrice:r,other:i}}else throw Error("Invalid config")}function W1(e){if(!e)throw new Error("Invalid config");if(e.loadUint(8)!==234)throw new Error("Invalid msg prices param");return{lumpPrice:e.loadUintBig(64),bitPrice:e.loadUintBig(64),cellPrice:e.loadUintBig(64),ihrPriceFactor:e.loadUint(32),firstFrac:e.loadUint(16),nextFrac:e.loadUint(16)}}function i6(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(t===193){const n=e.loadUint(32),r=e.loadUint(32),i=e.loadUint(32),o=e.loadUint(32);return{masterCatchainLifetime:n,shardCatchainLifetime:r,shardValidatorsLifetime:i,shardValidatorsCount:o}}if(t===194){const n=e.loadUint(7),r=e.loadBit(),i=e.loadUint(32),o=e.loadUint(32),s=e.loadUint(32),a=e.loadUint(32);return{flags:n,suffleMasterValidators:r,masterCatchainLifetime:i,shardCatchainLifetime:o,shardValidatorsLifetime:s,shardValidatorsCount:a}}throw new Error("Invalid config")}function o6(e){if(!e)throw new Error("Invalid config");const t=e.loadUint(8);if(t===214){const n=e.loadUint(32),r=e.loadUint(32),i=e.loadUint(32),o=e.loadUint(32),s=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),d=e.loadUint(32);return{roundCandidates:n,nextCandidateDelay:r,consensusTimeout:i,fastAttempts:o,attemptDuration:s,catchainMaxDeps:a,maxBlockBytes:c,maxColaltedBytes:d}}else if(t===215){const n=e.loadUint(7),r=e.loadBit(),i=e.loadUint(8),o=e.loadUint(32),s=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),d=e.loadUint(32),f=e.loadUint(32),p=e.loadUint(32);return{flags:n,newCatchainIds:r,roundCandidates:i,nextCandidateDelay:o,consensusTimeout:s,fastAttempts:a,attemptDuration:c,catchainMaxDeps:d,maxBlockBytes:f,maxColaltedBytes:p}}else if(t===216){const n=e.loadUint(7),r=e.loadBit(),i=e.loadUint(8),o=e.loadUint(32),s=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),d=e.loadUint(32),f=e.loadUint(32),p=e.loadUint(32),g=e.loadUint(16);return{flags:n,newCatchainIds:r,roundCandidates:i,nextCandidateDelay:o,consensusTimeout:s,fastAttempts:a,attemptDuration:c,catchainMaxDeps:d,maxBlockBytes:f,maxColaltedBytes:p,protoVersion:g}}else if(t===217){const n=e.loadUint(7),r=e.loadBit(),i=e.loadUint(8),o=e.loadUint(32),s=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),d=e.loadUint(32),f=e.loadUint(32),p=e.loadUint(32),g=e.loadUint(16),b=e.loadUint(32);return{flags:n,newCatchainIds:r,roundCandidates:i,nextCandidateDelay:o,consensusTimeout:s,fastAttempts:a,attemptDuration:c,catchainMaxDeps:d,maxBlockBytes:f,maxColaltedBytes:p,protoVersion:g,catchainMaxBlocksCoeff:b}}throw new Error("Invalid config")}function H1(e){if(e.loadUint(8)!==54)throw new Error("Invalid config");const n=e.loadUint(8),r=e.loadUint(8),i=e.loadUint(8),o=e.loadUint(8),s=e.loadUint(32),a=e.loadUint(32),c=e.loadUint(32),d=e.loadUint(32);return{minTotalRounds:n,maxTotalRounds:r,minWins:i,maxLoses:o,minStoreSec:s,maxStoreSec:a,bitPrice:c,cellPrice:d}}function s6(e){if(!e)throw new Error("Invalid config");if(e.loadUint(8)!==145)throw new Error("Invalid config");const n=H1(e.loadRef().beginParse()),r=H1(e.loadRef().beginParse());return{normalParams:n,criticalParams:r}}function a6(e){return ai.Cell.fromBase64(e).beginParse().loadDictDirect(ai.Dictionary.Keys.Int(32),ai.Dictionary.Values.Cell())}function fN(e,t){return a6(e).get(t)}function hN(e){const t=a6(e),n=new Map;for(const[r,i]of t)n.set(r,i.beginParse());return n}function pN(e){return{configAddress:z1(e.get(0)),electorAddress:z1(e.get(1)),minterAddress:ed(e.get(2)),feeCollectorAddress:ed(e.get(3)),dnsRootAddress:ed(e.get(4)),burningConfig:Yx(e.get(5)),globalVersion:t6(e.get(8)),workchains:r6(e.get(12)),voting:s6(e.get(11)),validators:{...Jx(e.get(15)),...Qx(e.get(16)),...Xx(e.get(17))},storagePrices:e6(e.get(18)),gasPrices:{masterchain:V1(e.get(20)),workchain:V1(e.get(21))},msgPrices:{masterchain:W1(e.get(24)),workchain:W1(e.get(25))},validatorSets:{prevValidators:ul(e.get(32)),prevTempValidators:ul(e.get(33)),currentValidators:ul(e.get(34)),currentTempValidators:ul(e.get(35)),nextValidators:ul(e.get(36)),nextTempValidators:ul(e.get(37))},validatorsPunish:n6(e.get(40)),bridges:{ethereum:Jh(e.get(71)),binance:Jh(e.get(72)),polygon:Jh(e.get(73))},catchain:i6(e.get(28)),consensus:o6(e.get(29))}}var dl={};Object.defineProperty(dl,"__esModule",{value:!0}),dl.computeStorageFees=gN,dl.computeFwdFees=q1,dl.computeGasPrices=mN,dl.computeExternalMessageFees=yN,dl.computeMessageForwardFees=bN;const K1=$n;function gN(e){const{lastPaid:t,now:n,storagePrices:r,storageStat:i,special:o,masterchain:s}=e;if(n<=t||r.length===0||n>16n)}function yN(e,t){let n=Qh(t);return n.bits-=t.bits.length,n.cells-=1,q1(e,BigInt(n.cells),BigInt(n.bits))}function bN(e,t){let n=(0,K1.loadMessageRelaxed)(t.beginParse()),r={bits:0,cells:0};if(n.init){const c=new K1.Cell().asBuilder();(0,K1.storeStateInit)(n.init)(c);const d=c.endCell();let f=Qh(d);f.bits-=d.bits.length,f.cells-=1,r.bits+=f.bits,r.cells+=f.cells}let i=Qh(n.body);i.bits-=n.body.bits.length,i.cells-=1,r.bits+=i.bits,r.cells+=i.cells;let o=q1(e,BigInt(r.cells),BigInt(r.bits)),s=o*BigInt(e.firstFrac)>>16n,a=o-s;return{fees:s,remaining:a}}function Qh(e){let t=e.bits.length,n=1;for(let r of e.refs){let i=Qh(r);n+=i.cells,t+=i.bits}return{bits:t,cells:n}}function l6(e){let t=e%65536n,n=e>>16n;return t!==0n&&(n+=1n),n}(function(e){var t=et&&et.__createBinding||(Object.create?function(X,J,me,oe){oe===void 0&&(oe=me);var Q=Object.getOwnPropertyDescriptor(J,me);(!Q||("get"in Q?!J.__esModule:Q.writable||Q.configurable))&&(Q={enumerable:!0,get:function(){return J[me]}}),Object.defineProperty(X,oe,Q)}:function(X,J,me,oe){oe===void 0&&(oe=me),X[oe]=J[me]}),n=et&&et.__exportStar||function(X,J){for(var me in X)me!=="default"&&!Object.prototype.hasOwnProperty.call(J,me)&&t(J,X,me)};Object.defineProperty(e,"__esModule",{value:!0}),e.computeStorageFees=e.computeMessageForwardFees=e.computeGasPrices=e.computeFwdFees=e.computeExternalMessageFees=e.loadConfigParamsAsSlice=e.loadConfigParamById=e.parseFullConfig=e.parseVotingSetup=e.parseValidatorSet=e.parseProposalSetup=e.parseBridge=e.configParseWorkchainDescriptor=e.configParseValidatorSet=e.configParseMsgPrices=e.configParseMasterAddressRequired=e.configParseMasterAddress=e.configParseGasLimitsPrices=e.configParseBridge=e.configParse40=e.configParse29=e.configParse28=e.configParse18=e.configParse17=e.configParse16=e.configParse15=e.configParse13=e.configParse12=e.configParse8=e.configParse5=e.ElectorContract=e.MultisigWallet=e.MultisigOrderBuilder=e.MultisigOrder=e.JettonWallet=e.JettonMaster=e.WalletContractV5R1=e.WalletContractV5Beta=e.WalletContractV4=e.WalletContractV3R2=e.WalletContractV3R1=e.WalletContractV2R2=e.WalletContractV2R1=e.WalletContractV1R3=e.WalletContractV1R2=e.WalletContractV1R1=e.TonClient4=e.TonClient=e.HttpApi=void 0,n($n,e);var r=Ru;Object.defineProperty(e,"HttpApi",{enumerable:!0,get:function(){return r.HttpApi}});var i=Mh;Object.defineProperty(e,"TonClient",{enumerable:!0,get:function(){return i.TonClient}});var o=Rh;Object.defineProperty(e,"TonClient4",{enumerable:!0,get:function(){return o.TonClient4}});var s=$h;Object.defineProperty(e,"WalletContractV1R1",{enumerable:!0,get:function(){return s.WalletContractV1R1}});var a=Uh;Object.defineProperty(e,"WalletContractV1R2",{enumerable:!0,get:function(){return a.WalletContractV1R2}});var c=Nh;Object.defineProperty(e,"WalletContractV1R3",{enumerable:!0,get:function(){return c.WalletContractV1R3}});var d=Dh;Object.defineProperty(e,"WalletContractV2R1",{enumerable:!0,get:function(){return d.WalletContractV2R1}});var f=jh;Object.defineProperty(e,"WalletContractV2R2",{enumerable:!0,get:function(){return f.WalletContractV2R2}});var p=Fh;Object.defineProperty(e,"WalletContractV3R1",{enumerable:!0,get:function(){return p.WalletContractV3R1}});var g=zh;Object.defineProperty(e,"WalletContractV3R2",{enumerable:!0,get:function(){return g.WalletContractV3R2}});var b=Vh;Object.defineProperty(e,"WalletContractV4",{enumerable:!0,get:function(){return b.WalletContractV4}});var _=zx;Object.defineProperty(e,"WalletContractV5Beta",{enumerable:!0,get:function(){return _.WalletContractV5Beta}});var S=Vx;Object.defineProperty(e,"WalletContractV5R1",{enumerable:!0,get:function(){return S.WalletContractV5R1}});var k=Wh;Object.defineProperty(e,"JettonMaster",{enumerable:!0,get:function(){return k.JettonMaster}});var I=Hh;Object.defineProperty(e,"JettonWallet",{enumerable:!0,get:function(){return I.JettonWallet}});var B=Qu;Object.defineProperty(e,"MultisigOrder",{enumerable:!0,get:function(){return B.MultisigOrder}});var R=Zh;Object.defineProperty(e,"MultisigOrderBuilder",{enumerable:!0,get:function(){return R.MultisigOrderBuilder}});var $=Gh;Object.defineProperty(e,"MultisigWallet",{enumerable:!0,get:function(){return $.MultisigWallet}});var L=Yh;Object.defineProperty(e,"ElectorContract",{enumerable:!0,get:function(){return L.ElectorContract}});var U=Bn;Object.defineProperty(e,"configParse5",{enumerable:!0,get:function(){return U.configParse5}}),Object.defineProperty(e,"configParse8",{enumerable:!0,get:function(){return U.configParse8}}),Object.defineProperty(e,"configParse12",{enumerable:!0,get:function(){return U.configParse12}}),Object.defineProperty(e,"configParse13",{enumerable:!0,get:function(){return U.configParse13}}),Object.defineProperty(e,"configParse15",{enumerable:!0,get:function(){return U.configParse15}}),Object.defineProperty(e,"configParse16",{enumerable:!0,get:function(){return U.configParse16}}),Object.defineProperty(e,"configParse17",{enumerable:!0,get:function(){return U.configParse17}}),Object.defineProperty(e,"configParse18",{enumerable:!0,get:function(){return U.configParse18}}),Object.defineProperty(e,"configParse28",{enumerable:!0,get:function(){return U.configParse28}}),Object.defineProperty(e,"configParse29",{enumerable:!0,get:function(){return U.configParse29}}),Object.defineProperty(e,"configParse40",{enumerable:!0,get:function(){return U.configParse40}}),Object.defineProperty(e,"configParseBridge",{enumerable:!0,get:function(){return U.configParseBridge}}),Object.defineProperty(e,"configParseGasLimitsPrices",{enumerable:!0,get:function(){return U.configParseGasLimitsPrices}}),Object.defineProperty(e,"configParseMasterAddress",{enumerable:!0,get:function(){return U.configParseMasterAddress}}),Object.defineProperty(e,"configParseMasterAddressRequired",{enumerable:!0,get:function(){return U.configParseMasterAddressRequired}}),Object.defineProperty(e,"configParseMsgPrices",{enumerable:!0,get:function(){return U.configParseMsgPrices}}),Object.defineProperty(e,"configParseValidatorSet",{enumerable:!0,get:function(){return U.configParseValidatorSet}}),Object.defineProperty(e,"configParseWorkchainDescriptor",{enumerable:!0,get:function(){return U.configParseWorkchainDescriptor}}),Object.defineProperty(e,"parseBridge",{enumerable:!0,get:function(){return U.parseBridge}}),Object.defineProperty(e,"parseProposalSetup",{enumerable:!0,get:function(){return U.parseProposalSetup}}),Object.defineProperty(e,"parseValidatorSet",{enumerable:!0,get:function(){return U.parseValidatorSet}}),Object.defineProperty(e,"parseVotingSetup",{enumerable:!0,get:function(){return U.parseVotingSetup}}),Object.defineProperty(e,"parseFullConfig",{enumerable:!0,get:function(){return U.parseFullConfig}}),Object.defineProperty(e,"loadConfigParamById",{enumerable:!0,get:function(){return U.loadConfigParamById}}),Object.defineProperty(e,"loadConfigParamsAsSlice",{enumerable:!0,get:function(){return U.loadConfigParamsAsSlice}});var G=dl;Object.defineProperty(e,"computeExternalMessageFees",{enumerable:!0,get:function(){return G.computeExternalMessageFees}}),Object.defineProperty(e,"computeFwdFees",{enumerable:!0,get:function(){return G.computeFwdFees}}),Object.defineProperty(e,"computeGasPrices",{enumerable:!0,get:function(){return G.computeGasPrices}}),Object.defineProperty(e,"computeMessageForwardFees",{enumerable:!0,get:function(){return G.computeMessageForwardFees}}),Object.defineProperty(e,"computeStorageFees",{enumerable:!0,get:function(){return G.computeStorageFees}})})(Ri);var c6=Nn.env.BASE_URL??"https://app.mytonswap.com/api/",vN={name:"@mytonswap/sdk",description:"MyTonSwap Dex Aggregator SDK",author:{name:"MyTonSwap",url:"https://github.com/mytonswap"},homepage:"https://docs.mytonswap.com",contributors:[{email:"ho3einwave@gmail.com",name:"Ho3einWave"}],repository:{type:"git",url:"git+https://github.com/MyTonSwap/sdk.git"},main:"dist/index.cjs",module:"dist/index.js",types:"dist/index.d.ts",keywords:["MyTonSwap","TON","The Open Network","TON Blockchain","SDK","Swap","Telegram","stonfi","ston.fi","dedust","DEX","DeFi"],version:"1.0.12",type:"module",scripts:{build:"tsup"},devDependencies:{"@types/bun":"^1.1.10","@types/lodash":"^4.17.9",tsup:"^8.3.0"},peerDependencies:{"@ton/ton":"^15.0.0",typescript:"^5.0.0"},dependencies:{"@lifeomic/attempt":"^3.1.0",axios:"^1.7.7",lodash:"^4.17.21"}},wN=class{constructor(t){Lo(this,"attemptOptions",{maxAttempts:3,delay:500});this.client=t}async send(t){var s,a,c;const n={baseURL:((s=this.client.options)==null?void 0:s.baseUrl)??c6,headers:t.baseURL?{}:{...((a=this.client.options)==null?void 0:a.apiKey)&&{"x-api-key":this.client.options.apiKey},...((c=this.client.options)==null?void 0:c.headers)??{},"sdk-version":vN.version},method:"GET"},r=b3.defaultsDeep(t,n,{headers:this.getDefaultHeaders}),i=await this.faultTolerantRequest(r);this.handleErrors(i);let o;return t.baseURL===c6?o=this.transformBody(i.data):o=i.data,o}handleErrors(t){if(t&&t.data.statusCode<=200&&t.data.statusCode>=400)throw new Error(`Request failed with ${t.data.statusCode} Reason: ${t.data.errorData}`)}transformBody(t){return t.data}async faultTolerantRequest(t){try{return await YP(async()=>Dn.request(t),this.attemptOptions)}catch(n){throw n}}getDefaultHeaders(){return{stats_id:"SDK"}}},Xh=class{constructor(e){Lo(this,"client");this.client=e}},_N=class extends Xh{async getExactAsset(e){const t=await this.client.request.send({url:"/swap-process/data/assets/find/exactSearch",method:"POST",data:{assets:[e]}});return t.length>0?t[0]:null}async getAssets(e){return(await this.client.request.send({url:"/swap-process/data/assets",method:"POST",data:{assets:e}})).list}async getPaginatedAssets(e=1,t=!1,n){return await this.client.request.send({url:`/swap-process/data/assets/find/${e}?warning=${t}${n?`&search=${n}`:""}`})}async getPairs(e,t=1,n=!1,r=""){return await this.client.request.send({url:`https://app.mytonswap.com/api/swap-process/data/assets/pairs/${e}?page=${t}&warning=${n}&search=${r}`})}},xN=class extends Xh{async findBestRoute(e,t,n,r,i){const o={token0:e,token1:t,amount:n.toString(),slippage:r??"auto",token0_symbol:"SDK",token1_symbol:"SDK",init:!0,dex:i};return this.client.request.send({url:"v2/routes/pair",method:"POST",data:o})}},CN=class extends Xh{async getJettonData(e,t){return await this.client.request.send({baseURL:"https://tonapi.io/v2",maxBodyLength:1/0,url:`/accounts/${e}/jettons/${t}?supported_extensions=custom_payload`})}async getCustomPayload(e,t){return await this.client.request.send({baseURL:"https://tonapi.io/v2",maxBodyLength:1/0,url:`/jettons/${t}/transfer/${e}/payload`})}async getWalletAssets(e,t=["usd"],n=!0){const{balances:r}=await this.client.request.send({baseURL:"https://tonapi.io/v2",maxBodyLength:1/0,url:`/accounts/${e}/jettons?currencies=${t.join(",")}${n?"&supported_extensions=custom_payload":""}`}),i=r.map(c=>c.jetton.address).join(","),{rates:o}=await this.client.request.send({baseURL:"https://tonapi.io/v2",url:`/rates?tokens=${i.length>0?i:""},EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c¤cies=usd`}),{balance:s}=await this.client.request.send({baseURL:"https://tonapi.io/v2",url:`/accounts/${e}`});return r.push({balance:String(s),wallet_address:{address:e,is_scam:!1,is_wallet:!0},jetton:{address:"EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c",symbol:"TON",name:"TON",image:"https://asset.ston.fi/img/EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c/4ecd4687e0b5b8ff21a7fbe03f9d281c26a2dc13eac7b7d16048cc693fe0ec39",decimals:9,verification:""}}),r.reduce((c,d)=>{const f=Ri.address(d.jetton.address).toString();return d.price=o[f],c.set(f,d),c},new Map)}async getAssetsRates(e){const t=e.join(","),{rates:n}=await this.client.request.send({baseURL:"https://tonapi.io/v2",url:`/rates?tokens=${t.length>0?t:""},EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c¤cies=usd`});return e.reduce((i,o)=>{const s=Ri.address(o).toString();return i.set(s,n[s].prices),i},new Map)}async waitForTransactionResult(e,t=3e3,n=30){let r=0;for(;r<=n;)try{let i=await this.client.tonapi.getTransactionEvent(e);for(;!this.allTransactionComplete(i);)if(await new Promise(o=>setTimeout(o,t)),i=await this.client.tonapi.getTransactionEvent(e),r++,r>n)throw new Error("Max retries reached");return i}catch{if(await new Promise(o=>setTimeout(o,t)),r++,r>n)throw new Error("Max retries reached")}throw new Error("Max retries reached")}async getTransactionEvent(e){return await this.client.request.send({baseURL:"https://tonapi.io/v2",url:`/events/${e}`})}allTransactionComplete(e){if(e.in_progress)return!1;if(e.actions.some(t=>t.status!=="ok"))throw new Error("Transaction failed");return!0}},SN=class extends Xh{async createSwap(t,n,r){return await this.client.request.send({method:"POST",headers:{...r?{"app-id":r}:{}},url:"v2/routes/boc",data:{userWallet:t,bestRoute:n}})}},Z1=class{constructor(e){Lo(this,"options");Lo(this,"request",new wN(this));Lo(this,"assets",new _N(this));Lo(this,"router",new xN(this));Lo(this,"tonapi",new CN(this));Lo(this,"swap",new SN(this));Lo(this,"tonClient");this.options=e,this.tonClient=new Ri.TonClient({endpoint:"https://toncenter.com/api/v2/jsonRPC",apiKey:e==null?void 0:e.tonCenterApiKey})}};function td(e,t=9){if(typeof e=="bigint")return e*10n**BigInt(t);{if(typeof e=="number"){if(!Number.isFinite(e))throw Error("Invalid number");if(Math.log10(e)<=6)e=e.toLocaleString("en",{minimumFractionDigits:t,useGrouping:!1});else if(e-Math.trunc(e)===0)e=e.toLocaleString("en",{maximumFractionDigits:0,useGrouping:!1});else throw Error("Not enough precision for a number value. Use string value instead")}let n=!1;for(;e.startsWith("-");)n=!n,e=e.slice(1);if(e===".")throw Error("Invalid number");let r=e.split(".");if(r.length>2)throw Error("Invalid number");let i=r[0],o=r[1];if(i||(i="0"),o||(o="0"),o.length>t)throw Error("Invalid number");for(;o.length({tonConnectInstance:null,options:{ui_preferences:{disable_provided_text:!1,disable_token_select_pay:!1,disable_token_select_receive:!1,show_swap_details:!0,show_settings_wallet:!0,show_settings_slippage:!0,show_settings_community:!0,show_change_direction:!0,show_settings:!0,show_refresh:!0}},userOptions:{},setOptions:n=>{const{options:r,userOptions:i}=t();if(JSON.stringify(n)===JSON.stringify(i))return;const o=b3.defaultsDeep(n,r);e({options:o,userOptions:n}),n.default_slippage&&qn.getState().setSlippage(n.default_slippage)},setTonConnectInstance:n=>{t().tonConnectInstance||e({tonConnectInstance:n})}}));function fr(e,...t){try{const n=e(...t);return n instanceof Promise?n.then(r=>({data:r,error:null})).catch(r=>({data:null,error:r})):Promise.resolve({data:n,error:null})}catch(n){return Promise.resolve({data:null,error:n})}}const nd="2.0.18",rd="EQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAM9c",G1={initial:{opacity:0,bottom:"0%",left:"0%",transform:"translateY(60%) translateX(0)",transition:{duration:.5,ease:[.4,.4,0,1]}},animate:{bottom:"0%",left:"0%",opacity:1,transform:"translateY(0) translateX(0)",transition:{duration:.5,ease:[.4,.4,0,1]}},exit:{bottom:"0%",left:"0%",opacity:0,transform:"translateY(60%) translateX(0)",transition:{duration:.5,ease:[.4,.4,0,1]}}},Y1={initial:{opacity:0,bottom:"50%",left:"50%",transform:"translate(-50%, 50%) scale(1.03)",transition:{duration:.3,ease:[.25,.1,.25,1]}},animate:{opacity:1,bottom:"50%",left:"50%",transform:"translate(-50%, 50%) scale(1)",transition:{duration:.3,ease:[.25,.1,.25,1]}},exit:{opacity:0,bottom:"50%",left:"50%",transform:"translate(-50%, 50%) scale(1.03)",transition:{duration:.3,ease:[.25,.1,.25,1]}}},fc={bottomRight:{initial:{opacity:0,scale:.95,transformOrigin:"top right",top:"115%",right:"0%",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,top:"115%",right:"0%",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,scale:.95,transition:{duration:.15,ease:"easeOut"}}},bottomLeft:{initial:{opacity:0,scale:.95,transformOrigin:"top left",top:"115%",left:"0%",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,top:"115%",left:"0%",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,scale:.95,transition:{duration:.15,ease:"easeOut"}}},topRight:{initial:{opacity:0,scale:.95,transformOrigin:"top right",bottom:"115%",top:"auto",right:"0%",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,bottom:"115%",top:"auto",right:"0%",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,scale:.95,top:"auto",transition:{duration:.15,ease:"easeOut"}}},topLeft:{initial:{opacity:0,scale:.95,transformOrigin:"bottom left",bottom:"115%",top:"auto",left:"0%",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,bottom:"115%",top:"auto",left:"0%",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,top:"auto",scale:.95,transition:{duration:.15,ease:"easeOut"}}},topCenter:{initial:{opacity:0,scale:.5,transformOrigin:"bottom center",bottom:"115%",top:"auto",left:"50%",transform:"translateX(-50%) scale(0.95)",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,bottom:"115%",top:"auto",left:"50%",transform:"translateX(-50%) scale(1)",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,bottom:"110%",top:"auto",left:"50%",scale:.5,transform:"translateX(-50%) scale(0.95)",transition:{duration:.15,ease:"easeOut"}}},bottomCenter:{initial:{opacity:0,scale:.8,transformOrigin:"top center",top:"110%",left:"50%",transform:"translateX(-50%)",transition:{duration:.15,ease:"easeOut"}},animate:{opacity:1,scale:1,transformOrigin:"bottom center",top:"115%",left:"50%",transform:"translateX(-50%)",transition:{duration:.15,ease:"easeOut"}},exit:{opacity:0,top:"110%",transformOrigin:"bottom center",scale:.8,transition:{duration:.15,ease:"easeOut"}}}},kN={"top-right":fc.topRight,"top-left":fc.topLeft,"bottom-right":fc.bottomRight,"bottom-left":fc.bottomLeft,"top-center":fc.topCenter,"bottom-center":fc.bottomCenter};let AN={data:""},EN=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||AN,TN=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,PN=/\/\*[^]*?\*\/| +/g,u6=/\n+/g,Fs=(e,t)=>{let n="",r="",i="";for(let o in e){let s=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+s+";":r+=o[1]=="f"?Fs(s,o):o+"{"+Fs(s,o[1]=="k"?"":t)+"}":typeof s=="object"?r+=Fs(s,t?t.replace(/([^,])+/g,a=>o.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,c=>/&/.test(c)?c.replace(/&/g,a):a?a+" "+c:c)):o):s!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=Fs.p?Fs.p(o,s):o+":"+s+";")}return n+(t&&i?t+"{"+i+"}":i)+r},Jo={},d6=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+d6(e[n]);return t}return e},BN=(e,t,n,r,i)=>{let o=d6(e),s=Jo[o]||(Jo[o]=(c=>{let d=0,f=11;for(;d>>0;return"go"+f})(o));if(!Jo[s]){let c=o!==e?e:(d=>{let f,p,g=[{}];for(;f=TN.exec(d.replace(PN,""));)f[4]?g.shift():f[3]?(p=f[3].replace(u6," ").trim(),g.unshift(g[0][p]=g[0][p]||{})):g[0][f[1]]=f[2].replace(u6," ").trim();return g[0]})(e);Jo[s]=Fs(i?{["@keyframes "+s]:c}:c,n?"":"."+s)}let a=n&&Jo.g?Jo.g:null;return n&&(Jo.g=Jo[s]),((c,d,f,p)=>{p?d.data=d.data.replace(p,c):d.data.indexOf(c)===-1&&(d.data=f?c+d.data:d.data+c)})(Jo[s],t,r,a),s},IN=(e,t,n)=>e.reduce((r,i,o)=>{let s=t[o];if(s&&s.call){let a=s(n),c=a&&a.props&&a.props.className||/^go/.test(a)&&a;s=c?"."+c:a&&typeof a=="object"?a.props?"":Fs(a,""):a===!1?"":a}return r+i+(s??"")},"");function ep(e){let t=this||{},n=e.call?e(t.p):e;return BN(n.unshift?n.raw?IN(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,EN(t.target),t.g,t.o,t.k)}let f6,J1,Q1;ep.bind({g:1});let Qo=ep.bind({k:1});function MN(e,t,n,r){Fs.p=t,f6=e,J1=n,Q1=r}function zs(e,t){let n=this||{};return function(){let r=arguments;function i(o,s){let a=Object.assign({},o),c=a.className||i.className;n.p=Object.assign({theme:J1&&J1()},a),n.o=/ *go\d+/.test(c),a.className=ep.apply(n,r)+(c?" "+c:"");let d=e;return e[0]&&(d=a.as||e,delete a.as),Q1&&d[0]&&Q1(a),f6(d,a)}return i}}var RN=e=>typeof e=="function",tp=(e,t)=>RN(e)?e(t):e,ON=(()=>{let e=0;return()=>(++e).toString()})(),h6=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),$N=20,np=new Map,LN=1e3,p6=e=>{if(np.has(e))return;let t=setTimeout(()=>{np.delete(e),fl({type:4,toastId:e})},LN);np.set(e,t)},UN=e=>{let t=np.get(e);t&&clearTimeout(t)},X1=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,$N)};case 1:return t.toast.id&&UN(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?X1(e,{type:1,toast:n}):X1(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?p6(r):e.toasts.forEach(o=>{p6(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},rp=[],ip={toasts:[],pausedAt:void 0},fl=e=>{ip=X1(ip,e),rp.forEach(t=>{t(ip)})},NN={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},DN=(e={})=>{let[t,n]=xe.useState(ip);xe.useEffect(()=>(rp.push(n),()=>{let i=rp.indexOf(n);i>-1&&rp.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,s;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||NN[i.type],style:{...e.style,...(s=e[i.type])==null?void 0:s.style,...i.style}}});return{...t,toasts:r}},jN=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||ON()}),id=e=>(t,n)=>{let r=jN(t,e,n);return fl({type:2,toast:r}),r.id},vi=(e,t)=>id("blank")(e,t);vi.error=id("error"),vi.success=id("success"),vi.loading=id("loading"),vi.custom=id("custom"),vi.dismiss=e=>{fl({type:3,toastId:e})},vi.remove=e=>fl({type:4,toastId:e}),vi.promise=(e,t,n)=>{let r=vi.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(vi.success(tp(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{vi.error(tp(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var FN=(e,t)=>{fl({type:1,toast:{id:e,height:t}})},zN=()=>{fl({type:5,time:Date.now()})},VN=e=>{let{toasts:t,pausedAt:n}=DN(e);xe.useEffect(()=>{if(n)return;let o=Date.now(),s=t.map(a=>{if(a.duration===1/0)return;let c=(a.duration||0)+a.pauseDuration-(o-a.createdAt);if(c<0){a.visible&&vi.dismiss(a.id);return}return setTimeout(()=>vi.dismiss(a.id),c)});return()=>{s.forEach(a=>a&&clearTimeout(a))}},[t,n]);let r=xe.useCallback(()=>{n&&fl({type:6,time:Date.now()})},[n]),i=xe.useCallback((o,s)=>{let{reverseOrder:a=!1,gutter:c=8,defaultPosition:d}=s||{},f=t.filter(b=>(b.position||d)===(o.position||d)&&b.height),p=f.findIndex(b=>b.id===o.id),g=f.filter((b,_)=>_b.visible).slice(...a?[g+1]:[0,g]).reduce((b,_)=>b+(_.height||0)+c,0)},[t]);return{toasts:t,handlers:{updateHeight:FN,startPause:zN,endPause:r,calculateOffset:i}}},WN=Qo` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,HN=Qo` from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; }`,KN=Qo` from { transform: scale(0) rotate(90deg); opacity: 0; } to { transform: scale(1) rotate(90deg); opacity: 1; }`,qN=zs("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#ff4b4b"}; position: relative; transform: rotate(45deg); animation: ${WN} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after, &:before { content: ''; animation: ${HN} 0.15s ease-out forwards; animation-delay: 150ms; position: absolute; border-radius: 3px; opacity: 0; background: ${e=>e.secondary||"#fff"}; bottom: 9px; left: 4px; height: 2px; width: 12px; } &:before { animation: ${KN} 0.15s ease-out forwards; animation-delay: 180ms; transform: rotate(90deg); } `,ZN=Qo` from { transform: rotate(0deg); } to { transform: rotate(360deg); } `,GN=zs("div")` width: 12px; height: 12px; box-sizing: border-box; border: 2px solid; border-radius: 100%; border-color: ${e=>e.secondary||"#e0e0e0"}; border-right-color: ${e=>e.primary||"#616161"}; animation: ${ZN} 1s linear infinite; `,YN=Qo` from { transform: scale(0) rotate(45deg); opacity: 0; } to { transform: scale(1) rotate(45deg); opacity: 1; }`,JN=Qo` 0% { height: 0; width: 0; opacity: 0; } 40% { height: 0; width: 6px; opacity: 1; } 100% { opacity: 1; height: 10px; }`,QN=zs("div")` width: 20px; opacity: 0; height: 20px; border-radius: 10px; background: ${e=>e.primary||"#61d345"}; position: relative; transform: rotate(45deg); animation: ${YN} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; animation-delay: 100ms; &:after { content: ''; box-sizing: border-box; animation: ${JN} 0.2s ease-out forwards; opacity: 0; animation-delay: 200ms; position: absolute; border-right: 2px solid; border-bottom: 2px solid; border-color: ${e=>e.secondary||"#fff"}; bottom: 6px; left: 6px; height: 10px; width: 6px; } `,XN=zs("div")` position: absolute; `,eD=zs("div")` position: relative; display: flex; justify-content: center; align-items: center; min-width: 20px; min-height: 20px; `,tD=Qo` from { transform: scale(0.6); opacity: 0.4; } to { transform: scale(1); opacity: 1; }`,nD=zs("div")` position: relative; transform: scale(0.6); opacity: 0.4; min-width: 20px; animation: ${tD} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; `,rD=({toast:e})=>{let{icon:t,type:n,iconTheme:r}=e;return t!==void 0?typeof t=="string"?_n.createElement(nD,null,t):t:n==="blank"?null:_n.createElement(eD,null,_n.createElement(GN,{...r}),n!=="loading"&&_n.createElement(XN,null,n==="error"?_n.createElement(qN,{...r}):_n.createElement(QN,{...r})))},iD=e=>` 0% {transform: translate3d(0,${e*-200}%,0) scale(.6); opacity:.5;} 100% {transform: translate3d(0,0,0) scale(1); opacity:1;} `,oD=e=>` 0% {transform: translate3d(0,0,-1px) scale(1); opacity:1;} 100% {transform: translate3d(0,${e*-150}%,-1px) scale(.6); opacity:0;} `,sD="0%{opacity:0;} 100%{opacity:1;}",aD="0%{opacity:1;} 100%{opacity:0;}",lD=zs("div")` display: flex; align-items: center; background: #fff; color: #363636; line-height: 1.3; will-change: transform; box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05); max-width: 350px; pointer-events: auto; padding: 8px 10px; border-radius: 8px; `,cD=zs("div")` display: flex; justify-content: center; margin: 4px 10px; color: inherit; flex: 1 1 auto; white-space: pre-line; `,uD=(e,t)=>{let n=e.includes("top")?1:-1,[r,i]=h6()?[sD,aD]:[iD(n),oD(n)];return{animation:t?`${Qo(r)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${Qo(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},dD=_n.memo(({toast:e,position:t,style:n,children:r})=>{let i=e.height?uD(e.position||t||"top-center",e.visible):{opacity:0},o=_n.createElement(rD,{toast:e}),s=_n.createElement(cD,{...e.ariaProps},tp(e.message,e));return _n.createElement(lD,{className:e.className,style:{...i,...n,...e.style}},typeof r=="function"?r({icon:o,message:s}):_n.createElement(_n.Fragment,null,o,s))});MN(_n.createElement);var fD=({id:e,className:t,style:n,onHeightUpdate:r,children:i})=>{let o=_n.useCallback(s=>{if(s){let a=()=>{let c=s.getBoundingClientRect().height;r(e,c)};a(),new MutationObserver(a).observe(s,{subtree:!0,childList:!0,characterData:!0})}},[e,r]);return _n.createElement("div",{ref:o,className:t,style:n},i)},hD=(e,t)=>{let n=e.includes("top"),r=n?{top:0}:{bottom:0},i=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:h6()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(n?1:-1)}px)`,...r,...i}},pD=ep` z-index: 9999; > * { pointer-events: auto; } `,op=16,gD=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:s})=>{let{toasts:a,handlers:c}=VN(n);return _n.createElement("div",{style:{position:"fixed",zIndex:9999,top:op,left:op,right:op,bottom:op,pointerEvents:"none",...o},className:s,onMouseEnter:c.startPause,onMouseLeave:c.endPause},a.map(d=>{let f=d.position||t,p=c.calculateOffset(d,{reverseOrder:e,gutter:r,defaultPosition:t}),g=hD(f,p);return _n.createElement(fD,{id:d.id,key:d.id,onHeightUpdate:c.updateHeight,className:d.visible?pD:"",style:g},d.type==="custom"?tp(d.message,d):i?i(d):_n.createElement(dD,{toast:d,position:f}))}))},sp=vi;const Vs=uu((e,t)=>({client:new Z1({headers:{"widget-version":nd}}),wallet:null,walletConnected:!1,balance:new Map,disconnect(){e(()=>({wallet:null,balance:new Map}))},async setWallet(n){const{client:r,wallet:i}=t();if(!(!n||i&&n.account.address===i.account.address)){e(()=>({wallet:n}));try{const o=await fr(()=>r.tonapi.getWalletAssets(n.account.address));if(o.error){hr(o.error,"Failed to fetch balances","wallet.store.ts setWallet getWalletAssets :45");return}const s=o.data;e(()=>({balance:s}));const a=Array.from(s.keys()),c=await fr(()=>r.assets.getAssets(a));if(c.error){hr(c.error,"Failed to fetch assets","wallet.store.ts setWallet getAssets :59");return}const d=c.data;qn.getState().addToAssets(d)}catch(o){console.log(o)}}},async refetch(){const{wallet:n,client:r}=t();if(n)try{const i=await fr(()=>r.tonapi.getWalletAssets(n.account.address));if(i.error){hr(i.error,"Failed to fetch balances","wallet.store.ts refetch getWalletAssets :81");return}const o=i.data;e(()=>({balance:o}))}catch(i){console.log(i)}}})),mD=new Set(["ENOTFOUND","ENETUNREACH","UNABLE_TO_GET_ISSUER_CERT","UNABLE_TO_GET_CRL","UNABLE_TO_DECRYPT_CERT_SIGNATURE","UNABLE_TO_DECRYPT_CRL_SIGNATURE","UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY","CERT_SIGNATURE_FAILURE","CRL_SIGNATURE_FAILURE","CERT_NOT_YET_VALID","CERT_HAS_EXPIRED","CRL_NOT_YET_VALID","CRL_HAS_EXPIRED","ERROR_IN_CERT_NOT_BEFORE_FIELD","ERROR_IN_CERT_NOT_AFTER_FIELD","ERROR_IN_CRL_LAST_UPDATE_FIELD","ERROR_IN_CRL_NEXT_UPDATE_FIELD","OUT_OF_MEM","DEPTH_ZERO_SELF_SIGNED_CERT","SELF_SIGNED_CERT_IN_CHAIN","UNABLE_TO_GET_ISSUER_CERT_LOCALLY","UNABLE_TO_VERIFY_LEAF_SIGNATURE","CERT_CHAIN_TOO_LONG","CERT_REVOKED","INVALID_CA","PATH_LENGTH_EXCEEDED","INVALID_PURPOSE","CERT_UNTRUSTED","CERT_REJECTED","HOSTNAME_MISMATCH"]);var yD=e=>!mD.has(e&&e.code);const bD=ka(yD),ey="axios-retry";function g6(e){const t=["ERR_CANCELED","ECONNABORTED"];return e.response||!e.code||t.includes(e.code)?!1:bD(e)}const m6=["get","head","options"],vD=m6.concat(["put","delete"]);function ty(e){return e.code!=="ECONNABORTED"&&(!e.response||e.response.status===429||e.response.status>=500&&e.response.status<=599)}function wD(e){var t;return(t=e.config)!=null&&t.method?ty(e)&&m6.indexOf(e.config.method)!==-1:!1}function y6(e){var t;return(t=e.config)!=null&&t.method?ty(e)&&vD.indexOf(e.config.method)!==-1:!1}function b6(e){return g6(e)||y6(e)}function ny(e=void 0){var r;const t=(r=e==null?void 0:e.response)==null?void 0:r.headers["retry-after"];if(!t)return 0;let n=(Number(t)||0)*1e3;return n===0&&(n=(new Date(t).valueOf()||0)-Date.now()),Math.max(0,n)}function _D(e=0,t=void 0){return Math.max(0,ny(t))}function xD(e=0,t=void 0,n=100){const r=2**e*n,i=Math.max(r,ny(t)),o=i*.2*Math.random();return i+o}function CD(e=100){return(t=0,n=void 0)=>{const r=t*e;return Math.max(r,ny(n))}}const SD={retries:3,retryCondition:b6,retryDelay:_D,shouldResetTimeout:!1,onRetry:()=>{},onMaxRetryTimesExceeded:()=>{},validateResponse:null};function kD(e,t){return{...SD,...t,...e[ey]}}function v6(e,t,n=!1){const r=kD(e,t||{});return r.retryCount=r.retryCount||0,(!r.lastRequestTime||n)&&(r.lastRequestTime=Date.now()),e[ey]=r,r}function AD(e,t){e.defaults.agent===t.agent&&delete t.agent,e.defaults.httpAgent===t.httpAgent&&delete t.httpAgent,e.defaults.httpsAgent===t.httpsAgent&&delete t.httpsAgent}async function ED(e,t){const{retries:n,retryCondition:r}=e,i=(e.retryCount||0)d],await s(t.retryCount,n,r),(c=r.signal)!=null&&c.aborted?Promise.resolve(e(r)):new Promise(d=>{var g;const f=()=>{clearTimeout(p),d(e(r))},p=setTimeout(()=>{var b;d(e(r)),(b=r.signal)!=null&&b.removeEventListener&&r.signal.removeEventListener("abort",f)},a);(g=r.signal)!=null&&g.addEventListener&&r.signal.addEventListener("abort",f,{once:!0})})}async function PD(e,t){e.retryCount>=e.retries&&await e.onMaxRetryTimesExceeded(t,e.retryCount)}const Ws=(e,t)=>{const n=e.interceptors.request.use(i=>{var o;return v6(i,t,!0),(o=i[ey])!=null&&o.validateResponse&&(i.validateStatus=()=>!1),i}),r=e.interceptors.response.use(null,async i=>{var a;const{config:o}=i;if(!o)return Promise.reject(i);const s=v6(o,t);return i.response&&((a=s.validateResponse)!=null&&a.call(s,i.response))?i.response:await ED(s,i)?TD(e,s,i,o):(await PD(s,i),Promise.reject(i))});return{requestInterceptorId:n,responseInterceptorId:r}};Ws.isNetworkError=g6,Ws.isSafeRequestError=wD,Ws.isIdempotentRequestError=y6,Ws.isNetworkOrIdempotentRequestError=b6,Ws.exponentialDelay=xD,Ws.linearDelay=CD,Ws.isRetryableError=ty,Ws(Dn,{retries:3});const w6=Dn.create({baseURL:"https://app.mytonswap.com/api",headers:{"Content-Type":"application/json"}});async function BD(e){try{await w6.post("/stats/error",e),console.log("Error reported successfully")}catch(t){console.error("Failed to report error:",t)}}async function ry(e){const{onePayRoute:t,pay_token:n,pay_rate:r,pay_amount:i,receive_token:o,receive_rate:s,bestRoute:a,slippage:c,swapModal:d,transactionHash:f}=qn.getState(),p=JSON.stringify({onePayRoute:t,pay_token:n,pay_rate:r,pay_amount:i.toString(),receive_token:o,receive_rate:s,bestRoute:a,slippage:c,swapModal:d,transactionHash:f},null,2),{wallet:g,balance:b}=Vs.getState(),_=JSON.stringify({wallet:g,balance:Object.fromEntries(b)},null,2);e+=` [SWAP STATE]: ${p} [WALLET STATE]: ${_}`,await BD({section:"widget",error:e,distinct_id:"cdef4d5a-8f43-4f82-be21-52a0ed1fa5e7",version:nd})}function hr(e,t,n){const r=n.split(":")[1];return Dn.isAxiosError(e)&&e.response?(ry(`Message: ${t} Error Code: 002 Location: ${n} Reason: ${JSON.stringify(e.response.data)} ${e} ${e.cause} ${e.code}`),sp.error(`${t} E${r}`)):Dn.isCancel(e)||!Dn.isAxiosError(e)?(ry(`Message: Failed to fetch assets Error Code: 001 Location: ${n} Reason: ${e.message} Trace: ${e.stack}`),sp.error(`${t} E${r}`)):(ry(`Message: Failed to fetch assets Error Code: 001 Location: ${n} Reason: ${e.message} Trace: ${e.stack}`),sp.error(`${t} E${r}`))}const Hs=uu(e=>({onTokenSelect:t=>{console.log("default onTokenSelect called"),console.log(t)},onSwap:t=>{console.log("default onSwap called"),console.log(t)},setOnTokenSelect:t=>{e({onTokenSelect:t})},setOnSwap:t=>{e({onSwap:t})}}));var Cr=(e=>(e.NONE="NONE",e.WAITING="WAITING",e.ACCEPTED="ACCEPTED",e.IN_PROGRESS="IN_PROGRESS",e.DONE="DONE",e.ERROR="ERROR",e.CONFIRM="CONFIRM",e))(Cr||{});const qn=uu((e,t)=>({client:new Z1({headers:{"widget-version":nd}}),pay_token:null,pay_rate:null,pay_amount:0n,receive_token:null,receive_rate:null,isLoading:!0,isSelectingToken:!1,isFindingBestRoute:!1,bestRoute:null,onePayRoute:null,slippage:"auto",communityTokens:localStorage.getItem("mts_widget_ct")==="true",acceptedCommunityToken:JSON.parse(localStorage.getItem("mts_widget_act")??"[]"),swapModal:"NONE",transactionError:null,transactionErrorBody:null,transactionHash:null,transactionQueryId:null,transactionBestRoute:null,pinnedTokens:null,assets:null,setTransactionHash(n,r){const{pay_token:i,receive_token:o,bestRoute:s,pay_amount:a,pay_rate:c,receive_rate:d}=t();Hs.getState().onSwap({type:"start",data:{pay:i,receive:o,pay_amount:a.toString(),receive_amount:(s==null?void 0:s.pool_data.receive.toString())??"0",pay_rate:(c==null?void 0:c.USD)??0,receive_rate:(d==null?void 0:d.USD)??0,dex:s.selected_pool.dex,hash:n}}),e(()=>({transactionHash:n,transactionQueryId:r,swapModal:"IN_PROGRESS"}))},setErrorMessage({errorMessage:n,errorTitle:r}){e(()=>({transactionError:r,transactionErrorBody:n,swapModal:"ERROR"}))},setModalState(n){e(()=>({swapModal:n}))},changeDirection(){const{receive_token:n,receive_rate:r}=t();n&&(Hs.getState().onTokenSelect({type:"pay",asset:n}),e(()=>({pay_token:n,pay_rate:r,pay_amount:0n,receive_token:null,receive_rate:null,bestRoute:null})))},addToken(n){const{acceptedCommunityToken:r}=t();if(!r.includes(n)){const i=[...r,n];localStorage.setItem("mts_widget_act",JSON.stringify(i)),e(()=>({acceptedCommunityToken:i}))}},removeToken(n){const{acceptedCommunityToken:r}=t();if(!r.includes(n)){const i=r.filter(o=>o!==n);localStorage.setItem("mts_widget_act",JSON.stringify(i)),e(()=>({acceptedCommunityToken:i}))}},isInAgreedTokens(n){const{acceptedCommunityToken:r}=t();return r.includes(n)},setCommunityTokens(n){localStorage.setItem("mts_widget_ct",String(n)),e(()=>({communityTokens:n}))},setSlippage(n){e(()=>({slippage:n}))},setIsLoading(n){e(()=>({isLoading:n}))},setPayToken:async n=>{e(()=>({isSelectingToken:!0})),Hs.getState().onTokenSelect({type:"pay",asset:n});const{client:r}=t();if(!n)return;const i=await fr(()=>r.tonapi.getAssetsRates([n.address]));if(i.error){hr(i.error,"Failed to get asset rates","swap.store.ts setPayToken getAssetsRates :165");return}const s=i.data.get(n.address);e(()=>({pay_token:n,pay_rate:s??null,pay_amount:0n,receive_rate:null,receive_token:null,bestRoute:null,isSelectingToken:!1}))},async setPayAmount(n){const{client:r,pay_token:i,receive_token:o,slippage:s}=t();if(e(()=>({pay_amount:n})),!i||!o)return;e(()=>({isFindingBestRoute:!0}));const a=await fr(()=>r.router.findBestRoute(i.address,o.address,n,s==="auto"?void 0:s));if(a.error){hr(a.error,"Failed to get best route","swap.store.ts setPayAmount findBestRoute :196");return}const c=a.data;if(!c)throw new Error("failed to get best route");e(()=>({bestRoute:c,isFindingBestRoute:!1}))},setReceiveToken:async n=>{e(()=>({isSelectingToken:!0})),Hs.getState().onTokenSelect({type:"receive",asset:n});const{client:r,pay_token:i,pay_amount:o,slippage:s}=t();if(!n||n.address===(i==null?void 0:i.address))return;const a=await fr(()=>r.tonapi.getAssetsRates([n.address]));if(a.error){hr(a.error,"Failed to get asset rates","swap.store.ts setReceiveToken getAssetsRates :215");return}const d=a.data.get(n.address);e(()=>({receive_token:n,receive_rate:d??null,isFindingBestRoute:!0,isSelectingToken:!1}));const f=await fr(()=>r.router.findBestRoute(i.address,n.address,td(1,i.decimal),s==="auto"?void 0:s));if(f.error){hr(f.error,"Failed to get one pay route","swap.store.ts setReceiveToken findBestRoute :238");return}const p=f.data;if(o>0n&&i){e(()=>({onePayRoute:p}));const g=await fr(()=>r.router.findBestRoute(i.address,n.address,o,s==="auto"?void 0:s));if(g.error){hr(g.error,"Failed to get best route","swap.store.ts setReceiveToken findBestRoute :258");return}const b=g.data;e(()=>({bestRoute:b,isFindingBestRoute:!1}))}else e(()=>({onePayRoute:p,isFindingBestRoute:!1}))},async addToAssets(n){n&&e(r=>{const i=new Map((r.assets||[]).map(s=>[s.address,s]));return n.forEach(s=>{s&&!i.has(s.address)&&i.set(s.address,s)}),{assets:Array.from(i.values())}})},async initializeApp(){const{client:n,slippage:r,setPayAmount:i}=t(),{default_pay_token:o,default_receive_token:s,pin_tokens:a,default_pay_amount:c}=Li.getState().options,d=async(g,b)=>{if(!g){const _=await fr(()=>n.assets.getExactAsset(b));return _.error?(hr(_.error,"Failed to get asset","swap.store.ts initializeApp getAsset :305"),null):_.data}try{Ri.address(g);const _=await fr(()=>n.assets.getExactAsset(g));return _.error?(hr(_.error,"Failed to get asset","swap.store.ts initializeApp getAsset :320"),null):_.data}catch{const _=await fr(()=>n.assets.getExactAsset(b));return _.error?(hr(_.error,"Failed to get asset","swap.store.ts initializeApp getAsset :333"),null):_.data}},f=async g=>{if(!g)return null;const b=await fr(()=>n.tonapi.getAssetsRates([g.address]));return b.error?(hr(b.error,"Failed to get asset rates","swap.store.ts initializeApp getRates :352"),null):b.data.get(g.address)??{USD:0}};await(async()=>{const g=await d(o,"TON"),b=await d(s,"");if(!g)return;const _=await f(g),S=await f(b);let k=null;if(g&&b){const B=await fr(()=>n.router.findBestRoute(g.address,b.address,td(1,g.decimal),r==="auto"?void 0:r));if(B.error){hr(B.error,"Failed to get one pay route","swap.store.ts initializeApp findBestRoute :383");return}k=B.data}let I=null;if(a&&a.length>0){const B=await fr(()=>n.assets.getAssets(a));if(B.error){hr(B.error,"Failed to get pinned tokens","swap.store.ts initializeApp getAssets :399");return}I=B.data}Hs.getState().onTokenSelect({type:"pay",asset:g}),b&&Hs.getState().onTokenSelect({type:"receive",asset:b}),e({pay_token:g,pay_rate:_,receive_token:b,receive_rate:S,onePayRoute:k,pinnedTokens:I,isLoading:!1})})(),i(c?BigInt(c):0n)},async refetchBestRoute(){const{pay_token:n,receive_token:r,pay_amount:i,slippage:o,client:s,swapModal:a}=t();if(!n||!r||a!=="NONE")return;e(()=>({isFindingBestRoute:!0}));const c=await fr(()=>s.router.findBestRoute(n.address,r.address,i,o==="auto"?void 0:o));if(c.error){hr(c.error,"Failed to get best route","swap.store.ts refetchBestRoute findBestRoute :436");return}const d=c.data;if(!d)throw new Error("failed to get best route");e(()=>({bestRoute:d,isFindingBestRoute:!1}))}}));var ID={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0};const MD=ka(ID);var RD=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function _6(e){var t={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(t.name=n[1],(MD[n[1]]||e.charAt(e.length-2)==="/")&&(t.voidElement=!0),t.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var i=new RegExp(RD),o=null;(o=i.exec(e))!==null;)if(o[0].trim())if(o[1]){var s=o[1].trim(),a=[s,""];s.indexOf("=")>-1&&(a=s.split("=")),t.attrs[a[0]]=a[1],i.lastIndex--}else o[2]&&(t.attrs[o[2]]=o[3].trim().substring(1,o[3].length-1));return t}var OD=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,$D=/^\s*$/,LD=Object.create(null);function x6(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(n){var r=[];for(var i in n)r.push(i+'="'+n[i]+'"');return r.length?" "+r.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(x6,"")+"";case"comment":return e+""}}var UD={parse:function(e,t){t||(t={}),t.components||(t.components=LD);var n,r=[],i=[],o=-1,s=!1;if(e.indexOf("<")!==0){var a=e.indexOf("<");r.push({type:"text",content:a===-1?e:e.substring(0,a)})}return e.replace(OD,function(c,d){if(s){if(c!=="")return;s=!1}var f,p=c.charAt(1)!=="/",g=c.startsWith("