UNPKG

@lovebowls/leagueelements

Version:

League Elements package for LoveBowls

1,081 lines (920 loc) 591 kB
var LeagueSchedule = (function () { 'use strict'; // Shared base styles for dropdown elements const dropdownStyles = ` /* Shared base styles for dropdown select elements */ .dropdown-select-shared { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-color: var(--le-background-color-panel, #fff); border: 1px solid var(--le-border-color-medium, #ddd); border-radius: var(--le-border-radius-small, 3px); padding: var(--le-padding-xs, 0.25rem); font-size: var(--le-font-size-base, 1em); color: var(--le-text-color-primary, #333); cursor: pointer; line-height: 1.4; max-width: 100%; width: auto; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 0.5em center; background-size: 1em; } .dropdown-select-shared:hover { border-color: var(--le-border-color-dark, #ccc); } .dropdown-select-shared:focus { outline: none; border-color: var(--le-text-color-accent, #2196f3); box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2); } .dropdown-shared { position: relative; display: inline-block; } /* Shared styles for dropdown menus (button-triggered) */ .list-item-actions { position: relative; /* Ensure actions container can contain absolutely positioned menu */ } .dropdown-menu { position: fixed; /* Use fixed positioning to escape container boundaries */ background-color: var(--le-background-color-panel, #fff); border: 1px solid var(--le-border-color-medium, #ddd); border-radius: var(--le-border-radius-standard, 4px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); min-width: 120px; z-index: 9999; /* Much higher z-index to appear above list containers */ margin-top: 2px; /* Small gap between button and menu */ } .dropdown-menu-item { padding: var(--le-padding-s, 0.5em) var(--le-padding-m, 0.75em); cursor: pointer; border-bottom: 1px solid var(--le-border-color-light, #eee); transition: background-color 0.2s ease; font-size: var(--le-font-size-base, 1em); color: var(--le-text-color-primary, #333); } .dropdown-menu-item:last-child { border-bottom: none; } .dropdown-menu-item:hover { background-color: var(--le-background-color-hover, #f5f5f5); } .dropdown-menu-item:first-child { border-top-left-radius: var(--le-border-radius-standard, 4px); border-top-right-radius: var(--le-border-radius-standard, 4px); } .dropdown-menu-item:last-child { border-bottom-left-radius: var(--le-border-radius-standard, 4px); border-bottom-right-radius: var(--le-border-radius-standard, 4px); } `; const panelStyles = ` .panel { margin-bottom: var(--le-padding-m, 1.25em); border: 1px solid var(--le-border-color-light, #f0f0f0); border-radius: var(--le-border-radius-standard, 4px); background-color: var(--le-background-color-panel, #fff); } .panel-header-shared { padding: var(--le-padding-s, 0.75em) var(--le-padding-m, 1.25em); /* Increased padding */ border-bottom: 1px solid var(--le-border-color-medium, #eee); font-weight: bold; color: var(--le-text-color-primary, #333); background-color: var(--le-background-color-header, #f9f9f9); display: flex; justify-content: space-between; align-items: center; font-size: var(--le-font-size-medium, 1.1em); } .panel .panel-header { display: flex; justify-content: space-between; align-items: center; background-color: var(--le-background-color-header, #f9f9f9); } .panel-content { padding: var(--le-padding-m, 1.25em); background-color: var(--le-background-color-panel, #fff); /* Common border for content area if needed border: 1px solid var(--le-border-color-light, #f0f0f0); */ } .controls-panel { /* Layout properties moved to mobile/desktop sections */ padding: 0; margin-bottom: var(--le-padding-s, 0.5rem); margin-top: var(--le-padding-s, 0.5rem); background: transparent; border: none; display: flex; justify-content: space-between; align-items: center; gap: var(--le-padding-m, 1rem); } .filter-controls { gap: var(--le-padding-s, 0.5rem); display: flex; align-items: center; flex: 1; } /* Enhanced dropdown styling for button-like appearance */ .controls-panel .dropdown-shared { position: relative; display: inline-block; } .controls-panel .dropdown-select-shared { appearance: none; -webkit-appearance: none; -moz-appearance: none; background-color: var(--le-background-color-button, #f0f0f0); border: 1px solid var(--le-border-color-medium, #ddd); border-radius: var(--le-border-radius-standard, 4px); padding: var(--le-padding-xs, 0.25rem); font-size: var(--le-font-size-dropdown, 1em)); color: var(--le-text-color-primary, #333); cursor: pointer; line-height: 1.4; min-width: 150px; transition: all 0.2s ease; font-weight: 500; } .controls-panel .dropdown-select-shared:hover { background-color: var(--le-background-color-button-hover, #e0e0e0); border-color: var(--le-border-color-dark, #ccc); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .controls-panel .dropdown-select-shared:focus { outline: none; border-color: var(--le-text-color-accent, #2196f3); box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.2); background-color: var(--le-background-color-panel, #fff); } .controls-panel .dropdown-select-shared:active { background-color: var(--le-background-color-button-hover, #e0e0e0); transform: translateY(1px); } `; const buttonStyles = ` .button-shared { padding: 4px 8px; border: 1px solid var(--le-border-color-medium, #ccc); background-color: var(--le-background-color-button, #f0f0f0); color: var(--le-text-color-primary, #333); /* Ensure text color contrasts with button background */ cursor: pointer; border-radius: var(--le-border-radius-standard, 4px); font-size: var(--le-font-size-button, var(--le-font-size-medium, 1.15em)); /* Use variable with fallback */ text-decoration: none; display: inline-block; text-align: center; line-height: normal; /* Ensure consistent line height */ white-space: nowrap; /* Prevent text wrapping */ vertical-align: middle; /* Align nicely if next to text/icons */ user-select: none; /* Prevent text selection on click */ transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out; /* Smooth transitions */ } .button-shared:hover:not(:disabled) { background-color: var(--le-background-color-button-hover, #e0e0e0); border-color: var(--le-border-color-dark, #bbb); /* Slightly darker border on hover */ /* color: var(--le-text-color-accent-hover, inherit); Optional: change text color on hover */ } .button-shared:active:not(:disabled) { /* Optional: style for active (pressed) state */ /* background-color: var(--le-background-color-button-active, #d0d0d0); */ } .button-shared:disabled, .button-shared.disabled { /* Allow class-based disabling too */ background-color: var(--le-background-color-button-disabled, #eee); color: var(--le-text-color-secondary, #aaa); border-color: var(--le-border-color-medium, #ccc); /* Use medium border for disabled state */ cursor: not-allowed; opacity: 0.7; /* Visually indicate disabled state */ } /* Variations */ .button-shared.button-primary { background-color: var(--le-color-primary, #007bff); color: var(--le-text-color-on-primary, #fff); border-color: var(--le-color-primary, #007bff); } .button-shared.button-primary:hover:not(:disabled) { background-color: var(--le-color-primary-hover, #0056b3); border-color: var(--le-color-primary-hover, #0056b3); } .button-shared.button-secondary-light { background-color: var(--le-background-color-button-secondary-light, #f8f9fa); color: var(--le-text-color-secondary-light-text, #212529); border-color: var(--le-border-color-secondary-light, #ced4da); } .button-shared.button-secondary-light:hover:not(:disabled) { background-color: var(--le-background-color-button-secondary-light-hover, #e2e6ea); border-color: var(--le-border-color-secondary-light-hover, #dae0e5); color: var(--le-text-color-secondary-light-text-hover, #212529); } /* Example for a darker secondary button if needed elsewhere .button-shared.button-secondary { background-color: var(--le-color-secondary, #6c757d); color: var(--le-text-color-on-secondary, #fff); border-color: var(--le-color-secondary, #6c757d); } .button-shared.button-secondary:hover:not(:disabled) { background-color: var(--le-color-secondary-hover, #5a6268); border-color: var(--le-color-secondary-hover, #5a6268); } */ `; const pagingStyles = ` /* Paging Controls Styles */ .paging-controls { display: flex; justify-content: flex-end; gap: var(--le-padding-s, 0.5rem); margin-top: var(--le-padding-s, 0.5rem); padding: var(--le-padding-xs, 0.25rem) 0; background-color: transparent; border: none; font-size: var(--le-font-size-xs, 0.75em); } .paging-btn { background: var(--le-background-color-button, #f5f5f5); border: 1px solid var(--le-border-color-dark, #ccc); border-radius: var(--le-border-radius-small, 3px); padding: var(--le-padding-xs, 0.2rem) var(--le-padding-s, 0.7rem); cursor: pointer; color: var(--le-text-color-primary, #333); transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out; user-select: none; } .paging-btn:hover:not(:disabled) { background: var(--le-background-color-button-hover, #e0e0e0); border-color: var(--le-border-color-dark, #bbb); } .paging-btn:disabled { background: var(--le-background-color-button-disabled, #eee); color: var(--le-text-color-secondary, #aaa); cursor: not-allowed; opacity: 0.7; } `; const BASE_STYLES$1 = ` ${panelStyles} ${buttonStyles} ${dropdownStyles} ${pagingStyles} :host { display: block; font-family: var(--le-font-family-main, 'Open Sans', Helvetica, Arial, sans-serif); box-sizing: border-box; color: var(--le-text-color-primary, #333); } .schedule-container { display: flex; flex-direction: column; } .controls-panel { display: flex; justify-content: space-between; align-items: center; gap: var(--le-padding-m, 1rem); padding: var(--le-padding-s, 0.5rem) 0; } .filter-controls { display: flex; align-items: center; gap: var(--le-padding-s, 0.5rem); } .filter-panel { padding: 0; margin-bottom: 0; background: transparent; border: none; } .calendar-filter { padding: var(--le-padding-s, 0.5rem) 0; } .schedule-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: var(--le-padding-s, 0.5rem); display: table; } .schedule-table tr { display: table-row; margin: 0; padding: 0; } .schedule-table td, .schedule-table th { display: table-cell; margin: 0; padding: 0.25rem 0.5rem; line-height: 1.4; } .schedule-table th { background-color: var(--le-background-color-header, #f5f5f5); color: var(--le-text-color-primary, #333); font-weight: 600; text-align: center; padding: 0.25rem 0.5rem; border-bottom: 2px solid var(--le-border-color-medium, #ddd); display: table-cell; vertical-align: middle; line-height: 1.4; } .schedule-table th.date-col, .schedule-table th.team-col { text-align: left; } .schedule-table th.rink-col, .schedule-table th.result-col { text-align: center; } .schedule-table td { padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--le-border-color-light, #eee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; display: table-cell; vertical-align: middle; line-height: 1.4; margin: 0; border-left: none; border-right: none; border-top: none; } .schedule-table td:first-child, .schedule-table td:nth-child(3), .schedule-table td:nth-child(4) { text-align: left; } .schedule-table tr:hover { background-color: var(--le-background-color-row-hover, #f9f9f9); } .match-row { cursor: pointer; display: table-row; line-height: 1.4; padding: 0; margin: 0; border: none; background: none; } .match-row.selected { background-color: var(--le-background-color-selected, #e6f7ff); } /* Match state styles */ .match-row.past-with-result { opacity: 0.6; color: var(--le-text-color-secondary, #666); } .match-row.past-with-result td { color: var(--le-text-color-secondary, #666); } .match-row.past-with-result:hover { background-color: rgba(249, 249, 249, 0.8); } .match-row.past-no-result { background-color: #fff5f5; border-left: 4px solid #ff6b6b; } .match-row.past-no-result:hover { background-color: #ffebeb; } .match-row.past-no-result td { color: #d63031; font-weight: 500; } .match-row.past-no-result .result-col { font-style: normal; font-weight: 600; text-align: center; } .match-row.future { /* Keep normal styling for future matches */ } .date-col { width: 15%; } .team-col { width: 30%; } .result-col { width: 15%; } .rink-col { width: 10%; text-align: center; } .paging-info { color: var(--le-text-color-secondary, #666); } .paging-buttons { /* Layout properties moved to mobile/desktop sections */ gap: var(--le-padding-xs, 0.25rem); } .paging-buttons button { padding: 0.25rem 0.5rem; background-color: var(--le-background-color-button, #f0f0f0); border: 1px solid var(--le-border-color-medium, #ddd); border-radius: var(--le-border-radius-standard, 4px); color: var(--le-text-color-primary, #333); cursor: pointer; transition: all 0.2s ease; } .paging-buttons button:hover:not(:disabled) { background-color: var(--le-background-color-button-hover, #e0e0e0); border-color: var(--le-border-color-dark, #ccc); } .paging-buttons button:disabled { background-color: var(--le-background-color-button-disabled, #f5f5f5); color: var(--le-text-color-secondary, #999); cursor: not-allowed; opacity: 0.6; } .error { color: var(--le-text-color-error, #ff0000); padding: var(--le-padding-s, 0.5rem); background-color: var(--le-background-color-error, #fff0f0); border-radius: var(--le-border-radius-standard, 4px); margin-bottom: var(--le-padding-s, 0.5rem); } /* Needs attention styles */ .match-row.needs-attention { background-color: #fff8e1; /* Light yellow background for attention */ border-left: 4px solid #ff9800; /* Orange border for attention */ } .match-row.needs-attention:hover { background-color: #ffecb3; /* Slightly darker yellow on hover */ } .match-row.needs-attention td { color: #e65100; /* Dark orange text for attention */ font-weight: 500; } .match-row.needs-attention .result-col { font-style: normal; font-weight: 600; text-align: center; } /* Mobile needs attention styles */ .schedule-table .match-row.needs-attention { border-left: 4px solid #ff9800; background-color: #fff8e1; } /* Editable date link styles */ .date-link { color: var(--le-color-primary, #007bff); text-decoration: underline; cursor: pointer; transition: color 0.2s ease; } .date-link:hover { color: var(--le-color-primary-dark, #0056b3); text-decoration: underline; } .date-link:active { color: var(--le-color-primary-darker, #004085); } /* Editable rink link styles */ .rink-link { color: var(--le-color-primary, #007bff); text-decoration: underline; cursor: pointer; transition: color 0.2s ease; } .rink-link:hover { color: var(--le-color-primary-dark, #0056b3); text-decoration: underline; } .rink-link:active { color: var(--le-color-primary-darker, #004085); } `; const MOBILE_STYLES$1 = ` ${BASE_STYLES$1} /* Mobile-specific controls panel adjustments */ .controls-panel { flex-direction: column; gap: var(--le-padding-s, 0.5rem); align-items: stretch; } .controls-panel .dropdown-shared { width: 100%; } .controls-panel .dropdown-select-shared { width: 100%; min-width: auto; } .calendar-filter { width: 100%; } .schedule-cards { display: block; font-size: var(--le-font-size-xs); } .match-card { display: block; width: 100%; margin-bottom: 1rem; border: none; border-radius: 12px; padding: var(--le-padding-s); position: relative; background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06); border-left: 4px solid #e9ecef; transition: all 0.2s ease-in-out; cursor: pointer; box-sizing: border-box; } .match-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08); } /* Enhanced mobile match state styles */ .match-card.past-no-result { border-left: 4px solid #ff6b6b; background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%); box-shadow: 0 2px 8px rgba(255, 107, 107, 0.15), 0 1px 3px rgba(255, 107, 107, 0.1); } .match-card.past-with-result { border-left: 4px solid #28a745; background: linear-gradient(135deg, #f8fff9 0%, #e6f7e6 100%); opacity: 0.85; } .match-card.today { border-left: 4px solid #ffc107; background: linear-gradient(135deg, #fffbf0 0%, #fff3cd 100%); box-shadow: 0 2px 8px rgba(255, 193, 7, 0.2), 0 1px 3px rgba(255, 193, 7, 0.1); } .match-card.future { border-left: 4px solid #007bff; background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%); } .match-card.needs-attention { border-left: 4px solid #ff9800; background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%); box-shadow: 0 2px 8px rgba(255, 152, 0, 0.15), 0 1px 3px rgba(255, 152, 0, 0.1); } .card-row { display: flex; align-items: center; padding: 0; line-height: 1.4; } .card-label { font-weight: 600; width: 5%; margin-right: 0.75rem; color: var(--le-text-color-secondary, #6c757d); text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; } .card-value { flex: 1; font-weight: 500; color: var(--le-text-color-primary, #333); position: relative; } .card-row:after { content: ''; position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%); width: calc(100% - 15% - 0.75rem); height: 1px; background: linear-gradient(to right, rgba(0,0,0,0.1) 0%, transparent 100%); z-index: 0; } /* Remove the line for the last row */ .card-row:last-child:after { display: none; } .card-row:not(:last-child) { margin-bottom: 0.2rem; } /* Date styling */ .card-row:first-child .card-value { font-weight: 700; color: var(--le-color-primary, #007bff); } .match-card.today .card-row:first-child .card-value { color: #e67e22; text-shadow: 0 1px 2px rgba(230, 126, 34, 0.3); } /* Date and rink container styling */ .date-rink-container { display: flex; justify-content: space-between; align-items: center; width: 100%; } .date-section { text-align: left; flex: 1; } .rink-section { text-align: right; color: var(--le-text-color-secondary, #666); font-weight: 500; margin-left: 0.5rem; } /* Teams and result grid layout */ .teams-result-row { display: grid; grid-template-columns: auto 1fr 1rem auto 1rem 1fr auto; align-items: center; width: 100%; gap: 0; } .home-label { font-weight: 600; color: var(--le-text-color-secondary, #6c757d); text-transform: uppercase; letter-spacing: 0.5px; grid-column: 1; margin-right: 0.25rem; } .team-name-home { font-weight: 500; color: var(--le-text-color-primary, #2c3e50); text-align: right; grid-column: 2; } .result-score { font-weight: 700; color: var(--le-color-primary, #007bff); background: none !important; white-space: nowrap; grid-column: 4; justify-self: center; } .team-name-away { font-weight: 500; color: var(--le-text-color-primary, #2c3e50); text-align: left; grid-column: 6; } .away-label { font-weight: 600; color: var(--le-text-color-secondary, #6c757d); text-transform: uppercase; letter-spacing: 0.5px; grid-column: 7; margin-left: 0.25rem; } /* Winner team styling */ .team-name-home.winner, .team-name-away.winner { font-weight: 700; } /* Result styling for different match states */ .match-card.past-no-result .result-score, .match-card.needs-attention .result-score { background-color: rgba(214, 48, 49, 0.1); color: #d63031; } .match-card.past-with-result .result-score { background-color: rgba(40, 167, 69, 0.1); color: #28a745; } .paging-info { text-align: center; } `; const DESKTOP_STYLES$1 = ` ${BASE_STYLES$1} /* Desktop-specific controls panel adjustments */ .controls-panel { justify-content: space-between; align-items: center; width: 100%; padding: 0 var(--le-padding-s, 0.5rem); box-sizing: border-box; } .filter-controls { display: flex; align-items: center; gap: var(--le-padding-s, 0.5rem); flex: 1; justify-content: space-between; } /* Desktop-specific dropdown styling for filter controls */ .filter-controls .dropdown-shared { width: auto; min-width: 120px; } .filter-controls .dropdown-shared:last-child { text-align: right; } .filter-controls .dropdown-select-shared { width: 100%; min-width: 120px; } .filter-controls .dropdown-shared:last-child .dropdown-select-shared { width: auto; min-width: 120px; } .calendar-filter { max-width: 400px; margin: 0; } .paging-controls { display: flex; justify-content: space-between; align-items: center; } .paging-settings { display: flex; align-items: center; } .paging-buttons { display: flex; } /* Desktop table layout */ .schedule-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin-top: var(--le-padding-s, 0.5rem); display: table; } .schedule-table tr { display: table-row; margin: 0; padding: 0; } .schedule-table td, .schedule-table th { display: table-cell; margin: 0; padding: 0.25rem 0.5rem; line-height: 1.4; } .schedule-table th { background-color: var(--le-background-color-header, #f5f5f5); color: var(--le-text-color-primary, #333); font-weight: 600; text-align: center; padding: 0.25rem 0.5rem; border-bottom: 2px solid var(--le-border-color-medium, #ddd); display: table-cell; vertical-align: middle; line-height: 1.4; } .schedule-table th.date-col, .schedule-table th.team-col { text-align: left; } .schedule-table th.rink-col, .schedule-table th.result-col { text-align: center; } .schedule-table td { padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--le-border-color-light, #eee); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; display: table-cell; vertical-align: middle; line-height: 1.4; margin: 0; border-left: none; border-right: none; border-top: none; } .schedule-table td[data-label="Date"], .schedule-table td[data-label="H"] { text-align: left; } .schedule-table td[data-label="Rink"], .schedule-table td[data-label="Result"] { text-align: center; } .schedule-table td[data-label="A"] { text-align: left; } .schedule-table tr:hover { background-color: var(--le-background-color-row-hover, #f9f9f9); } .schedule-table thead { display: table-header-group; } .schedule-table tbody { display: table-row-group; } .schedule-table tr { display: table-row; margin-bottom: 0; border: none; border-radius: 0; padding: 0; } .schedule-table td::before { content: none; } /* Desktop column widths */ .date-col { width: 15%; } .team-col { width: 30%; } .result-col { width: 15%; } .rink-col { width: 10%; text-align: center; } /* Desktop match row styles */ .match-row { cursor: pointer; display: table-row; line-height: 1.4; padding: 0; margin: 0; border: none; background: none; } .match-row.selected { background-color: var(--le-background-color-selected, #e6f7ff); } .match-row.past-with-result { opacity: 0.6; color: var(--le-text-color-secondary, #666); } .match-row.past-with-result td { color: var(--le-text-color-secondary, #666); } .match-row.past-with-result:hover { background-color: rgba(249, 249, 249, 0.8); } .match-row.past-no-result { background-color: #fff5f5; border-left: 4px solid #ff6b6b; } .match-row.past-no-result:hover { background-color: #ffebeb; } .match-row.past-no-result td { color: #d63031; font-weight: 500; } .match-row.past-no-result .result-col { font-style: normal; font-weight: 600; text-align: center; } .match-row.needs-attention { background-color: #fff8e1; border-left: 4px solid #ff9800; } .match-row.needs-attention:hover { background-color: #ffecb3; } .match-row.needs-attention td { color: #e65100; font-weight: 500; } .match-row.needs-attention .result-col { font-style: normal; font-weight: 600; text-align: center; } /* Desktop-specific column alignments */ .home-col { text-align: right !important; } .center-align { text-align: center !important; } /* Desktop winner styling */ .winner { font-weight: 700 !important; } /* Desktop dropdowns - ensure consistency */ .controls-panel .dropdown-shared { width: auto; min-width: 160px; } `; var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } var jsbiUmd$1 = {exports: {}}; var jsbiUmd = jsbiUmd$1.exports; var hasRequiredJsbiUmd; function requireJsbiUmd () { if (hasRequiredJsbiUmd) return jsbiUmd$1.exports; hasRequiredJsbiUmd = 1; (function (module, exports) { (function(e,t){module.exports=t();})(jsbiUmd,function(){var e=Math.imul,t=Math.clz32;function i(t,i){(null==i||i>t.length)&&(i=t.length);for(var _=0,o=Array(i);_<i;_++)o[_]=t[_];return o}function _(e){if(Array.isArray(e))return e}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(i,t,_){return t=r(t),v(i,b()?Reflect.construct(t,_||[],r(i).constructor):t.apply(i,_))}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function g(i,t,e){if(b())return Reflect.construct.apply(null,arguments);var _=[null];_.push.apply(_,t);var n=new(i.bind.apply(i,_));return e&&y(n,e.prototype),n}function a(i,e){for(var _,n=0;n<e.length;n++)_=e[n],_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(i,D(_.key),_);}function s(i,e,_){return e&&a(i.prototype,e),_&&a(i,_),Object.defineProperty(i,"prototype",{writable:!1}),i}function u(i,_){var e="undefined"!=typeof Symbol&&i[Symbol.iterator]||i["@@iterator"];if(!e){if(Array.isArray(i)||(e=B(i))||_&&i&&"number"==typeof i.length){e&&(i=e);var l=0,g=function(){};return {s:g,n:function(){return l>=i.length?{done:!0}:{done:!1,value:i[l++]}},e:function(e){throw e},f:g}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,d=!0,h=!1;return {s:function(){e=e.call(i);},n:function(){var t=e.next();return d=t.done,t},e:function(e){h=!0,s=e;},f:function(){try{d||null==e.return||e.return();}finally{if(h)throw s}}}}function r(e){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},r(e)}function d(i,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(t&&t.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),t&&y(i,t);}function h(e){try{return -1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return "function"==typeof e}}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(e){}return (b=function(){return !!e})()}function m(_,g){var l=null==_?null:"undefined"!=typeof Symbol&&_[Symbol.iterator]||_["@@iterator"];if(null!=l){var s,d,r,h,b=[],a=!0,m=!1;try{if(r=(l=l.call(_)).next,0===g){if(Object(l)!==l)return;a=!1;}else for(;!(a=(s=r.call(l)).done)&&(b.push(s.value),b.length!==g);a=!0);}catch(e){m=!0,d=e;}finally{try{if(!a&&null!=l.return&&(h=l.return(),Object(h)!==h))return}finally{if(m)throw d}}return b}}function c(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(i,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return n(i)}function y(i,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,t){return i.__proto__=t,i},y(i,t)}function f(t,i){return _(t)||m(t,i)||B(t,i)||c()}function k(_,t){if("object"!=typeof _||!_)return _;var n=_[Symbol.toPrimitive];if(void 0!==n){var e=n.call(_,t||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return ("string"===t?String:Number)(_)}function D(e){var t=k(e,"string");return "symbol"==typeof t?t:t+""}function p(e){"@babel/helpers - typeof";return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function B(e,_){if(e){if("string"==typeof e)return i(e,_);var n={}.toString.call(e).slice(8,-1);return "Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,_):void 0}}function S(e){var i="function"==typeof Map?new Map:void 0;return S=function(e){function t(){return g(e,arguments,r(this).constructor)}if(null===e||!h(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==i){if(i.has(e))return i.get(e);i.set(e,t);}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),y(t,e)},S(e)}var C=function(e){var t=Math.abs,i=Math.max,_=Math.floor;function g(e,t){var i;if(l(this,g),i=o(this,g,[e]),i.sign=t,Object.setPrototypeOf(i,g.prototype),e>g.__kMaxLength)throw new RangeError("Maximum BigInt size exceeded");return i}return d(g,e),s(g,[{key:"toDebugString",value:function e(){var t,i=["BigInt["],_=u(this);try{for(_.s();!(t=_.n()).done;){var n=t.value;i.push((n?(n>>>0).toString(16):n)+", ");}}catch(e){_.e(e);}finally{_.f();}return i.push("]"),i.join("")}},{key:"toString",value:function e(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:10;if(2>t||36<t)throw new RangeError("toString() radix argument must be between 2 and 36");return 0===this.length?"0":0==(t&t-1)?g.__toStringBasePowerOfTwo(this,t):g.__toStringGeneric(this,t,!1)}},{key:"valueOf",value:function e(){throw new Error("Convert JSBI instances to native numbers using `toNumber`.")}},{key:"__copy",value:function e(){for(var t=new g(this.length,this.sign),_=0;_<this.length;_++)t[_]=this[_];return t}},{key:"__trim",value:function e(){for(var t=this.length,i=this[t-1];0===i;)t--,i=this[t-1],this.pop();return 0===t&&(this.sign=!1),this}},{key:"__initializeDigits",value:function e(){for(var t=0;t<this.length;t++)this[t]=0;}},{key:"__clzmsd",value:function e(){return g.__clz30(this.__digit(this.length-1))}},{key:"__inplaceMultiplyAdd",value:function n(e,t,_){_>this.length&&(_=this.length);for(var o=32767&e,l=e>>>15,a=0,s=t,u=0;u<_;u++){var r=this.__digit(u),h=32767&r,b=r>>>15,m=g.__imul(h,o),c=g.__imul(h,l),v=g.__imul(b,o),y=g.__imul(b,l),f=s+m+a;a=f>>>30,f&=1073741823,f+=((32767&c)<<15)+((32767&v)<<15),a+=f>>>30,s=y+(c>>>15)+(v>>>15),this.__setDigit(u,1073741823&f);}if(0!==a||0!==s)throw new Error("implementation bug")}},{key:"__inplaceAdd",value:function n(e,t,_){for(var o,l=0,g=0;g<_;g++)o=this.__halfDigit(t+g)+e.__halfDigit(g)+l,l=o>>>15,this.__setHalfDigit(t+g,32767&o);return l}},{key:"__inplaceSub",value:function n(e,t,_){var o=_-1>>>1,l=0;if(1&t){t>>=1;for(var g=this.__digit(t),a=32767&g,s=0;s<o;s++){var u=e.__digit(s),r=(g>>>15)-(32767&u)-l;l=1&r>>>15,this.__setDigit(t+s,(32767&r)<<15|32767&a),g=this.__digit(t+s+1),a=(32767&g)-(u>>>15)-l,l=1&a>>>15;}var d=e.__digit(s),h=(g>>>15)-(32767&d)-l;l=1&h>>>15,this.__setDigit(t+s,(32767&h)<<15|32767&a);var b=d>>>15;if(t+s+1>=this.length)throw new RangeError("out of bounds");0==(1&_)&&(g=this.__digit(t+s+1),a=(32767&g)-b-l,l=1&a>>>15,this.__setDigit(t+e.length,1073709056&g|32767&a));}else {t>>=1;for(var m=0;m<e.length-1;m++){var c=this.__digit(t+m),v=e.__digit(m),y=(32767&c)-(32767&v)-l;l=1&y>>>15;var f=(c>>>15)-(v>>>15)-l;l=1&f>>>15,this.__setDigit(t+m,(32767&f)<<15|32767&y);}var k=this.__digit(t+m),D=e.__digit(m),p=(32767&k)-(32767&D)-l;l=1&p>>>15;var B=0;0==(1&_)&&(B=(k>>>15)-(D>>>15)-l,l=1&B>>>15),this.__setDigit(t+m,(32767&B)<<15|32767&p);}return l}},{key:"__inplaceRightShift",value:function t(e){if(0!==e){for(var _,n=this.__digit(0)>>>e,o=this.length-1,l=0;l<o;l++)_=this.__digit(l+1),this.__setDigit(l,1073741823&_<<30-e|n),n=_>>>e;this.__setDigit(o,n);}}},{key:"__digit",value:function t(e){return this[e]}},{key:"__unsignedDigit",value:function t(e){return this[e]>>>0}},{key:"__setDigit",value:function i(e,t){this[e]=0|t;}},{key:"__setDigitGrow",value:function i(e,t){this[e]=0|t;}},{key:"__halfDigitLength",value:function e(){var t=this.length;return 32767>=this.__unsignedDigit(t-1)?2*t-1:2*t}},{key:"__halfDigit",value:function t(e){return 32767&this[e>>>1]>>>15*(1&e)}},{key:"__setHalfDigit",value:function i(e,t){var _=e>>>1,n=this.__digit(_),o=1&e?32767&n|t<<15:1073709056&n|32767&t;this.__setDigit(_,o);}}],[{key:"BigInt",value:function t(e){var i=Number.isFinite;if("number"==typeof e){if(0===e)return g.__zero();if(g.__isOneDigitInt(e))return 0>e?g.__oneDigit(-e,!0):g.__oneDigit(e,!1);if(!i(e)||_(e)!==e)throw new RangeError("The number "+e+" cannot be converted to BigInt because it is not an integer");return g.__fromDouble(e)}if("string"==typeof e){var n=g.__fromString(e);if(null===n)throw new SyntaxError("Cannot convert "+e+" to a BigInt");return n}if("boolean"==typeof e)return !0===e?g.__oneDigit(1,!1):g.__zero();if("object"===p(e)){if(e.constructor===g)return e;var o=g.__toPrimitive(e);return g.BigInt(o)}throw new TypeError("Cannot convert "+e+" to a BigInt")}},{key:"toNumber",value:function t(e){var i=e.length;if(0===i)return 0;if(1===i){var _=e.__unsignedDigit(0);return e.sign?-_:_}var n=e.__digit(i-1),o=g.__clz30(n),l=30*i-o;if(1024<l)return e.sign?-Infinity:1/0;var a=l-1,s=n,u=i-1,r=o+3,d=32===r?0:s<<r;d>>>=12;var h=r-12,b=12<=r?0:s<<20+r,m=20+r;for(0<h&&0<u&&(u--,s=e.__digit(u),d|=s>>>30-h,b=s<<h+2,m=h+2);0<m&&0<u;)u--,s=e.__digit(u),b|=30<=m?s<<m-30:s>>>30-m,m-=30;var c=g.__decideRounding(e,m,u,s);if((1===c||0===c&&1==(1&b))&&(b=b+1>>>0,0===b&&(d++,0!=d>>>20&&(d=0,a++,1023<a))))return e.sign?-Infinity:1/0;var v=e.sign?-2147483648:0;return a=a+1023<<20,g.__kBitConversionInts[g.__kBitConversionIntHigh]=v|a|d,g.__kBitConversionInts[g.__kBitConversionIntLow]=b,g.__kBitConversionDouble[0]}},{key:"unaryMinus",value:function t(e){if(0===e.length)return e;var i=e.__copy();return i.sign=!e.sign,i}},{key:"bitwiseNot",value:function t(e){return e.sign?g.__absoluteSubOne(e).__trim():g.__absoluteAddOne(e,!0)}},{key:"exponentiate",value:function i(e,t){if(t.sign)throw new RangeError("Exponent must be positive");if(0===t.length)return g.__oneDigit(1,!1);if(0===e.length)return e;if(1===e.length&&1===e.__digit(0))return e.sign&&0==(1&t.__digit(0))?g.unaryMinus(e):e;if(1<t.length)throw new RangeError("BigInt too big");var _=t.__unsignedDigit(0);if(1===_)return e;if(_>=g.__kMaxLengthBits)throw new RangeError("BigInt too big");if(1===e.length&&2===e.__digit(0)){var n=1+(0|_/30),o=e.sign&&0!=(1&_),l=new g(n,o);l.__initializeDigits();var a=1<<_%30;return l.__setDigit(n-1,a),l}var s=null,u=e;for(0!=(1&_)&&(s=e),_>>=1;0!==_;_>>=1)u=g.multiply(u,u),0!=(1&_)&&(null===s?s=u:s=g.multiply(s,u));return s}},{key:"multiply",value:function _(e,t){if(0===e.length)return e;if(0===t.length)return t;var n=e.length+t.length;30<=e.__clzmsd()+t.__clzmsd()&&n--;var o=new g(n,e.sign!==t.sign);o.__initializeDigits();for(var l=0;l<e.length;l++)g.__multiplyAccumulate(t,e.__digit(l),o,l);return o.__trim()}},{key:"divide",value:function i(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(e,t))return g.__zero();var _,n=e.sign!==t.sign,o=t.__unsignedDigit(0);if(1===t.length&&32767>=o){if(1===o)return n===e.sign?e:g.unaryMinus(e);_=g.__absoluteDivSmall(e,o,null);}else _=g.__absoluteDivLarge(e,t,!0,!1);return _.sign=n,_.__trim()}},{key:"remainder",value:function i(e,t){if(0===t.length)throw new RangeError("Division by zero");if(0>g.__absoluteCompare(e,t))return e;var _=t.__unsignedDigit(0);if(1===t.length&&32767>=_){if(1===_)return g.__zero();var n=g.__absoluteModSmall(e,_);return 0===n?g.__zero():g.__oneDigit(n,e.sign)}var i=g.__absoluteDivLarge(e,t,!1,!0);return i.sign=e.sign,i.__trim()}},{key:"add",value:function i(e,t){var _=e.sign;return _===t.sign?g.__absoluteAdd(e,t,_):0<=g.__absoluteCompare(e,t)?g.__absoluteSub(e,t,_):g.__absoluteSub(t,e,!_)}},{key:"subtract",value:function i(e,t){var _=e.sign;return _===t.sign?0<=g.__absoluteCompare(e,t)?g.__absoluteSub(e,t,_):g.__absoluteSub(t,e,!_):g.__absoluteAdd(e,t,_)}},{key:"leftShift",value:function i(e,t){return 0===t.length||0===e.length?e:t.sign?g.__rightShiftByAbsolute(e,t):g.__leftShiftByAbsolute(e,t)}},{key:"signedRightShift",value:function i(e,t){return 0===t.length||0===e.length?e:t.sign?g.__leftShiftByAbsolute(e,t):g.__rightShiftByAbsolute(e,t)}},{key:"unsignedRightShift",value:function e(){throw new TypeError("BigInts have no unsigned right shift; use >> instead")}},{key:"lessThan",value:function i(e,t){return 0>g.__compareToBigInt(e,t)}},{key:"lessThanOrEqual",value:function i(e,t){return 0>=g.__compareToBigInt(e,t)}},{key:"greaterThan",value:function i(e,t){return 0<g.__compareToBigInt(e,t)}},{key:"greaterThanOrEqual",value:function i(e,t){return 0<=g.__compareToBigInt(e,t)}},{key:"equal",value:function _(e,t){if(e.sign!==t.sign)return !1;if(e.length!==t.length)return !1;for(var n=0;n<e.length;n++)if(e.__digit(n)!==t.__digit(n))return !1;return !0}},{key:"notEqual",value:function i(e,t){return !g.equal(e,t)}},{key:"bitwiseAnd",value:function _(e,t){if(!e.sign&&!t.sign)return g.__absoluteAnd(e,t).__trim();if(e.sign&&t.sign){var n=i(e.length,t.length)+1,o=g.__absoluteSubOne(e,n),l=g.__absoluteSubOne(t);return o=g.__absoluteOr(o,l,o),g.__absoluteAddOne(o,!0,o).__trim()}if(e.sign){var a=[t,e];e=a[0],t=a[1];}return g.__absoluteAndNot(e,g.__absoluteSubOne(t)).__trim()}},{key:"bitwiseXor",value:function _(e,t){if(!e.sign&&!t.sign)return g.__absoluteXor(e,t).__trim();if(e.sign&&t.sign){var n=i(e.length,t.length),o=g.__absoluteSubOne(e,n),l=g.__absoluteSubOne(t);return g.__absoluteXor(o,l,o).__trim()}var a=i(e.length,t.length)+1;if(e.sign){var s=[t,e];e=s[0],t=s[1];}var u=g.__absoluteSubOne(t,a);return u=g.__absoluteXor(u,e,u),g.__absoluteAddOne(u,!0,u).__trim()}},{key:"bitwiseOr",value:function _(e,t){var n=i(e.length,t.length);if(!e.sign&&!t.sign)return g.__absoluteOr(e,t).__trim();if(e.sign&&t.sign){var o=g.__absoluteSubOne(e,n),l=g.__absoluteSubOne(t);return o=g.__absoluteAnd(o,l,o),g.__absoluteAddOne(o,!0,o).__trim()}if(e.sign){var a=[t,e];e=a[0],t=a[1];}var s=g.__absoluteSubOne(t,n);return s=g.__absoluteAndNot(s,e,s),g.__absoluteAddOne(s,!0,s).__trim()}},{key:"asIntN",value:function o(e,t){if(0===t.length)return t;if(e=_(e),0>e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return g.__zero();if(e>=g.__kMaxLengthBits)return t;var l=0|(e+29)/30;if(t.length<l)return t;var a=t.__unsignedDigit(l-1),s=1<<(e-1)%30;if(t.length===l&&a<s)return t;var u=(a&s)===s;if(!u)return g.__truncateToNBits(e,t);if(!t.sign)return g.__truncateAndSubFromPowerOfTwo(e,t,!0);if(0==(a&s-1)){for(var r=l-2;0<=r;r--)if(0!==t.__digit(r))return g.__truncateAndSubFromPowerOfTwo(e,t,!1);return t.length===l&&a===s?t:g.__truncateToNBits(e,t)}return g.__truncateAndSubFromPowerOfTwo(e,t,!1)}},{key:"asUintN",value:function i(e,t){if(0===t.length)return t;if(e=_(e),0>e)throw new RangeError("Invalid value: not (convertible to) a safe integer");if(0===e)return g.__zero();if(t.sign){if(e>g.__kMaxLengthBits)throw new RangeError("BigInt too big");return g.__truncateAndSubFromPowerOfTwo(e,t,!1)}if(e>=g.__kMaxLengthBits)return t;var o=0|(e+29)/30;if(t.length<o)return t;var l=e%30;if(t.length==o){if(0===l)return t;var a=t.__digit(o-1);if(0==a>>>l)return t}return g.__truncateToNBits(e,t)}},{key:"ADD",value:function i(e,t){if(e=g.__toPrimitive(e),t=g.__toPrimitive(t),"string"==typeof e)return "string"!=typeof t&&(t=t.toString()),e+t;if("string"==typeof t)return e.toString()+t;if(e=g.__toNumeric(e),t=g.__toNumeric(t),g.__isBigInt(e)&&g.__isBigInt(t))return g.add(e,t);if("number"==typeof e&&"number"==typeof t)return e+t;throw new TypeError("Cannot mix BigInt and other types, use explicit conversions")}},{key:"LT",value:function i(e,t){return g.__compare(e,t,0)}},{key:"LE",value:function i(e,t){return g.__compare(e,t,1)}},{key:"GT",value:function i(e,t){return g.__compare(e,t,2)}},{key:"GE",value:function i(e,t){return g.__compare(e,t,3)}},{key:"EQ",value:function i(e,t){for(;!0;){if(g.__isBigInt(e))return g.__isBigInt(t)?g.equal(e,t):g.EQ(t,e);if("number"==typeof e){if(g.__isBigInt(t))return g.__equalToNumber(t,e);if("object"!==p(t))return e==t;t=g.__toPrimitive(t);}else if("string"==typeof e){if(g.__isBigInt(t))return e=g.__fromString(e),null!==e&&g.equal(e,t);if("object"!==p(t))return e==t;t=g.__toPrimitive(t);}else if("boolean"==typeof e){if(g.__isBigInt(t))return g.__equalToNumber(t,+e);if("object"!==p(t))return e==t;t=g.__toPrimitive(t);}else if("symbol"===p(e)){if(g.__isBigInt(t))return !1;if("object"!==p(t))return e==t;t=g.__toPrimitive(t);}else if("object"===p(e)){if("object"===p(t)&&t.constructor!==g)return e==t;e=g.__toPrimitive(e);}else return e==t}}},{key:"NE",value:function i(e,t){return !g.EQ(e,t)}},{key:"DataViewGetBigInt64",value:function i(e,t){var _=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2];return g.asIntN(64,g.DataViewGetBigUint64(e,t,_))}},{key:"DataViewGetBigUint64",value:function i(e,t){var _=!!(2<arguments.length&&void 0!==arguments[2])&&arguments[2],n=_?[4,0]:[0,4],o=f(n,2),a=o[0],s=o[1],l=e.getUint32(t+a,_),u=e.getUint32(t+s,_),r=new g(3,!1);return r.__setDigit(0,1073741823&u),r.__setDigit(1,(268435455&l)<<2|u>>>30),r.__setDigit(2,l>>>28),r.__trim()}},{key:"DataViewSetBigInt64",value:function _(e,t,i){var n=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3];g.DataViewSetBigUint64(e,t,i,n);}},{key:"DataViewSetBigUint64",value:function _(e,t,i){var n=!!(3<arguments.length&&void 0!==arguments[3])&&arguments[3];i=g.asUintN(64,i);var o=0,a=0;if(0<i.length&&(a=i.__digit(0),1<i.length)){var s=i.__digit(1);a|=s<<30,o=s>>>2,2<i.length&&(o|=i.__digit(2)<<28);}var u=n?[4,0]:[0,4],r=f(u,2),d=r[0],h=r[1];e.setUint32(t+d,o,n),e.setUint32(t+h,a,n);}},{key:"__zero",value:function e(){return new g(0,!1)}},{key:"__oneDigit",value:function i(e,t){var _=new g(1,t);return _.__setDigit(0,e),_}},{key:"__decideRounding",value:function n(e,t,i,_){if(0<t)return -1;var o;if(0>t)o=-t-1;else {if(0===i)return -1;i--,_=e.__digit(i),o=29;}var l=1<<o;if(0==(_&l))return -1;if(l-=1,0!=(_&l))return 1;for(;0<i;)if(i--,0!==e.__digit(i))return 1;return 0}},{key:"__fromDouble",value:function t(e){var i=0>e;g.__kBitConversionDouble[0]=e;var _,n=2047&g.__kBitConversionInts[g.__kBitConversionIntHigh]>>>20,o=n-1023,l=(0|o/30)+1,a=new g(l,i),s=1048576,u=1048575&g.__kBitConversionInts[g.__kBitConversionIntHigh]|s,r=g.__kBitConversionInts[g.__kBitConversionIntLow],d=20,h=o%30,b=0;if(h<d){var m=d-h;b=m+32,_=u>>>m,u=u<<32-m|r>>>m,r<<=32-m;}else if(h===d)b=32,_=u,u=r,r=0;else {var c=h-d;b=32-c,_=u<<c|r>>>32-c,u=r<<c,r=0;}a.__setDigit(l-1,_);for(var v=l-2;0<=v;v--)0<b?(b-=30,_=u>>>2,u=u<<30|r>>>2,r<<=30):_=0,a.__setDigit(v,_);return a.__trim()}},{key:"__isWhitespace",value:function t(e){return !!(13>=e&&9<=e)||(159>=e?32==e:131071>=e?160==e||5760==e:196607>=e?(e&=131071,10>=e||40==e||41==e||47==e||95==e||4096==e):65279==e)}},{key:"__fromString",value:function t(e){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:0,_=0,n=e.length,o=0;if(o===n)return g.__zero();for(var l=e.charCodeAt(o);g.__isWhitespace(l);){if(++o===n)return g.__zero();l=e.charCodeAt(o);}if(43===l){if(++o===n)return null;l=e.charCodeAt(o),_=1;}else if(45===l){if(++o===n)return null;l=e.charCodeAt(o),_=-1;}if(0===i){if(i=10,48===l){if(++o===n)return g.__zero();if(l=e.charCodeAt(o),88===l||120===l){if(i=16,++o===n)return null;l=e.charCodeAt(o);}else if(79===l||111===l){if(i=8,++o===n)return null;l=e.charCodeAt(o);}else if(66===l||98===l){if(i=2,++o===n)return null;l=e.charCodeAt(o);}}}else if(16===i&&48===l){if(++o===n)return g.__zero();if(l=e.charCodeAt(o),88===l||120===l){if(++o===n)return null;l=e.charCodeAt(o);}}if(0!==_&&10!==i)return null;for(;48===l;){if(++o===n)return g.__zero();l=e.charCodeAt(o);}var a=n-o,s=g.__kMaxBitsPerChar[i],u=g.__kBitsPerCharTableMultiplier-1;if(a>1073741824/s)return null;var r=s*a+u>>>g.__kBitsPerCharTableShift,h=0|(r+29)/30,b=new g(h,!1),c=10>i?i:10,v=10<i?i-10:0;if(0==(i&i-1)){s>>=g.__kBitsPerCharTableShift;var y=[],f=[],k=!1;do{for(var D,p=0,B=0;!0;){if(D=void 0,l-48>>>0<c)D=l-48;else if((32|l)-97>>>0<v)D=(32|l)-87;else {k=!0;break}if(B+=s,p=p<<s|D,++o===n){k=!0;break}if(l=e.charCodeAt(o),30<B+s)break}y.push(p),f.push(B);}while(!k);g.__fillFromParts(b,y,f);}else {b.__initializeDigits();var S=!1,C=0;do{for(var I,A=0,T=1;!0;){if(I=void 0,l-48>>>0<c)I=l-48;else if((32|l)-97>>>0<v)I=(32|l)-87;else {S=!0;break}var P=T*i;if(1073741823<P)break;if(T=P,A=A*i+I,C++,++o===n){S=!0;break}l=e.charCodeAt(o);}u=30*g.__kBitsPerCharTableMultiplier-1;var O=0|(s*C+u>>>g.__kBitsPerCharTableShift)/30;b.__inplaceMultiplyAdd(T,A,O);}while(!S)}if(o!==n){if(!g.__isWhitespace(l))return null;for(o++;o<n;o++)if(l=e.charCodeAt(o),!g.__isWhitespace(l))return null}return b.sign=-1===_,b.__trim()}},{key:"__fillFromParts",value:function n(e,t,_){for(var o=0,l=0,g=0,a=t.length-1;0<=a;a--){var s=t[a],u=_[a];l|=s<<g,g+=u,30===g?(e.__setDigit(o++,l),g=0,l=0):30<g&&(e.__setDigit(o++,1073741823&l),g-=30,l=s>>>u-g);}if(0!==l){if(o>=e.length)throw new Error("implementation bug");e.__setDigit(o++,l);}for(;o<e.length;o++)e.__setDigit(o,0);}},{key:"__toStringBasePowerOfTwo",value:function _(e,t){var n=e.length,o=t-1;o=(85&o>>>1)+(85&o),o=(51&o>>>2)+(51&o),o=(15&o>>>4)+(15&o);var l=o,a=t-1,s=e.__digit(n-1),u=g.__clz30(s),r=30*n-u,d=0|(r+l-1)/l;if(e.sign&&d++,268435456<d)throw new Error("string too long");for(var h=Array(d),b=d-1,m=0,c=0,v=0;v<n-1;v++){var y=e.__digit(v),f=(m|y<<c)&a;h[b--]=g.__kConversionChars[f];var k=l-c;for(m=y>>>k,c=30-k;c>=l;)h[b--]=g.__kConversionChars[m&a],m>>>=l,c-=l;}var D=(m|s<<c)&a;for(h[b--]=g.__kConversionChars[D],m=s>>>l-c;0!==m;)h[b--]=g.__kConversionChars[m&a],m>>>=l;if(e.sign&&(h[b--]="-"),-1!==b)throw new Error("implementation bug");return h.join("")}},{key:"__toStringGeneric",value:function n(e,t,_){var o=e.length;if(0===o)return "";if(1===o){var l=e.__unsignedDigit(0).toString(t);return !1===_&&e.sign&&(l="-"+l),l}var a=30*o-g.__clz30(e.__digit(o-1)),s=g.__kMaxBitsPerChar[t],u=s-1,r=a*g.__kBitsPerCharTableMultiplier;r+=u-1,r=0|r/u;var d,h,b=r+1>>1,m=g.exponentiate(g.__oneDigit(t,!1),g.__oneDigit(b,!1)),c=m.__unsignedDigit(0);if(1===m.length&&32767>=c){d=new g(e.length,!1),d.__initializeDigits();for(var v,y=0,f=2*e.length-1;0<=f;f--)v=y<<15|e.__halfDigit(f),d.__setHalfDigit(f,0|v/c),y=0|v%c;h=y.toString(t);}else {var k=g.__absoluteDivLarge(e,m,!0,!0);d=k.quotient;var D=k.remainder.__trim();h=g.__toStringGeneric(D,t,!0);}d.__trim();for(var p=g.__toStringGeneric(d,t,!0);h.length<b;)h="0"+h;return !1===_&&e.sign&&(p="-"+p),p+h}},{key:"__unequalSign",value:function t(e){return e?